qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 2/3] 9pfs: forbid . and .. in file names


From: Greg Kurz
Subject: Re: [Qemu-devel] [PATCH v4 2/3] 9pfs: forbid . and .. in file names
Date: Tue, 30 Aug 2016 21:03:11 +0200

On Tue, 30 Aug 2016 13:06:31 -0500
Eric Blake <address@hidden> wrote:

> On 08/30/2016 12:13 PM, Greg Kurz wrote:
> > According to the 9P spec http://man.cat-v.org/plan_9/5/open about the
> > create request:
> > 
> > The names . and .. are special; it is illegal to create files with these
> > names.
> > 
> > This patch causes the create and lcreate requests to fail with EINVAL if
> > the file name is either "." or "..".
> > 
> > Even if it isn't explicitly written in the spec, this patch extends the
> > checking to all requests that may cause a directory entry to be created:
> > 
> >     - mknod
> >     - rename
> >     - renameat
> >     - mkdir
> >     - link
> >     - symlink
> > 
> > The unlinkat request also gets patched for consistency (even if
> > rmdir("foo/..") is expected to fail according to POSIX.1-2001).
> > 
> > The various error values come from the linux manual pages.
> > 
> > Suggested-by: Peter Maydell <address@hidden>
> > Signed-off-by: Greg Kurz <address@hidden>
> > 
> > v3: - rename and renameat now return EISDIR instead of EBUSY  
> 
> The v3 comment could occur after the '---' separator.
> 

Yes of course. Sorry for the other patches as well :)

> > ---
> >  hw/9pfs/9p.c |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 51 insertions(+)  
> 
> Maintainer can touch that up, then add
> Reviewed-by: Eric Blake <address@hidden>
> 

Attachment: pgpKkabN0WJOx.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]