rlm_exec does not change already existing attributes

Joe Maimon jmaimon at ttec.com
Mon Apr 24 13:15:30 CEST 2006

Dmitry Lyubimkov wrote:

> In the rlm_exec module for change of attributes according to result of
> script it is used 
> 	if (output_pairs) pairmove(output_pairs, &answer);
> in function
> 	static int exec_dispatch(void *instance, REQUEST *request)
> But function pairmove in valuepair.c does only the following
> /* 
>  *      Move attributes from one list to the other 
>  *      if not already present. 
>  */ 
> void pairmove(VALUE_PAIR **to, VALUE_PAIR **from) 
> I.e. if such attribute does not exist that it will be added, and if
> already exists, will take place nothing.
> As result using an external script we can only add new attributes, but
> we can not change existing attributes!
> How to change User-Name in Radius request?
> Is it possible to change existing attributes in the simple way without
> change of the module rlm_exec code?
> Dmitry

if you keep reading in that function you will find that certain 
operators produce different behavior.

Furthermore, if you look at the server's version of valuepair.c (not 
lib/valuepair.c but main/valuepair.c ) you might decide to patch your 
version of rlm_exec to use pairxlatmove() instead.

My local radiusd runs with this patches which further extends/corrects 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 030-substar_regex.patch
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20060424/faf9055b/attachment.ksh>

More information about the Freeradius-Users mailing list