| Summary: | [libc] lstat(2) returns bogus permissions on symlinks | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | mkamm | ||||
| Component: | kern | Assignee: | Robert Watson <rwatson> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.2-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
mkamm
2001-02-11 22:50:02 UTC
On Sat, 10 Feb 2001 mkamm@gmx.net wrote: > >How-To-Repeat: > > (umask 321 && ln -s "have strange but nontheless nonexistant perms" symlinks) > ls -l symlinks > > The permissions shown reflect the umask value at the time of the > symlink(2) call rather than the more intuitive "lrwxrwxrwx" or > in case of mount -onosymfollow "l---------". Fixing this makes lchmod(2) more useless than it already is :-). Bruce Responsible Changed From-To: freebsd-bugs->rwatson Grab ownership. rwatson 2008-08-03 15:44:56 UTC
FreeBSD src repository
Modified files:
sys/kern vfs_vnops.c
Log:
SVN rev 181254 on 2008-08-03 15:44:56Z by rwatson
Remove broken code to replace st_mode value with ACCESSPERMS when
lstat(2) is called on symlinks -- this code appears never to have
worked. The PR this addresses suggests that the intended
original behavior is the right one, but as bde points out in the
PR comments, we do actually support storing a mode on symlinks,
so returning it seems reasonable.
This is consistent with Mac OS X, which despite documentation to
the contrary does return the mode set on a symlink, but not some
other platforms. The Single Unix Spec requires only that the
returned bits be "meaningful", which seems at best unhelpful as
advice goes.
PR: 25018
MFC after: 3 days
Revision Changes Path
1.262 +0 -5 src/sys/kern/vfs_vnops.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->patched Transition to patched as I have removed the bogus code. This is not the change requested in this PR, but does address the issue of the broken code. I'll close the PR once this change has been MFC'd. Thanks for the report, and apologies for the extraordinarily long time it has taken for someone to pick up this PR. rwatson 2008-08-31 21:27:05 UTC
FreeBSD src repository
Modified files: (Branch: RELENG_7)
sys/kern vfs_vnops.c
Log:
SVN rev 182574 on 2008-08-31 21:27:05Z by rwatson
Merge r181254 from head to stable/7:
Remove broken code to replace st_mode value with ACCESSPERMS when
lstat(2) is called on symlinks -- this code appears never to have
worked. The PR this addresses suggests that the intended
original behavior is the right one, but as bde points out in the
PR comments, we do actually support storing a mode on symlinks,
so returning it seems reasonable.
This is consistent with Mac OS X, which despite documentation to
the contrary does return the mode set on a symlink, but not some
other platforms. The Single Unix Spec requires only that the
returned bits be "meaningful", which seems at best unhelpful as
advice goes.
PR: 25018
Revision Changes Path
1.252.2.1 +0 -5 src/sys/kern/vfs_vnops.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: patched->closed Close PR as this fix has been merged to 7.x, and was included in FreeBSD 7.1. Thanks for the report and patch! |