summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-11 03:04:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-11 03:04:44 +0000
commit96c299e5d1a70a605f1270b681f1bb01cbc27da5 (patch)
tree283b5a8a0b8246a4aa6717ceb4ffa41de3bc2d11 /lib/libc/stdlib/malloc.c
parent7db7941547de86662ef38d041af7c03f2a91a7b5 (diff)
only support MALLOC_OPTIONS for non-setuid
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r--lib/libc/stdlib/malloc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index e82a5953fdb..bdae6f00a32 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -8,7 +8,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: malloc.c,v 1.9 1996/09/06 16:14:36 tholo Exp $";
+static char rcsid[] = "$OpenBSD: malloc.c,v 1.10 1996/09/11 03:04:43 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -526,8 +526,9 @@ malloc_init ()
malloc_junk = 1;
#endif /* EXTRA_SANITY */
- for (p=getenv("MALLOC_OPTIONS"); p && *p; p++) {
- switch (*p) {
+ if (issetugid() == 0) {
+ for (p=getenv("MALLOC_OPTIONS"); p && *p; p++) {
+ switch (*p) {
case 'a': malloc_abort = 0; break;
case 'A': malloc_abort = 1; break;
#ifdef MALLOC_STATS
@@ -544,6 +545,7 @@ malloc_init ()
wrtwarning("(Init): Unknown char in MALLOC_OPTIONS\n");
p = 0;
break;
+ }
}
}