From e11e252cdf1f7dc0cd8bd6d318d9dc972460ed40 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Tue, 8 Dec 2009 18:15:52 -0500 Subject: [PATCH] --- yaml --- r: 177201 b: refs/heads/master c: 12045a6ee9908b38b6d286530c7d816e39071346 h: refs/heads/master i: 177199: 5044ee80b97cfbad8a3b06ce31d98e49eaba2972 v: v3 --- [refs] | 2 +- trunk/fs/nfsd/nfsfh.c | 4 +++- trunk/include/linux/nfsd/export.h | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 64535e712285..bd26724d7b88 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e8e8753f7a32ce4f636771126fc8eba0dc4ad817 +refs/heads/master: 12045a6ee9908b38b6d286530c7d816e39071346 diff --git a/trunk/fs/nfsd/nfsfh.c b/trunk/fs/nfsd/nfsfh.c index 0eb1c59f5ab8..951938d6c495 100644 --- a/trunk/fs/nfsd/nfsfh.c +++ b/trunk/fs/nfsd/nfsfh.c @@ -88,8 +88,10 @@ nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type) static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp, struct svc_export *exp) { + int flags = nfsexp_flags(rqstp, exp); + /* Check if the request originated from a secure port. */ - if (!rqstp->rq_secure && EX_SECURE(exp)) { + if (!rqstp->rq_secure && (flags & NFSEXP_INSECURE_PORT)) { RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]); dprintk(KERN_WARNING "nfsd: request from insecure port %s!\n", diff --git a/trunk/include/linux/nfsd/export.h b/trunk/include/linux/nfsd/export.h index 4f1df1d7312c..4cafbe1255f0 100644 --- a/trunk/include/linux/nfsd/export.h +++ b/trunk/include/linux/nfsd/export.h @@ -44,7 +44,8 @@ /* The flags that may vary depending on security flavor: */ #define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \ - | NFSEXP_ALLSQUASH) + | NFSEXP_ALLSQUASH \ + | NFSEXP_INSECURE_PORT) #ifdef __KERNEL__ @@ -109,7 +110,6 @@ struct svc_expkey { struct path ek_path; }; -#define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) #define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)