From 75249b648af2117f5c86646a7a342114deb52d4d Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Sun, 11 Nov 2001 10:44:02 +0000 Subject: [PATCH] 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. --- sbin/fsdb/fsdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c index fb72fb1cd713..59364cbdee75 100644 --- a/sbin/fsdb/fsdb.c +++ b/sbin/fsdb/fsdb.c @@ -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; }