diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2001-11-02 21:11:41 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2001-11-02 21:11:41 +0000 |
commit | cd778f0244acdb4d90bbe9f842af953f8f14e60a (patch) | |
tree | 3cdd62d460d9e8b93d8e3a1cd59a6d29ff345b81 /sys/kern/vfs_extattr.c | |
parent | 5e0deac346b1669c25488ce2179d532730c4c776 (diff) | |
download | src-cd778f0244acdb4d90bbe9f842af953f8f14e60a.tar.gz src-cd778f0244acdb4d90bbe9f842af953f8f14e60a.zip |
o Remove the local temporary variable "struct proc *p" from vfs_mount()
in vfs_syscalls.c. Although it did save some indirection, many of
those savings will be obscured with the impending commit of suser()
changes, and the result is increased code complexity. Also, once
p->p_ucred and td->td_ucred are distinguished, this will make
vfs_mount() use the correct thread credential, rather than the
process credential.
Notes
Notes:
svn path=/head/; revision=85902
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r-- | sys/kern/vfs_extattr.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 766382770082..530ad1591e64 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -187,7 +187,6 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata) int error, flag = 0, flag2 = 0; struct vattr va; struct nameidata nd; - struct proc *p = td->td_proc; /* * Be ultra-paranoid about making sure the type and fspath @@ -214,7 +213,7 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata) /* * Silently enforce MNT_NOSUID and MNT_NODEV for non-root users */ - if (suser_xxx(p->p_ucred, 0, 0)) + if (suser_xxx(td->td_proc->p_ucred, 0, 0)) fsflags |= MNT_NOSUID | MNT_NODEV; /* * Get vnode to be covered @@ -245,7 +244,7 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata) * Only root, or the user that did the original mount is * permitted to update it. */ - if (mp->mnt_stat.f_owner != p->p_ucred->cr_uid) { + if (mp->mnt_stat.f_owner != td->td_proc->p_ucred->cr_uid) { error = suser_td(td); if (error) { vput(vp); @@ -275,19 +274,20 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata) * If the user is not root, ensure that they own the directory * onto which we are attempting to mount. */ - error = VOP_GETATTR(vp, &va, p->p_ucred, td); + error = VOP_GETATTR(vp, &va, td->td_proc->p_ucred, td); if (error) { vput(vp); return (error); } - if (va.va_uid != p->p_ucred->cr_uid) { + if (va.va_uid != td->td_proc->p_ucred->cr_uid) { error = suser_td(td); if (error) { vput(vp); return (error); } } - if ((error = vinvalbuf(vp, V_SAVE, p->p_ucred, td, 0, 0)) != 0) { + if ((error = vinvalbuf(vp, V_SAVE, td->td_proc->p_ucred, td, 0, 0)) + != 0) { vput(vp); return (error); } @@ -351,7 +351,7 @@ vfs_mount(td, fstype, fspath, fsflags, fsdata) strncpy(mp->mnt_stat.f_fstypename, fstype, MFSNAMELEN); mp->mnt_stat.f_fstypename[MFSNAMELEN - 1] = '\0'; mp->mnt_vnodecovered = vp; - mp->mnt_stat.f_owner = p->p_ucred->cr_uid; + mp->mnt_stat.f_owner = td->td_proc->p_ucred->cr_uid; strncpy(mp->mnt_stat.f_mntonname, fspath, MNAMELEN); mp->mnt_stat.f_mntonname[MNAMELEN - 1] = '\0'; mp->mnt_iosize_max = DFLTPHYS; |