]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
passwd: Call fail_exit on pwd lock failure
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 15 Dec 2025 16:06:00 +0000 (17:06 +0100)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Tue, 16 Dec 2025 12:22:43 +0000 (13:22 +0100)
At this point, shadow might be already locked if update_noshadow is
called as fallback within update_shadow. Make sure that unlock is
called before exit.

Fixes: 45c6603cc86c (2007-10-07; "[svn-upgrade] Integrating new upstream version, shadow (19990709)")
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
src/passwd.c

index 918f8e5d1c42c1fd610dc8156c44dbb6361ad16c..3f4d9c3c04d7fea8bf5c8fab1ea7e3701caf14e4 100644 (file)
@@ -564,7 +564,7 @@ static void update_noshadow(bool process_selinux)
                (void) fprintf (stderr,
                                _("%s: cannot lock %s; try again later.\n"),
                                Prog, pw_dbname ());
-               exit (E_PWDBUSY);
+               fail_exit (E_PWDBUSY, process_selinux);
        }
        pw_locked = true;
        if (pw_open (O_CREAT | O_RDWR) == 0) {