[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/29] 9pfs: introduce openat_nofollow() helper
From: |
Greg Kurz |
Subject: |
Re: [Qemu-devel] [PATCH 04/29] 9pfs: introduce openat_nofollow() helper |
Date: |
Mon, 27 Feb 2017 11:37:43 +0100 |
On Mon, 27 Feb 2017 10:20:58 +0000
Stefan Hajnoczi <address@hidden> wrote:
> On Fri, Feb 24, 2017 at 11:17:44PM +0100, Greg Kurz wrote:
> > On Fri, 24 Feb 2017 17:17:30 +0000
> > Stefan Hajnoczi <address@hidden> wrote:
> > [...]
> > > > > This function doesn't handle absolute paths? It ignores leading '/'
> > > > > and
> > > > > therefore treats all paths as relative paths.
> > > > >
> > > >
> > > > Yes because any path coming from the client is supposed (*) to be
> > > > relative to the
> > > > shared directory and openat(2) says:
> > >
> > > Please change the function name since this isn't openat with nofollow
> > > behavior, it's a subset of openat that only takes relative paths with
> > > nofollow behavior.
> >
> > In the v2, this function is only called by local_open_nofollow() actually.
> > Maybe I should move the stripping of leading '/' characters there ?
>
> As long as the function name is clear then I'm happy. If it has
> different semantics from openat() then it should have a different name
> (e.g. relative_openat_nofollow()).
>
I've moved the stripping to the caller. This makes the code simpler.
> Stefan
pgp5F1ppjo3xc.pgp
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 02/29] 9pfs: remove side-effects in local_init(), (continued)
[Qemu-devel] [PATCH 05/29] 9pfs: local: keep a file descriptor on the shared folder, Greg Kurz, 2017/02/20
[Qemu-devel] [PATCH 06/29] 9pfs: local: open/opendir: don't follow symlinks, Greg Kurz, 2017/02/20
[Qemu-devel] [PATCH 07/29] 9pfs: local: introduce symlink-attack safe xattr helpers, Greg Kurz, 2017/02/20