Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Apr 1995 02:29:40 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-hackers@freefall.cdrom.com, kargl@troutmask.apl.washington.edu
Subject:   Re: symlink mode_t question
Message-ID:  <199503311629.CAA04990@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I have a simply question about the mode given to a symlink when I
>use `ls -l'.  Why is it alway lrwxrwxr-x, and not resolved to the true
>access permission of the file?

Because this is the historical (broken) behaviour of `ls -l'.  Use
`ls -lL' to follow symlinks.

>I'm adding a symlink option to install(1), and I would like the 
>symlink access permissions to reflect those of the original file.

They can't in general in FreeBSD-2.0.  Symlinks have the same
attributes as their parent directory.

>While I'm here.  What happens to the setting of immutable/append bits
>on a file?  Does a symlink correctly handle these flags?

The symlink gets resolved for most operations.  For unlink(), the
immutability of the parent directory applies (just as it does to
stop unlinking of files in the directory).

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503311629.CAA04990>