public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Casper.Dik-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
To: "Andries E. Brouwer" <Andries.Brouwer-rh8NL+sEX9E@public.gmane.org>
Cc: "Michael Kerrisk (man-pages)"
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: realpath(3) bugs
Date: Sat, 05 May 2012 09:34:01 +0200	[thread overview]
Message-ID: <201205050734.q457Y2AC002399@ucsinet22.oracle.com> (raw)
In-Reply-To: <20120505000619.GA8038@iq>


>I wrote the Linux man page on 1999-08-24.
>It was first included in man-pages-1.26.
>
>The note about Solaris came from the 4.4BSD-Lite man page realpath.3
>(dated 1994-02-16) which says:

Yes, it noticed that it exists in both BSD and Linux manual pages;
I asssumed it was copied by one or the other.  Yours address was the
first I could find to get it remoed.

>I forgot the details. What happens if some of the directories involved
>are not readable or not searchable? What happens if some parent
>directory was overmounted so that there is no absolute pathname
>in the system that refers to the same place as your relative pathname?

>From my reading from the source code, it would fail if it fails to find
the pathname, e.g., whem the pathname desn't exist, getcwd() fails,
chdir() fails (the very old implementation uses chdir() to the pathname or
its dirname and runs getcwd())  Later implementation use resolvepath()
(since 1997) and resolvepath() returns a relative pathname if resolvepat
does't find the root) and then combnes the outut with getcwd() removing
one component for each ".." in front of the pathname.

If either of the calls fail, realpath will fail and if it succeeds i returns
a absolute pathname.

Casper
--
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

  reply	other threads:[~2012-05-05  7:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 11:22 realpath(3) bugs Casper.Dik-QHcLZuEGTsvQT0dZR+AlfA
     [not found] ` <201205041122.q44BMDEO002270-Og0DlWfCjE/25RUcvsgne1aTQe2KTcn/@public.gmane.org>
2012-05-04 22:54   ` Michael Kerrisk (man-pages)
     [not found]     ` <CAKgNAkgjjKXx_Aw5iF_Phe7c7ixpqtfLSiV6fkTttN5ge4CGww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-05  0:06       ` Andries E. Brouwer
2012-05-05  7:34         ` Casper.Dik-QHcLZuEGTsvQT0dZR+AlfA [this message]
     [not found]           ` <201205050734.q457Y2AC002399-Og0DlWfCjE/25RUcvsgne1aTQe2KTcn/@public.gmane.org>
2012-05-05 15:50             ` Andries E. Brouwer
2012-05-05 18:10               ` Casper.Dik-QHcLZuEGTsvQT0dZR+AlfA
     [not found]                 ` <201205051810.q45IAU9K000837-Og0DlWfCjE/86v54HqmmKFaTQe2KTcn/@public.gmane.org>
2012-05-05 22:14                   ` Andries E. Brouwer
2012-05-05 18:34               ` Casper.Dik-QHcLZuEGTsvQT0dZR+AlfA

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=201205050734.q457Y2AC002399@ucsinet22.oracle.com \
    --to=casper.dik-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=Andries.Brouwer-rh8NL+sEX9E@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox