re-add the expect_password option
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 30 Oct 2012 13:00:08 +0000 (13:00 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 30 Oct 2012 19:25:57 +0000 (19:25 +0000)
raddb/mods-available/ldap
src/modules/rlm_ldap/rlm_ldap.c

index 34582dd..c4ae0ec 100644 (file)
@@ -2,6 +2,7 @@
 #
 #  $Id$
 
+#
 # Lightweight Directory Access Protocol (LDAP)
 #
 ldap {
@@ -27,6 +28,11 @@ ldap {
        # directory attributes.
 #      dictionary_mapping = ${confdir}/ldap.attrmap
 
+       # Set to "no" to disable the "no \"known good\" password" warning,
+       # if you're not using LDAP to retrieve password values.
+#      expect_password = "yes" 
+
+       #
        #  Profile related attributes.
        #
        profiles {
index ee93646..3c8e10d 100644 (file)
@@ -54,6 +54,7 @@ typedef struct {
        const char      *xlat_name; /* name used to xlat */
 
        const char      *map_file;
+       int             expect_password;
        TLDAP_RADIUS    *check_map;
        TLDAP_RADIUS    *reply_map;
        char            **attrs;
@@ -247,7 +248,11 @@ static const CONF_PARSER module_config[] = {
        /* file with mapping between LDAP and RADIUS attributes */
        {"dictionary_mapping", PW_TYPE_FILENAME,
         offsetof(ldap_instance, map_file), NULL, NULL},
-
+       
+       /* turn off the annoying warning if we don't expect a password */
+       {"expect_password", PW_TYPE_BOOLEAN,
+        offsetof(ldap_instance,expect_password), NULL, "yes"},
+        
        /*
         *      Terrible things which should be deleted.
         */
@@ -1423,7 +1428,7 @@ static void do_check_reply(ldap_instance *inst, LDAP *ld, REQUEST *request,
        *       More warning messages for people who can't be bothered
        *       to read the documentation.
        */
-       if (debug_flag > 1) {
+       if (inst->expect_password && (debug_flag > 1)) {
               if (!pairfind(request->config_items, PW_CLEARTEXT_PASSWORD, 0) &&
                   !pairfind(request->config_items, PW_NT_PASSWORD, 0) &&
                   !pairfind(request->config_items, PW_USER_PASSWORD, 0) &&