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

Alan DeKok aland at deployingradius.com
Wed Mar 2 02:28:45 CET 2016


On Mar 1, 2016, at 12:58 PM, Boris Lytochkin <lytboris at yandex-team.ru> wrote:
> OKay, trying naive

  Thinking about it helps, too.

> mycp = cf_pair_find(request->client->cs, "group");

  Is request a valid pointer?  Is request->client a valid pointer?  Is request->client->cs a valid pointer?

> results in
> (gdb) p *mycp
> $2 = {item = {next = 0xa00000038, parent = 0x8034c2330, lineno = 805314604,
>    filename = 0x800300034 <Error reading address 0x800300034: Bad address>, type = 1919181921}, attr = 0x0,
>  value = 0xb0000003b <Error reading address 0xb0000003b: Bad address>, op = 172, lhs_type = T_INVALID, rhs_type = 73, pass2 = 19, parsed = false}

  Which is garbage data.  You've walked off of the end of a pointer somewhere.

  Programming your own module require understanding C programming.

> Am I missing some tiny bits to make it work as expected?

  C programming.

> There are no references for these techniques in http://wiki.freeradius.org/contributing/Modules3
> sorry for asking dumb questions. :)

  This isn't documented because (a) we don't have time to document everything, and (b) if you're programming your own module, we expect some ability to root through the header files and figure things out.

  Alan DeKok.




More information about the Freeradius-Devel mailing list