81 |
} |
} |
82 |
|
|
83 |
void |
void |
84 |
|
anubis_section_set_prio(char *name, enum section_prio prio) |
85 |
|
{ |
86 |
|
struct rc_secdef *p = anubis_find_section(name); |
87 |
|
if (p) |
88 |
|
p->prio = prio; |
89 |
|
} |
90 |
|
|
91 |
|
void |
92 |
open_rcfile(int method) |
open_rcfile(int method) |
93 |
{ |
{ |
94 |
char homedir[MAXPATHLEN+1]; |
char homedir[MAXPATHLEN+1]; |
95 |
char *rcfile = 0; |
char *rcfile = 0; |
96 |
RC_SECTION *sec; |
RC_SECTION *sec; |
|
|
|
|
rc_section_list_destroy(parse_tree); |
|
|
parse_tree = NULL; |
|
97 |
|
|
98 |
switch (method) { |
switch (method) { |
99 |
case CF_SUPERVISOR: |
case CF_SUPERVISOR: |
173 |
#define KW_SOCKS_AUTH 11 |
#define KW_SOCKS_AUTH 11 |
174 |
#define KW_READ_ENTIRE_BODY 12 |
#define KW_READ_ENTIRE_BODY 12 |
175 |
#define KW_DROP_UNKNOWN_USER 13 |
#define KW_DROP_UNKNOWN_USER 13 |
176 |
|
#define KW_RULE_PRIORITY 14 |
177 |
|
|
178 |
char ** |
char ** |
179 |
list_to_argv(LIST *list) |
list_to_argv(LIST *list) |
204 |
if (strlen(session.tunnel) != 0) |
if (strlen(session.tunnel) != 0) |
205 |
topt |= T_NAMES; |
topt |= T_NAMES; |
206 |
break; |
break; |
207 |
|
|
208 |
|
case KW_RULE_PRIORITY: |
209 |
|
if (strcasecmp(arg, "user") == 0) |
210 |
|
anubis_section_set_prio("RULE", prio_user); |
211 |
|
else if (strcasecmp(arg, "system") == 0) |
212 |
|
anubis_section_set_prio("RULE", prio_system); |
213 |
|
else if (strcasecmp(arg, "override") == 0) |
214 |
|
anubis_section_set_prio("RULE", prio_override); |
215 |
|
else |
216 |
|
return RC_KW_ERROR; |
217 |
|
break; |
218 |
|
|
219 |
case KW_TERMLEVEL: |
case KW_TERMLEVEL: |
220 |
if (strcmp("silent", arg) == 0) |
if (strcmp("silent", arg) == 0) |
318 |
|
|
319 |
static struct rc_kwdef init_kw[] = { |
static struct rc_kwdef init_kw[] = { |
320 |
{ "bind", KW_BIND }, |
{ "bind", KW_BIND }, |
321 |
|
{ "rule-priority", KW_RULE_PRIORITY }, |
322 |
{ NULL }, |
{ NULL }, |
323 |
}; |
}; |
324 |
|
|
525 |
{ |
{ |
526 |
struct rc_secdef *sp = anubis_add_section("RULE"); |
struct rc_secdef *sp = anubis_add_section("RULE"); |
527 |
sp->allow_prog = 1; |
sp->allow_prog = 1; |
528 |
|
sp->prio = prio_system; |
529 |
rc_secdef_add_child(sp, &rule_sect_child); |
rc_secdef_add_child(sp, &rule_sect_child); |
530 |
} |
} |
531 |
|
|
543 |
#endif /* HAVE_GPG */ |
#endif /* HAVE_GPG */ |
544 |
} |
} |
545 |
|
|
|
/* Placeholders */ |
|
|
|
|
546 |
void |
void |
547 |
rcfile_process_section(int method, char *name, void *data, MESSAGE *msg) |
rcfile_process_section(int method, char *name, void *data, MESSAGE *msg) |
548 |
{ |
{ |
549 |
RC_SECTION *sec = rc_section_lookup(parse_tree, name); |
RC_SECTION *sec; |
550 |
rc_run_section(method, sec, anubis_rc_sections, data, msg); |
|
551 |
|
for (sec = rc_section_lookup(parse_tree, name); |
552 |
|
sec; |
553 |
|
sec = rc_section_lookup(sec->next, name)) |
554 |
|
rc_run_section(method, sec, anubis_rc_sections, data, msg); |
555 |
} |
} |
556 |
|
|
557 |
void |
void |
559 |
{ |
{ |
560 |
RC_SECTION *sec = rc_section_lookup(parse_tree, name); |
RC_SECTION *sec = rc_section_lookup(parse_tree, name); |
561 |
if (!sec) |
if (!sec) |
562 |
anubis_error(SOFT, |
anubis_error(SOFT, _("No such section: %s"), name); |
|
_("No such section: %s"), name); |
|
563 |
rc_call_section(method, sec, anubis_rc_sections, data, msg); |
rc_call_section(method, sec, anubis_rc_sections, data, msg); |
564 |
} |
} |
565 |
|
|