X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fnfsd%2Fauth.c;h=294992e9bf69e18b17a52964dd0af23841894f26;hb=3c375c6f3a809d0d999d6dc933634f0b97ed7ae9;hp=cf61dc8ae942d664036ad0630b1713cd93435433;hpb=99e1221d1a1edac316f7f8116c781f75733b1159;p=linux-2.6 diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c index cf61dc8ae9..294992e9bf 100644 --- a/fs/nfsd/auth.c +++ b/fs/nfsd/auth.c @@ -9,10 +9,10 @@ #include #include #include +#include +#include "auth.h" -#define CAP_NFSD_MASK (CAP_FS_MASK|CAP_TO_MASK(CAP_SYS_RESOURCE)) - -static int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp) +int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp) { struct exp_flavor_info *f; struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; @@ -68,10 +68,12 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp) ret = set_current_groups(cred.cr_group_info); put_group_info(cred.cr_group_info); if ((cred.cr_uid)) { - cap_t(current->cap_effective) &= ~CAP_NFSD_MASK; + current->cap_effective = + cap_drop_nfsd_set(current->cap_effective); } else { - cap_t(current->cap_effective) |= (CAP_NFSD_MASK & - current->cap_permitted); + current->cap_effective = + cap_raise_nfsd_set(current->cap_effective, + current->cap_permitted); } return ret; }