Accessing %{client:...} in C custom module

Matthew Newton mcn4 at leicester.ac.uk
Wed Mar 2 12:35:24 CET 2016


On Wed, Mar 02, 2016 at 02:19:31PM +0300, Boris Lytochkin wrote:
> On 02.03.2016 13:08, Stefan Paetow wrote:
> >Try this:
> >
> >if ("%{client:group}" == '8021X') {
> That works, thanks :) Will go track how this is being expanded now.

It's an xlat, so look for the xlat_register function for it.

~/git/freeradius-server/src/main$ grep xlat * | grep client
mainconfig.c:static ssize_t xlat_client(UNUSED void *instance, REQUEST *request, char const *fmt, char *out, size_t outlen)
mainconfig.c:static ssize_t xlat_getclient(UNUSED void *instance, REQUEST *request, char const *fmt, char *out, size_t outlen)
>>>
mainconfig.c: xlat_register("client", xlat_client, NULL, NULL);
<<<
mainconfig.c: xlat_register("getclient", xlat_getclient, NULL, NULL);
radclient.c:       *  xlat expansions aren't supported here
radclient.c:          vp->vp_strvalue = vp->value.xlat;
radclient.c:       *  Double quoted strings get marked up as xlat expansions,
radclient.c:        vp->vp_strvalue = vp->value.xlat;

look at the xlat_client function in mainconfig.c

Matthew


-- 
Matthew Newton, Ph.D. <mcn4 at le.ac.uk>

Systems Specialist, Infrastructure Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom

For IT help contact helpdesk extn. 2253, <ithelp at le.ac.uk>


More information about the Freeradius-Devel mailing list