diff options
author | rwatson <rwatson@FreeBSD.org> | 2008-08-03 15:44:56 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2008-08-03 15:44:56 +0000 |
commit | 8883e5c019649d676291980af150ddd497142b96 (patch) | |
tree | c5b6fdbfcafeab98625658cf16e72f36a4b96488 /sys | |
parent | 28def2c5ae2c4a5561bbc4ab5275aa8c916733a6 (diff) | |
download | FreeBSD-src-8883e5c019649d676291980af150ddd497142b96.zip FreeBSD-src-8883e5c019649d676291980af150ddd497142b96.tar.gz |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_vnops.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index c00d66a..fdc34f6 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -736,11 +736,6 @@ vn_stat(vp, sb, active_cred, file_cred, td) break; case VLNK: mode |= S_IFLNK; - /* This is a cosmetic change, symlinks do not have a mode. */ - if (vp->v_mount->mnt_flag & MNT_NOSYMFOLLOW) - sb->st_mode &= ~ACCESSPERMS; /* 0000 */ - else - sb->st_mode |= ACCESSPERMS; /* 0777 */ break; case VSOCK: mode |= S_IFSOCK; |