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
signature.asc
Description: OpenPGP digital signature
