Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aea93397 authored by J. Bruce Fields's avatar J. Bruce Fields
Browse files

nfsd: distinguish functions of NFSD_MAY_* flags



Most of the NFSD_MAY_* flags actually request permissions, but over the
years we've accreted a few that modify the behavior of the permission or
open code in other ways.

Distinguish the two cases a little more.  In particular, allow the
shortcut at the start of nfsd_permission to ignore the
non-permission-requesting bits.

Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 8985ef0b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2027,7 +2027,7 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp,
	struct inode	*inode = dentry->d_inode;
	int		err;

	if (acc == NFSD_MAY_NOP)
	if ((acc & NFSD_MAY_MASK) == NFSD_MAY_NOP)
		return 0;
#if 0
	dprintk("nfsd: permission 0x%x%s%s%s%s%s%s%s mode 0%o%s%s%s\n",
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@
#define NFSD_MAY_SATTR		8
#define NFSD_MAY_TRUNC		16
#define NFSD_MAY_LOCK		32
#define NFSD_MAY_MASK		63

/* extra hints to permission and open routines: */
#define NFSD_MAY_OWNER_OVERRIDE	64
#define NFSD_MAY_LOCAL_ACCESS	128 /* IRIX doing local access check on device special file*/
#define NFSD_MAY_BYPASS_GSS_ON_ROOT 256