On 12/16/2011 11:37 AM, Bob Proulx wrote:
> Eric Blake wrote:
>> Bob Proulx wrote:
>>> * The mode bits of a symlink are not used.  The original Unix authors
>>>   ignored them and did not provide any way to change them.
>>
>> That's true for Linux, but false for BSD (where the mode bits of a
>> symlink can allow restriction on dereferencing through the symlink).
> 
> What?!  I was not aware of this.  I have been too SysV centric for too
> many years.  And I do not have access to a BSD system in which to
> learn about it.
> 
> It would be informative to myself and I expect others if you could
> post an example of the behavior from a BSD system showing the
> restriction through a symlink's permissions.

Right now, I only had easy access to 64-bit FreeBSD 8.2-RELEASE, and
there, the system call lchmod(2) exists, but 'man 7 symlink' states that
access permissions are ignored.

But I still remember reading about permissions affecting symlinks on at
least one BSD variant (I'm still trying to find where I remember that
from); something like 'w' permissions were required for readlink(2) to
succeed, and 'x' permissions required for open(2) and friends to
successfully follow the symlink.  I'll post back if I can find more
evidence.

-- 
Eric Blake   [email protected]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to