From: Marc Dionne Date: Mon, 8 Aug 2011 21:08:34 +0000 (-0400) Subject: pam: fix unused but set warnings X-Git-Tag: openafs-devel-1_7_1~174 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=d28188382b40055acf7096ef89d5507194a3b8b6 pam: fix unused but set warnings Fix a few cases of set but unused variables. Change-Id: I0a3e0906dbc708e2449121f3de1726d7055efc27 Reviewed-on: http://gerrit.openafs.org/5173 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- diff --git a/src/pam/afs_auth.c b/src/pam/afs_auth.c index df18fbe..26a3900 100644 --- a/src/pam/afs_auth.c +++ b/src/pam/afs_auth.c @@ -54,7 +54,6 @@ pam_sm_authenticate(pam_handle_t * pamh, int flags, int argc, /* satisfy kdm 2.x */ int use_klog = 0; - int set_expires = 0; /* This option is only used in pam_set_cred() */ int got_authtok = 0; /* got PAM_AUTHTOK upon entry */ PAM_CONST char *user = NULL, *password = NULL; afs_int32 password_expires = -1; @@ -132,7 +131,7 @@ pam_sm_authenticate(pam_handle_t * pamh, int flags, int argc, else pam_afs_syslog(LOG_ERR, PAMAFS_CONFLICTOPT, "use_klog"); } else if (strcasecmp(argv[i], "setenv_password_expires") == 0) { - set_expires = 1; + ; } else { pam_afs_syslog(LOG_ERR, PAMAFS_UNKNOWNOPT, argv[i]); } diff --git a/src/pam/afs_password.c b/src/pam/afs_password.c index 8cb26cc..07fa47f 100644 --- a/src/pam/afs_password.c +++ b/src/pam/afs_password.c @@ -38,7 +38,6 @@ pam_sm_chauthtok(pam_handle_t * pamh, int flags, int argc, const char **argv) int use_first_pass = 0; int try_first_pass = 0; int ignore_root = 0; - int got_authtok = 0; /* got PAM_AUTHTOK upon entry */ char *torch_password = NULL; int i; char my_password_buf[256]; @@ -158,7 +157,6 @@ pam_sm_chauthtok(pam_handle_t * pamh, int flags, int argc, const char **argv) } else { if (logmask && LOG_MASK(LOG_DEBUG)) pam_afs_syslog(LOG_DEBUG, PAMAFS_GOTPASS, user); - got_authtok = 1; } if (!(use_first_pass || try_first_pass)) { password = NULL; diff --git a/src/pam/afs_session.c b/src/pam/afs_session.c index ad205e0..9dee59b 100644 --- a/src/pam/afs_session.c +++ b/src/pam/afs_session.c @@ -35,13 +35,12 @@ pam_sm_close_session(pam_handle_t * pamh, int flags, int argc, { int i; int logmask = LOG_UPTO(LOG_INFO); - int origmask; int remain = 0; int remainlifetime = REMAINLIFETIME; int no_unlog = 0; openlog(pam_afs_ident, LOG_CONS | LOG_PID, LOG_AUTH); - origmask = setlogmask(logmask); + setlogmask(logmask); /* * Parse the user options. Log an error for any unknown options. diff --git a/src/pam/afs_setcred.c b/src/pam/afs_setcred.c index 8520444..bb73cee 100644 --- a/src/pam/afs_setcred.c +++ b/src/pam/afs_setcred.c @@ -40,9 +40,7 @@ pam_sm_setcred(pam_handle_t * pamh, int flags, int argc, const char **argv) int nowarn = 0; int use_first_pass = 1; /* use the password passed in by auth */ int try_first_pass = 0; - int got_authtok = 0; int ignore_uid = 0; - int no_unlog = 0; uid_t ignore_uid_id = 0; int refresh_token = 0; int set_expires = 0; /* the default is to not to set the env variable */ @@ -109,7 +107,7 @@ pam_sm_setcred(pam_handle_t * pamh, int flags, int argc, const char **argv) pam_afs_syslog(LOG_INFO, PAMAFS_OTHERCELL, cell_ptr); } } else if (strcasecmp(argv[i], "no_unlog") == 0) { - no_unlog = 1; + ; } else if (strcasecmp(argv[i], "refresh_token") == 0) { refresh_token = 1; } else if (strcasecmp(argv[i], "set_token") == 0) { @@ -205,7 +203,6 @@ pam_sm_setcred(pam_handle_t * pamh, int flags, int argc, const char **argv) pam_afs_syslog(LOG_DEBUG, PAMAFS_NOFIRSTPASS, user); } else if (password[0] == '\0') { /* Actually we *did* get one but it was empty. */ - got_authtok = 1; /* So don't use it. */ password = NULL; if (use_first_pass) { @@ -217,7 +214,6 @@ pam_sm_setcred(pam_handle_t * pamh, int flags, int argc, const char **argv) } else { if (logmask && LOG_MASK(LOG_DEBUG)) pam_afs_syslog(LOG_DEBUG, PAMAFS_GOTPASS, user); - got_authtok = 1; } if (!(use_first_pass || try_first_pass)) { password = NULL;