summaryrefslogtreecommitdiff
path: root/modules/pam_userdb/pam_userdb.c
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@fedoraproject.org>2013-02-07 17:06:57 +0100
committerTomas Mraz <tmraz@fedoraproject.org>2013-02-07 17:06:57 +0100
commite2a818773f96d12fc9f91bf2792a5a216c3b9aa4 (patch)
tree2c847c27401917c440a5378a7fb7cb359d1d5cd9 /modules/pam_userdb/pam_userdb.c
parentd1ed6a6fc71967b31eb758cea715690e478844c9 (diff)
pam_userdb: Allow also modern password hashes supported by crypt().
modules/pam_userdb/pam_userdb.c (user_lookup): Allow password hashes longer than 13 characters and long salt.
Diffstat (limited to 'modules/pam_userdb/pam_userdb.c')
-rw-r--r--modules/pam_userdb/pam_userdb.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/pam_userdb/pam_userdb.c b/modules/pam_userdb/pam_userdb.c
index c075c4b5..de8b5b1e 100644
--- a/modules/pam_userdb/pam_userdb.c
+++ b/modules/pam_userdb/pam_userdb.c
@@ -214,17 +214,13 @@ user_lookup (pam_handle_t *pamh, const char *database, const char *cryptmode,
/* crypt(3) password storage */
char *cryptpw;
- char salt[2];
- if (data.dsize != 13) {
+ if (data.dsize < 13) {
compare = -2;
} else if (ctrl & PAM_ICASE_ARG) {
compare = -2;
} else {
- salt[0] = *data.dptr;
- salt[1] = *(data.dptr + 1);
-
- cryptpw = crypt (pass, salt);
+ cryptpw = crypt (pass, data.dptr);
if (cryptpw) {
compare = strncasecmp (data.dptr, cryptpw, data.dsize);