]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove & from debug output and compiled names
authorAlan T. DeKok <aland@freeradius.org>
Sat, 8 Mar 2025 15:38:57 +0000 (10:38 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 8 Mar 2025 15:38:57 +0000 (10:38 -0500)
src/lib/server/map.c
src/lib/server/pairmove.c
src/lib/server/state.c
src/lib/server/tmpl_tokenize.c
src/lib/tls/cache.c
src/lib/tls/verify.c
src/lib/unlang/compile.c
src/lib/unlang/xlat_builtin.c

index 500270a5d9cff694fd4a6e27f65b9c17b1d2af66..06f9c0227a67c8710d4d29f0ec8e09e007505eb8 100644 (file)
@@ -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)) {
index b8f224179deb4306387d37f6850f8570096747f5..4268c4bfe675a5fd4a4b65de99450dadab2a5b37 100644 (file)
@@ -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.
                 */
index 7bccfe9e60426e76ce0b291dc9712becd6a048ff..2bfaffbd4b2bd85952ccd14863e757b17a970f00 100644 (file)
@@ -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
                /*
index 6113fb563d386c527c7cde407f72a48e72004b9b..baf5fac65d744a388ab62dd42a7b8073036d503a 100644 (file)
@@ -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
index cf4c0f1f6e4a55166485e0bf8e9e776ea1103124..a129c23a50a4ff5f041d2f8a53e8cc30d7e24af4 100644 (file)
@@ -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();
        }
 
index 7babc3023758829c8de3dee9593203234b544ed1..863c6da12cd185b6bd7b3e86e1d619cc42b4e82b 100644 (file)
@@ -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:
        /*
index 7ed99b1cd713b5fa3ccce3b1a01f075647e9ce7e..b10198a9117b7bc077e46edf628c1b974a1d5cea 100644 (file)
@@ -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, "<INVALID>"));
+               snprintf(list_buffer, sizeof(list_buffer), "%s", tmpl_list_name(unlang_ctx->rules->attr.list_def, "<INVALID>"));
 
        }
 
@@ -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;
 
                        /*
index 5f59d0b1e439543acb20dbdbdaa797babfcf5663..61a748d1203e68ddaa49d0618e30f85b3aa2dfcc 100644 (file)
@@ -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.