/[radius]/radius/radiusd/proxy.c
ViewVC logotype

Diff of /radius/radiusd/proxy.c

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

revision 1.58 by gray, Sun Nov 2 21:45:40 2003 UTC revision 1.59 by gray, Mon Nov 3 13:23:10 2003 UTC
# Line 261  static REALM * Line 261  static REALM *
261  proxy_lookup_realm(RADIUS_REQ *req, char *name)  proxy_lookup_realm(RADIUS_REQ *req, char *name)
262  {  {
263          REALM *realm = realm_lookup_name(name);          REALM *realm = realm_lookup_name(name);
264            static char *var[] = { "auth", "acct" };
265            int t;
266            
267          if (realm) {          if (realm) {
268                  char *var = NULL;                  int rc;
269                  switch (req->code) {                  switch (req->code) {
270                  case RT_AUTHENTICATION_REQUEST:                  case RT_AUTHENTICATION_REQUEST:
271                          var = "auth";                          t = R_AUTH;
272                          break;                          break;
273                                    
274                  case RT_ACCOUNTING_REQUEST:                  case RT_ACCOUNTING_REQUEST:
275                          var = "acct";                          t = R_ACCT;
276                          break;                          break;
277                                                    
278                  default:                  default:
# Line 278  proxy_lookup_realm(RADIUS_REQ *req, char Line 280  proxy_lookup_realm(RADIUS_REQ *req, char
280                          insist_fail("unexpected request code");                          insist_fail("unexpected request code");
281                  }                  }
282    
283                  if (envar_lookup_int(realm->args, var, 1) == 0)                  rc = envar_lookup_int(realm->args, var[t], -1);
284                    if (rc == -1) {
285                            /* Neither {var} nor no{var} is specified. Check
286                               the orthogonal variable. If it is not set, proxying
287                               is enabled for both authentication and
288                               accounting. */
289                            rc = !envar_lookup_int(realm->args, var[!t], 0);
290                    }
291                    if (!rc)
292                          realm = NULL;                          realm = NULL;
293                    
294          }          }
295          return realm;          return realm;
296  }  }

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59

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