summaryrefslogtreecommitdiff
path: root/sys/nfs
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-08-15 20:32:22 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-08-15 20:32:22 +0000
commita1ee01486d4d2da0dce2fd97a58ca548a402d598 (patch)
treeeb06f4625b973fc701bb62d6902e4f1eb40bb4f2 /sys/nfs
parent1a3299929d48eae52404e0b75267c111d07d2af4 (diff)
change arguments to suser. suser now takes the process, and a flags
argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_serv.c10
-rw-r--r--sys/nfs/nfs_syscalls.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index c98c3c5f84c..a0cdc8349f7 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_serv.c,v 1.35 2003/06/02 23:28:19 millert Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.36 2003/08/15 20:32:20 tedu Exp $ */
/* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */
/*
@@ -1343,7 +1343,7 @@ nfsrv_create(nfsd, slp, procp, mrq)
if (va.va_type == VCHR && rdev == 0xffffffff)
va.va_type = VFIFO;
if (va.va_type != VFIFO &&
- (error = suser(cred, (u_short *)0))) {
+ (error = suser_ucred(cred))) {
vrele(nd.ni_startdir);
free(nd.ni_cnd.cn_pnbuf, M_NAMEI);
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
@@ -1540,7 +1540,7 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
FREE(nd.ni_cnd.cn_pnbuf, M_NAMEI);
} else {
if (va.va_type != VFIFO &&
- (error = suser(cred, (u_short *)0))) {
+ (error = suser_ucred(cred))) {
vrele(nd.ni_startdir);
free((caddr_t)nd.ni_cnd.cn_pnbuf, M_NAMEI);
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
@@ -1652,7 +1652,7 @@ nfsrv_remove(nfsd, slp, procp, mrq)
if (!error) {
vp = nd.ni_vp;
if (vp->v_type == VDIR &&
- (error = suser(cred, (u_short *)0)) != 0)
+ (error = suser_ucred(cred)) != 0)
goto out;
/*
* The root of a mounted filesystem cannot be deleted.
@@ -1908,7 +1908,7 @@ nfsrv_link(nfsd, slp, procp, mrq)
nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft);
return (0);
}
- if (vp->v_type == VDIR && (error = suser(cred, (u_short *)0)) != 0)
+ if (vp->v_type == VDIR && (error = suser_ucred(cred)) != 0)
goto out1;
nd.ni_cnd.cn_cred = cred;
nd.ni_cnd.cn_nameiop = CREATE;
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index ad3e0cc0b07..6cc9edca2b2 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.37 2003/06/02 23:28:20 millert Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.38 2003/08/15 20:32:20 tedu Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -243,7 +243,7 @@ sys_nfssvc(p, v, retval)
/*
* Must be super user
*/
- error = suser(p->p_ucred, &p->p_acflag);
+ error = suser(p, 0);
if(error)
return (error);
while (nfssvc_sockhead_flag & SLP_INIT) {