[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 4/5] 9p: handle walk of ".." in the root dire
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 4/5] 9p: handle walk of ".." in the root directory |
Date: |
Fri, 26 Aug 2016 13:52:58 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 08/26/2016 10:07 AM, Greg Kurz wrote:
> The 9P spec at http://man.cat-v.org/plan_9/5/intro says:
>
> All directories must support walks to the directory .. (dot-dot) meaning
> parent directory, although by convention directories contain no explicit
> entry for .. or . (dot). The parent of the root directory of a server's
> tree is itself.
>
> This means that a client cannot walk further than the root directory
> exported by the server. In other words, if the client wants to walk
> "/.." or "/foo/../..", the server shoud answer like the request was
s/shoud/should/
> to walk "/".
>
> This patch just does that:
> - we cache the QID of the root directory at attach time
> - during the walk we compare the QID of each path component with the root
> QID to detect if we're in a "/.." situation
> - if so, we skip the current component and go to the next one
>
> Signed-off-by: Greg Kurz <address@hidden>
> ---
> hw/9pfs/9p.c | 40 +++++++++++++++++++++++++++++++---------
> hw/9pfs/9p.h | 1 +
> 2 files changed, 32 insertions(+), 9 deletions(-)
>
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v2 1/5] 9p: forbid illegal path names, (continued)
- [Qemu-devel] [PATCH v2 2/5] 9p: disallow the NUL character in all strings, Greg Kurz, 2016/08/26
- [Qemu-devel] [PATCH v2 3/5] 9p: forbid . and .. in file names, Greg Kurz, 2016/08/26
- [Qemu-devel] [PATCH v2 4/5] 9p: handle walk of ".." in the root directory, Greg Kurz, 2016/08/26
- Re: [Qemu-devel] [PATCH v2 4/5] 9p: handle walk of ".." in the root directory,
Eric Blake <=
- [Qemu-devel] [PATCH v2 5/5] 9p: forbid empty extension string, Greg Kurz, 2016/08/26
- Re: [Qemu-devel] [PATCH v2 5/5] 9p: forbid empty extension string, Eric Blake, 2016/08/26
- Re: [Qemu-devel] [PATCH v2 5/5] 9p: forbid empty extension string, Michael S. Tsirkin, 2016/08/26
- Re: [Qemu-devel] [PATCH v2 5/5] 9p: forbid empty extension string, Greg Kurz, 2016/08/28
- Re: [Qemu-devel] [PATCH v2 5/5] 9p: forbid empty extension string, Greg Kurz, 2016/08/28
- Re: [Qemu-devel] [PATCH v2 5/5] 9p: forbid empty extension string, Eric Blake, 2016/08/29
- Re: [Qemu-devel] [PATCH v2 5/5] 9p: forbid empty extension string, Greg Kurz, 2016/08/30
- Re: [Qemu-devel] [PATCH v2 5/5] 9p: forbid empty extension string, Peter Maydell, 2016/08/28