Linux NFS development
 help / color / mirror / Atom feed
* non working tests on unsigned f->pseudoflavor
@ 2009-04-21 14:08 Roel Kluin
  2009-04-21 22:34 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-04-21 14:08 UTC (permalink / raw)
  To: bfields, neilb; +Cc: linux-nfs

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-21 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-21 14:08 non working tests on unsigned f->pseudoflavor Roel Kluin
2009-04-21 22:34 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox