Skip to content

Commit

Permalink
Standardise debugging in rlm_ldap and rlm_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Apr 27, 2014
1 parent c9e1302 commit 55b30e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/modules/rlm_cache/rlm_cache.c
Expand Up @@ -459,7 +459,7 @@ static rlm_cache_entry_t *cache_add(rlm_cache_t *inst, REQUEST *request,
pairfree(&found);
return NULL;
}
RDEBUG("\t%s %s %s (%s)", map->dst->name,
RDEBUG("\t%s %s %s:%s", map->dst->name,
fr_int2str(fr_tokens, map->op, "<INVALID>"),
map->src->name, vp->da->name);
vp->op = map->op;
Expand Down
11 changes: 5 additions & 6 deletions src/modules/rlm_ldap/groups.c
Expand Up @@ -288,7 +288,6 @@ rlm_rcode_t rlm_ldap_cacheable_userobj(ldap_instance_t const *inst, REQUEST *req
if (is_dn) {
pairmake(request, &request->config_items, inst->cache_da->name, vals[i], T_OP_ADD);
RDEBUG("Added %s with value \"%s\" to control list", inst->cache_da->name, vals[i]);

/*
* We were told to cache DNs but we got a name, we now need to resolve
* this to a DN. Store all the group names in an array so we can do one query.
Expand All @@ -304,7 +303,7 @@ rlm_rcode_t rlm_ldap_cacheable_userobj(ldap_instance_t const *inst, REQUEST *req
*/
if (!is_dn) {
pairmake(request, &request->config_items, inst->cache_da->name, vals[i], T_OP_ADD);
RDEBUG("Added %s with value \"%s\" to control list", inst->cache_da->name, vals[i]);
RDEBUG("Added control:%s with value \"%s\"", inst->cache_da->name, vals[i]);
/*
* We were told to cache names but we got a DN, we now need to resolve
* this to a name.
Expand All @@ -320,7 +319,7 @@ rlm_rcode_t rlm_ldap_cacheable_userobj(ldap_instance_t const *inst, REQUEST *req
}

pairmake(request, &request->config_items, inst->cache_da->name, name, T_OP_ADD);
RDEBUG("Added %s with value \"%s\" to control list", inst->cache_da->name, name);
DEBUG("Added control:%s with value \"%s\"", inst->cache_da->name, name);
talloc_free(name);
}
}
Expand All @@ -338,7 +337,7 @@ rlm_rcode_t rlm_ldap_cacheable_userobj(ldap_instance_t const *inst, REQUEST *req
dn_p = group_dn;
while(*dn_p) {
pairmake(request, &request->config_items, inst->cache_da->name, *dn_p, T_OP_ADD);
RDEBUG("Added %s with value \"%s\" to control list", inst->cache_da->name, *dn_p);
RDEBUG("Added control:%s with value \"%s\"", inst->cache_da->name, *dn_p);
ldap_memfree(*dn_p);

dn_p++;
Expand Down Expand Up @@ -416,7 +415,7 @@ rlm_rcode_t rlm_ldap_cacheable_groupobj(ldap_instance_t const *inst, REQUEST *re
if (inst->cacheable_group_dn) {
dn = ldap_get_dn((*pconn)->handle, entry);
pairmake(request, &request->config_items, inst->cache_da->name, dn, T_OP_ADD);
RDEBUG("Added %s with value \"%s\" to control list", inst->cache_da->name, dn);
RDEBUG("Added control:%s with value \"%s\"", inst->cache_da->name, dn);
ldap_memfree(dn);
}

Expand All @@ -427,7 +426,7 @@ rlm_rcode_t rlm_ldap_cacheable_groupobj(ldap_instance_t const *inst, REQUEST *re
}

pairmake(request, &request->config_items, inst->cache_da->name, *vals, T_OP_ADD);
RDEBUG("Added %s with value \"%s\" to control list", inst->cache_da->name, *vals);
RDEBUG("Added control:%s with value \"%s\"", inst->cache_da->name, *vals);

ldap_value_free(vals);
}
Expand Down

0 comments on commit 55b30e7

Please sign in to comment.