GNU bug report logs -
#62385
POSIX behavior of readlink, realpath
Previous Next
To reply to this bug, email your comments to 62385 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#62385
; Package
coreutils
.
(Wed, 22 Mar 2023 14:20:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Eric Blake <eblake <at> redhat.com>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Wed, 22 Mar 2023 14:20:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
POSIX will be standardizing readlink(1) and realpath(1):
https://www.austingroupbugs.net/view.php?id=1457
Among other things, I can see the following changes that coreutils
will need to make to become compliant, or else we need to push back on
the POSIX folks if we have strong reasons to complain that their
specification will break things:
POSIX wants 'readlink non-symlink' to output a diagnostic; that is, it
looks like POSIX wants us to behave like '-v' is enabled by default
(our current behavior of -q by default will be non-compliant).
POSIX wants us to support 'realpath -E file'. I'm not quite sure if
it is matches our existing behavior when -e is omitted (in which case,
all the more we have to do is have -E coming later than -e disable the
earlier -e). In particular, it gives a convincing example:
"The behavior with the -E option when file does not resolve (with
symbolic links followed) to an existing file is not the same as simply
calling realpath() with the path prefix of the file operand and
writing the resulting pathname, a <slash>, and the last component of
file to standard output. For example, if /tmp/nofile does not exist,
and file is A/B where A is an existing directory and B is a symbolic
link to /tmp/nofile, realpath with -E will output /tmp/nofile, but if
B is a symbolic link to /tmp/nofile/foo, realpath with -E will treat
this as an error. In both cases <tt>realpath("A/B")</tt> would fail
with errno set to [ENOENT]. Even though <tt>realpath("A")</tt> would
succeed, in neither case is anything ending /B the result."
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
This bug report was last modified 2 years and 84 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.