diff mbox series

[16/20] shadow: update 4.16.0 -> 4.17.1

Message ID 20250108084226.117178-16-alex.kanavin@gmail.com
State New
Headers show
Series [01/20] ppp: update 2.5.1 -> 2.5.2 | expand

Commit Message

Alexander Kanavin Jan. 8, 2025, 8:42 a.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

Remove groups entries, as that has been removed in favor of the coreutils implementation.

Add a patch to support older host compilers.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 ...-use-C23-attributes-only-with-gcc-10.patch | 29 +++++++++++++++++++
 ...nexpected-open-failure-in-chroot-env.patch |  6 ++--
 .../shadow/files/shadow-update-pam-conf.patch |  2 +-
 .../{shadow_4.16.0.bb => shadow_4.17.1.bb}    |  9 +++---
 4 files changed, 37 insertions(+), 9 deletions(-)
 create mode 100644 meta/recipes-extended/shadow/files/0001-lib-attr.h-use-C23-attributes-only-with-gcc-10.patch
 rename meta/recipes-extended/shadow/{shadow_4.16.0.bb => shadow_4.17.1.bb} (96%)
diff mbox series

Patch

diff --git a/meta/recipes-extended/shadow/files/0001-lib-attr.h-use-C23-attributes-only-with-gcc-10.patch b/meta/recipes-extended/shadow/files/0001-lib-attr.h-use-C23-attributes-only-with-gcc-10.patch
new file mode 100644
index 00000000000..4e2d3a89c34
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/0001-lib-attr.h-use-C23-attributes-only-with-gcc-10.patch
@@ -0,0 +1,29 @@ 
+From f2d8d96e8586772becd68593a5bd9e14632841af Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex@linutronix.de>
+Date: Tue, 7 Jan 2025 17:03:32 +0100
+Subject: [PATCH] lib/attr.h: use C23 attributes only with gcc >= 10
+
+These are not available on earlier versions and builds break there.
+
+Upstream-Status: Submitted [https://github.com/shadow-maint/shadow/pull/1172]
+Signed-off-by: Alexander Kanavin <alex@linutronix.de>
+---
+ lib/attr.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/attr.h b/lib/attr.h
+index 02c7e252..290514d8 100644
+--- a/lib/attr.h
++++ b/lib/attr.h
+@@ -5,7 +5,7 @@
+ #include "config.h"
+ 
+ 
+-#if defined(__GNUC__)
++#if defined(__GNUC__) && (__GNUC__ >= 10)
+ # define MAYBE_UNUSED                [[gnu::unused]]
+ # define NORETURN                    [[gnu::__noreturn__]]
+ # define format_attr(type, fmt, va)  [[gnu::format(type, fmt, va)]]
+-- 
+2.45.2
+
diff --git a/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch b/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
index cd99aad135c..699269ed643 100644
--- a/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
+++ b/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
@@ -1,4 +1,4 @@ 
-From f512071dd3a4c29d4bf048c5a89c4ba9160e37b1 Mon Sep 17 00:00:00 2001
+From f7b765c022e4cad9140ac44712885c66e149abdc Mon Sep 17 00:00:00 2001
 From: Chen Qi <Qi.Chen@windriver.com>
 Date: Thu, 17 Jul 2014 15:53:34 +0800
 Subject: [PATCH] commonio.c-fix-unexpected-open-failure-in-chroot-env
@@ -20,10 +20,10 @@  Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
  1 file changed, 12 insertions(+), 4 deletions(-)
 
 diff --git a/lib/commonio.c b/lib/commonio.c
-index 01a26c9..82b2868 100644
+index 4d83e83..9ee0e13 100644
 --- a/lib/commonio.c
 +++ b/lib/commonio.c
-@@ -601,10 +601,18 @@ int commonio_open (struct commonio_db *db, int mode)
+@@ -604,10 +604,18 @@ int commonio_open (struct commonio_db *db, int mode)
  	db->cursor = NULL;
  	db->changed = false;
  
diff --git a/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch b/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch
index 1eacb8a53fe..cb3baf450c4 100644
--- a/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch
+++ b/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch
@@ -1,4 +1,4 @@ 
-From 38882ab288fd4d2cc2e45dff222ae3412c8fe357 Mon Sep 17 00:00:00 2001
+From eb17cd91d8e4d76ee95de9c0c9f4938ba2e3e82a Mon Sep 17 00:00:00 2001
 From: Kang Kai <kai.kang@windriver.com>
 Date: Wed, 20 Jul 2011 19:18:14 +0800
 Subject: [PATCH] shadow: update pam related configure files
diff --git a/meta/recipes-extended/shadow/shadow_4.16.0.bb b/meta/recipes-extended/shadow/shadow_4.17.1.bb
similarity index 96%
rename from meta/recipes-extended/shadow/shadow_4.16.0.bb
rename to meta/recipes-extended/shadow/shadow_4.17.1.bb
index b7282d7933f..a70ecea1f2e 100644
--- a/meta/recipes-extended/shadow/shadow_4.16.0.bb
+++ b/meta/recipes-extended/shadow/shadow_4.17.1.bb
@@ -14,6 +14,7 @@  GITHUB_BASE_URI = "https://github.com/shadow-maint/shadow/releases"
 SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.gz \
            ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \
            file://useradd \
+           file://0001-lib-attr.h-use-C23-attributes-only-with-gcc-10.patch \
            "
 
 SRC_URI:append:class-target = " \
@@ -24,7 +25,7 @@  SRC_URI:append:class-target = " \
 SRC_URI:append:class-native = " \
            file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \
            "
-SRC_URI[sha256sum] = "1744f339e07a2b41056347ddd612839762ff565d7e9494fb049428002fa2e7e0"
+SRC_URI[sha256sum] = "51a946bbce141c5de14b6d47cab167206cd685d2307e917611dbc1be46c84a18"
 UPSTREAM_CHECK_REGEX = "releases/tag/v?(?P<pver>\d+(\.\d+)+)$"
 
 # Additional Policy files for PAM
@@ -182,7 +183,6 @@  FILES:${PN}-base = "\
     ${base_bindir}/su.shadow \
     ${bindir}/sg \
     ${bindir}/newgrp.shadow \
-    ${bindir}/groups.shadow \
     ${sysconfdir}/pam.d/login \
     ${sysconfdir}/pam.d/su \
     ${sysconfdir}/login.defs \
@@ -201,14 +201,13 @@  ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
 ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
 ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
-ALTERNATIVE:${PN}-doc = "chfn.1 chsh.1 groups.1 su.1 nologin.8"
+ALTERNATIVE:${PN}-doc = "chfn.1 chsh.1 su.1 nologin.8"
 ALTERNATIVE_LINK_NAME[chfn.1] = "${mandir}/man1/chfn.1"
 ALTERNATIVE_LINK_NAME[chsh.1] = "${mandir}/man1/chsh.1"
-ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
 ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1"
 ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8"
 
-ALTERNATIVE:${PN}-base = "newgrp groups login su"
+ALTERNATIVE:${PN}-base = "newgrp login su"
 ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
 ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"