From: Karel Zak Date: Wed, 8 Jun 2011 09:32:53 +0000 (+0200) Subject: login: cleanup unused variables X-Git-Tag: v2.20-rc1~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abd0a5c9eb1c787b85ab9cdc1bcb0096d5239a8d;p=thirdparty%2Futil-linux.git login: cleanup unused variables 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 --- 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