mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-02 08:42:48 +00:00
Only superuser can create symlinks.
Give symlinks mode 755 by default to avoid triggering alert eyes. (the mode isn't use on symlinks)
This commit is contained in:
parent
42f1c17e48
commit
ecde9a6dae
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71936
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user