Re: Porting pam to Solaris, HP-UX, others

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

 



The -f option to ln is not portable.

Nico


On Wed, Dec 13, 2000 at 01:32:59PM -0600, Steve Langasek wrote:
> On Wed, 13 Dec 2000, Andrew Morgan wrote:
> 
> > David Lee wrote:
> > > Hence my suggestion of "-f", which seems widely available, and doesn't
> > > adversely affect the use to which we are putting it (although it may be
> > > possible to dream up pathological cases if someone has gone in behind the
> > > back of "make" with malice aforethought).
> 
> > But your patch says:
> 
> > !       if [ ! -r include/security ]; then ln -sf . 
> 
> > "-r or -f" Which is it?
> 
> -L?:)
> 
> >From test(1) on Linux (sh-utils-1.16):
> 
> -e file
> 	True if file exists
> -f file
> 	True if file exists and is a regular file.
> ...
> -L file
> 	True if file exists and is a symbolic link.
> ...
> 
> -r file
> 	True if file exists and is readable.
> 
> I don't know how portable -L is, but -f is certain to not give the correct
> behavior on any OS that follows the above semantics.
> 
> So -- if we have the option, it seems to me that -L is what we want.  (If
> someone's put something there that's not a symlink, there's no reason not to
> stomp on it, as it will probably break the build anyway.)  If neither -L nor
> -e is portable, the only option left is -r, I guess..
> 
> Steve Langasek
> postmodern programmer
> 
> 
> 
> _______________________________________________
> 
> Pam-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/pam-list
--





[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux