summaryrefslogtreecommitdiffstats
path: root/sbin/fsdb
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2001-11-11 10:44:02 +0000
committeriedowse <iedowse@FreeBSD.org>2001-11-11 10:44:02 +0000
commit78699c965008e303e6e6be6deaf68da2fc36c2b4 (patch)
tree0243538520c2bdc995d53d437a7e0eed06cb7675 /sbin/fsdb
parentbfc3513ef7b3f6807cc10419264c914f151cfd71 (diff)
downloadFreeBSD-src-78699c965008e303e6e6be6deaf68da2fc36c2b4.zip
FreeBSD-src-78699c965008e303e6e6be6deaf68da2fc36c2b4.tar.gz
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.
Diffstat (limited to 'sbin/fsdb')
-rw-r--r--sbin/fsdb/fsdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c
index fb72fb1..59364cb 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;
}
OpenPOWER on IntegriCloud