* [PATCH] add secure_getenv function
@ 2019-05-28 20:47 Petr Vaněk
2019-08-08 15:34 ` Rich Felker
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vaněk @ 2019-05-28 20:47 UTC (permalink / raw)
To: musl
This function is a GNU extension introduced in glibc 2.17.
---
include/stdlib.h | 1 +
src/env/secure_getenv.c | 8 ++++++++
2 files changed, 9 insertions(+)
create mode 100644 src/env/secure_getenv.c
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 <stdlib.h>
+#include "libc.h"
+
+char *secure_getenv(const char *name)
+{
+ return libc.secure ? NULL : getenv(name);
+}
--
2.21.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] add secure_getenv function
2019-05-28 20:47 [PATCH] add secure_getenv function Petr Vaněk
@ 2019-08-08 15:34 ` Rich Felker
2019-08-13 16:26 ` Petr Vaněk
0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2019-08-08 15:34 UTC (permalink / raw)
To: musl
On Tue, May 28, 2019 at 10:47:48PM +0200, Petr Vaněk wrote:
> This function is a GNU extension introduced in glibc 2.17.
> ---
> include/stdlib.h | 1 +
> src/env/secure_getenv.c | 8 ++++++++
> 2 files changed, 9 insertions(+)
> create mode 100644 src/env/secure_getenv.c
>
> 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 <stdlib.h>
> +#include "libc.h"
> +
> +char *secure_getenv(const char *name)
> +{
> + return libc.secure ? NULL : getenv(name);
> +}
> --
> 2.21.0
Sorry I overlooked this at the time. Applying it now. Thanks!
Rich
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] add secure_getenv function
2019-08-08 15:34 ` Rich Felker
@ 2019-08-13 16:26 ` Petr Vaněk
0 siblings, 0 replies; 3+ messages in thread
From: Petr Vaněk @ 2019-08-13 16:26 UTC (permalink / raw)
To: musl
On Thu, Aug 08, 2019 at 11:34:09AM -0400, Rich Felker wrote:
> Sorry I overlooked this at the time. Applying it now. Thanks!
That's fine, I am glad you applied it. Thanks.
Petr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-13 16:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28 20:47 [PATCH] add secure_getenv function Petr Vaněk
2019-08-08 15:34 ` Rich Felker
2019-08-13 16:26 ` Petr Vaněk
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).