qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/5] 9pfs: local: resolve special directories in


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 2/5] 9pfs: local: resolve special directories in paths
Date: Thu, 18 May 2017 09:19:20 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/18/2017 03:41 AM, Greg Kurz wrote:
> [...]
>>>> +        } else if (!strcmp(name, "..")) {
>>>> +            if (!strcmp(dir_path->data, ".")) {
>>>> +                /* ".." relative to the root is "." */
>>>> +                v9fs_path_sprintf(target, ".");
>>>> +            } else {
>>>> +                char *tmp = g_path_get_dirname(dir_path->data);
>>>> +                /* ".." relative to "foo/bar" is equivalent to "foo" */   
>>>>  
>>>
>>> True only if bar is not a symlink to some other directory.  What
>>> guarantees do you have that you are not going to be inadvertently
>>> skipping a traversal through symlinks and thereby picking the wrong
>>> location for '..'?
>>>   
>>
>> My understanding is that symlinks are supposed to be resolved by the client,
>> and we shouldn't follow them in the server.
>>
> 
> Eric,
> 
> Do you have any comment further comment or can I go on with this change ?

I'd update the comment to mention that the equivalency between
"foo/bar/.." and "foo" is _because_ the client has already resolved
symlinks, and then I think you're good to go.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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