]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
gshadow: Open audit socket after check_fds
authorTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 20 Dec 2025 17:25:03 +0000 (17:25 +0000)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Sat, 20 Dec 2025 18:07:33 +0000 (19:07 +0100)
Protect gshadow the same way as newgrp.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
src/gpasswd.c

index a917de6830c604a67c96bf65309d4683b6249136..0ac6837c2c261adfd9e73572898c936c501f5b38 100644 (file)
@@ -885,10 +885,6 @@ int main (int argc, char **argv)
        struct passwd *pw = NULL;
        struct option_flags  flags = {.chroot = false};
 
-#ifdef WITH_AUDIT
-       audit_help_open ();
-#endif
-
        sanitize_env ();
        check_fds ();
 
@@ -908,6 +904,10 @@ int main (int argc, char **argv)
        log_set_logfd(stderr);
 
        OPENLOG (Prog);
+#ifdef WITH_AUDIT
+       audit_help_open ();
+#endif
+
        setbuf (stdout, NULL);
        setbuf (stderr, NULL);