summaryrefslogtreecommitdiff
path: root/modules/pam_userdb
diff options
context:
space:
mode:
authorTomas Mraz <tm@t8m.info>2005-07-28 10:16:55 +0000
committerTomas Mraz <tm@t8m.info>2005-07-28 10:16:55 +0000
commit2b5457bbf7352200f7bc77795adbbcfd47550855 (patch)
tree35d25f15afcda0cc86a72d3c31b30fa1135f8899 /modules/pam_userdb
parentb697c858ecd08ad6c2e0dcdb624b26a878c27856 (diff)
Relevant BUGIDs: Red Hat bz #164418
Purpose of commit: bugfix Commit summary: --------------- pam_userdb: Fix regression - crash when crypt param not specified
Diffstat (limited to 'modules/pam_userdb')
-rw-r--r--modules/pam_userdb/pam_userdb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/pam_userdb/pam_userdb.c b/modules/pam_userdb/pam_userdb.c
index 09467877..87a6ffd5 100644
--- a/modules/pam_userdb/pam_userdb.c
+++ b/modules/pam_userdb/pam_userdb.c
@@ -164,8 +164,8 @@ user_lookup (const char *database, const char *cryptmode,
}
if (ctrl & PAM_DEBUG_ARG) {
- _pam_log(LOG_INFO, "password in database is [%p]`%s', len is %d",
- data.dptr, (char *) data.dptr, data.dsize);
+ _pam_log(LOG_INFO, "password in database is [%p]`%.*s', len is %d",
+ data.dptr, data.dsize, (char *) data.dptr, data.dsize);
}
if (data.dptr != NULL) {
@@ -177,7 +177,7 @@ user_lookup (const char *database, const char *cryptmode,
return 0; /* found it, data contents don't matter */
}
- if (strncasecmp(cryptmode, "crypt", 5) == 0) {
+ if (cryptmode && strncasecmp(cryptmode, "crypt", 5) == 0) {
/* crypt(3) password storage */
@@ -219,7 +219,8 @@ user_lookup (const char *database, const char *cryptmode,
compare = strncmp(data.dptr, pass, data.dsize);
}
- if (strncasecmp(cryptmode, "none", 4) && ctrl & PAM_DEBUG_ARG) {
+ if (cryptmode && strncasecmp(cryptmode, "none", 4)
+ && (ctrl & PAM_DEBUG_ARG)) {
_pam_log(LOG_INFO, "invalid value for crypt parameter: %s",
cryptmode);
_pam_log(LOG_INFO, "defaulting to plaintext password mode");