pam: Use the right password variable in pam_sm_chauthtok()
authorGarrett Wollman <wollman@csail.mit.edu>
Sat, 28 Jul 2012 04:26:44 +0000 (00:26 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 28 Jul 2012 05:24:08 +0000 (22:24 -0700)
"password" is known to be null at this point.  Use "prompt_password"
which is obviously the one intended.

Change-Id: I4ab566f93c4978438df2c2875d619177ad8f5bdd
Reviewed-on: http://gerrit.openafs.org/7892
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/pam/afs_password.c

index d282902..547e723 100644 (file)
@@ -192,7 +192,7 @@ pam_sm_chauthtok(pam_handle_t * pamh, int flags, int argc, const char **argv)
         */
        strncpy(my_password_buf, prompt_password, sizeof(my_password_buf));
        my_password_buf[sizeof(my_password_buf) - 1] = '\0';
-       memset(prompt_password, 0, strlen(password));
+       memset(prompt_password, 0, strlen(prompt_password));
        free(prompt_password);
        password = torch_password = my_password_buf;
     }