[Libguestfs] [PATCH 2/2] actions: turn some params into RelativePathnameList (RHBZ#1174551).

Pino Toscano ptoscano at redhat.com
Tue Oct 20 13:50:31 UTC 2015


On Tuesday 20 October 2015 14:43:53 Richard W.M. Jones wrote:
> On Tue, Oct 20, 2015 at 01:59:10PM +0200, Pino Toscano wrote:
> > Use RelativePathnameList as type for lists of relative paths, as used in
> > some listing-alike APIs.  This way we can ensure absolute paths in those
> > lists are rejects outright.
> > 
> > As a consequence, test-big-dirs.pl does not need to prepend the
> > directory name anymore before calling listing-alike APIs: previously
> > they didn't fail, but the returned lists contained only invalid
> > elements (and only their size was checked).
> 
> Are these all relative pathnames, or are they in fact just filenames
> without any path at all.  That is to say: is "foo/bar" permitted, or
> just "bar"?

At least with *lstat*list and *readlinklist functions, the file names
are considered as relative wrt the path specified, as they are resolved
against the file descriptor of the directory.

In case of *lxattrlist, the absolute path+name for each is built and
used as path within the guest.

So yes, "bar", "foo/bar", and "../bar" too, should work.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20151020/7e397d28/attachment.sig>


More information about the Libguestfs mailing list