pam: fix unused but set warnings
authorMarc Dionne <marc.c.dionne@gmail.com>
Mon, 8 Aug 2011 21:08:34 +0000 (17:08 -0400)
committerDerrick Brashear <shadow@dementia.org>
Wed, 10 Aug 2011 03:54:05 +0000 (20:54 -0700)
Fix a few cases of set but unused variables.

Change-Id: I0a3e0906dbc708e2449121f3de1726d7055efc27
Reviewed-on: http://gerrit.openafs.org/5173
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/pam/afs_auth.c
src/pam/afs_password.c
src/pam/afs_session.c
src/pam/afs_setcred.c

index df18fbe..26a3900 100644 (file)
@@ -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]);
        }
index 8cb26cc..07fa47f 100644 (file)
@@ -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;
index ad205e0..9dee59b 100644 (file)
@@ -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.
index 8520444..bb73cee 100644 (file)
@@ -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;