summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2019-08-18 18:00:31 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-21 15:29:02 +0100
commitfe6d059212647338809998ddadbf4c876f600066 (patch)
tree9036020c50ac01afef64ee3559dd2e71e498758d /meta/recipes-extended/shadow
parentf45a48887fd5c0e632fb1bb3be8b19fc2402f395 (diff)
downloadpoky-fe6d059212647338809998ddadbf4c876f600066.tar.gz
shadow: musl now supports secure_getenv
This fixed a potential security vulnerability on musl and made the patch obsolete. (From OE-Core rev: 30b6ae3084f63df437a4d6dd859bca674ca01e12) Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/shadow')
-rw-r--r--meta/recipes-extended/shadow/files/0002-gettime-Use-secure_getenv-over-getenv.patch71
-rw-r--r--meta/recipes-extended/shadow/shadow.inc1
2 files changed, 0 insertions, 72 deletions
diff --git a/meta/recipes-extended/shadow/files/0002-gettime-Use-secure_getenv-over-getenv.patch b/meta/recipes-extended/shadow/files/0002-gettime-Use-secure_getenv-over-getenv.patch
deleted file mode 100644
index 8c8234d038..0000000000
--- a/meta/recipes-extended/shadow/files/0002-gettime-Use-secure_getenv-over-getenv.patch
+++ /dev/null
@@ -1,71 +0,0 @@
1From 3d921155e0a761f61c8f1ec37328724aee1e2eda Mon Sep 17 00:00:00 2001
2From: Chris Lamb <chris@chris-lamb.co.uk>
3Date: Sun, 31 Mar 2019 15:59:45 +0100
4Subject: [PATCH 2/2] gettime: Use secure_getenv over getenv.
5
6Upstream-Status: Backport
7Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
8---
9 README | 1 +
10 configure.ac | 3 +++
11 lib/defines.h | 6 ++++++
12 libmisc/gettime.c | 2 +-
13 4 files changed, 11 insertions(+), 1 deletion(-)
14
15diff --git a/README b/README
16index 952ac5787f06..26cfff1e8fa8 100644
17--- a/README
18+++ b/README
19@@ -51,6 +51,7 @@ Brian R. Gaeke <brg@dgate.org>
20 Calle Karlsson <ckn@kash.se>
21 Chip Rosenthal <chip@unicom.com>
22 Chris Evans <lady0110@sable.ox.ac.uk>
23+Chris Lamb <chris@chris-lamb.co.uk>
24 Cristian Gafton <gafton@sorosis.ro>
25 Dan Walsh <dwalsh@redhat.com>
26 Darcy Boese <possum@chardonnay.niagara.com>
27diff --git a/configure.ac b/configure.ac
28index da236722766b..a738ad662cc3 100644
29--- a/configure.ac
30+++ b/configure.ac
31@@ -110,6 +110,9 @@ AC_REPLACE_FUNCS(sgetgrent sgetpwent sgetspent)
32 AC_REPLACE_FUNCS(snprintf strcasecmp strdup strerror strstr)
33
34 AC_CHECK_FUNC(setpgrp)
35+AC_CHECK_FUNC(secure_getenv, [AC_DEFINE(HAS_SECURE_GETENV,
36+ 1,
37+ [Defined to 1 if you have the declaration of 'secure_getenv'])])
38
39 if test "$ac_cv_header_shadow_h" = "yes"; then
40 AC_CACHE_CHECK(for working shadow group support,
41diff --git a/lib/defines.h b/lib/defines.h
42index cded1417fd12..2fb1b56eca6b 100644
43--- a/lib/defines.h
44+++ b/lib/defines.h
45@@ -382,4 +382,10 @@ extern char *strerror ();
46 # endif
47 #endif
48
49+#ifdef HAVE_SECURE_GETENV
50+# define shadow_getenv(name) secure_getenv(name)
51+# else
52+# define shadow_getenv(name) getenv(name)
53+#endif
54+
55 #endif /* _DEFINES_H_ */
56diff --git a/libmisc/gettime.c b/libmisc/gettime.c
57index 53eaf51670bb..0e25a4b75061 100644
58--- a/libmisc/gettime.c
59+++ b/libmisc/gettime.c
60@@ -52,7 +52,7 @@
61 unsigned long long epoch;
62
63 fallback = time (NULL);
64- source_date_epoch = getenv ("SOURCE_DATE_EPOCH");
65+ source_date_epoch = shadow_getenv ("SOURCE_DATE_EPOCH");
66
67 if (!source_date_epoch)
68 return fallback;
69--
702.17.1
71
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index 7f82d20826..acd753d0c1 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -12,7 +12,6 @@ UPSTREAM_CHECK_URI = "https://github.com/shadow-maint/shadow/releases"
12SRC_URI = "https://github.com/shadow-maint/shadow/releases/download/${PV}/${BP}.tar.gz \ 12SRC_URI = "https://github.com/shadow-maint/shadow/releases/download/${PV}/${BP}.tar.gz \
13 file://shadow-4.1.3-dots-in-usernames.patch \ 13 file://shadow-4.1.3-dots-in-usernames.patch \
14 file://0001-Make-the-sp_lstchg-shadow-field-reproducible-re.-71.patch \ 14 file://0001-Make-the-sp_lstchg-shadow-field-reproducible-re.-71.patch \
15 file://0002-gettime-Use-secure_getenv-over-getenv.patch \
16 file://0001-configure.ac-fix-configure-error-with-dash.patch \ 15 file://0001-configure.ac-fix-configure-error-with-dash.patch \
17 ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \ 16 ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \
18 " 17 "