Date: Tue, 14 Mar 2023 10:30:59 -0600 From: Warner Losh <imp@bsdimp.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Warner Losh <imp@freebsd.org>, 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: <CANCZdfpkEq5%2BPRaieR4wz4AK_NBtzw5deMZB7c%2B1TcG=0zjqgA@mail.gmail.com> In-Reply-To: <ZBA6JXzO3dq0egDi@kib.kiev.ua> References: <202303140419.32E4Jtsd058392@gitrepo.freebsd.org> <ZBA6JXzO3dq0egDi@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Tue, Mar 14, 2023 at 3:11 AM Konstantin Belousov <kostikbel@gmail.com> wrote: > 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 <seafork@disroot.org> > > AuthorDate: 2023-03-13 22:01:12 +0000 > > Commit: Warner Losh <imp@FreeBSD.org> > > 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 <seafork@disroot.org> > > --- > > 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. > Thanks. https://reviews.freebsd.org/D39076 > > void srand(unsigned); > > double strtod(const char * __restrict, char ** __restrict); > > float strtof(const char * __restrict, char ** __restrict); > [-- Attachment #2 --] <div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 14, 2023 at 3:11 AM Konstantin Belousov <<a href="mailto:kostikbel@gmail.com">kostikbel@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Mar 14, 2023 at 04:19:55AM +0000, Warner Losh wrote:<br> > The branch main has been updated by imp:<br> > <br> > URL: <a href="https://cgit.FreeBSD.org/src/commit/?id=adeca21464d25bc61f98968a5c1e76ab3c808ae4" rel="noreferrer" target="_blank">https://cgit.FreeBSD.org/src/commit/?id=adeca21464d25bc61f98968a5c1e76ab3c808ae4</a><br> > <br> > commit adeca21464d25bc61f98968a5c1e76ab3c808ae4<br> > Author: lucy <<a href="mailto:seafork@disroot.org" target="_blank">seafork@disroot.org</a>><br> > AuthorDate: 2023-03-13 22:01:12 +0000<br> > Commit: Warner Losh <imp@FreeBSD.org><br> > CommitDate: 2023-03-14 04:19:24 +0000<br> > <br> > Add GNU glibc compatible secure_getenv<br> > <br> > Add mostly glibc and msl compatible secure_getenv. Return NULL if<br> > issetugid() indicates the process is tainted, otherwise getenv(x). The<br> > rational behind this is the fact that many Linux applications use this<br> > function instead of getenv() as it's widely consider a, "best<br> > practice".<br> > <br> > Reviewed by: imp, mjg (feedback)<br> > Pull Request: <a href="https://github.com/freebsd/freebsd-src/pull/686" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd-src/pull/686</a><br> > Signed-off-by: Lucy Marsh <<a href="mailto:seafork@disroot.org" target="_blank">seafork@disroot.org</a>><br> > ---<br> > include/stdlib.h | 1 +<br> > lib/libc/stdlib/Makefile.inc | 4 ++--<br> > lib/libc/stdlib/Symbol.map | 1 +<br> > lib/libc/stdlib/getenv.3 | 26 +++++++++++++++++++++++++-<br> > lib/libc/stdlib/getenv.c | 12 ++++++++++++<br> > 5 files changed, 41 insertions(+), 3 deletions(-)<br> > <br> > diff --git a/include/stdlib.h b/include/stdlib.h<br> > index 01629ed84a11..c41e8704e810 100644<br> > --- a/include/stdlib.h<br> > +++ b/include/stdlib.h<br> > @@ -111,6 +111,7 @@ void qsort(void *, size_t, size_t,<br> > int (* _Nonnull)(const void *, const void *));<br> > int rand(void);<br> > void *realloc(void *, size_t) __result_use_check __alloc_size(2);<br> > +char *secure_getenv(const char *);<br> The declaration must be put under BSD_VISIBLE.<br></blockquote><div><br></div><div>Thanks. <a href="https://reviews.freebsd.org/D39076">https://reviews.freebsd.org/D39076</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> > void srand(unsigned);<br> > double strtod(const char * __restrict, char ** __restrict);<br> > float strtof(const char * __restrict, char ** __restrict);<br> </blockquote></div></div>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpkEq5%2BPRaieR4wz4AK_NBtzw5deMZB7c%2B1TcG=0zjqgA>
