aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsdb
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2001-11-11 10:44:02 +0000
committerIan Dowse <iedowse@FreeBSD.org>2001-11-11 10:44:02 +0000
commit75249b648af2117f5c86646a7a342114deb52d4d (patch)
tree0243538520c2bdc995d53d437a7e0eed06cb7675 /sbin/fsdb
parentc2f9738fdae9693aa21fa1de469a1dc7a2c038ac (diff)
downloadsrc-75249b648af2117f5c86646a7a342114deb52d4d.tar.gz
src-75249b648af2117f5c86646a7a342114deb52d4d.zip
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.
Notes
Notes: svn path=/head/; revision=86258
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 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;
}