From 9d0c114d2488edb7fc890fa31cbe6e6f7a1b135273dfbbdabd06b94972b05b37 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 18 Nov 2021 13:50:59 +0000 Subject: [PATCH] - Fix segfaults in newgrp and pwck * Add shadow-4.9-newgrp-segfault.patch https://github.com/shadow-maint/shadow/pull/437 * Add shadow-4.9-pwck-segfault.patch https://github.com/shadow-maint/shadow/pull/445 OBS-URL: https://build.opensuse.org/package/show/Base:System/shadow?expand=0&rev=116 --- shadow-4.9-newgrp-segfault.patch | 15 +++++++++++++++ shadow-4.9-pwck-segfault.patch | 14 ++++++++++++++ shadow.changes | 9 +++++++++ shadow.spec | 6 ++++++ 4 files changed, 44 insertions(+) create mode 100644 shadow-4.9-newgrp-segfault.patch create mode 100644 shadow-4.9-pwck-segfault.patch diff --git a/shadow-4.9-newgrp-segfault.patch b/shadow-4.9-newgrp-segfault.patch new file mode 100644 index 0000000..e57cae0 --- /dev/null +++ b/shadow-4.9-newgrp-segfault.patch @@ -0,0 +1,15 @@ +https://github.com/shadow-maint/shadow/commit/497e90751bc0d95cc998b0f06305040563903948 +Index: shadow-4.9/src/newgrp.c +=================================================================== +--- shadow-4.9.orig/src/newgrp.c ++++ shadow-4.9/src/newgrp.c +@@ -163,8 +163,8 @@ static void check_perms (const struct gr + spwd = xgetspnam (pwd->pw_name); + if (NULL != spwd) { + pwd->pw_passwd = xstrdup (spwd->sp_pwdp); ++ spw_free (spwd); + } +- spw_free (spwd); + + if ((pwd->pw_passwd[0] == '\0') && (grp->gr_passwd[0] != '\0')) { + needspasswd = true; diff --git a/shadow-4.9-pwck-segfault.patch b/shadow-4.9-pwck-segfault.patch new file mode 100644 index 0000000..1193366 --- /dev/null +++ b/shadow-4.9-pwck-segfault.patch @@ -0,0 +1,14 @@ +https://github.com/shadow-maint/shadow/commit/d8e54618feea201987c1f3cb402ed50d1d8b604f + +Index: shadow-4.9/src/pwck.c +=================================================================== +--- shadow-4.9.orig/src/pwck.c ++++ shadow-4.9/src/pwck.c +@@ -857,6 +857,7 @@ int main (int argc, char **argv) + * Get my name so that I can use it to report errors. + */ + Prog = Basename (argv[0]); ++ shadow_logfd = stderr; + + (void) setlocale (LC_ALL, ""); + (void) bindtextdomain (PACKAGE, LOCALEDIR); diff --git a/shadow.changes b/shadow.changes index ab7c955..3dcdc4a 100644 --- a/shadow.changes +++ b/shadow.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Nov 18 13:46:03 UTC 2021 - Michael Vetter + +- Fix segfaults in newgrp and pwck + * Add shadow-4.9-newgrp-segfault.patch + https://github.com/shadow-maint/shadow/pull/437 + * Add shadow-4.9-pwck-segfault.patch + https://github.com/shadow-maint/shadow/pull/445 + ------------------------------------------------------------------- Tue Nov 16 15:58:46 UTC 2021 - Johannes Segitz diff --git a/shadow.spec b/shadow.spec index 279c748..e9923a4 100644 --- a/shadow.spec +++ b/shadow.spec @@ -71,6 +71,10 @@ Patch13: shadow-passwd-handle-null.patch Patch14: shadow-4.9-sgent-free.patch # PATCH-FIX-UPSTREAM shadow-4.9-useradd-subuid.patch mvetter@suse.de -- Fix generating empty subid range and undeclared subid_count (boo#1190146) Patch15: shadow-4.9-useradd-subuid.patch +# PATCH-FIX-UPSTREAM shadow-4.9-newgrp-segfault.patch mvetter@suse.de -- Fix segfault in newgrp (gh#437) +Patch16: shadow-4.9-newgrp-segfault.patch +# PATCH-FIX-UPSTREAM shadow-4.9-pwck-segfault.patch mvetter@suse.de -- Fix segfault in pwck (gh#445) +Patch17: shadow-4.9-pwck-segfault.patch BuildRequires: audit-devel > 2.3 BuildRequires: autoconf BuildRequires: automake @@ -150,6 +154,8 @@ Development files for libsubid3. %patch13 -p1 %patch14 -p1 %patch15 -p1 +%patch16 -p1 +%patch17 -p1 iconv -f ISO88591 -t utf-8 doc/HOWTO > doc/HOWTO.utf8 mv -v doc/HOWTO.utf8 doc/HOWTO