Lines 92-97
Link Here
|
92 |
struct passwd *pwd; |
92 |
struct passwd *pwd; |
93 |
int retval; |
93 |
int retval; |
94 |
const char *pass, *user, *realpw, *prompt; |
94 |
const char *pass, *user, *realpw, *prompt; |
|
|
95 |
char *cryptpw; |
95 |
|
96 |
|
96 |
if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) { |
97 |
if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) { |
97 |
user = getlogin(); |
98 |
user = getlogin(); |
Lines 125-131
Link Here
|
125 |
if (retval != PAM_SUCCESS) |
126 |
if (retval != PAM_SUCCESS) |
126 |
return (retval); |
127 |
return (retval); |
127 |
PAM_LOG("Got password"); |
128 |
PAM_LOG("Got password"); |
128 |
if (strcmp(crypt(pass, realpw), realpw) == 0) |
129 |
cryptpw = crypt(pass, realpw); |
|
|
130 |
if (cryptpw != NULL && strcmp(cryptpw, realpw) == 0) |
129 |
return (PAM_SUCCESS); |
131 |
return (PAM_SUCCESS); |
130 |
|
132 |
|
131 |
PAM_VERBOSE_ERROR("UNIX authentication refused"); |
133 |
PAM_VERBOSE_ERROR("UNIX authentication refused"); |
Lines 345-351
Link Here
|
345 |
if (old_pass[0] == '\0' && |
347 |
if (old_pass[0] == '\0' && |
346 |
!openpam_get_option(pamh, PAM_OPT_NULLOK)) |
348 |
!openpam_get_option(pamh, PAM_OPT_NULLOK)) |
347 |
return (PAM_PERM_DENIED); |
349 |
return (PAM_PERM_DENIED); |
348 |
if (strcmp(encrypted, pwd->pw_passwd) != 0) |
350 |
if (encrypted == NULL || strcmp(encrypted, pwd->pw_passwd) != 0) |
349 |
return (PAM_PERM_DENIED); |
351 |
return (PAM_PERM_DENIED); |
350 |
} |
352 |
} |
351 |
else if (flags & PAM_UPDATE_AUTHTOK) { |
353 |
else if (flags & PAM_UPDATE_AUTHTOK) { |