Check that the mode argument to fsdb's `chmod' command contains no

inode type bits set. Previously it would let you set IFMT bits (but
not clear them). The `chtype' command should be be used instead
for changing the inode type; having chmod half-work only causes
confusion.
This commit is contained in:
Ian Dowse 2001-11-11 10:44:02 +00:00
parent c2f9738fda
commit 75249b648a

View File

@ -669,7 +669,7 @@ CMDFUNCSTART(chmode)
return 1;
modebits = strtol(argv[1], &cp, 8);
if (cp == argv[1] || *cp != '\0' ) {
if (cp == argv[1] || *cp != '\0' || (modebits & ~07777)) {
warnx("bad modebits `%s'", argv[1]);
return 1;
}