Consistent usage of KAUTH_GENERIC_ISSUSER.
This commit is contained in:
parent
b2eb9a5389
commit
8426ae751a
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: nfs_export.c,v 1.23 2006/12/09 16:11:52 chs Exp $ */
|
/* $NetBSD: nfs_export.c,v 1.24 2007/01/04 20:24:08 elad Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1997, 1998, 2004, 2005 The NetBSD Foundation, Inc.
|
* Copyright (c) 1997, 1998, 2004, 2005 The NetBSD Foundation, Inc.
|
||||||
|
@ -82,7 +82,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: nfs_export.c,v 1.23 2006/12/09 16:11:52 chs Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: nfs_export.c,v 1.24 2007/01/04 20:24:08 elad Exp $");
|
||||||
|
|
||||||
#include "opt_compat_netbsd.h"
|
#include "opt_compat_netbsd.h"
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
|
@ -224,7 +224,7 @@ mountd_set_exports_list(const struct mountd_exports_list *mel, struct lwp *l)
|
||||||
size_t fid_size;
|
size_t fid_size;
|
||||||
|
|
||||||
if (kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
|
if (kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
|
||||||
&l->l_acflag) != 0)
|
NULL) != 0)
|
||||||
return EPERM;
|
return EPERM;
|
||||||
|
|
||||||
/* Lookup the file system path. */
|
/* Lookup the file system path. */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: nfs_serv.c,v 1.121 2006/12/27 12:10:09 yamt Exp $ */
|
/* $NetBSD: nfs_serv.c,v 1.122 2007/01/04 20:24:08 elad Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1989, 1993
|
* Copyright (c) 1989, 1993
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.121 2006/12/27 12:10:09 yamt Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.122 2007/01/04 20:24:08 elad Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -1506,7 +1506,7 @@ nfsrv_create(nfsd, slp, lwp, mrq)
|
||||||
va.va_type = VFIFO;
|
va.va_type = VFIFO;
|
||||||
if (va.va_type != VFIFO &&
|
if (va.va_type != VFIFO &&
|
||||||
(error = kauth_authorize_generic(cred,
|
(error = kauth_authorize_generic(cred,
|
||||||
KAUTH_GENERIC_ISSUSER, (u_short *)0))) {
|
KAUTH_GENERIC_ISSUSER, NULL))) {
|
||||||
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
||||||
vput(nd.ni_dvp);
|
vput(nd.ni_dvp);
|
||||||
nfsm_reply(0);
|
nfsm_reply(0);
|
||||||
|
@ -1701,7 +1701,7 @@ abort:
|
||||||
} else {
|
} else {
|
||||||
if (va.va_type != VFIFO &&
|
if (va.va_type != VFIFO &&
|
||||||
(error = kauth_authorize_generic(cred,
|
(error = kauth_authorize_generic(cred,
|
||||||
KAUTH_GENERIC_ISSUSER, (u_short *)0))) {
|
KAUTH_GENERIC_ISSUSER, NULL))) {
|
||||||
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
||||||
vput(nd.ni_dvp);
|
vput(nd.ni_dvp);
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -1799,7 +1799,7 @@ nfsrv_remove(nfsd, slp, lwp, mrq)
|
||||||
vp = nd.ni_vp;
|
vp = nd.ni_vp;
|
||||||
if (vp->v_type == VDIR &&
|
if (vp->v_type == VDIR &&
|
||||||
(error = kauth_authorize_generic(cred,
|
(error = kauth_authorize_generic(cred,
|
||||||
KAUTH_GENERIC_ISSUSER, (u_short *)0)) != 0)
|
KAUTH_GENERIC_ISSUSER, NULL)) != 0)
|
||||||
goto out;
|
goto out;
|
||||||
/*
|
/*
|
||||||
* The root of a mounted filesystem cannot be deleted.
|
* The root of a mounted filesystem cannot be deleted.
|
||||||
|
@ -2096,7 +2096,7 @@ nfsrv_link(nfsd, slp, lwp, mrq)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if (vp->v_type == VDIR && (error = kauth_authorize_generic(cred,
|
if (vp->v_type == VDIR && (error = kauth_authorize_generic(cred,
|
||||||
KAUTH_GENERIC_ISSUSER, (u_short *)0)) != 0)
|
KAUTH_GENERIC_ISSUSER, NULL)) != 0)
|
||||||
goto out1;
|
goto out1;
|
||||||
nd.ni_cnd.cn_cred = cred;
|
nd.ni_cnd.cn_cred = cred;
|
||||||
nd.ni_cnd.cn_nameiop = CREATE;
|
nd.ni_cnd.cn_nameiop = CREATE;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: nfs_syscalls.c,v 1.102 2006/12/28 00:39:03 yamt Exp $ */
|
/* $NetBSD: nfs_syscalls.c,v 1.103 2007/01/04 20:24:08 elad Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1989, 1993
|
* Copyright (c) 1989, 1993
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: nfs_syscalls.c,v 1.102 2006/12/28 00:39:03 yamt Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: nfs_syscalls.c,v 1.103 2007/01/04 20:24:08 elad Exp $");
|
||||||
|
|
||||||
#include "fs_nfs.h"
|
#include "fs_nfs.h"
|
||||||
#include "opt_nfs.h"
|
#include "opt_nfs.h"
|
||||||
|
@ -165,7 +165,7 @@ sys_nfssvc(struct lwp *l, void *v, register_t *retval)
|
||||||
* Must be super user
|
* Must be super user
|
||||||
*/
|
*/
|
||||||
error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
|
error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER,
|
||||||
&l->l_acflag);
|
NULL);
|
||||||
if (error)
|
if (error)
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue