summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow
diff options
context:
space:
mode:
authorzhengruoqin <zhengrq.fnst@fujitsu.com>2021-12-28 07:17:49 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-05 17:18:15 +0000
commit0da47a56bd8432d2657b188621398c5a7ef85f84 (patch)
tree6a054ac8cf9046d5615b90de750ab4198029f0d7 /meta/recipes-extended/shadow
parent8f04ade2c623c3624e07690fa06caf23570d44ac (diff)
downloadpoky-0da47a56bd8432d2657b188621398c5a7ef85f84.tar.gz
shadow: upgrade 4.9 -> 4.10
0001-Fix-out-of-tree-builds-with-respect-to-libsubid-incl.patch 0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch 0001-libsubid-link-to-PAM-libraries.patch removed since they're included in 4.10 License-Update: Delete the space at the end of the sentence. Changelog: ========== * libsubid fixes * Rename the test program list_subid_ranges to getsubids, write a manpage, so distros can ship it. (Iker Pedrosa) * Add libeconf dep for new*idmap * Allow all group types with usermod -G * Avoid useradd generating empty subid range * Handle NULL pw_passwd * Fix default value SHA_get_salt_rounds * Use https where possible in README * Update content and format of README * Translation updates * Switch from xml2po to itstool in 'make dist' * Fix double frees * Add LOG_INIT configurable to useradd * Add CREATE_MAIL_SPOOL documentation * Create a security.md * Fix su never being SIGKILLd when trapping TERM * Fix wrong SELinux labels in several possible cases * Fix missing chmod in chadowtb_move * Handle malformed hushlogins entries * Fix groupdel segv when passwd does not exist * Fix covscan-found newgrp segfault * Remove trailing slash on hoedir * Fix passwd -l message - it does not change expirey * Fix SIGCHLD handling bugs in su and vipw * Remove special case for "" in usermod * Implement usermod -rG to remove a specific group * call pam_end() after fork in child path for su and login * useradd: In absence of /etc/passwd, assume 0 == root * lib: check NULL before freeing data * Fix pwck segfault (From OE-Core rev: b7215993cf00f668d7e33b7fbc98fb4d8636edac) Signed-off-by: Zheng Ruoqin <zhengrq.fnst@fujitsu.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/shadow')
-rw-r--r--meta/recipes-extended/shadow/files/0001-Fix-out-of-tree-builds-with-respect-to-libsubid-incl.patch114
-rw-r--r--meta/recipes-extended/shadow/files/0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch64
-rw-r--r--meta/recipes-extended/shadow/files/0001-libsubid-link-to-PAM-libraries.patch31
-rw-r--r--meta/recipes-extended/shadow/shadow.inc10
-rw-r--r--meta/recipes-extended/shadow/shadow_4.10.bb (renamed from meta/recipes-extended/shadow/shadow_4.9.bb)0
5 files changed, 4 insertions, 215 deletions
diff --git a/meta/recipes-extended/shadow/files/0001-Fix-out-of-tree-builds-with-respect-to-libsubid-incl.patch b/meta/recipes-extended/shadow/files/0001-Fix-out-of-tree-builds-with-respect-to-libsubid-incl.patch
deleted file mode 100644
index c577be6505..0000000000
--- a/meta/recipes-extended/shadow/files/0001-Fix-out-of-tree-builds-with-respect-to-libsubid-incl.patch
+++ /dev/null
@@ -1,114 +0,0 @@
1From eced8077b57946fe0b723e7c6c510e8f344ce89b Mon Sep 17 00:00:00 2001
2From: Serge Hallyn <serge@hallyn.com>
3Date: Fri, 23 Jul 2021 17:51:13 -0500
4Subject: [PATCH] Fix out of tree builds with respect to libsubid includes
5
6There's a better way to do this, and I hope to clean that up,
7but this fixes out of tree builds for me right now.
8
9Closes #386
10
11Signed-off-by: Serge Hallyn <serge@hallyn.com>
12Upstream-Status: Backport [https://github.com/shadow-maint/shadow/commit/537b8cd90be7b47b45c45cfd27765ef85eb0ebf1]
13Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14---
15 lib/Makefile.am | 2 ++
16 libmisc/Makefile.am | 2 +-
17 libsubid/Makefile.am | 4 ++--
18 src/Makefile.am | 6 ++++++
19 4 files changed, 11 insertions(+), 3 deletions(-)
20
21diff --git a/lib/Makefile.am b/lib/Makefile.am
22index ecf3ee25..5ac2e111 100644
23--- a/lib/Makefile.am
24+++ b/lib/Makefile.am
25@@ -10,6 +10,8 @@ if HAVE_VENDORDIR
26 libshadow_la_CPPFLAGS += -DVENDORDIR=\"$(VENDORDIR)\"
27 endif
28
29+libshadow_la_CPPFLAGS += -I$(top_srcdir)
30+
31 libshadow_la_SOURCES = \
32 commonio.c \
33 commonio.h \
34diff --git a/libmisc/Makefile.am b/libmisc/Makefile.am
35index 9766a7ec..9f237e0d 100644
36--- a/libmisc/Makefile.am
37+++ b/libmisc/Makefile.am
38@@ -1,7 +1,7 @@
39
40 EXTRA_DIST = .indent.pro xgetXXbyYY.c
41
42-AM_CPPFLAGS = -I$(top_srcdir)/lib $(ECONF_CPPFLAGS)
43+AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir) $(ECONF_CPPFLAGS)
44
45 noinst_LTLIBRARIES = libmisc.la
46
47diff --git a/libsubid/Makefile.am b/libsubid/Makefile.am
48index 189165b0..cdc41fe6 100644
49--- a/libsubid/Makefile.am
50+++ b/libsubid/Makefile.am
51@@ -19,8 +19,8 @@ MISCLIBS = \
52 $(LIBTCB)
53
54 libsubid_la_LIBADD = \
55- $(top_srcdir)/lib/libshadow.la \
56- $(top_srcdir)/libmisc/libmisc.la \
57+ $(top_builddir)/lib/libshadow.la \
58+ $(top_builddir)/libmisc/libmisc.la \
59 $(MISCLIBS) -ldl
60
61 AM_CPPFLAGS = \
62diff --git a/src/Makefile.am b/src/Makefile.am
63index 35027013..7c1a3491 100644
64--- a/src/Makefile.am
65+++ b/src/Makefile.am
66@@ -10,6 +10,7 @@ sgidperms = 2755
67 AM_CPPFLAGS = \
68 -I${top_srcdir}/lib \
69 -I$(top_srcdir)/libmisc \
70+ -I$(top_srcdir) \
71 -DLOCALEDIR=\"$(datadir)/locale\"
72
73 # XXX why are login and su in /bin anyway (other than for
74@@ -183,6 +184,7 @@ list_subid_ranges_LDADD = \
75 list_subid_ranges_CPPFLAGS = \
76 -I$(top_srcdir)/lib \
77 -I$(top_srcdir)/libmisc \
78+ -I$(top_srcdir) \
79 -I$(top_srcdir)/libsubid
80
81 get_subid_owners_LDADD = \
82@@ -194,11 +196,13 @@ get_subid_owners_LDADD = \
83 get_subid_owners_CPPFLAGS = \
84 -I$(top_srcdir)/lib \
85 -I$(top_srcdir)/libmisc \
86+ -I$(top_srcdir) \
87 -I$(top_srcdir)/libsubid
88
89 new_subid_range_CPPFLAGS = \
90 -I$(top_srcdir)/lib \
91 -I$(top_srcdir)/libmisc \
92+ -I$(top_srcdir) \
93 -I$(top_srcdir)/libsubid
94
95 new_subid_range_LDADD = \
96@@ -210,6 +214,7 @@ new_subid_range_LDADD = \
97 free_subid_range_CPPFLAGS = \
98 -I$(top_srcdir)/lib \
99 -I$(top_srcdir)/libmisc \
100+ -I$(top_srcdir) \
101 -I$(top_srcdir)/libsubid
102
103 free_subid_range_LDADD = \
104@@ -220,6 +225,7 @@ free_subid_range_LDADD = \
105
106 check_subid_range_CPPFLAGS = \
107 -I$(top_srcdir)/lib \
108+ -I$(top_srcdir) \
109 -I$(top_srcdir)/libmisc
110
111 check_subid_range_LDADD = \
112--
1132.31.1
114
diff --git a/meta/recipes-extended/shadow/files/0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch b/meta/recipes-extended/shadow/files/0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch
deleted file mode 100644
index 2c9b1d06cd..0000000000
--- a/meta/recipes-extended/shadow/files/0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch
+++ /dev/null
@@ -1,64 +0,0 @@
1From 234e8fa7b134d1ebabfdad980a3ae5b63c046c62 Mon Sep 17 00:00:00 2001
2From: Mike Gilbert <floppym@gentoo.org>
3Date: Sat, 14 Aug 2021 13:24:34 -0400
4Subject: [PATCH] libmisc: fix default value in SHA_get_salt_rounds()
5
6If SHA_CRYPT_MIN_ROUNDS and SHA_CRYPT_MAX_ROUNDS are both unspecified,
7use SHA_ROUNDS_DEFAULT.
8
9Previously, the code fell through, calling shadow_random(-1, -1). This
10ultimately set rounds = (unsigned long) -1, which ends up being a very
11large number! This then got capped to SHA_ROUNDS_MAX later in the
12function.
13
14The new behavior matches BCRYPT_get_salt_rounds().
15
16Bug: https://bugs.gentoo.org/808195
17Fixes: https://github.com/shadow-maint/shadow/issues/393
18
19Upstream-Status: Backport [https://github.com/shadow-maint/shadow/commit/234e8fa7b134d1ebabfdad980a3ae5b63c046c62]
20
21Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
22---
23 libmisc/salt.c | 21 +++++++++++----------
24 1 file changed, 11 insertions(+), 10 deletions(-)
25
26diff --git a/libmisc/salt.c b/libmisc/salt.c
27index 91d528fd..30eefb9c 100644
28--- a/libmisc/salt.c
29+++ b/libmisc/salt.c
30@@ -223,20 +223,21 @@ static /*@observer@*/const unsigned long SHA_get_salt_rounds (/*@null@*/int *pre
31 if ((-1 == min_rounds) && (-1 == max_rounds)) {
32 rounds = SHA_ROUNDS_DEFAULT;
33 }
34+ else {
35+ if (-1 == min_rounds) {
36+ min_rounds = max_rounds;
37+ }
38
39- if (-1 == min_rounds) {
40- min_rounds = max_rounds;
41- }
42+ if (-1 == max_rounds) {
43+ max_rounds = min_rounds;
44+ }
45
46- if (-1 == max_rounds) {
47- max_rounds = min_rounds;
48- }
49+ if (min_rounds > max_rounds) {
50+ max_rounds = min_rounds;
51+ }
52
53- if (min_rounds > max_rounds) {
54- max_rounds = min_rounds;
55+ rounds = (unsigned long) shadow_random (min_rounds, max_rounds);
56 }
57-
58- rounds = (unsigned long) shadow_random (min_rounds, max_rounds);
59 } else if (0 == *prefered_rounds) {
60 rounds = SHA_ROUNDS_DEFAULT;
61 } else {
62--
632.17.1
64
diff --git a/meta/recipes-extended/shadow/files/0001-libsubid-link-to-PAM-libraries.patch b/meta/recipes-extended/shadow/files/0001-libsubid-link-to-PAM-libraries.patch
deleted file mode 100644
index ea7a99dbf7..0000000000
--- a/meta/recipes-extended/shadow/files/0001-libsubid-link-to-PAM-libraries.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 4f44617af3a0c59be267ac5fcc33586e3783f5e6 Mon Sep 17 00:00:00 2001
2From: Xi Ruoyao <xry111@mengyan1223.wang>
3Date: Fri, 23 Jul 2021 14:38:08 +0800
4Subject: [PATCH] libsubid: link to PAM libraries
5
6libsubid.so links to libmisc.a, which contains several routines referring to
7PAM functions.
8
9Upstream-Status: Backport [https://github.com/shadow-maint/shadow/commit/f4a84efb468b8be21be124700ce35159c444e9d6]
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11---
12 libsubid/Makefile.am | 3 ++-
13 1 file changed, 2 insertions(+), 1 deletion(-)
14
15diff --git a/libsubid/Makefile.am b/libsubid/Makefile.am
16index cdc41fe6..99308c1f 100644
17--- a/libsubid/Makefile.am
18+++ b/libsubid/Makefile.am
19@@ -16,7 +16,8 @@ MISCLIBS = \
20 $(LIBCRYPT) \
21 $(LIBACL) \
22 $(LIBATTR) \
23- $(LIBTCB)
24+ $(LIBTCB) \
25+ $(LIBPAM)
26
27 libsubid_la_LIBADD = \
28 $(top_builddir)/lib/libshadow.la \
29--
302.31.1
31
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index c91f2739cf..6d4a77caed 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -4,8 +4,9 @@ DESCRIPTION = "${SUMMARY}"
4BUGTRACKER = "http://github.com/shadow-maint/shadow/issues" 4BUGTRACKER = "http://github.com/shadow-maint/shadow/issues"
5SECTION = "base/utils" 5SECTION = "base/utils"
6LICENSE = "BSD-3-Clause | Artistic-1.0" 6LICENSE = "BSD-3-Clause | Artistic-1.0"
7LIC_FILES_CHKSUM = "file://COPYING;md5=ed80ff1c2b40843cf5768e5229cf16e5 \ 7LIC_FILES_CHKSUM = "file://COPYING;md5=24f172951acb1904c9273a6a016b0b36 \
8 file://src/passwd.c;beginline=2;endline=30;md5=5720ff729a6ff39ecc9f64555d75f4af" 8 file://src/passwd.c;beginline=2;endline=30;md5=5720ff729a6ff39ecc9f64555d75f4af \
9 "
9 10
10DEPENDS = "virtual/crypt" 11DEPENDS = "virtual/crypt"
11 12
@@ -14,9 +15,6 @@ SRC_URI = "https://github.com/shadow-maint/shadow/releases/download/v${PV}/${BP}
14 file://shadow-4.1.3-dots-in-usernames.patch \ 15 file://shadow-4.1.3-dots-in-usernames.patch \
15 ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \ 16 ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \
16 file://shadow-relaxed-usernames.patch \ 17 file://shadow-relaxed-usernames.patch \
17 file://0001-Fix-out-of-tree-builds-with-respect-to-libsubid-incl.patch \
18 file://0001-libsubid-link-to-PAM-libraries.patch \
19 file://0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch \
20 file://useradd \ 18 file://useradd \
21 " 19 "
22 20
@@ -33,7 +31,7 @@ SRC_URI:append:class-nativesdk = " \
33 file://0001-Disable-use-of-syslog-for-sysroot.patch \ 31 file://0001-Disable-use-of-syslog-for-sysroot.patch \
34 " 32 "
35 33
36SRC_URI[sha256sum] = "6c4627ff9c9422b96664517ae753c944f2902e92809d0698b65f5fef11985212" 34SRC_URI[sha256sum] = "efa9b89b5901644890dbf230b8e9e3dbcdb51ffb6be145afc57f3012861aeddf"
37 35
38# Additional Policy files for PAM 36# Additional Policy files for PAM
39PAM_SRC_URI = "file://pam.d/chfn \ 37PAM_SRC_URI = "file://pam.d/chfn \
diff --git a/meta/recipes-extended/shadow/shadow_4.9.bb b/meta/recipes-extended/shadow/shadow_4.10.bb
index 2fbd81bf72..2fbd81bf72 100644
--- a/meta/recipes-extended/shadow/shadow_4.9.bb
+++ b/meta/recipes-extended/shadow/shadow_4.10.bb