summaryrefslogtreecommitdiffstats
path: root/login-utils/login.c
diff options
context:
space:
mode:
authorKarel Zak2011-06-08 11:32:53 +0200
committerKarel Zak2011-06-08 11:32:53 +0200
commitabd0a5c9eb1c787b85ab9cdc1bcb0096d5239a8d (patch)
tree49fdc7d3ffb943ed12a9c40b1ff62ea7846c4afb /login-utils/login.c
parentlibmount: fix uninitialized variable in sample (diff)
downloadkernel-qcow2-util-linux-abd0a5c9eb1c787b85ab9cdc1bcb0096d5239a8d.tar.gz
kernel-qcow2-util-linux-abd0a5c9eb1c787b85ab9cdc1bcb0096d5239a8d.tar.xz
kernel-qcow2-util-linux-abd0a5c9eb1c787b85ab9cdc1bcb0096d5239a8d.zip
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 <kzak@redhat.com>
Diffstat (limited to 'login-utils/login.c')
-rw-r--r--login-utils/login.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/login-utils/login.c b/login-utils/login.c
index 40f23ad3a..74e0cdd15 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 <michael@stud.uni-hannover.de>
execvp(childArgv[0], childArgv + 1);
- errsv = errno;
-
if (!strcmp(childArgv[0], "/bin/sh"))
warn(_("couldn't exec shell script"));
else