non working tests on unsigned f->pseudoflavor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 
---
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux