All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ben Hutchings <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
Subject: Re: readlink(2) handling of empty strings
Date: Tue, 30 Sep 2014 10:10:02 +0200	[thread overview]
Message-ID: <542A655A.3090406@gmail.com> (raw)
In-Reply-To: <1412033603.9388.68.camel-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>

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

  parent reply	other threads:[~2014-09-30  8:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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) [this message]
     [not found]     ` <542A655A.3090406-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-09-30 11:38       ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=542A655A.3090406@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.