From abd0a5c9eb1c787b85ab9cdc1bcb0096d5239a8d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 8 Jun 2011 11:32:53 +0200 Subject: [PATCH] login: cleanup unused variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit login.c: In function ‘main’: login.c:389:40: warning: variable ‘errsv’ set but not used [-Wunused-but-set-variable] login.c:389:9: warning: variable ‘ask’ set but not used [-Wunused-but-set-variable] Signed-off-by: Karel Zak --- login-utils/login.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/login-utils/login.c b/login-utils/login.c index 40f23ad3a0..74e0cdd15a 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -386,7 +386,7 @@ main(int argc, char **argv) struct group *gr; register int ch; register char *p; - int ask, fflag, hflag, pflag, cnt, errsv; + int fflag, hflag, pflag, cnt; int quietlog, passwd_req; char *domain, *ttyn; char tbuf[MAXPATHLEN + 2]; @@ -400,6 +400,7 @@ main(int argc, char **argv) struct pam_conv conv = { misc_conv, NULL }; struct sigaction sa, oldsa_hup, oldsa_term; #else + int ask; char *salt, *pp; #endif #ifdef LOGIN_CHOWN_VCS @@ -492,16 +493,20 @@ main(int argc, char **argv) } argc -= optind; argv += optind; + +#ifndef HAVE_SECURITY_PAM_MISC_H + ask = *argv ? 0 : 1; /* Do we need ask for login name? */ +#endif + if (*argv) { char *p = *argv; username = strdup(p); - ask = 0; + /* wipe name - some people mistype their password here */ /* (of course we are too late, but perhaps this helps a little ..) */ while(*p) *p++ = ' '; - } else - ask = 1; + } for (cnt = getdtablesize(); cnt > 2; cnt--) close(cnt); @@ -1274,8 +1279,6 @@ Michael Riepe execvp(childArgv[0], childArgv + 1); - errsv = errno; - if (!strcmp(childArgv[0], "/bin/sh")) warn(_("couldn't exec shell script")); else -- 2.47.3