Jim,

here is a small chmod input validation fix.

Cheers,
Andreas.
From: Andreas Gruenbacher <[EMAIL PROTECTED]>
Subject: chmod input parsing fix

A command like ``chmod 0759 /mnt/x'' doesn't produce an error
message even though 0759 is not a valid octal number.

Index: coreutils-5.90/lib/modechange.c
===================================================================
--- coreutils-5.90.orig/lib/modechange.c
+++ coreutils-5.90/lib/modechange.c
@@ -124,6 +124,9 @@ mode_compile (char const *mode_string)
 	}
       while ('0' <= *mode_string && *mode_string < '8');
 
+      if (*mode_string)
+	return NULL;
+
       /* Help the compiler optimize the usual case where mode_t uses
 	 the traditional octal representation.  */
       mode = ((S_ISUID == SUID && S_ISGID == SGID && S_ISVTX == SVTX
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to