[PATCH 2/3] shadow: Disable tallylog execution

Richard Purdie
2026-04-21T10:41:57Z

We don't want to be calling tallylog from our native tools, disable it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
.../shadow/files/notallylog.patch | 19 +++++++++++++++++++
meta/recipes-extended/shadow/shadow_4.19.4.bb | 1 +
2 files changed, 20 insertions(+)
create mode 100644 meta/recipes-extended/shadow/files/notallylog.patch

diff --git a/meta/recipes-extended/shadow/files/notallylog.patch b/meta/recipes-extended/shadow/files/notallylog.patch
new file mode 100644
index 00000000000..94773ace2ba
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/notallylog.patch
@@ -0,0 +1,19 @@
+We don't want to call /sbin/pam_tally2 in the native tools case so
+disable this function.
+
+Upstream-Status: Inappropriate [OE cross configuration specific]
+
+Index: shadow-4.19.4/src/useradd.c
+===================================================================
+--- shadow-4.19.4.orig/src/useradd.c
++++ shadow-4.19.4/src/useradd.c
+@@ -2046,6 +2046,9 @@ static void tallylog_reset (const char *
+ int failed;
+ int status;
+
++ /* Don't call /sbin/pam_tally2 in native builds */
++ return;
++
+ if (access(pam_tally2, X_OK) == -1)
+ return;
+
diff --git a/meta/recipes-extended/shadow/shadow_4.19.4.bb b/meta/recipes-extended/shadow/shadow_4.19.4.bb
index 9fe6a27e411..3ab9ae9c287 100644
--- a/meta/recipes-extended/shadow/shadow_4.19.4.bb
+++ b/meta/recipes-extended/shadow/shadow_4.19.4.bb
@@ -25,6 +25,7 @@ SRC_URI:append:class-target = " \
SRC_URI:append:class-native = " \
file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \
file://disable_syslog.patch \
+ file://notallylog.patch \
"
SRC_URI[sha256sum] = "ba7e9aed1c5420203ac549583d6e6f485a819ac7505af9c7cd8c13b2013210b8"
UPSTREAM_CHECK_REGEX = "releases/tag/v?(?P<pver>\d+(\.\d+)+)$"