31 |
struct _parse_data { |
struct _parse_data { |
32 |
int (*fun)(); |
int (*fun)(); |
33 |
int ports[PORT_MAX]; |
int ports[PORT_MAX]; |
34 |
char *file; |
LOCUS *loc; |
|
int line; |
|
35 |
}; |
}; |
36 |
|
|
37 |
int |
int |
56 |
srv->port[PORT_ACCT] = pd->ports[PORT_ACCT]; |
srv->port[PORT_ACCT] = pd->ports[PORT_ACCT]; |
57 |
} |
} |
58 |
if (pd->fun && pd->fun(srv)) { |
if (pd->fun && pd->fun(srv)) { |
59 |
radlog(L_ERR, |
radlog_loc(L_ERR, pd->loc, |
60 |
_("%s:%d: can't find secret for %s"), |
_("can't find secret for %s"), |
61 |
pd->file, pd->line, srv->name); |
srv->name); |
62 |
return 1; |
return 1; |
63 |
} |
} |
64 |
return 0; |
return 0; |
79 |
rad_clt_append_server(qp, rad_clt_alloc_server(&srv)); |
rad_clt_append_server(qp, rad_clt_alloc_server(&srv)); |
80 |
|
|
81 |
if (i < argc && argv[i][0] != ',') { |
if (i < argc && argv[i][0] != ',') { |
82 |
radlog(L_ERR, |
radlog_loc(L_ERR, pd->loc, |
83 |
_("%s:%d: expected , but found %s"), |
_("expected , but found %s"), |
84 |
pd->file, pd->line, argv[i]); |
argv[i]); |
85 |
argcv_free(argc, argv); |
argcv_free(argc, argv); |
86 |
return 1; |
return 1; |
87 |
} |
} |
94 |
/* read realms entry */ |
/* read realms entry */ |
95 |
/*ARGSUSED*/ |
/*ARGSUSED*/ |
96 |
int |
int |
97 |
read_realms_entry(struct _parse_data *pd, int fc, char **fv, |
read_realms_entry(void *closure, int fc, char **fv, LOCUS *loc) |
|
char *file,int lineno) |
|
98 |
{ |
{ |
99 |
|
struct _parse_data *pd = closure; |
100 |
REALM *rp; |
REALM *rp; |
101 |
int i; |
int i; |
102 |
|
|
103 |
if (fc < 2) { |
if (fc < 2) { |
104 |
radlog(L_ERR, _("%s:%d: too few fields (%d)"), |
radlog_loc(L_ERR, loc, _("too few fields (%d)"), fc); |
|
file, lineno, fc); |
|
105 |
return -1; |
return -1; |
106 |
} |
} |
107 |
|
|
108 |
pd->file = file; |
pd->loc = loc; |
|
pd->line = lineno; |
|
109 |
|
|
110 |
rp = emalloc(sizeof(REALM)); |
rp = emalloc(sizeof(REALM)); |
111 |
rp->queue = NULL; |
rp->queue = NULL; |
123 |
i++; |
i++; |
124 |
|
|
125 |
if (list_count(rp->queue->servers) == 0) { |
if (list_count(rp->queue->servers) == 0) { |
126 |
radlog(L_ERR, |
radlog_loc(L_ERR, loc, _("cannot parse")); |
|
_("%s:%d: cannot parse"), |
|
|
file, lineno); |
|
127 |
rad_clt_destroy_queue(rp->queue); |
rad_clt_destroy_queue(rp->queue); |
128 |
efree(rp); |
efree(rp); |
129 |
return 0; |
return 0; |