Skip to content

Commit b7d543c

Browse files
committed
remove & from debug output and compiled names
1 parent e31704c commit b7d543c

File tree

8 files changed

+16
-18
lines changed

8 files changed

+16
-18
lines changed

src/lib/server/map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ static int _map_afrom_cs(TALLOC_CTX *ctx, map_list_t *out, map_t *parent, CONF_S
10401040
* }
10411041
*
10421042
* On the other hand, any xlats on the RHS don't use the full path. :( And we still need
1043-
* to allow relative attribute references via "&.foo", when updating structures.
1043+
* to allow relative attribute references via ".foo", when updating structures.
10441044
*/
10451045
our_rhs_rules = rhs_rules;
10461046
if (edit && (rhs_rules->attr.list_def != child_lhs_rules.attr.list_def)) {

src/lib/server/pairmove.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ int radius_legacy_map_apply(request_t *request, map_t const *map, fr_edit_list_t
594594

595595
/*
596596
* Delete all existing attributes. Note that we re-initialize the cursor every time,
597-
* because creating "&foo := baz" means deleting ALL existing "foo". But we can't use
597+
* because creating "foo := baz" means deleting ALL existing "foo". But we can't use
598598
* the tmpl as a cursor, because the tmpl containst NUM_UNSPEC, and the cursor needs
599599
* NUM_ALL. So we have to delete all existing attributes, and then add a new one.
600600
*/

src/lib/server/state.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ int fr_state_to_request(fr_state_tree_t *state, request_t *request)
713713

714714
if (!fr_pair_list_empty(&request->session_state_pairs)) {
715715
RDEBUG2("Restored session-state");
716-
log_request_pair_list(L_DBG_LVL_2, request, NULL, &request->session_state_pairs, "&session-state.");
716+
log_request_pair_list(L_DBG_LVL_2, request, NULL, &request->session_state_pairs, "session-state.");
717717
}
718718

719719
RDEBUG3("%s - restored", state->da->name);
@@ -748,7 +748,7 @@ int fr_request_to_state(fr_state_tree_t *state, request_t *request)
748748

749749
if (!fr_pair_list_empty(&request->session_state_pairs)) {
750750
RDEBUG2("Saving session-state");
751-
log_request_pair_list(L_DBG_LVL_2, request, NULL, &request->session_state_pairs, "&session-state.");
751+
log_request_pair_list(L_DBG_LVL_2, request, NULL, &request->session_state_pairs, "session-state.");
752752

753753
#ifdef WITH_VERIFY_PTR
754754
/*

src/lib/server/tmpl_tokenize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ int tmpl_attr_set_leaf_da(tmpl_t *vpt, fr_dict_attr_t const *da)
11911191
/** Rewrite the leaf's instance number
11921192
*
11931193
* This function is _only_ called from the compiler, for "update" and "foreach" keywords. In those cases,
1194-
* the user historically did "&foo-bar", but really meant "&foo-bar[*]". We silently update that for
1194+
* the user historically did "foo-bar", but really meant "foo-bar[*]". We silently update that for
11951195
* "update" sections, and complain about it in "foreach" sections.
11961196
*
11971197
* As the server now supports multiple types of leaf references, we do the rewrite _only_ from "none" (no

src/lib/tls/cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static int tls_cache_app_data_get(request_t *request, SSL_SESSION *sess)
275275

276276
RDEBUG2("Session-ID %pV - Restoring session-state[*]", &sess_id);
277277
RINDENT();
278-
log_request_pair_list(L_DBG_LVL_2, request, NULL, &tmp, "&session-state.");
278+
log_request_pair_list(L_DBG_LVL_2, request, NULL, &tmp, "session-state.");
279279
REXDENT();
280280
}
281281

src/lib/tls/verify.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ int fr_tls_verify_cert_cb(int ok, X509_STORE_CTX *x509_ctx)
260260
goto done;
261261
}
262262

263-
log_request_pair(L_DBG_LVL_2, request, NULL, container, "&session-state.");
263+
log_request_pair(L_DBG_LVL_2, request, NULL, container, "session-state.");
264264
}
265265
done:
266266
/*

src/lib/unlang/compile.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -939,13 +939,13 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla
939939
cf_item_insert_after(g->cs, cs, group);
940940

941941
/*
942-
* Hoist this out of the loop, and make sure it always has a '&' prefix.
942+
* Hoist this out of the loop, and make sure it never has a '&' prefix.
943943
*/
944944
if (name2) {
945945
if (*name2 == '&') name2++;
946-
snprintf(list_buffer, sizeof(list_buffer), "&%s", name2);
946+
snprintf(list_buffer, sizeof(list_buffer), "%s", name2);
947947
} else {
948-
snprintf(list_buffer, sizeof(list_buffer), "&%s", tmpl_list_name(unlang_ctx->rules->attr.list_def, "<INVALID>"));
948+
snprintf(list_buffer, sizeof(list_buffer), "%s", tmpl_list_name(unlang_ctx->rules->attr.list_def, "<INVALID>"));
949949

950950
}
951951

@@ -1027,7 +1027,7 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla
10271027
char *p;
10281028

10291029
attr_is_list:
1030-
snprintf(attr_buffer, sizeof(attr_buffer), "&%s", attr);
1030+
snprintf(attr_buffer, sizeof(attr_buffer), "%s", attr);
10311031
list = attr_buffer;
10321032
attr = NULL;
10331033

@@ -1054,9 +1054,9 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla
10541054

10551055
} else {
10561056
if (strchr(attr, '[') == NULL) {
1057-
snprintf(value_buffer, sizeof(value_buffer), "&%s[*]", attr);
1057+
snprintf(value_buffer, sizeof(value_buffer), "%s[*]", attr);
10581058
} else {
1059-
snprintf(value_buffer, sizeof(value_buffer), "&%s", attr);
1059+
snprintf(value_buffer, sizeof(value_buffer), "%s", attr);
10601060
}
10611061

10621062
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
11051105
rcode = edit_section_alloc(group, &child, list, op);
11061106
if (rcode < 0) break;
11071107

1108-
snprintf(attr_buffer, sizeof(attr_buffer), "&%s", attr);
1109-
rcode = edit_pair_alloc(child, cp, attr_buffer, T_OP_EQ, value, op);
1108+
rcode = edit_pair_alloc(child, cp, attr, T_OP_EQ, value, op);
11101109
break;
11111110

11121111
/*
@@ -1129,8 +1128,7 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla
11291128
return NULL;
11301129
}
11311130

1132-
snprintf(attr_buffer, sizeof(attr_buffer), "&%s", attr);
1133-
rcode = edit_pair_alloc(child, cp, attr_buffer, op, value, T_OP_SUB_EQ);
1131+
rcode = edit_pair_alloc(child, cp, attr, op, value, T_OP_SUB_EQ);
11341132
break;
11351133

11361134
/*

src/lib/unlang/xlat_builtin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ static xlat_arg_parser_t const xlat_func_map_arg[] = {
12261226
*
12271227
* e.g.
12281228
@verbatim
1229-
%map("&User-Name := 'foo'")
1229+
%map("User-Name := 'foo'")
12301230
@endverbatim
12311231
*
12321232
* Allows sets of modifications to be cached and then applied.

0 commit comments

Comments
 (0)