summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-03-31 12:02:53 +0000
committerpeter <peter@FreeBSD.org>1997-03-31 12:02:53 +0000
commit760db2332ecbe275e9d104f54ef480fa8adcc1c9 (patch)
tree75518bc437ecbc8627b474513a579baea6269e49 /sys/ufs
parent1543ecae887bd6435390612196e8618908146b13 (diff)
downloadFreeBSD-src-760db2332ecbe275e9d104f54ef480fa8adcc1c9.zip
FreeBSD-src-760db2332ecbe275e9d104f54ef480fa8adcc1c9.tar.gz
Treat symlinks as first class citizens with their own uid/gid rather than
as shadows of their containing directory. This should solve the problem of users not being able to delete their symlinks from /tmp once and for all. Symlinks do not have modes though, they are accessable to everything that can read the directory (as before). They are made to show this fact at lstat time (they appear as mode 0777 always, since that's how the the lookup routines in the kernel treat them). More commits will follow, eg: add a real lchown() syscall and man pages.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_lookup.c3
-rw-r--r--sys/ufs/ufs/ufs_vnops.c7
2 files changed, 3 insertions, 7 deletions
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index 8681ee0..c5ccbbe 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_lookup.c 8.15 (Berkeley) 6/16/95
- * $Id: ufs_lookup.c,v 1.12 1997/02/22 09:47:49 peter Exp $
+ * $Id: ufs_lookup.c,v 1.13 1997/03/09 06:10:33 mpp Exp $
*/
#include <sys/param.h>
@@ -504,7 +504,6 @@ found:
if ((dp->i_mode & ISVTX) &&
cred->cr_uid != 0 &&
cred->cr_uid != dp->i_uid &&
- tdp->v_type != VLNK &&
VTOI(tdp)->i_uid != cred->cr_uid) {
vput(tdp);
return (EPERM);
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 70bb3cc..fdce65b 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
- * $Id: ufs_vnops.c,v 1.47 1997/03/09 06:10:36 mpp Exp $
+ * $Id: ufs_vnops.c,v 1.48 1997/03/22 06:53:45 bde Exp $
*/
#include "opt_quota.h"
@@ -2128,10 +2128,7 @@ ufs_makeinode(mode, dvp, vpp, cnp)
}
ip = VTOI(tvp);
ip->i_gid = pdir->i_gid;
- if ((mode & IFMT) == IFLNK)
- ip->i_uid = pdir->i_uid;
- else
- ip->i_uid = cnp->cn_cred->cr_uid;
+ ip->i_uid = cnp->cn_cred->cr_uid;
#ifdef QUOTA
if ((error = getinoquota(ip)) ||
(error = chkiq(ip, 1, cnp->cn_cred, 0))) {
OpenPOWER on IntegriCloud