summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2004-07-01 07:28:02 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2004-07-01 07:28:02 +0000
commitac664251ec0543bee7502a93e1e5cda7598ca937 (patch)
tree82e586ceb49c57549993f93490d6d972a626ef45 /lib
parent5dcb030c453a6d5de627386ae801d7ed0938fa68 (diff)
Initialize cmd when processing octal only. Failing to do that results
in rare cases of bogus permissions; noted when using mtree(8) with mmap malloc. ok tdeval@ millert@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/setmode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c
index 5904cea042d..9ed72f5ec0a 100644
--- a/lib/libc/gen/setmode.c
+++ b/lib/libc/gen/setmode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setmode.c,v 1.13 2004/05/18 02:05:52 jfb Exp $ */
+/* $OpenBSD: setmode.c,v 1.14 2004/07/01 07:28:01 otto Exp $ */
/* $NetBSD: setmode.c,v 1.15 1997/02/07 22:21:06 christos Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)setmode.c 8.2 (Berkeley) 3/25/94";
#else
-static char rcsid[] = "$OpenBSD: setmode.c,v 1.13 2004/05/18 02:05:52 jfb Exp $";
+static char rcsid[] = "$OpenBSD: setmode.c,v 1.14 2004/07/01 07:28:01 otto Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -218,6 +218,7 @@ setmode(const char *p)
return (NULL);
}
ADDCMD('=', (STANDARD_BITS|S_ISTXT), perm, mask);
+ set->cmd = 0;
return (saveset);
}