* readlink(2) handling of empty strings
@ 2014-09-29 23:33 Ben Hutchings
[not found] ` <1412033603.9388.68.camel-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2014-09-29 23:33 UTC (permalink / raw)
To: linux-man-u79uwXL29TY76Z2rM5mHXA; +Cc: Al Viro
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]
readlink(2) claims:
Since Linux 2.6.39, pathname can be an empty string, in which case the
call operates on the file referred to by dirfd (which may have been
obtained using the open(2) O_PATH flag). In this case, dirfd can refer
to any type of file, not just a directory.
The last sentence seems to be incorrect. dirfd must refer to a symlink
that has been opened using the O_PATH flag. (The symlink could refer to
a file, directory, or nothing, but opening with O_PATH doesn't resolve
it.)
Ben.
--
Ben Hutchings
The two most common things in the universe are hydrogen and stupidity.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: readlink(2) handling of empty strings
[not found] ` <1412033603.9388.68.camel-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
@ 2014-09-30 8:10 ` Michael Kerrisk (man-pages)
[not found] ` <542A655A.3090406-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-09-30 8:10 UTC (permalink / raw)
To: Ben Hutchings, linux-man-u79uwXL29TY76Z2rM5mHXA
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, Al Viro
Hello Ben,
On 09/30/2014 01:33 AM, Ben Hutchings wrote:
> readlink(2) claims:
>
> Since Linux 2.6.39, pathname can be an empty string, in which case the
> call operates on the file referred to by dirfd (which may have been
> obtained using the open(2) O_PATH flag). In this case, dirfd can refer
> to any type of file, not just a directory.
>
> The last sentence seems to be incorrect. dirfd must refer to a symlink
> that has been opened using the O_PATH flag. (The symlink could refer to
> a file, directory, or nothing, but opening with O_PATH doesn't resolve
> it.)
Yes, you must be right. The existing text makes no sense; I suspect
a cut-and-paste error as I went through updating some of the *at.2 pages.
I've changed the text to:
Since Linux 2.6.39, pathname can be an empty string, in which
case the call operates on the symbolic link referred to by dirfd
(which should have have been obtained using the open(2) with the
O_PATH and O_NOFOLLOW flags).
Okay?
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: readlink(2) handling of empty strings
[not found] ` <542A655A.3090406-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-09-30 11:38 ` Ben Hutchings
0 siblings, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2014-09-30 11:38 UTC (permalink / raw)
To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, Al Viro
[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]
On Tue, 2014-09-30 at 10:10 +0200, Michael Kerrisk (man-pages) wrote:
> Hello Ben,
>
> On 09/30/2014 01:33 AM, Ben Hutchings wrote:
> > readlink(2) claims:
> >
> > Since Linux 2.6.39, pathname can be an empty string, in which case the
> > call operates on the file referred to by dirfd (which may have been
> > obtained using the open(2) O_PATH flag). In this case, dirfd can refer
> > to any type of file, not just a directory.
> >
> > The last sentence seems to be incorrect. dirfd must refer to a symlink
> > that has been opened using the O_PATH flag. (The symlink could refer to
> > a file, directory, or nothing, but opening with O_PATH doesn't resolve
> > it.)
>
> Yes, you must be right. The existing text makes no sense; I suspect
> a cut-and-paste error as I went through updating some of the *at.2 pages.
> I've changed the text to:
>
> Since Linux 2.6.39, pathname can be an empty string, in which
> case the call operates on the symbolic link referred to by dirfd
> (which should have have been obtained using the open(2) with the
> O_PATH and O_NOFOLLOW flags).
>
> Okay?
LGTM.
Ben.
--
Ben Hutchings
The two most common things in the universe are hydrogen and stupidity.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-30 11:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-29 23:33 readlink(2) handling of empty strings Ben Hutchings
[not found] ` <1412033603.9388.68.camel-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
2014-09-30 8:10 ` Michael Kerrisk (man-pages)
[not found] ` <542A655A.3090406-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-30 11:38 ` Ben Hutchings
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).