diff --git a/shadow-4.15.0-useradd-fix-write-full-return.patch b/shadow-4.15.0-useradd-fix-write-full-return.patch new file mode 100644 index 0000000..64e2ef8 --- /dev/null +++ b/shadow-4.15.0-useradd-fix-write-full-return.patch @@ -0,0 +1,34 @@ +From 8903b94c86c978e8abef623358fd3e4629c06967 Mon Sep 17 00:00:00 2001 +From: Iker Pedrosa +Date: Mon, 9 Sep 2024 10:36:17 +0200 +Subject: [PATCH] useradd: fix write_full() return value + +write_full() returns -1 on error and useradd was checking another value. + +Closes: https://github.com/shadow-maint/shadow/issues/1072 +Fixes: f45498a6c286 ("libmisc/write_full.c: Improve write_full()") + +Reported-by: +Suggested-by: +Reviewed-by: Alejandro Colomar +Reviewed-by: Iker Pedrosa +--- + src/useradd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/useradd.c b/src/useradd.c +index 02c500d0..d64fd892 100644 +--- a/src/useradd.c ++++ b/src/useradd.c +@@ -2042,7 +2042,7 @@ static void lastlog_reset (uid_t uid) + return; + } + if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid) +- || (write_full (fd, &ll, sizeof (ll)) != (ssize_t) sizeof (ll)) ++ || (write_full (fd, &ll, sizeof (ll)) == -1) + || (fsync (fd) != 0)) { + fprintf (stderr, + _("%s: failed to reset the lastlog entry of UID %lu: %s\n"), +-- +2.46.0 + diff --git a/shadow-utils.spec b/shadow-utils.spec index 86713aa..27a9e8d 100644 --- a/shadow-utils.spec +++ b/shadow-utils.spec @@ -1,7 +1,7 @@ Summary: Utilities for managing accounts and shadow password files Name: shadow-utils Version: 4.15.0 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 2 License: BSD-3-Clause AND GPL-2.0-or-later URL: https://github.com/shadow-maint/shadow @@ -30,6 +30,8 @@ Patch3: shadow-4.15.0-audit-update.patch Patch4: shadow-4.15.0-account-tools-setuid.patch # https://github.com/shadow-maint/shadow/commit/ead55e9ba8958504e23e29545f90c4dd925c7462 Patch5: shadow-4.15.0-getdef-spurious-error.patch +# https://github.com/shadow-maint/shadow/commit/903593249630054ab5df327481f7386f718088cc +Patch6: shadow-4.15.0-useradd-fix-write-full-return.patch ### Dependencies ### Requires: audit-libs >= 1.6.5 @@ -128,6 +130,7 @@ autoreconf --with-selinux \ --without-libbsd \ --without-libcrack \ + --without-nscd \ --without-sssd \ --enable-shared \ --with-group-name-max-length=32 \ @@ -277,6 +280,10 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libsubid.a %{_libdir}/libsubid.so %changelog +* Mon Nov 4 2024 Iker Pedrosa - 2:4.15.0-5 +- Disable nscd. Resolves: RHEL-56355 +- useradd: fix write_full() return value + * Tue Oct 29 2024 Troy Dawson - 2:4.15.0-4 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018