Re: JSON format to use for rlm_rest
Thanks Arran the authorization is working now but I can't do more than 1 request. I get a FATAL SIGNAL: Segmentation fault Below my output showing one Request and Response working, and then the following one fails: Ready to process requests rad_recv: Access-Request packet from host 192.168.118.102 port 58368, id=54, length=58 User-Name = '4411' CHAP-Password = 0xcc26c6f1f411c1f53fb28c2c59bb946d81 (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default (0) authorize { (0) [preprocess] = ok (0) chap : Setting 'Auth-Type := CHAP' (0) [chap] = ok (0) [mschap] = noop (0) eap : No EAP-Message, not doing EAP (0) [eap] = noop rlm_rest (rest): Reserved connection (4) (0) rest : Expanding URI components (0) rest : expand: "http://192.168.113.154:2233" -> ' http://192.168.113.154:2233' (0) rest : expand: "/authorize" -> '/authorize' (0) rest : Sending HTTP POST to "http://192.168.113.154:2233/authorize" (0) rest : Encoding attribute "User-Name" (0) rest : Encoding attribute "CHAP-Password" (0) rest : Encoding attribute "NAS-IP-Address" (0) rest : Encoding attribute "CHAP-Challenge" (0) rest : Status : 200 (OK) (0) rest : Type : json (application/json) (0) rest : Parsing attribute "control:Cleartext-Password" (0) rest : expand: "12345" -> '12345' (0) rest : Parsing attribute "reply:Reply-Message" (0) rest : expand: "pass" -> 'pass' rlm_rest (rest): Released connection (4) (0) [rest] = updated (0) [expiration] = noop (0) [logintime] = noop (0) WARNING: pap : Auth-Type already set. Not setting to PAP (0) [pap] = noop (0) } # authorize = updated (0) Found Auth-Type = CHAP (0) # Executing group from file /usr/local/etc/raddb/sites-enabled/default (0) Auth-Type CHAP { (0) chap : Login attempt by "4411" with CHAP password (0) chap : Comparing with "known good" Cleartext-Password (0) chap : CHAP user "4411" authenticated successfully (0) [chap] = ok (0) } # Auth-Type CHAP = ok (0) # Executing section post-auth from file /usr/local/etc/raddb/sites-enabled/default (0) post-auth { (0) [exec] = noop (0) remove_reply_message_if_eap remove_reply_message_if_eap { (0) ? if (reply:EAP-Message && reply:Reply-Message) (0) ? if (reply:EAP-Message && reply:Reply-Message) -> FALSE (0) else else { (0) [noop] = noop (0) } # else else = noop (0) } # remove_reply_message_if_eap remove_reply_message_if_eap = noop (0) } # post-auth = noop Sending Access-Accept of id 54 from 192.168.113.151 port 1812 to 192.168.118.102 port 58368 Reply-Message = 'pass' (0) Finished request 0. rad_recv: Access-Request packet from host 192.168.118.102 port 58368, id=54, length=58 Sending Access-Accept of id 54 from 192.168.113.151 port 1812 to 192.168.118.102 port 58368 Waking up in 999997.9 seconds. rad_recv: Access-Request packet from host 192.168.118.102 port 58368, id=54, length=58 Sending Access-Accept of id 54 from 192.168.113.151 port 1812 to 192.168.118.102 port 58368 Waking up in 1999995.9 seconds. rad_recv: Access-Request packet from host 192.168.118.102 port 45385, id=55, length=58 User-Name = '4411' CHAP-Password = 0x72932b75282b7002a540446a3f6929a94b (1) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default (1) authorize { (1) [preprocess] = ok (1) chap : Setting 'Auth-Type := CHAP' (1) [chap] = ok (1) [mschap] = noop (1) eap : No EAP-Message, not doing EAP (1) [eap] = noop rlm_rest (rest): Reserved connection (4) (1) rest : Expanding URI components (1) rest : expand: "http://192.168.113.154:2233" -> ' http://192.168.113.154:2233' (1) rest : expand: "/authorize" -> '/authorize' (1) rest : Sending HTTP POST to "http://192.168.113.154:2233/authorize" (1) rest : Encoding attribute "User-Name" (1) rest : Encoding attribute "CHAP-Password" (1) rest : Encoding attribute "NAS-IP-Address" (1) rest : Encoding attribute "CHAP-Challenge" (1) rest : Status : 200 (OK) (1) rest : Type : json (application/json) (1) rest : Parsing attribute "control:Cleartext-Password" (1) rest : expand: "12345" -> '12345' FATAL SIGNAL: Segmentation fault Backtrace of last 25 frames: /usr/local/lib/libfreeradius-radius.so(fr_fault+0x72) [0x7effd806b92a] /lib64/libpthread.so.0() [0x36a200f710] /usr/local/lib/libjson-c.so.2(array_list_get_idx+0xd) [0x7effc89c2dcd] /usr/local/lib/rlm_rest.so(+0x5952) [0x7effc8bcf952] /usr/local/lib/rlm_rest.so(+0x5a99) [0x7effc8bcfa99] /usr/local/lib/rlm_rest.so(rest_request_decode+0x14e) [0x7effc8bd15a3] /usr/local/lib/rlm_rest.so(+0x337f) [0x7effc8bcd37f] radiusd() [0x422e71] radiusd() [0x42368b] radiusd() [0x423047] radiusd() [0x4243fe] radiusd(modcall+0x88) [0x425140] radiusd(indexed_modcall+0x2e4) [0x420723] radiusd(process_authorize+0x22) [0x422741] radiusd(rad_authenticate+0x1af) [0x40d241] radiusd() [0x4335af] radiusd() [0x4326bd] radiusd(request_receive+0x5f4) [0x433c69] radiusd() [0x414588] radiusd() [0x439523] /usr/local/lib/libfreeradius-radius.so(fr_event_loop+0x5ba) [0x7effd808edeb] radiusd(radius_event_process+0x26) [0x43ac73] radiusd(main+0xbdf) [0x4285ae] /lib64/libc.so.6(__libc_start_main+0xfd) [0x36a1c1ed1d] radiusd() [0x40c449] No panic action set _EXIT CALLED src/lib/debug.c[262]: 1:
On 17 Mar 2014, at 10:46, Werner Stucky <wernerml@stucky-solutions.net> wrote:
Thanks Arran the authorization is working now but I can't do more than 1 request. I get a FATAL SIGNAL: Segmentation fault
Fixed. Apparently json_object_array_get_idx has undefined behaviour when called on something which is not an array (instead of nice behaviour like returning NULL). Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
participants (2)
-
Arran Cudbard-Bell -
Werner Stucky