Skip to content

Commit 64fe8e5

Browse files
committed
minimal changes to get rid of tmpl_require_enum_prefix
all of the tests pass with it enabled. So let's require it. If CI passes, we'll take a second pass and remove all references to it from the code.
1 parent 94a32de commit 64fe8e5

File tree

9 files changed

+15
-12
lines changed

9 files changed

+15
-12
lines changed

src/bin/unit_test_attribute.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,7 +2394,7 @@ static size_t command_max_buffer_size(command_result_t *result, command_file_ctx
23942394
RETURN_OK(snprintf(data, COMMAND_OUTPUT_MAX, "%ld", size));
23952395
}
23962396

2397-
extern bool tmpl_require_enum_prefix;
2397+
//extern bool tmpl_require_enum_prefix;
23982398
extern bool xlat_func_bare_words;
23992399

24002400
/** Set or clear migration flags.
@@ -2415,7 +2415,8 @@ static size_t command_migrate(command_result_t *result, command_file_ctx_t *cc,
24152415

24162416
} else if (strncmp(p, "tmpl_require_enum_prefix", sizeof("tmpl_require_enum_prefix") - 1) == 0) {
24172417
p += sizeof("tmpl_require_enum_prefix") - 1;
2418-
out = &tmpl_require_enum_prefix;
2418+
// out = &tmpl_require_enum_prefix;
2419+
RETURN_OK(0);
24192420

24202421
} else {
24212422
fr_strerror_const("Unknown migration flag");
@@ -3844,7 +3845,7 @@ int main(int argc, char *argv[])
38443845

38453846
case 'S':
38463847
if (strcmp(optarg, "require_enum_prefix=yes") == 0) {
3847-
tmpl_require_enum_prefix = true;
3848+
// tmpl_require_enum_prefix = true;
38483849
break;
38493850
}
38503851

src/lib/server/cf_parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static char const parse_spaces[] = "
5050
/*
5151
* For migration.
5252
*/
53-
extern bool tmpl_require_enum_prefix;
53+
//extern bool tmpl_require_enum_prefix;
5454

5555
void cf_pair_debug_log(CONF_SECTION const *cs, CONF_PAIR *cp, conf_parser_t const *rule)
5656
{

src/lib/server/main_config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static const conf_parser_t thread_config[] = {
187187
/*
188188
* Migration configuration.
189189
*/
190-
extern bool tmpl_require_enum_prefix;
190+
//extern bool tmpl_require_enum_prefix;
191191
bool xlat_func_bare_words = false;
192192

193193
static const conf_parser_t migrate_config[] = {
@@ -1541,7 +1541,7 @@ int main_config_parse_option(char const *value)
15411541
fr_exit(1);
15421542
}
15431543

1544-
if (out == &main_config->require_enum_prefix) tmpl_require_enum_prefix = box.vb_bool;
1544+
if (out == &main_config->require_enum_prefix) {}
15451545
if (out == &main_config->xlat_func_bare_words) xlat_func_bare_words = box.vb_bool;
15461546

15471547
*out = box.vb_bool;

src/lib/server/map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ RCSID("$Id$")
4747

4848
#include <ctype.h>
4949

50-
extern bool tmpl_require_enum_prefix;
50+
//extern bool tmpl_require_enum_prefix;
5151

5252
static fr_table_num_sorted_t const cond_quote_table[] = {
5353
{ L("\""), T_DOUBLE_QUOTED_STRING }, /* Don't re-order, backslash throws off ordering */

src/lib/server/tmpl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ extern "C" {
8484
*/
8585
#define TMPL_MAX_REQUEST_REF_NESTING 10
8686

87+
#define tmpl_require_enum_prefix (1)
88+
8789
extern fr_table_num_ordered_t const pair_list_table[];
8890
extern size_t pair_list_table_len;
8991

src/lib/server/tmpl_tokenize.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ RCSID("$Id$")
4949
/*
5050
* Migration flag for enum prefixes.
5151
*/
52-
extern bool tmpl_require_enum_prefix;
52+
//extern bool tmpl_require_enum_prefix;
5353

54-
bool tmpl_require_enum_prefix = true;
54+
//bool tmpl_require_enum_prefix = true;
5555

5656
/** Define a global variable for specifying a default request reference
5757
*

src/lib/unlang/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ RCSID("$Id$")
6161

6262
#define UNLANG_IGNORE ((unlang_t *) -1)
6363

64-
extern bool tmpl_require_enum_prefix;
64+
//extern bool tmpl_require_enum_prefix;
6565

6666
static unsigned int unlang_number = 1;
6767

src/lib/unlang/xlat_expr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RCSID("$Id$")
3939
# define XLAT_DEBUG(...)
4040
#endif
4141

42-
extern bool tmpl_require_enum_prefix;
42+
//extern bool tmpl_require_enum_prefix;
4343

4444
/*
4545
* The new tokenizer accepts most things which are accepted by the old one. Many of the errors will be

src/lib/unlang/xlat_tokenize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ RCSID("$Id$")
4545
# define XLAT_HEXDUMP(...)
4646
#endif
4747

48-
extern const bool tmpl_require_enum_prefix;
48+
//extern const bool tmpl_require_enum_prefix;
4949
extern const bool xlat_func_bare_words;
5050

5151
/** These rules apply to literal values and function arguments inside of an expansion

0 commit comments

Comments
 (0)