From 766147079e4ff2bb1db546b8a4a0fc99e025556e Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 2 Feb 2001 18:35:29 +0000 Subject: Only superuser can create symlinks. Give symlinks mode 755 by default to avoid triggering alert eyes. (the mode isn't use on symlinks) --- sys/fs/devfs/devfs_vnops.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 4337bd2..1f41b51 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -631,17 +631,20 @@ devfs_symlink(ap) char *a_target; } */ *ap; { - int i; + int i, error; struct devfs_dirent *dd; struct devfs_dirent *de; struct devfs_mount *dmp; + error = suser(ap->a_cnp->cn_proc); + if (error) + return(error); dmp = VFSTODEVFS(ap->a_dvp->v_mount); dd = ap->a_dvp->v_data; de = devfs_newdirent(ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen); de->de_uid = 0; de->de_gid = 0; - de->de_mode = 0642; + de->de_mode = 0755; de->de_inode = dmp->dm_inode++; de->de_dirent->d_type = DT_LNK; i = strlen(ap->a_target) + 1; -- cgit v1.1