[exim-dev] radius auth support

Inizio della pagina
Delete this message
Reply to this message
Autore: Lai Zit Seng
Data:  
To: exim-dev
Oggetto: [exim-dev] radius auth support
I ran into some problems with exim-4.52 while doing radius authentication
with radiusclient 0.4.9:

- Error returned from rc_read_config was caught wrongly
- Username/password not passed on to radius server due to wrong length.

I guess some radiusclient API changes were not taken care of correctly.

My humble patch attached.

Regards,

.lzs
--
http://thinkingfarm.com/~lzs/--- exim-4.52/src/auths/call_radius.c Fri Jul 1 19:09:15 2005
+++ exim-4.52-lzs/src/auths/call_radius.c       Sun Aug 14 12:27:42 2005
@@ -113,16 +113,16 @@

 #else  /* RADIUS_LIB_RADIUSCLIENT unset => RADIUS_LIB_RADIUSCLIENT2 */

-if ((h = 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(h, rc_conf_str(h, "dictionary")) != 0)
   *errptr = string_sprintf("RADIUS: can't read dictionary");

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

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

 else if (rc_avpair_add(h, &send, PW_SERVICE_TYPE, &service, 0, 0) == NULL)