From f88b40218849498b617e3f1ebe9b1af8ef577670 Mon Sep 17 00:00:00 2001 From: jca Date: Wed, 8 Sep 2021 15:57:27 +0000 Subject: [PATCH] Zap _THIS_PORT helper for printf("%n") tracking in ports land This hack isn't very useful now that libc aborts on printf("%n") calls, it's expected that the resulting error would lead to a build failure, and that the coredump along with the syslog message should be enough to find the culprit. Hinted by naddy@ and prodded by deraadt@ --- lib/libc/stdio/vfprintf.c | 8 +------- lib/libc/stdio/vfwprintf.c | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 527de41d75c..9c684c819dc 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfprintf.c,v 1.80 2021/08/30 11:16:49 deraadt Exp $ */ +/* $OpenBSD: vfprintf.c,v 1.81 2021/09/08 15:57:27 jca Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -805,12 +805,6 @@ fp_common: /* <10> is LOG_CRIT */ strlcpy(buf, "<10>", sizeof buf); - /* XXX */ - if ((p = getenv("_THIS_PORT")) != NULL) { - strlcat(buf, p, sizeof buf); - strlcat(buf, " ", sizeof buf); - } - /* Make sure progname does not fill the whole buffer */ strlcat(buf, __progname, sizeof(buf) - sizeof n_msg); strlcat(buf, n_msg, sizeof buf); diff --git a/lib/libc/stdio/vfwprintf.c b/lib/libc/stdio/vfwprintf.c index 15312c27a18..c6db189dc30 100644 --- a/lib/libc/stdio/vfwprintf.c +++ b/lib/libc/stdio/vfwprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfwprintf.c,v 1.21 2021/08/30 11:16:49 deraadt Exp $ */ +/* $OpenBSD: vfwprintf.c,v 1.22 2021/09/08 15:57:27 jca Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -789,12 +789,6 @@ fp_common: /* <10> is LOG_CRIT */ strlcpy(buf, "<10>", sizeof buf); - /* XXX */ - if ((p = getenv("_THIS_PORT")) != NULL) { - strlcat(buf, p, sizeof buf); - strlcat(buf, " ", sizeof buf); - } - /* Make sure progname does not fill the whole buffer */ strlcat(buf, __progname, sizeof(buf) - sizeof n_msg); strlcat(buf, n_msg, sizeof buf); -- 2.20.1