From: Alan T. DeKok Date: Sat, 8 Mar 2025 15:38:57 +0000 (-0500) Subject: remove & from debug output and compiled names X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7d543c4087a6f7ce876fe2cbd1b632b669e2431;p=thirdparty%2Ffreeradius-server.git remove & from debug output and compiled names --- diff --git a/src/lib/server/map.c b/src/lib/server/map.c index 500270a5d9..06f9c0227a 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -1040,7 +1040,7 @@ do_children: * } * * On the other hand, any xlats on the RHS don't use the full path. :( And we still need - * to allow relative attribute references via "&.foo", when updating structures. + * to allow relative attribute references via ".foo", when updating structures. */ our_rhs_rules = rhs_rules; if (edit && (rhs_rules->attr.list_def != child_lhs_rules.attr.list_def)) { diff --git a/src/lib/server/pairmove.c b/src/lib/server/pairmove.c index b8f224179d..4268c4bfe6 100644 --- a/src/lib/server/pairmove.c +++ b/src/lib/server/pairmove.c @@ -594,7 +594,7 @@ int radius_legacy_map_apply(request_t *request, map_t const *map, fr_edit_list_t /* * Delete all existing attributes. Note that we re-initialize the cursor every time, - * because creating "&foo := baz" means deleting ALL existing "foo". But we can't use + * because creating "foo := baz" means deleting ALL existing "foo". But we can't use * the tmpl as a cursor, because the tmpl containst NUM_UNSPEC, and the cursor needs * NUM_ALL. So we have to delete all existing attributes, and then add a new one. */ diff --git a/src/lib/server/state.c b/src/lib/server/state.c index 7bccfe9e60..2bfaffbd4b 100644 --- a/src/lib/server/state.c +++ b/src/lib/server/state.c @@ -713,7 +713,7 @@ int fr_state_to_request(fr_state_tree_t *state, request_t *request) if (!fr_pair_list_empty(&request->session_state_pairs)) { RDEBUG2("Restored session-state"); - log_request_pair_list(L_DBG_LVL_2, request, NULL, &request->session_state_pairs, "&session-state."); + log_request_pair_list(L_DBG_LVL_2, request, NULL, &request->session_state_pairs, "session-state."); } RDEBUG3("%s - restored", state->da->name); @@ -748,7 +748,7 @@ int fr_request_to_state(fr_state_tree_t *state, request_t *request) if (!fr_pair_list_empty(&request->session_state_pairs)) { RDEBUG2("Saving session-state"); - log_request_pair_list(L_DBG_LVL_2, request, NULL, &request->session_state_pairs, "&session-state."); + log_request_pair_list(L_DBG_LVL_2, request, NULL, &request->session_state_pairs, "session-state."); #ifdef WITH_VERIFY_PTR /* diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index 6113fb563d..baf5fac65d 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -1191,7 +1191,7 @@ int tmpl_attr_set_leaf_da(tmpl_t *vpt, fr_dict_attr_t const *da) /** Rewrite the leaf's instance number * * This function is _only_ called from the compiler, for "update" and "foreach" keywords. In those cases, - * the user historically did "&foo-bar", but really meant "&foo-bar[*]". We silently update that for + * the user historically did "foo-bar", but really meant "foo-bar[*]". We silently update that for * "update" sections, and complain about it in "foreach" sections. * * As the server now supports multiple types of leaf references, we do the rewrite _only_ from "none" (no diff --git a/src/lib/tls/cache.c b/src/lib/tls/cache.c index cf4c0f1f6e..a129c23a50 100644 --- a/src/lib/tls/cache.c +++ b/src/lib/tls/cache.c @@ -275,7 +275,7 @@ static int tls_cache_app_data_get(request_t *request, SSL_SESSION *sess) RDEBUG2("Session-ID %pV - Restoring session-state[*]", &sess_id); RINDENT(); - log_request_pair_list(L_DBG_LVL_2, request, NULL, &tmp, "&session-state."); + log_request_pair_list(L_DBG_LVL_2, request, NULL, &tmp, "session-state."); REXDENT(); } diff --git a/src/lib/tls/verify.c b/src/lib/tls/verify.c index 7babc30237..863c6da12c 100644 --- a/src/lib/tls/verify.c +++ b/src/lib/tls/verify.c @@ -260,7 +260,7 @@ int fr_tls_verify_cert_cb(int ok, X509_STORE_CTX *x509_ctx) goto done; } - log_request_pair(L_DBG_LVL_2, request, NULL, container, "&session-state."); + log_request_pair(L_DBG_LVL_2, request, NULL, container, "session-state."); } done: /* diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 7ed99b1cd7..b10198a911 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -939,13 +939,13 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla cf_item_insert_after(g->cs, cs, group); /* - * Hoist this out of the loop, and make sure it always has a '&' prefix. + * Hoist this out of the loop, and make sure it never has a '&' prefix. */ if (name2) { if (*name2 == '&') name2++; - snprintf(list_buffer, sizeof(list_buffer), "&%s", name2); + snprintf(list_buffer, sizeof(list_buffer), "%s", name2); } else { - snprintf(list_buffer, sizeof(list_buffer), "&%s", tmpl_list_name(unlang_ctx->rules->attr.list_def, "")); + snprintf(list_buffer, sizeof(list_buffer), "%s", tmpl_list_name(unlang_ctx->rules->attr.list_def, "")); } @@ -1027,7 +1027,7 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla char *p; attr_is_list: - snprintf(attr_buffer, sizeof(attr_buffer), "&%s", attr); + snprintf(attr_buffer, sizeof(attr_buffer), "%s", attr); list = attr_buffer; attr = NULL; @@ -1054,9 +1054,9 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla } else { if (strchr(attr, '[') == NULL) { - snprintf(value_buffer, sizeof(value_buffer), "&%s[*]", attr); + snprintf(value_buffer, sizeof(value_buffer), "%s[*]", attr); } else { - snprintf(value_buffer, sizeof(value_buffer), "&%s", attr); + snprintf(value_buffer, sizeof(value_buffer), "%s", attr); } rcode = edit_pair_alloc(group, cp, list, T_OP_SUB_EQ, value_buffer, T_INVALID); @@ -1105,8 +1105,7 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla rcode = edit_section_alloc(group, &child, list, op); if (rcode < 0) break; - snprintf(attr_buffer, sizeof(attr_buffer), "&%s", attr); - rcode = edit_pair_alloc(child, cp, attr_buffer, T_OP_EQ, value, op); + rcode = edit_pair_alloc(child, cp, attr, T_OP_EQ, value, op); break; /* @@ -1129,8 +1128,7 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla return NULL; } - snprintf(attr_buffer, sizeof(attr_buffer), "&%s", attr); - rcode = edit_pair_alloc(child, cp, attr_buffer, op, value, T_OP_SUB_EQ); + rcode = edit_pair_alloc(child, cp, attr, op, value, T_OP_SUB_EQ); break; /* diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index 5f59d0b1e4..61a748d120 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -1226,7 +1226,7 @@ static xlat_arg_parser_t const xlat_func_map_arg[] = { * * e.g. @verbatim -%map("&User-Name := 'foo'") +%map("User-Name := 'foo'") @endverbatim * * Allows sets of modifications to be cached and then applied.