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

On Fri, May 4, 2012 at 11:22 PM,  <Casper.Dik-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:

>> For some reason, many of the realpath() manual pages (BSD, Linux) have
>> words to the following effect:
>>
>> Solaris may return a relative pathname when the path argument is relative.
>>
>> I have looked through the Solaris source files and have found no
>> such bug reported or fixed; the implementation from at least 1997 and
>> beyond certainly doesn't have this problem and even the older versions
>> prepend getcwd() or chdir() to dirname and run getcwd() in that
>> directory.
>>
>> realpath() existed in Solaris 2.0 as it came from SVr4.0 and even at that
>> time i t returned the full, non-relative path.

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:

.Sh CAVEATS
This implementation of
.Fn realpath
differs slightly from the Solaris implementation.  The
.Bx 4.4
version always returns absolute pathnames, whereas the
Solaris implementation will, under certain circumstances,
return a relative
.Fa resolved_path
when given a relative
.Fa pathname .

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?

Andries
--
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:[~2012-05-05  0:06 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 [this message]
2012-05-05  7:34         ` Casper.Dik-QHcLZuEGTsvQT0dZR+AlfA
     [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=20120505000619.GA8038@iq \
    --to=andries.brouwer-rh8nl+sex9e@public.gmane.org \
    --cc=Casper.Dik-QHcLZuEGTsvQT0dZR+AlfA@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