/[radius]/radius/lib/realms.c
ViewVC logotype

Diff of /radius/lib/realms.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by gray, Tue Jul 29 10:17:06 2003 UTC revision 1.10 by gray, Tue Oct 14 07:10:42 2003 UTC
# Line 31  static RAD_LIST /* of REALM */ *realms; Line 31  static RAD_LIST /* of REALM */ *realms;
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
# Line 57  _parse_server(int argc, char **argv, str Line 56  _parse_server(int argc, char **argv, str
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;
# Line 80  _parse_server_list(RADIUS_SERVER_QUEUE * Line 79  _parse_server_list(RADIUS_SERVER_QUEUE *
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                  }                  }
# Line 95  _parse_server_list(RADIUS_SERVER_QUEUE * Line 94  _parse_server_list(RADIUS_SERVER_QUEUE *
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;
# Line 126  read_realms_entry(struct _parse_data *pd Line 123  read_realms_entry(struct _parse_data *pd
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;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26