Remove some static char arrays

Some strings are first written into static char arrays before passed to
functions which expect a const char pointer anyway.

It is easier to pass these strings directly as arguments.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
This commit is contained in:
Samanta Navarro
2023-05-09 11:59:20 +00:00
committed by Serge Hallyn
parent 72290ede0e
commit 666468cc36
2 changed files with 3 additions and 10 deletions

View File

@@ -29,7 +29,6 @@
*/
const char *Prog;
static char name[BUFSIZ];
static char pass[BUFSIZ];
static struct passwd pwent;
@@ -119,14 +118,12 @@ static void catch_signals (unused int sig)
}
#endif /* !USE_PAM */
(void) strcpy (name, "root"); /* KLUDGE!!! */
(void) signal (SIGALRM, catch_signals); /* exit if the timer expires */
(void) alarm (ALARM); /* only wait so long ... */
while (true) { /* repeatedly get login/password pairs */
char *cp;
pw_entry (name, &pwent); /* get entry from password file */
pw_entry ("root", &pwent); /* get entry from password file */
if (pwent.pw_name == NULL) {
/*
* Fail secure