Linux NFS development
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: bfields@fieldses.org, neilb@suse.de
Cc: linux-nfs@vger.kernel.org
Subject: non working tests on unsigned f->pseudoflavor
Date: Tue, 21 Apr 2009 16:08:39 +0200	[thread overview]
Message-ID: <49EDD367.9000709@gmail.com> (raw)

vi include/linux/nfsd/export.h +77
and note that struct exp_flavor_info f->pseudoflavor in secinfo_parse() is
unsigned. Should there maybe be a test:

if (f->pseudoflavor > MAX)

(and what should MAX be then?)

Otherwise you may want to apply the cleanup patch below

Roel
------------------------------>8-------------8<---------------------------------
Remove redundant tests on unsigned

Signed-off-by: Roel Kluin <roel.kluin@gmail.com> 
---
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 5839b22..f09c3b4 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -463,17 +463,6 @@ static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp)
 		err = get_int(mesg, &f->pseudoflavor);
 		if (err)
 			return err;
-		/*
-		 * Just a quick sanity check; we could also try to check
-		 * whether this pseudoflavor is supported, but at worst
-		 * an unsupported pseudoflavor on the export would just
-		 * be a pseudoflavor that won't match the flavor of any
-		 * authenticated request.  The administrator will
-		 * probably discover the problem when someone fails to
-		 * authenticate.
-		 */
-		if (f->pseudoflavor < 0)
-			return -EINVAL;
 		err = get_int(mesg, &f->flags);
 		if (err)
 			return err;

             reply	other threads:[~2009-04-21 14:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-21 14:08 Roel Kluin [this message]
2009-04-21 22:34 ` non working tests on unsigned f->pseudoflavor J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49EDD367.9000709@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox