[exim-dev] Radiusclient

Góra strony
Delete this message
Reply to this message
Autor: Pete Carah
Data:  
Dla: exim-dev
Temat: [exim-dev] Radiusclient
Exim no longer builds with 0.4.7 of radiusclient; they added what
appears to be a re-entrancy feature, the rc_handle.  This is trivial
to fix...
There is another difference that I don't know the reason for - there is
an extra integer (I used 0) at the end of rc_avpair_add.
--------------------------------------------
freeware.interworld:882% diff -u call_radius.c call_radius.c.new
--- call_radius.c       Thu Feb 17 06:49:11 2005
+++ call_radius.c.new   Mon Mar  7 23:42:51 2005
@@ -73,6 +73,7 @@
 VALUE_PAIR *received;
 unsigned int service = PW_AUTHENTICATE_ONLY;
 char msg[4096];
+rc_handle *h;
 #endif



@@ -91,19 +92,19 @@

rc_openlog("exim");

-if (rc_read_config(RADIUS_CONFIG_FILE) != 0)
+if ((h=rc_read_config(RADIUS_CONFIG_FILE)) != 0)
*errptr = string_sprintf("RADIUS: can't open %s", RADIUS_CONFIG_FILE);

-else if (rc_read_dictionary(rc_conf_str("dictionary")) != 0)
+else if (rc_read_dictionary(h, rc_conf_str(h, "dictionary")) != 0)
*errptr = string_sprintf("RADIUS: can't read dictionary");

-else if (rc_avpair_add(&send, PW_USER_NAME, user, 0) == NULL)
+else if (rc_avpair_add(h, &send, PW_USER_NAME, user, 0, 0) == NULL)
*errptr = string_sprintf("RADIUS: add user name failed\n");

-else if (rc_avpair_add(&send, PW_USER_PASSWORD, CS radius_args, 0) == NULL)
+else if (rc_avpair_add(h, &send, PW_USER_PASSWORD, CS radius_args, 0, 0) == NULL)
*errptr = string_sprintf("RADIUS: add password failed\n");

-else if (rc_avpair_add(&send, PW_SERVICE_TYPE, &service, 0) == NULL)
+else if (rc_avpair_add(h, &send, PW_SERVICE_TYPE, &service, 0, 0) == NULL)
*errptr = string_sprintf("RADIUS: add service type failed\n");

if (*errptr != NULL)
@@ -112,7 +113,7 @@
return ERROR;
}

-result = rc_auth(0, send, &received, msg);
+result = rc_auth(h, 0, send, &received, msg);
DEBUG(D_auth) debug_printf("RADIUS code returned %d\n", result);

switch (result)
----------------------------------------