summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver/nfs_serv.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2008-09-17 15:49:44 +0000
committerattilio <attilio@FreeBSD.org>2008-09-17 15:49:44 +0000
commit23ff3dbeb88f559906401e0fc17cf66554a620ab (patch)
treecf10ffc60d6ce4ed9af75e25eb64a81244564299 /sys/nfsserver/nfs_serv.c
parent30605e1eb117a4e8f8f43b22d297ee4594992fde (diff)
downloadFreeBSD-src-23ff3dbeb88f559906401e0fc17cf66554a620ab.zip
FreeBSD-src-23ff3dbeb88f559906401e0fc17cf66554a620ab.tar.gz
Remove the suser(9) interface from the kernel. It has been replaced from
years by the priv_check(9) interface and just very few places are left. Note that compatibility stub with older FreeBSD version (all above the 8 limit though) are left in order to reduce diffs against old versions. It is responsibility of the maintainers for any module, if they think it is the case, to axe out such cases. This patch breaks KPI so __FreeBSD_version will be bumped into a later commit. This patch needs to be credited 50-50 with rwatson@ as he found time to explain me how the priv_check() works in detail and to review patches. Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com> Reviewed by: rwatson
Diffstat (limited to 'sys/nfsserver/nfs_serv.c')
-rw-r--r--sys/nfsserver/nfs_serv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 15c6624..901a4bd 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -1802,7 +1802,8 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
if (vap->va_type == VCHR && rdev == 0xffffffff)
vap->va_type = VFIFO;
if (vap->va_type != VFIFO &&
- (error = suser_cred(cred, 0))) {
+ (error = priv_check_cred(cred, PRIV_VFS_MKNOD_DEV,
+ 0))) {
goto ereply;
}
vap->va_rdev = rdev;
@@ -2024,7 +2025,8 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
if (error)
NDFREE(&nd, NDF_ONLY_PNBUF);
} else {
- if (vtyp != VFIFO && (error = suser_cred(cred, 0)))
+ if (vtyp != VFIFO && (error = priv_check_cred(cred,
+ PRIV_VFS_MKNOD_DEV, 0)))
goto out;
error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap);
if (error) {
OpenPOWER on IntegriCloud