Don't set Auth-Type = LDAP if the request has no clear-text password.
authoraland <aland>
Tue, 5 Oct 2004 14:41:41 +0000 (14:41 +0000)
committeraland <aland>
Tue, 5 Oct 2004 14:41:41 +0000 (14:41 +0000)
src/modules/rlm_ldap/rlm_ldap.c

index 9f6bebc..c3ee3ec 100644 (file)
@@ -244,7 +244,9 @@ typedef struct ldap_conn {
        char            bound;
        char            locked;
        int             failed_conns;
+#ifdef HAVE_PTHREAD_H
        pthread_mutex_t mutex;
+#endif
 } LDAP_CONN;
 
 typedef struct {
@@ -1386,7 +1388,9 @@ ldap_authorize(void *instance, REQUEST * request)
         * Module should default to LDAP authentication if no Auth-Type
         * specified
         */
-       if (pairfind(*check_pairs, PW_AUTHTYPE) == NULL)
+       if ((pairfind(*check_pairs, PW_AUTH_TYPE) == NULL) &&
+           request->password &&
+           (request->password->attribute == PW_USER_PASSWORD))
                pairadd(check_pairs, pairmake("Auth-Type", "LDAP", T_OP_EQ));