22 |
#include <symtab.h> |
#include <symtab.h> |
23 |
#include <radiusd.h> |
#include <radiusd.h> |
24 |
#include <parser.h> |
#include <parser.h> |
25 |
|
#include <rewrite.h> |
26 |
|
|
27 |
#ifndef CHAR_BIT |
#ifndef CHAR_BIT |
28 |
# define CHAR_BIT 8 |
# define CHAR_BIT 8 |
104 |
} |
} |
105 |
} |
} |
106 |
|
|
107 |
|
static int |
108 |
|
compile_pairs(VALUE_PAIR *pair) |
109 |
|
{ |
110 |
|
for (; pair; pair = pair->next) { |
111 |
|
if (pair->eval_type == eval_interpret) { |
112 |
|
char *symname = rewrite_compile(pair->avp_strvalue); |
113 |
|
if (symname == 0) |
114 |
|
return -1; |
115 |
|
pair->eval_type = eval_compiled; |
116 |
|
efree(pair->avp_strvalue); |
117 |
|
pair->avp_strvalue = symname; |
118 |
|
pair->avp_strlength = strlen(symname); |
119 |
|
} |
120 |
|
} |
121 |
|
return 0; |
122 |
|
} |
123 |
|
|
124 |
int |
int |
125 |
pass1(struct check_datum *datum, User_symbol *sym) |
pass1(struct check_datum *datum, User_symbol *sym) |
126 |
{ |
{ |
127 |
|
if (compile_pairs(sym->reply)) { |
128 |
|
radlog(L_ERR, |
129 |
|
_("users:%d: discarding entry %s"), |
130 |
|
sym->lineno, sym->name); |
131 |
|
symtab_delete(datum->symtab, (Symbol *)sym); |
132 |
|
datum->count--; |
133 |
|
} |
134 |
mark_list(datum, sym, sym->check); |
mark_list(datum, sym, sym->check); |
135 |
mark_list(datum, sym, sym->reply); |
mark_list(datum, sym, sym->reply); |
|
|
|
136 |
return 0; |
return 0; |
137 |
} |
} |
138 |
|
|