]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/sulogin.c: Remove 'static' from a temporary variable
authorAlejandro Colomar <alx@kernel.org>
Wed, 17 Jan 2024 16:02:27 +0000 (17:02 +0100)
committerSerge Hallyn <serge@hallyn.com>
Thu, 18 Jan 2024 00:11:19 +0000 (18:11 -0600)
There's no need to keep 'pass' in .bss:

$ grep -nC3 '\<pass\>' src/sulogin.c
58-/*ARGSUSED*/ int main (int argc, char **argv)
59-{
60- int     err = 0;
61: char    pass[BUFSIZ];
62- char    **envp = environ;
63- TERMIO  termio;
64-#ifndef USE_PAM
--
166-#endif
167- exit (0);
168- }
169: STRTCPY(pass, cp);
170- erase_pass (cp);
171-
172: if (valid (pass, &pwent)) { /* check encrypted passwords ... */
173- break; /* ... encrypted passwords matched */
174- }
175-
176- sleep (2);
177- (void) puts (_("Login incorrect"));
178- }
179: MEMZERO(pass);
180- (void) alarm (0);
181- (void) signal (SIGALRM, SIG_DFL);
182- environ = newenvp; /* make new environment active */

Cc: Samanta Navarro <ferivoz@riseup.net>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/sulogin.c

index ca78e8ca94991a8a2a68cdb50b5ee0c6e864e6af..aa588c3dbe50bf73fac17107f34b809a72127c71 100644 (file)
@@ -58,13 +58,13 @@ static void catch_signals (unused int sig)
 /*ARGSUSED*/ int main (int argc, char **argv)
 {
        int            err = 0;
+       char           pass[BUFSIZ];
        char           **envp = environ;
        TERMIO         termio;
 #ifndef USE_PAM
        const char     *env;
 #endif
 
-       static char           pass[BUFSIZ];
        static struct passwd  pwent;
 
        tcgetattr (0, &termio);