From c13ff7ac6c9d7ada6c41f3c3e389cb815654d94e Mon Sep 17 00:00:00 2001 From: jasper Date: Wed, 1 Sep 2021 09:26:32 +0000 Subject: [PATCH] remove manual fiddling with MALLOC_OPTIONS from libc regress tests these options should be set globally (sysctl) when running regress as opposed to having individual tests set it, barring a few specific exceptions. ok bluhm@ --- regress/lib/libc/env/envtest.c | 5 +---- regress/lib/libc/strchr/strchrtest.c | 5 +---- regress/lib/libc/strlcat/strlcattest.c | 5 +---- regress/lib/libc/strlcpy/strlcpytest.c | 5 +---- regress/lib/libc/strnlen/strnlentest.c | 5 +---- 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/regress/lib/libc/env/envtest.c b/regress/lib/libc/env/envtest.c index f145ecbd140..79a5c0655f9 100644 --- a/regress/lib/libc/env/envtest.c +++ b/regress/lib/libc/env/envtest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: envtest.c,v 1.2 2019/01/25 00:19:26 millert Exp $ */ +/* $OpenBSD: envtest.c,v 1.3 2021/09/01 09:26:32 jasper Exp $ */ /* * Copyright (c) 2010 Todd C. Miller @@ -63,9 +63,6 @@ main(int argc, char *argv[]) int n, failures = 0; size_t len, bufsize; - /* Enable malloc security options. */ - setenv("MALLOC_OPTIONS", "S", 0); - fake_env(); n = count_instances("USER"); if (n != 2) { diff --git a/regress/lib/libc/strchr/strchrtest.c b/regress/lib/libc/strchr/strchrtest.c index 64d61203059..0be4c8df63f 100644 --- a/regress/lib/libc/strchr/strchrtest.c +++ b/regress/lib/libc/strchr/strchrtest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strchrtest.c,v 1.1 2021/07/24 05:45:49 visa Exp $ */ +/* $OpenBSD: strchrtest.c,v 1.2 2021/09/01 09:26:32 jasper Exp $ */ /* * Copyright (c) 2021 Visa Hankala @@ -28,9 +28,6 @@ main(void) char *buf; size_t bufsize; - /* Enable malloc security options. */ - setenv("MALLOC_OPTIONS", "S", 0); - /* Allocate buffer with guard pages. */ bufsize = getpagesize(); buf = malloc(bufsize); diff --git a/regress/lib/libc/strlcat/strlcattest.c b/regress/lib/libc/strlcat/strlcattest.c index 86896ff9873..00a9212eb5e 100644 --- a/regress/lib/libc/strlcat/strlcattest.c +++ b/regress/lib/libc/strlcat/strlcattest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strlcattest.c,v 1.3 2019/01/25 00:19:26 millert Exp $ */ +/* $OpenBSD: strlcattest.c,v 1.4 2021/09/01 09:26:32 jasper Exp $ */ /* * Copyright (c) 2014 Todd C. Miller @@ -43,9 +43,6 @@ main(int argc, char *argv[]) size_t len, bufsize; int failures = 0; - /* Enable malloc security options. */ - setenv("MALLOC_OPTIONS", "S", 0); - bufsize = getpagesize(); /* trigger guard pages easily */ buf = malloc(bufsize); if (buf == NULL) { diff --git a/regress/lib/libc/strlcpy/strlcpytest.c b/regress/lib/libc/strlcpy/strlcpytest.c index e2151aea747..8f1d12dbce6 100644 --- a/regress/lib/libc/strlcpy/strlcpytest.c +++ b/regress/lib/libc/strlcpy/strlcpytest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strlcpytest.c,v 1.3 2019/01/25 00:19:26 millert Exp $ */ +/* $OpenBSD: strlcpytest.c,v 1.4 2021/09/01 09:26:32 jasper Exp $ */ /* * Copyright (c) 2014 Todd C. Miller @@ -43,9 +43,6 @@ main(int argc, char *argv[]) size_t len, bufsize; int failures = 0; - /* Enable malloc security options. */ - setenv("MALLOC_OPTIONS", "S", 0); - bufsize = getpagesize(); /* trigger guard pages easily */ buf = malloc(bufsize); buf2 = malloc(bufsize); diff --git a/regress/lib/libc/strnlen/strnlentest.c b/regress/lib/libc/strnlen/strnlentest.c index 045b258bf10..78f8cfb2523 100644 --- a/regress/lib/libc/strnlen/strnlentest.c +++ b/regress/lib/libc/strnlen/strnlentest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strnlentest.c,v 1.2 2019/01/25 00:19:26 millert Exp $ */ +/* $OpenBSD: strnlentest.c,v 1.3 2021/09/01 09:26:32 jasper Exp $ */ /* * Copyright (c) 2010 Todd C. Miller @@ -29,9 +29,6 @@ int main(int argc, char *argv[]) int failures = 0; size_t len, bufsize; - /* Enable malloc security options. */ - setenv("MALLOC_OPTIONS", "S", 0); - bufsize = getpagesize(); /* trigger guard pages easily */ buf = malloc(bufsize); if (buf == NULL) { -- 2.20.1