request object pointer offset
I am having some difficulty accessing the data in the request object inside my module. It seems the pointers are offset ... inside the authenticate method of my module ... DEBUG ("MYMODULE: request->config_items->name = %s", request->config_items->name); DEBUG ("MYMODULE: request->config_items->strvalue = %s", request->config_items->strvalue); if (!request->username) { DEBUG ("MYMODULE: no username found\n"); } else { DEBUG ("MYMODULE: request->username->strvalue = %s\n", request->username->strvalue); } if (!request->password) { DEBUG ("MYMODULE: no password found\n"); } else { DEBUG ("MYMODULE: request->password->strvalue = %s\n", request->password->strvalue); } DEBUG ("MYMODULE: request->number = %d\n", request->number); return RLM_MODULE_REJECT; ... and this is the output i get from radiusd -X ... auth: type "mymodule" Processing the authenticate section of radiusd.conf modcall: entering group mymodule for request 0 MYMODULE: request->config_items->name = User-Name MYMODULE: request->config_items->strvalue = testuser MYMODULE: request->username->strvalue = test MYMODULE: no password found MYMODULE: request->number = 0 modcall[authenticate]: module "mymodule" returns reject for request 0 modcall: leaving group mymodule (returns reject) for request 0 auth: Failed to validate the user. ... As you can see, the config_items VP* points to the User-name VP and the username VP* points to the password and the password VB* is NULL. Any ideas ? -- View this message in context: http://www.nabble.com/request-object-pointer-offset-t1325410.html#a3537076 Sent from the FreeRadius - User forum at Nabble.com.
jasonatx0001 <jasonatx0001@yahoo.com> wrote:
I am having some difficulty accessing the data in the request object inside my module. It seems the pointers are offset ...
Look at the definition of the REQUEST structure in src/include/radiusd.h. Why would all of the entries be offset by one entry? And notice you're using DEBUG macros... Alan DeKok.
Thanks ... I think I've got it figured out now. Is there any reason to compile without the NDEBUG flag ? -- View this message in context: http://www.nabble.com/request-object-pointer-offset-t1325410.html#a3539679 Sent from the FreeRadius - User forum at Nabble.com.
participants (2)
-
Alan DeKok -
jasonatx0001