[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: symlink mode_t question
From:       Bruce Evans <bde () zeta ! org ! au>
Date:       1995-03-31 16:29:40
[Download RAW message or body]

>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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic