From: Petr Vaněk Date: Tue, 28 May 2019 20:47:48 +0000 (+0200) Subject: add secure_getenv function X-Git-Tag: v1.1.24~45 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7844ecb590893f8344324837956718001402d297;p=oweals%2Fmusl.git add secure_getenv function This function is a GNU extension introduced in glibc 2.17. --- diff --git a/include/stdlib.h b/include/stdlib.h index 42ca8336..194c2033 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -152,6 +152,7 @@ int ptsname_r(int, char *, size_t); char *ecvt(double, int, int *, int *); char *fcvt(double, int, int *, int *); char *gcvt(double, int, char *); +char *secure_getenv(const char *); struct __locale_struct; float strtof_l(const char *__restrict, char **__restrict, struct __locale_struct *); double strtod_l(const char *__restrict, char **__restrict, struct __locale_struct *); diff --git a/src/env/secure_getenv.c b/src/env/secure_getenv.c new file mode 100644 index 00000000..72322f81 --- /dev/null +++ b/src/env/secure_getenv.c @@ -0,0 +1,8 @@ +#define _GNU_SOURCE +#include +#include "libc.h" + +char *secure_getenv(const char *name) +{ + return libc.secure ? NULL : getenv(name); +}