summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2006-12-05 21:22:09 +0000
committerNathan Kinder <nkinder@redhat.com>2006-12-05 21:22:09 +0000
commitac8acf7645f37ca9027157a3eb697c15f106f81f (patch)
treec28141b14a699dc4642d9a2f9bd7b67fb5e19656 /ldap/servers/plugins
parent0d0cc2374ec0c63864b752eae72a5bcf294aa54e (diff)
downloadds-ac8acf7645f37ca9027157a3eb697c15f106f81f.tar.gz
ds-ac8acf7645f37ca9027157a3eb697c15f106f81f.tar.xz
ds-ac8acf7645f37ca9027157a3eb697c15f106f81f.zip
Resolves: 217796
Summary: Fix inconsistent clear password storage and ensure that SASL authentication uses passwords properly.
Diffstat (limited to 'ldap/servers/plugins')
-rw-r--r--ldap/servers/plugins/pwdstorage/clear_pwd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/ldap/servers/plugins/pwdstorage/clear_pwd.c b/ldap/servers/plugins/pwdstorage/clear_pwd.c
index a2e5920a..fd8ab46b 100644
--- a/ldap/servers/plugins/pwdstorage/clear_pwd.c
+++ b/ldap/servers/plugins/pwdstorage/clear_pwd.c
@@ -60,5 +60,16 @@ clear_pw_cmp( char *userpwd, char *dbpwd )
char *
clear_pw_enc( char *pwd )
{
- return( slapi_ch_strdup( pwd ));
+ /* Just return NULL if pwd is NULL */
+ if (!pwd)
+ return NULL;
+
+ /* If the modify operation specified the "{clear}" storage scheme
+ * prefix, we should strip it off.
+ */
+ if ((*pwd == PWD_HASH_PREFIX_START) && (pwd == PL_strcasestr( pwd, "{clear}" ))) {
+ return( slapi_ch_strdup( pwd + 7 ));
+ } else {
+ return( slapi_ch_strdup( pwd ));
+ }
}