From 903593249630054ab5df327481f7386f718088cc Mon Sep 17 00:00:00 2001 From: Iker Pedrosa Date: Fri, 4 Oct 2024 15:02:59 +0200 Subject: [PATCH] useradd: fix comparison sign for write_full() return I forgot to change the comparison sign that checks the return value of write_full() Closes: https://github.com/shadow-maint/shadow/issues/1072 Fixes: 8903b94c86c9 ("useradd: fix write_full() return value") Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2313559 Reported-by: Suggested-by: 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 b2142057..64e7a412 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)) != -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"),