diff options
-rw-r--r-- | modules/pam_unix/passverify.c | 6 | ||||
-rw-r--r-- | modules/pam_unix/unix_chkpwd.c | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/modules/pam_unix/passverify.c b/modules/pam_unix/passverify.c index c48e3c5a..c6515a65 100644 --- a/modules/pam_unix/passverify.c +++ b/modules/pam_unix/passverify.c @@ -1190,16 +1190,12 @@ char * getuidname(uid_t uid) { struct passwd *pw; - static char username[256]; pw = getpwuid(uid); if (pw == NULL) return NULL; - strncpy(username, pw->pw_name, sizeof(username)); - username[sizeof(username) - 1] = '\0'; - - return username; + return pw->pw_name; } #endif diff --git a/modules/pam_unix/unix_chkpwd.c b/modules/pam_unix/unix_chkpwd.c index 556a2e2c..50570dbc 100644 --- a/modules/pam_unix/unix_chkpwd.c +++ b/modules/pam_unix/unix_chkpwd.c @@ -138,11 +138,11 @@ int main(int argc, char *argv[]) /* if the caller specifies the username, verify that user matches it */ if (user == NULL || strcmp(user, argv[1])) { - user = argv[1]; /* no match -> permanently change to the real user and proceed */ if (setuid(getuid()) != 0) return PAM_AUTH_ERR; } + user = argv[1]; } option=argv[2]; |