]> git.sur5r.net Git - openldap/commitdiff
ITS#4021: add new {CLEARTEXT} kludge as bv_len=0 kludge no
authorKurt Zeilenga <kurt@openldap.org>
Thu, 29 Sep 2005 20:30:09 +0000 (20:30 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 29 Sep 2005 20:30:09 +0000 (20:30 +0000)
longer works well.

libraries/liblutil/passwd.c
servers/slapd/bconfig.c
servers/slapd/passwd.c
tests/scripts/test010-passwd

index 23d001f7d5aa5d4843fc704a6a879bd4f27c4194..269df67ed188c2bf58f3ab45ec29ceb1ccac80bd 100644 (file)
@@ -73,6 +73,10 @@ static lutil_cryptfunc lutil_crypt;
 lutil_cryptfunc *lutil_cryptptr = lutil_crypt;
 #endif
 
+/* KLUDGE:
+ *  chk_fn is NULL iff name is {CLEARTEXT}
+ *     otherwise, things will break
+ */
 struct pw_scheme {
        struct berval name;
        LUTIL_PASSWD_CHK_FUNC *chk_fn;
@@ -147,7 +151,7 @@ static const struct pw_scheme pw_schemes_default[] =
 
 #ifdef SLAPD_CLEARTEXT
        /* pseudo scheme */
-       { {0, "{CLEARTEXT}"},           NULL, hash_clear },
+       { BER_BVC("{CLEARTEXT}"),       NULL, hash_clear },
 #endif
 
        { BER_BVNULL, NULL, NULL }
@@ -306,7 +310,9 @@ lutil_passwd(
         */
        if (( passwd->bv_val[0] == '{' ) &&
                ( strchr( passwd->bv_val, '}' ) > passwd->bv_val+1 ))
+       {
                return 1;
+       }
        if( is_allowed_scheme("{CLEARTEXT}", schemes ) ) {
                return ( passwd->bv_len == cred->bv_len ) ?
                        memcmp( passwd->bv_val, cred->bv_val, passwd->bv_len )
index e2be24c8f8e771ed65433f7a64c576768d75848c..be9de3f5ea354990d7611a73962dab18147891f5 100644 (file)
@@ -1379,7 +1379,7 @@ config_passwd_hash(ConfigArgs *c) {
        }
        for(i = 1; i < c->argc; i++) {
                if(!lutil_passwd_scheme(c->argv[i])) {
-                       sprintf( c->msg, "<%s> schema not available", c->argv[0] );
+                       sprintf( c->msg, "<%s> scheme not available", c->argv[0] );
                        Debug(LDAP_DEBUG_ANY, "%s: %s (%s)\n",
                                c->log, c->msg, c->argv[i]);
                } else {
index 5ada68fa927588a9d9b045df1addbd9175b328c6..385e2be3c1c46480642787a7fa592314979d557b 100644 (file)
@@ -68,7 +68,9 @@ int passwd_extop(
                return LDAP_STRONG_AUTH_REQUIRED;
        }
 
+       qpw->rs_old.bv_len = 0;
        qpw->rs_old.bv_val = NULL;
+       qpw->rs_new.bv_len = 0;
        qpw->rs_new.bv_val = NULL;
        qpw->rs_mods = NULL;
        qpw->rs_modtail = NULL;
index 8de9baaaf80bf575b6f25ff3284ea113ce92becc..9abf3d93c2ef004a2616983a399cac013f959820 100755 (executable)
@@ -171,7 +171,7 @@ fi
 
 echo "Logging end state with ldapsearch..."
 echo "" >> $TESTOUT
-echo "++ Initial search" >> $TESTOUT
+echo "++ End search" >> $TESTOUT
 $LDAPSEARCH -h $LOCALHOST -p $PORT1 \
        -D "$MANAGERDN" -w $PASSWD \
        -b "$BASEDN" \