[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] canonicalize.c and realpath

From: James Youngman
Subject: Re: [bug-gnulib] canonicalize.c and realpath
Date: Mon, 4 Apr 2005 16:57:08 +0100
User-agent: Mutt/1.3.28i

On Mon, Apr 04, 2005 at 02:48:02PM +0000, Eric Blake wrote:

> Currently, lib/canonicalize.c performs a configure check to see if
> resolvepath(2) is exported, to speed up canonicalize_file_name.
> This is not a POSIX function, and meanwhile POSIX XSI requires
> realpath(2) to exist (basically, resolvepath without the length
> argument).  

However, the Linux manual page says:

| Solaris may return a relative path name when the path argument is
| relative.

A glance at the manual pages for Solaris 7, 8, and 9 shows that this
is true.  The Solaris 10 manual page indicates that it doesn't return
relative paths (i.e. the problem is fixed in Solaris 10).

Hence, even on systems where realpath exists, we should still fall
back on our own implementation if the call succeeds but the first
character of the result is not '/'.

I'm also slightly concerned that an implementation which is less than
very careful indeed could wrongly fail where the absolute path name of
the specified file is longer than PATH_MAX.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]