summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Novoa III2003-03-19 18:09:03 +0000
committerManuel Novoa III2003-03-19 18:09:03 +0000
commitea4c43445c1fcb378b80216ef388eebc61a57696 (patch)
tree01295b8a4b3f31ff3684c0dbc61c6e4182d31466
parent1cb1b64c35a9356575dc7c0e6125805c5ea62cf9 (diff)
downloadbusybox-ea4c43445c1fcb378b80216ef388eebc61a57696.zip
busybox-ea4c43445c1fcb378b80216ef388eebc61a57696.tar.gz
Restrict octal perms to <= 07777. Cosmetic error message change.
-rw-r--r--coreutils/chmod.c2
-rw-r--r--libbb/parse_mode.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/chmod.c b/coreutils/chmod.c
index 28c9855..a9758d5 100644
--- a/coreutils/chmod.c
+++ b/coreutils/chmod.c
@@ -38,7 +38,7 @@
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
{
if (!bb_parse_mode((char *)junk, &(statbuf->st_mode)))
- bb_error_msg_and_die( "unknown mode: %s", (char *)junk);
+ bb_error_msg_and_die( "invalid mode: %s", (char *)junk);
if (chmod(fileName, statbuf->st_mode) == 0)
return (TRUE);
bb_perror_msg("%s", fileName); /* Avoid multibyte problems. */
diff --git a/libbb/parse_mode.c b/libbb/parse_mode.c
index 49573df..7132c76 100644
--- a/libbb/parse_mode.c
+++ b/libbb/parse_mode.c
@@ -65,7 +65,7 @@ extern int bb_parse_mode(const char *s, mode_t *current_mode)
char *e;
tmp = strtol(s, &e, 8);
- if (*e || (tmp > 0xffffU)) { /* Check range and trailing chars. */
+ if (*e || (tmp > 07777U)) { /* Check range and trailing chars. */
return 0;
}
*current_mode = tmp;