map_cast_from_hex() does not produce error messages
[freeradius.git] / src / main / modcall.c
index 5b4b99a..b3dd3f0 100644 (file)
@@ -283,9 +283,9 @@ static rlm_rcode_t CC_HINT(nonnull) call_modsingle(rlm_components_t component, m
        blocked = (request->master_state == REQUEST_STOP_PROCESSING);
        if (blocked) return RLM_MODULE_NOOP;
 
-       RDEBUG3("modsingle[%s]: calling %s (%s) for request %d",
+       RDEBUG3("modsingle[%s]: calling %s (%s)",
                comp2str[component], sp->modinst->name,
-               sp->modinst->entry->name, request->number);
+               sp->modinst->entry->name);
        request->log.indent = 0;
 
        if (sp->modinst->force) {
@@ -309,14 +309,14 @@ static rlm_rcode_t CC_HINT(nonnull) call_modsingle(rlm_components_t component, m
         */
        blocked = (request->master_state == REQUEST_STOP_PROCESSING);
        if (blocked) {
-               RWARN("Module %s became unblocked for request %u", sp->modinst->entry->name, request->number);
+               RWARN("Module %s became unblocked", sp->modinst->entry->name);
        }
 
  fail:
        request->log.indent = indent;
-       RDEBUG3("modsingle[%s]: returned from %s (%s) for request %d",
+       RDEBUG3("modsingle[%s]: returned from %s (%s)",
               comp2str[component], sp->modinst->name,
-              sp->modinst->entry->name, request->number);
+              sp->modinst->entry->name);
 
        return request->rcode;
 }
@@ -449,6 +449,10 @@ redo:
         */
        if (!c) goto finish;
 
+       if (fr_debug_lvl >= 3) {
+               VERIFY_REQUEST(request);
+       }
+
        rad_assert(c->debug_name != NULL); /* if this happens, all bets are off. */
 
        /*
@@ -514,8 +518,8 @@ redo:
                 *      Like MOD_ELSE, but allow for a later "else"
                 */
                if (if_taken) {
-                       RDEBUG2("... skipping %s for request %d: Preceding \"if\" was taken",
-                               unlang_keyword[c->type], request->number);
+                       RDEBUG2("... skipping %s: Preceding \"if\" was taken",
+                               unlang_keyword[c->type]);
                        was_if = true;
                        if_taken = true;
                        goto next_sibling;
@@ -533,14 +537,14 @@ redo:
        if (c->type == MOD_ELSE) {
                if (!was_if) { /* error */
                elsif_error:
-                       RDEBUG2("... skipping %s for request %d: No preceding \"if\"",
-                               unlang_keyword[c->type], request->number);
+                       RDEBUG2("... skipping %s: No preceding \"if\"",
+                               unlang_keyword[c->type]);
                        goto next_sibling;
                }
 
                if (if_taken) {
-                       RDEBUG2("... skipping %s for request %d: Preceding \"if\" was taken",
-                               unlang_keyword[c->type], request->number);
+                       RDEBUG2("... skipping %s: Preceding \"if\" was taken",
+                               unlang_keyword[c->type]);
                        was_if = false;
                        if_taken = false;
                        goto next_sibling;
@@ -1660,7 +1664,7 @@ int modcall_fixup_update(vp_map_t *map, UNUSED void *ctx)
 
                                if (!map_cast_from_hex(map, T_BARE_WORD, vpt->name)) {
                                        map->rhs = vpt;
-                                       cf_log_err(map->ci, "%s", fr_strerror());
+                                       cf_log_err(map->ci, "Cannot parse RHS hex as the data type of the attribute %s", map->lhs->tmpl_da->name);
                                        return -1;
                                }
                                talloc_free(vpt);
@@ -3320,7 +3324,7 @@ static bool pass2_callback(void *ctx, fr_cond_t *c)
 
                                        if (!map_cast_from_hex(map, T_BARE_WORD, vpt->name)) {
                                                map->rhs = vpt;
-                                               cf_log_err(map->ci, "%s", fr_strerror());
+                                               cf_log_err(map->ci, "Cannot parse RHS hex as the data type of the attribute %s", map->lhs->tmpl_da->name);
                                                return -1;
                                        }
                                        talloc_free(vpt);
@@ -4008,3 +4012,10 @@ void modcall_debug(modcallable *mc, int depth)
                }
        }
 }
+
+int modcall_pass2_condition(fr_cond_t *c)
+{
+       if (!fr_condition_walk(c, pass2_callback, NULL)) return -1;
+
+       return 0;
+}