question about 1.1.6 client code: rc_config_init()

Adam Lewis VNQM87 at motorola.com
Thu Feb 18 13:22:02 CET 2010


Not sure what's the best way to go. The 'minumum impact' solution is to
replace:

 	authservers = rc_conf_srv(rh, "authserver"); 
	acctservers = rc_conf_srv(rh, "acctserver");
	authservers = malloc(sizeof(SERVER));
	acctservers = malloc(sizeof(SERVER));

with something like:
	OPTION *option;

	option = find_option(rh, "authserver", OT_SRV);

	if (option != NULL) {
		option->val = malloc(sizeof(SERVER));
 		authservers = option->val;
	} else {
		rc_log(LOG_CRIT, "rc_config_init: authserver option missing");
		rc_destroy(rh);
		return NULL;
	}

	option = find_option(rh, "acctserver", OT_SRV);

	if (option != NULL) {
		option->val = malloc(sizeof(SERVER));
		acctservers = option->val;
	} else {
		rc_log(LOG_CRIT, "rc_config_init: acctserver option missing");
		rc_destroy(rh);
		return NULL;
	}

alternatively you could move all the authserver & acctserver config from
rc_config_init() to the "if (serv == null)" clause in set_option_srv().

Apologies for not providing a proper patch. I'm being pulled off this
project for the moment.

Regards,
Adam.


Alan DeKok-2 wrote:
> 
> Adam Lewis wrote:
>> Hi,
>>  I'm currently trying to use the 1.1.6 client code to create an embedded
>> client. Doing a code inspection of rc_config_init() in lib\config.c , the
>> following code looks suspicious:
> 
>   Yup.
> 
>   ....
> 
>   Create a patch, and send it to the list.
> 
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/devel.html
> 
> 

-- 
View this message in context: http://old.nabble.com/question-about-1.1.6-client-code%3A-rc_config_init%28%29-tp27607215p27637446.html
Sent from the FreeRadius - Dev mailing list archive at Nabble.com.




More information about the Freeradius-Devel mailing list