summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow/files/0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch
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/files/0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch
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/files/0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch')
-rw-r--r--meta/recipes-extended/shadow/files/0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch64
1 files changed, 0 insertions, 64 deletions
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