Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfsserver/nfs_nfsdport.c
Show First 20 Lines • Show All 3,603 Lines • ▼ Show 20 Lines | if (uap->flag & NFSSVC_NFSDADDSOCK) { | ||||
if (error) | if (error) | ||||
goto out; | goto out; | ||||
/* | /* | ||||
* Since we don't know what rights might be required, | * Since we don't know what rights might be required, | ||||
* pretend that we need them all. It is better to be too | * pretend that we need them all. It is better to be too | ||||
* careful than too reckless. | * careful than too reckless. | ||||
*/ | */ | ||||
error = fget(td, sockarg.sock, | error = fget(td, sockarg.sock, | ||||
cap_rights_init(&rights, CAP_SOCK_SERVER), &fp); | cap_rights_init_one(&rights, CAP_SOCK_SERVER), &fp); | ||||
if (error != 0) | if (error != 0) | ||||
goto out; | goto out; | ||||
if (fp->f_type != DTYPE_SOCKET) { | if (fp->f_type != DTYPE_SOCKET) { | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
error = EPERM; | error = EPERM; | ||||
goto out; | goto out; | ||||
} | } | ||||
error = nfsrvd_addsock(fp); | error = nfsrvd_addsock(fp); | ||||
▲ Show 20 Lines • Show All 3,103 Lines • Show Last 20 Lines |