From: Alejandro Colomar Date: Wed, 17 Jan 2024 16:02:27 +0000 (+0100) Subject: src/sulogin.c: Remove 'static' from a temporary variable X-Git-Tag: 4.15.0-rc1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4edda5d8baaceb1d38d3d9e79709dacb5b82798f;p=thirdparty%2Fshadow.git src/sulogin.c: Remove 'static' from a temporary variable There's no need to keep 'pass' in .bss: $ grep -nC3 '\' 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 Cc: Serge Hallyn Signed-off-by: Alejandro Colomar --- diff --git a/src/sulogin.c b/src/sulogin.c index ca78e8ca9..aa588c3db 100644 --- a/src/sulogin.c +++ b/src/sulogin.c @@ -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);