From nobody Tue Mar 14 09:11:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbSSJ04y3z3y00s; Tue, 14 Mar 2023 09:11:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbSSH4tWjz3HqH; Tue, 14 Mar 2023 09:11:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 32E9B12d045967 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 14 Mar 2023 11:11:04 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 32E9B12d045967 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 32E9B1P1045966; Tue, 14 Mar 2023 11:11:01 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 14 Mar 2023 11:11:01 +0200 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: adeca21464d2 - main - Add GNU glibc compatible secure_getenv Message-ID: References: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4PbSSH4tWjz3HqH X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, Mar 14, 2023 at 04:19:55AM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=adeca21464d25bc61f98968a5c1e76ab3c808ae4 > > commit adeca21464d25bc61f98968a5c1e76ab3c808ae4 > Author: lucy > AuthorDate: 2023-03-13 22:01:12 +0000 > Commit: Warner Losh > CommitDate: 2023-03-14 04:19:24 +0000 > > Add GNU glibc compatible secure_getenv > > Add mostly glibc and msl compatible secure_getenv. Return NULL if > issetugid() indicates the process is tainted, otherwise getenv(x). The > rational behind this is the fact that many Linux applications use this > function instead of getenv() as it's widely consider a, "best > practice". > > Reviewed by: imp, mjg (feedback) > Pull Request: https://github.com/freebsd/freebsd-src/pull/686 > Signed-off-by: Lucy Marsh > --- > include/stdlib.h | 1 + > lib/libc/stdlib/Makefile.inc | 4 ++-- > lib/libc/stdlib/Symbol.map | 1 + > lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++- > lib/libc/stdlib/getenv.c | 12 ++++++++++++ > 5 files changed, 41 insertions(+), 3 deletions(-) > > diff --git a/include/stdlib.h b/include/stdlib.h > index 01629ed84a11..c41e8704e810 100644 > --- a/include/stdlib.h > +++ b/include/stdlib.h > @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t, > int (* _Nonnull)(const void *, const void *)); > int rand(void); > void *realloc(void *, size_t) __result_use_check __alloc_size(2); > +char *secure_getenv(const char *); The declaration must be put under BSD_VISIBLE. > void srand(unsigned); > double strtod(const char * __restrict, char ** __restrict); > float strtof(const char * __restrict, char ** __restrict);