bug-coreutils
[Top][All Lists]
Advanced

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

bug#10472: [PATCH] realpath: fix problems with // handling


From: Eric Blake
Subject: bug#10472: [PATCH] realpath: fix problems with // handling
Date: Tue, 13 Mar 2012 22:07:41 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

On 03/13/2012 09:15 PM, Eric Blake wrote:
>> Also doesn't path_prefix() need the same adjustment,
>> so as to verify --relative-base in the same way?
> 
> Yes, it looks like it.

In fact, I found another bug, this time present also on Linux:

$ realpath --relative-base=/ --relative-to=/ /
/

when it should really output '.' (since '/' relative to itself is '.',
and ALL files are below '/' [except when '//' is special]).  Likewise:

$ realpath --relative-base=/usr/local --relative-to=/usr \
    /usr /usr/local/lib
/usr
/usr/local/lib

when it should really output '/usr' (absolute, since it is not a child
of /usr/local) and 'local/lib' (which is a file below /usr/local, and an
output name relative to /usr).

My test caught these, so now I have to revisit my realpath.c patch.
It's getting too late tonight, so I'll have to post the series early
tomorrow.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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