useradd: fix write_full() return value

Resolves: #2313559

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
This commit is contained in:
Iker Pedrosa 2024-10-07 10:00:36 +02:00
commit 1a4bf4ab37
2 changed files with 3 additions and 3 deletions

View file

@ -25,7 +25,7 @@ index 02c500d0..d64fd892 100644
}
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)
+ || (write_full (fd, &ll, sizeof (ll)) == -1)
|| (fsync (fd) != 0)) {
fprintf (stderr,
_("%s: failed to reset the lastlog entry of UID %lu: %s\n"),

View file

@ -1,7 +1,7 @@
Summary: Utilities for managing accounts and shadow password files
Name: shadow-utils
Version: 4.15.1
Release: 11%{?dist}
Release: 12%{?dist}
Epoch: 2
License: BSD-3-Clause AND GPL-2.0-or-later
URL: https://github.com/shadow-maint/shadow
@ -298,7 +298,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libsubid.a
%{_libdir}/libsubid.so
%changelog
* Mon Sep 30 2024 Iker Pedrosa <ipedrosa@redhat.com> - 2:4.15.1-11
* Thu Oct 10 2024 Iker Pedrosa <ipedrosa@redhat.com> - 2:4.15.1-12
- useradd: fix write_full() return value. Resolves: #2313559
* Wed Sep 18 2024 Iker Pedrosa <ipedrosa@redhat.com> - 2:4.15.1-10