Remove 'children' option from rlm_ldap debug messages when the children scope is...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 13 Jun 2014 13:18:18 +0000 (14:18 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 13 Jun 2014 13:18:25 +0000 (14:18 +0100)
src/modules/rlm_ldap/rlm_ldap.c

index 551d054..aadcd42 100644 (file)
@@ -624,22 +624,37 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
         */
        inst->userobj_scope = fr_str2int(ldap_scope, inst->userobj_scope_str, -1);
        if (inst->userobj_scope < 0) {
-               LDAP_ERR("Invalid 'user.scope' value \"%s\", expected 'sub', 'one', 'base' or 'children'",
-                        inst->userobj_scope_str);
+               LDAP_ERR("Invalid 'user.scope' value \"%s\", expected 'sub', 'one'",
+#ifdef LDAP_SCOPE_CHILDREN
+                        ", 'base' or 'children'"
+#else
+                        " or 'base'"
+#endif
+                        , inst->userobj_scope_str);
                goto error;
        }
 
        inst->groupobj_scope = fr_str2int(ldap_scope, inst->groupobj_scope_str, -1);
        if (inst->groupobj_scope < 0) {
-               LDAP_ERR("Invalid 'group.scope' value \"%s\", expected 'sub', 'one', 'base' or 'children'",
-                        inst->groupobj_scope_str);
+               LDAP_ERR("Invalid 'group.scope' value \"%s\", expected 'sub', 'one'",
+#ifdef LDAP_SCOPE_CHILDREN
+                        ", 'base' or 'children'"
+#else
+                        " or 'base'"
+#endif
+                        , inst->groupobj_scope_str);
                goto error;
        }
 
        inst->clientobj_scope = fr_str2int(ldap_scope, inst->clientobj_scope_str, -1);
        if (inst->clientobj_scope < 0) {
-               LDAP_ERR("Invalid 'client.scope' value \"%s\", expected 'sub', 'one', 'base' or 'children'",
-                        inst->clientobj_scope_str);
+               LDAP_ERR("Invalid 'client.scope' value \"%s\", expected 'sub', 'one'",
+#ifdef LDAP_SCOPE_CHILDREN
+                        ", 'base' or 'children'"
+#else
+                        " or 'base'"
+#endif
+                        , inst->clientobj_scope_str);
                goto error;
        }