configuration parameters for perl module in rlm_perl
Hi list, is there are recommended way to pass configuration parameter to a rlm_perl module? My rlm_perl module, would need to have additional configuration parameters. I would like to avoid having the perl module read an additional configuration file. Is there a possibility to add such paramters somewhere in the freeradius config like in /etc/freeradius/modules/perl and than have the perl module access these parameters? Thanks a lot and kind regards Cornelius
Cornelius Kölbel wrote:
I would like to avoid having the perl module read an additional configuration file.
Then edit the source code to rlm_perl, and add those features.
Is there a possibility to add such paramters somewhere in the freeradius config like in /etc/freeradius/modules/perl and than have the perl module access these parameters?
No. Why is it a problem to read a configuration file? Alan DeKok.
Am 14.09.2013 14:50, schrieb Alan DeKok:
Cornelius Kölbel wrote:
I would like to avoid having the perl module read an additional configuration file. Then edit the source code to rlm_perl, and add those features.
Is there a possibility to add such paramters somewhere in the freeradius config like in /etc/freeradius/modules/perl and than have the perl module access these parameters? No. Thanks for the clarification!
Why is it a problem to read a configuration file? Just to avoid to many config files... But now I will do so.
Thanks a lot Cornelius
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hallo,
is there are recommended way to pass configuration parameter to a rlm_perl module?
I had the same problem and came to the conclusion it is not possible without changing the FreeRadius code. I solved it by using two configuration directories and symlinking the perl code and extracting the basename within the perl module: our $mandant = dirname($0) . '/'; It also seems to be possible to do something like that: Which I don't liked: perl_flags ='-e "\$ENV{mandant} = \"VDI\"; do \"/path/to/file\"'; Cheers, Thomas
Hello, I had the same need. I made some changes to rlm_perl to handle a configuration sub-section, eg: perl my_perl_instance { filename = ${modconfdir}/perl/my_perl_script.pl # perl configuration items perl_conf { attribute = value another_attr = 1234 } } I modified rlm_perl to read the subsection "perl_conf" in instantiate, populate a hash, and define a new perl hash passed to the perl code whenever a section is called. This hash can be manipulated in the same way as the attribute hashes, for instance: our (%RAD_REQUEST, %RAD_REPLY, %RAD_REQUEST_PROXY_REPLY, %RAD_CHECK, %RAD_PERLCONF); my $value = $RAD_PERLCONF{'attribute'}; If people is interested, I can share the code. I have no idea how to submit a git patch though, but I can provide the modified file as is.
-----Message d'origine----- De : freeradius-users- bounces+nicolas.chaigneau=capgemini.com@lists.freeradius.org [mailto:freeradius-users- bounces+nicolas.chaigneau=capgemini.com@lists.freeradius.org] De la part de Thomas Glanzmann Envoyé : vendredi 14 mars 2014 14:26 À : FreeRadius users mailing list Objet : Re: configuration parameters for perl module in rlm_perl
Hallo,
is there are recommended way to pass configuration parameter to a rlm_perl module?
I had the same problem and came to the conclusion it is not possible without changing the FreeRadius code. I solved it by using two configuration directories and symlinking the perl code and extracting the basename within the perl module:
our $mandant = dirname($0) . '/';
It also seems to be possible to do something like that: Which I don't liked:
perl_flags ='-e "\$ENV{mandant} = \"VDI\"; do \"/path/to/file\"';
Cheers, Thomas - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
Chaigneau, Nicolas wrote:
I modified rlm_perl to read the subsection "perl_conf" in instantiate, populate a hash, and define a new perl hash passed to the perl code whenever a section is called. This hash can be manipulated in the same way as the attribute hashes, for instance:
our (%RAD_REQUEST, %RAD_REPLY, %RAD_REQUEST_PROXY_REPLY, %RAD_CHECK, %RAD_PERLCONF);
That's useful.
If people is interested, I can share the code. I have no idea how to submit a git patch though, but I can provide the modified file as is.
That's fine. Just mail it to me and I'll take a look. Alan DeKok.
Here it is (see attached file "rlm_perl.c"). A few notes: - I put "//NCH:" markers to identify parts of the code I changed. - I didn't bother xlat'ing eventual ${} in "perl_conf" items (didn't need it), but maybe it could be useful. - I used a "hack" in my struct perl_conf_t: the first item is a pointer to the struct itself. (this allowed me to get around the bug I found in hash.c. This won't be needed anymore now it's fixed. Anyway, the code works with or without the hash fix) - I didn't free memory in mod_detach, this should be done... not critical though, since the perl module is not "RLM_TYPE_HUP_SAFE". Thanks for looking. I'm interested if you see anything wrong. Regards, Nicolas.
-----Message d'origine----- De : freeradius-users- bounces+nicolas.chaigneau=capgemini.com@lists.freeradius.org [mailto:freeradius-users- bounces+nicolas.chaigneau=capgemini.com@lists.freeradius.org] De la part de Alan DeKok Envoyé : vendredi 14 mars 2014 14:49 À : FreeRadius users mailing list Objet : Re: configuration parameters for perl module in rlm_perl
Chaigneau, Nicolas wrote:
I modified rlm_perl to read the subsection "perl_conf" in instantiate, populate a hash, and define a new perl hash passed to the perl code whenever a section is called. This hash can be manipulated in the same way as the attribute hashes, for instance:
our (%RAD_REQUEST, %RAD_REPLY, %RAD_REQUEST_PROXY_REPLY, %RAD_CHECK, %RAD_PERLCONF);
That's useful.
If people is interested, I can share the code. I have no idea how to submit a git patch though, but I can provide the modified file as is.
That's fine. Just mail it to me and I'll take a look.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
On 14 Mar 2014, at 14:37, Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> wrote:
Here it is (see attached file "rlm_perl.c").
A few notes:
- I put "//NCH:" markers to identify parts of the code I changed.
- I didn't bother xlat'ing eventual ${} in "perl_conf" items (didn't need it), but maybe it could be useful.
- I used a "hack" in my struct perl_conf_t: the first item is a pointer to the struct itself. (this allowed me to get around the bug I found in hash.c. This won't be needed anymore now it's fixed. Anyway, the code works with or without the hash fix)
- I didn't free memory in mod_detach, this should be done... not critical though, since the perl module is not "RLM_TYPE_HUP_SAFE".
Thanks for looking. I'm interested if you see anything wrong.
Well you've pretty much guaranteed that this isn't going to get merged by your method of submission. If someone cares enough they can send a pull request. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
Hello, I've created a pull request for this. My first, hopefully I got it right... tell me if something's wrong. (And for the record, I sent it the first time by mail because Alan asked me to.)
Well you've pretty much guaranteed that this isn't going to get merged by your method of submission.
If someone cares enough they can send a pull request.
Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
I've created a pull request for this.
My first, hopefully I got it right... tell me if something's wrong.
Nope looks ok. If you're ok with rebasing (squashing and fixing up commits), i'll make some suggestions on GitHub?
(And for the record, I sent it the first time by mail because Alan asked me to.)
Bad Alan! Once it goes into the issue queue, it also maintains it's visibility a lot better than if it just sits in the mailing list archive. I only caught this one because I was going back and deleting old list emails. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
I've created a pull request for this.
My first, hopefully I got it right... tell me if something's wrong.
Nope looks ok.
If you're ok with rebasing (squashing and fixing up commits), i'll make some suggestions on GitHub?
I'm not sure what you want me to do, but sure, suggestions are welcome. I've already a fix for the unnecessary struct element "walk_data", as pointed out by Alan. How do I proceed in this case ? do I need to do another pull request ? delete the first one ?
Once it goes into the issue queue, it also maintains it's visibility a lot better than if it just sits in the mailing list archive.
I only caught this one because I was going back and deleting old list emails.
No problem. There's a lot going on in this list (which is a good thing). I delete most of it quickly :) This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
On 28 Mar 2014, at 13:37, Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> wrote:
I've created a pull request for this.
My first, hopefully I got it right... tell me if something's wrong.
Nope looks ok.
If you're ok with rebasing (squashing and fixing up commits), i'll make some suggestions on GitHub?
I'm not sure what you want me to do, but sure, suggestions are welcome. I've already a fix for the unnecessary struct element "walk_data", as pointed out by Alan.
How do I proceed in this case ? do I need to do another pull request ? delete the first one ?
Make changes Commit changes git rebase -i HEAD~2 change 'pick' to 'f' on the last line in the list of commits. git push --force That updates the commit in the branch which the pull request was generate from. I was just thinking it could use some examples in the perl config file, and maybe loose the 'perl' part from the config section. Ideally it'd be something like perl { config { <config> = <value> } } Config paths should make sense in plain english perl.perl_config.<config> = <value Is duplicative. perl.config.<config> = value Is not. I'm not sure if you handle nested sections correctly either, ideally: perl { config { <key> { <key> = <value> <key> = <value> } } } Would work too. It shouldn't be *that* hard with some well placed recursive calls :). Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
Hello, I'm trying to use rlm_rest module, with no luck so far. I have a segmentation fault when it needs to add a connection to the pool. Any idea what the issue could be ? Here is the output including GDB backtrace: (0) # Executing section authorize from file /exec/applis/mwpnch/products/freeradius/v3.0.2/etc/raddb/sites-enabled/server-test-rest (0) authorize { rlm_rest (SRS.rest): Opening additional connection (0) FATAL SIGNAL: Segmentation fault Backtrace of last 24 frames: /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/libfreeradius-radius.so(fr_fault+0x6a) [0x2b859b400477] /lib64/libpthread.so.0 [0x30ac80eb10] /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_rest.so(mod_conn_create+0x85) [0x2b859d8b86f1] radiusd [0x42b6d7] radiusd(fr_connection_get+0x118) [0x42c9ac] /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_rest.so [0x2b859d8b8041] radiusd [0x4222a0] radiusd [0x422a5a] radiusd [0x422465] radiusd [0x423876] radiusd(modcall+0x7f) [0x424619] radiusd(indexed_modcall+0x2ac) [0x41fe4e] radiusd(process_authorize+0x20) [0x421bb6] radiusd(rad_authenticate+0x1bf) [0x40cc23] radiusd [0x4325c0] radiusd [0x431785] radiusd(request_receive+0x5e9) [0x432c5a] radiusd [0x41420b] radiusd [0x4382fb] /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/libfreeradius-radius.so(fr_event_loop+0x575) [0x2b859b421a6a] radiusd(radius_event_process+0x29) [0x439920] radiusd(main+0xb94) [0x427a74] /lib64/libc.so.6(__libc_start_main+0xf4) [0x30ab81d994] radiusd [0x40bdd9] Calling: gdb -silent -x /exec/applis/mwpnch/products/freeradius/v3.0.2/etc/raddb/panic.gdb radiusd 6631 2>&1 | tee /exec/applis/mwpnch/products/freeradius/v3.0.2/var/log/radius/gdb-radiusd-6631.log Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/sbin/radiusd...done. Attaching to program: /exec/applis/mwpnch/products/freeradius/v3.0.2/sbin/radiusd, process 6631 Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/libfreeradius-server.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/libfreeradius-server.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/libfreeradius-radius.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/libfreeradius-radius.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/libfreeradius-eap.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/libfreeradius-eap.so Reading symbols from /usr/local/lib/libtalloc.so.2...(no debugging symbols found)...done. Loaded symbols for /usr/local/lib/libtalloc.so.2 Reading symbols from /lib64/libcrypto.so.6...(no debugging symbols found)...done. Loaded symbols for /lib64/libcrypto.so.6 Reading symbols from /lib64/libnsl.so.1...(no debugging symbols found)...done. Loaded symbols for /lib64/libnsl.so.1 Reading symbols from /lib64/libresolv.so.2...(no debugging symbols found)...done. Loaded symbols for /lib64/libresolv.so.2 Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done. Loaded symbols for /lib64/libdl.so.2 Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done. [Thread debugging using libthread_db enabled] Loaded symbols for /lib64/libpthread.so.0 Reading symbols from /lib64/libssl.so.6...(no debugging symbols found)...done. Loaded symbols for /lib64/libssl.so.6 Reading symbols from /lib64/libcrypt.so.1...(no debugging symbols found)...done. Loaded symbols for /lib64/libcrypt.so.1 Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done. Loaded symbols for /lib64/libc.so.6 Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done. Loaded symbols for /lib64/librt.so.1 Reading symbols from /usr/lib64/libz.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib64/libz.so.1 Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 Reading symbols from /usr/lib64/libgssapi_krb5.so.2...(no debugging symbols found)...done. Loaded symbols for /usr/lib64/libgssapi_krb5.so.2 Reading symbols from /usr/lib64/libkrb5.so.3...(no debugging symbols found)...done. Loaded symbols for /usr/lib64/libkrb5.so.3 Reading symbols from /lib64/libcom_err.so.2...(no debugging symbols found)...done. Loaded symbols for /lib64/libcom_err.so.2 Reading symbols from /usr/lib64/libk5crypto.so.3...(no debugging symbols found)...done. Loaded symbols for /usr/lib64/libk5crypto.so.3 Reading symbols from /usr/lib64/libkrb5support.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib64/libkrb5support.so.0 Reading symbols from /lib64/libkeyutils.so.1...(no debugging symbols found)...done. Loaded symbols for /lib64/libkeyutils.so.1 Reading symbols from /lib64/libselinux.so.1...(no debugging symbols found)...done. Loaded symbols for /lib64/libselinux.so.1 Reading symbols from /lib64/libsepol.so.1...(no debugging symbols found)...done. Loaded symbols for /lib64/libsepol.so.1 Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_detail.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_detail.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_preprocess.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_preprocess.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_unpack.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_unpack.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_passwd.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_passwd.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_linelog.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_linelog.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_mschap.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_mschap.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_exec.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_exec.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_chap.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_chap.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_files.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_files.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_pap.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_pap.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_cache.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_cache.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_dynamic_clients.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_dynamic_clients.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_attr_filter.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_attr_filter.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_rest.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_rest.so Reading symbols from /usr/local/lib/libcurl.so.4...(no debugging symbols found)...done. Loaded symbols for /usr/local/lib/libcurl.so.4 Reading symbols from /usr/local/lib/libjson-c.so.2...done. Loaded symbols for /usr/local/lib/libjson-c.so.2 Reading symbols from /usr/lib64/libidn.so.11...(no debugging symbols found)...done. Loaded symbols for /usr/lib64/libidn.so.11 Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_expr.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_expr.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_dhcp.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_dhcp.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_md5.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_md5.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_leap.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_leap.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_gtc.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_gtc.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_tls.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_tls.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_ttls.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_ttls.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_peap.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_peap.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_mschapv2.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_eap_mschapv2.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_expiration.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_expiration.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_unix.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_unix.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_radutmp.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_radutmp.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_digest.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_digest.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_utf8.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_utf8.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_realm.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_realm.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_always.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_always.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_logintime.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_logintime.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_soh.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_soh.so Reading symbols from /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_replicate.so...done. Loaded symbols for /exec/applis/mwpnch/products/freeradius/v3.0.2/lib/rlm_replicate.so Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols found)...done. Loaded symbols for /lib64/libgcc_s.so.1 0x00000030ab899fc5 in waitpid () from /lib64/libc.so.6 No symbol table info available. No symbol table info available. Thread 1 (Thread 0x2b859be83410 (LWP 6631)): #0 0x00000030ab899fc5 in waitpid () from /lib64/libc.so.6 No symbol table info available. #1 0x00000030ab83c331 in do_system () from /lib64/libc.so.6 No symbol table info available. #2 0x00002b859b40066d in fr_fault (sig=11) at /users/admwpnch/freeradius-server-3.0.2/src/lib/debug.c:280 cmd = "gdb -silent -x /exec/applis/mwpnch/products/freeradius/v3.0.2/etc/raddb/panic.gdb radiusd 6631 2>&1 | tee /exec/applis/mwpnch/products/freeradius/v3.0.2/var/log/radius/gdb-radiusd-6631.log\000+\000\000@\036>\265\377\177\000\000\360\035>\265"... out = 0x7fffb53e1ca8 ".log" left = 348 ret = 90 p = 0x2b859b632b74 ".log" q = 0x0 code = 0 frame_count = 24 i = 24 stack = {0x2b859b400477, 0x30ac80eb10, 0x2b859d8b86f1, 0x42b6d7, 0x42c9ac, 0x2b859d8b8041, 0x4222a0, 0x422a5a, 0x422465, 0x423876, 0x424619, 0x41fe4e, 0x421bb6, 0x40cc23, 0x4325c0, 0x431785, 0x432c5a, 0x41420b, 0x4382fb, 0x2b859b421a6a, 0x439920, 0x427a74, 0x30ab81d994, 0x40bdd9, 0x46c4d50, 0x2046c4980, 0x45829f, 0x0, 0x7fffb53e3ad8, 0x6400000065, 0x44a905, 0x46f2e10, 0x46f2db0, 0x46f2e10, 0x46f2e10, 0x46f2db0, 0x7fffb53e1970, 0x2b859b8416f6, 0x474de80, 0x0, 0x5, 0x46f2e10, 0x474de20, 0x474de80, 0x474de80, 0x474de20, 0x7fffb53e1990, 0x2b859b841bd2, 0x474de80, 0x474de80, 0x5, 0x474de20, 0x7fffb53e19d0, 0x2b859b84473b, 0x474de80, 0x4, 0x46f36e0, 0x46f2e10, 0x0, 0x474de80, 0x7fffb53e1a00, 0x2b859b8446c1, 0x46f36e0, 0x474de80, 0x46f36e0, 0x46f2e10, 0x7fffb53e3b60, 0x2b859b1d61dd, 0x0, 0x0, 0x0, 0x64, 0x46f36e0, 0x474de80, 0x0, 0x44b712, 0x7fffb53e3bc0, 0x64ab405f6b, 0x44d1a9, 0x46f2e10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30ac400000, 0x30ac43b000, 0x30ac43a75c, 0x30ac43a75c, 0x0, 0x5, 0x30ac63b000, 0x30ac63c000, 0x30ac63b680, 0x30ac645d40, 0x3b000, 0x3000000003, 0x100000000, 0x30ac0030d0, 0x2b859be81058, 0x30ab40d988, 0x2b859be81070, 0x2b859bc697e8, 0x30ac402e48, 0x30ab4075c0, 0x7fffb53e1d80, 0x30ab40d988, 0x0, 0x2b859be81070, 0x30ac0030d0, 0x30ab4075c0, 0x7fffb53e1cf0, 0x30ab40d988, 0x70612f636578652f, 0x100000000, 0x30af401395, 0x30ab4075c0, 0x2f73756964617265, 0x30ab40d988, 0x7fffb53e1b00, 0x100000000, 0x30ae40488a, 0x30ab4075c0, 0x30ac0030d0, 0x30ab40d988, 0x30ac402e48, 0x100000000} frames = 0x4759630 #3 <signal handler called> No symbol table info available. #4 0x00002b859d8b86f1 in mod_conn_create (instance=0x4711280) at /users/admwpnch/freeradius-server-3.0.2/src/modules/rlm_rest/rest.c:300 inst = 0x4711280 randle = 0x0 ctx = 0x0 candle = 0x4750400 ret = CURLE_OK option = 0x2b859d8bd08c "unknown" #5 0x000000000042b6d7 in fr_connection_spawn (pool=0x4712540, now=1396001482) at /users/admwpnch/freeradius-server-3.0.2/src/main/connection.c:369 this = 0x474fad0 conn = 0x19e7 #6 0x000000000042c9ac in fr_connection_get (pool=0x4712540) at /users/admwpnch/freeradius-server-3.0.2/src/main/connection.c:979 now = 1396001482 this = 0x0 next = 0x30ab921301 #7 0x00002b859d8b8041 in mod_authorize (instance=0x4711280, request=0x474f440) at /users/admwpnch/freeradius-server-3.0.2/src/modules/rlm_rest/rlm_rest.c:260 inst = 0x4711280 section = 0x4711298 handle = 0x0 hcode = 0 rcode = 2 ret = 0 #8 0x00000000004222a0 in call_modsingle (component=RLM_COMPONENT_AUTZ, sp=0x47370b0, request=0x474f440) at /users/admwpnch/freeradius-server-3.0.2/src/main/modcall.c:313 myresult = 74674352 blocked = 0 #9 0x0000000000422a5a in modcall_recurse (request=0x474f440, component=RLM_COMPONENT_AUTZ, depth=1, entry=0x7fffb53e3268) at /users/admwpnch/freeradius-server-3.0.2/src/main/modcall.c:581 sp = 0x47370b0 if_taken = false was_if = false c = 0x47370b0 priority = -1 result = RLM_MODULE_UNKNOWN #10 0x0000000000422465 in modcall_child (request=0x474f440, component=RLM_COMPONENT_AUTZ, depth=1, entry=0x7fffb53e3250, c=0x47370b0, result=0x7fffb53e3138) at /users/admwpnch/freeradius-server-3.0.2/src/main/modcall.c:415 next = 0x7fffb53e3268 #11 0x0000000000423876 in modcall_recurse (request=0x474f440, component=RLM_COMPONENT_AUTZ, depth=0, entry=0x7fffb53e3250) at /users/admwpnch/freeradius-server-3.0.2/src/main/modcall.c:791 g = 0x4737220 if_taken = false was_if = false c = 0x4737220 priority = -1 result = RLM_MODULE_UNKNOWN #12 0x0000000000424619 in modcall (component=RLM_COMPONENT_AUTZ, c=0x4737220, request=0x474f440) at /users/admwpnch/freeradius-server-3.0.2/src/main/modcall.c:1051 stack = {{result = RLM_MODULE_NOTFOUND, priority = 0, unwind = 0, c = 0x4737220}, {result = RLM_MODULE_NOTFOUND, priority = 0, unwind = 0, c = 0x47370b0}, {result = RLM_MODULE_REJECT, priority = 0, unwind = -1679288720, c = 0x1}, {result = 24, priority = 0, unwind = 1787453062, c = 0x30ab408f64}, {result = RLM_MODULE_REJECT, priority = 0, unwind = -1254214944, c = 0x6a8a5e86}, { result = 3040752752, priority = 32767, unwind = -1254214520, c = 0x2b859b1ce648}, {result = RLM_MODULE_REJECT, priority = 0, unwind = 0, c = 0x2b859b1ccda8}, {result = 4212979, priority = 0, unwind = -1692597632, c = 0x402b18}, {result = RLM_MODULE_REJECT, priority = 1, unwind = 279, c = 0x0}, {result = 2602353504, priority = 11141, unwind = -1254214464, c = 0x7fffb53e3470}, {result = 1787453062, priority = 0, unwind = -1254214520, c = 0x0}, {result = 2873135458, priority = 48, unwind = 0, c = 0x0}, {result = RLM_MODULE_FAIL, priority = 32767, unwind = 0, c = 0x7fff00000001}, {result = 3040753169, priority = 32767, unwind = -1254214127, c = 0x0}, { result = 3040754191, priority = 32767, unwind = -1254214127, c = 0x1b53e3a0f}, {result = RLM_MODULE_REJECT, priority = 0, unwind = -1692613792, c = 0x7fffb53e34f0}, {result = 2602352640, priority = 11141, unwind = 4212979, c = 0x8f9de354}, { result = 2873134948, priority = 48, unwind = 0, c = 0x0}, {result = 2409489236, priority = 0, unwind = -1254214224, c = 0x0}, { result = RLM_MODULE_REJECT, priority = 0, unwind = 0, c = 0x0}, {result = 2602511423, priority = 11141, unwind = -1690327357, c = 0x30adc18f60}, {result = 3040758436, priority = 32767, unwind = -1254214320, c = 0x2b859b1e9252}, {result = 2602471845, priority = 11141, unwind = 4518920, c = 0x474f440}, {result = RLM_MODULE_FAIL, priority = 16, unwind = 32, c = 0x7fffb53e3560}, { result = 3040752800, priority = 32767, unwind = 6699384, c = 0x0}, {result = 3040755984, priority = 32767, unwind = 0, c = 0x0}, { result = 4516871, priority = 0, unwind = 74391488, c = 0x1}, {result = RLM_MODULE_REJECT, priority = 0, unwind = -1254214384, c = 0xc935aecc9b842ceb}, {result = 2602369136, priority = 11141, unwind = -1254208860, c = 0x7fffb53e35a0}, {result = 2873174018, priority = 48, unwind = 0, c = 0x44f408}, {result = 74773568, priority = 0, unwind = 1, c = 0x10}, {result = 4516871, priority = 0, unwind = 74391488, c = 0x2b859b1cc000}} #13 0x000000000041fe4e in indexed_modcall (comp=RLM_COMPONENT_AUTZ, idx=0, request=0x474f440) at /users/admwpnch/freeradius-server-3.0.2/src/main/modules.c:781 rcode = RLM_MODULE_OK list = 0x4737220 server = 0x4736fd0 #14 0x0000000000421bb6 in process_authorize (autz_type=0, request=0x474f440) at /users/admwpnch/freeradius-server-3.0.2/src/main/modules.c:1779 No locals. #15 0x000000000040cc23 in rad_authenticate (request=0x474f440) at /users/admwpnch/freeradius-server-3.0.2/src/main/auth.c:413 check_item = 0x0 module_msg = 0x474f800 tmp = 0x0 result = 0 autz_retry = 0 '\000' autz_type = 0 #16 0x00000000004325c0 in request_running (request=0x474f440, action=1) at /users/admwpnch/freeradius-server-3.0.2/src/main/process.c:1344 __FUNCTION__ = "request_running" #17 0x0000000000431785 in request_queue_or_run (request=0x474f440, process=0x4324e1 <request_running>) at /users/admwpnch/freeradius-server-3.0.2/src/main/process.c:924 No locals. #18 0x0000000000432c5a in request_receive (listener=0x474cea0, packet=0x474f2a0, client=0x474d840, fun=0x40ca64 <rad_authenticate>) at /users/admwpnch/freeradius-server-3.0.2/src/main/process.c:1542 count = 0 packet_p = 0x0 request = 0x474f440 now = {tv_sec = 1396001482, tv_usec = 988786} sock = 0x474cfd0 last_complained = 0 #19 0x000000000041420b in auth_socket_recv (listener=0x474cea0) at /users/admwpnch/freeradius-server-3.0.2/src/main/listen.c:1532 rcode = 49 code = 1 src_port = 24561 packet = 0x474f2a0 fun = 0x40ca64 <rad_authenticate> client = 0x474d840 src_ipaddr = {af = 2, ipaddr = {ip4addr = {s_addr = 93143818}, ip6addr = {in6_u = { u6_addr8 = "\nC\215\005N\263?\233\205+\000\000\000\000\000", u6_addr16 = {17162, 1421, 45902, 39743, 11141, 0, 0, 0}, u6_addr32 = { 93143818, 2604643150, 11141, 0}}}}, scope = 0} #20 0x00000000004382fb in event_socket_handler (xel=0x4737380, fd=3, ctx=0x474cea0) at /users/admwpnch/freeradius-server-3.0.2/src/main/process.c:3675 listener = 0x474cea0 #21 0x00002b859b421a6a in fr_event_loop (el=0x4737380) at /users/admwpnch/freeradius-server-3.0.2/src/lib/event.c:491 ef = 0x47373b8 i = 0 rcode = 1 maxfd = 5 when = {tv_sec = 0, tv_usec = 0} wake = 0x0 read_fds = {fds_bits = {8, 0 <repeats 15 times>}} master_fds = {fds_bits = {56, 0 <repeats 15 times>}} #22 0x0000000000439920 in radius_event_process () at /users/admwpnch/freeradius-server-3.0.2/src/main/process.c:4543 No locals. #23 0x0000000000427a74 in main (argc=2, argv=0x7fffb53e4118) at /users/admwpnch/freeradius-server-3.0.2/src/main/radiusd.c:545 rcode = 0 status = 0 argval = -1 spawn_flag = false dont_fork = true write_pid = false flag = 0 from_child = {-1, -1} devnull = 3 A debugging session is active. Inferior 1 [process 6631] will be detached. Quit anyway? (y or n) [answered Y; input not from terminal] Panic action exited with 0 _EXIT CALLED /users/admwpnch/freeradius-server-3.0.2/src/lib/debug.c[283]: 1: This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
On 28 Mar 2014, at 10:24, Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> wrote:
Hello,
I'm trying to use rlm_rest module, with no luck so far. I have a segmentation fault when it needs to add a connection to the pool. Any idea what the issue could be ?
Yeah, you've commented out connect_uri! Bad user, bad! I'll push a fix. You can just change: if (!*inst->connect_uri) { ERROR("rlm_rest (%s): Skipping pre-connect, connect_uri not specified", inst->xlat_name); return candle; } in rest.c: if (!inst->connect_uri) { ERROR("rlm_rest (%s): Skipping pre-connect, connect_uri not specified", inst->xlat_name); return candle; } Or as a work around, just set the connect URI to any URL on the server you're using, that's the recommended configuration anyway, as it means there's no add latency establishing the TCP connection the first time a handle is used to service a request. Thanks for the bug report. Note: Before 3.0.3 (unreleased) rlm_rest is marked as an unstable module. It was the large bit chunk of C code I wrote, and although the code organisation and general style is ok, corner cases aren't always dealt with gracefully. When it was written, it involved changes to the FreeRADIUS core API to support new features, and unfortunately that API changed considerably between the time the module was written and FreeRADIUS 3.0.0 being released. That's part of the reason why there have been quite a few issues with it. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
Woops. Yes I did comment out "connect_uri" :) (in my defense, the configuration example said I could) Thanks for the quick update. I've noticed that the module is not in the "stable" list, but it's fine. For the moment I'm just messing around to see if it can fulfill my needs. If it can reach a stable point soon, even better! Regards, Nicolas.
-----Message d'origine----- De : freeradius-users- bounces+nicolas.chaigneau=capgemini.com@lists.freeradius.org [mailto:freeradius-users- bounces+nicolas.chaigneau=capgemini.com@lists.freeradius.org] De la part de Arran Cudbard-Bell Envoyé : vendredi 28 mars 2014 12:08 À : FreeRadius users mailing list Objet : Re: 3.0.2 / rlm_rest - segmentation fault when "Opening additional connection"
On 28 Mar 2014, at 10:24, Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> wrote:
Hello,
I'm trying to use rlm_rest module, with no luck so far. I have a segmentation fault when it needs to add a connection to the pool. Any idea what the issue could be ?
Yeah, you've commented out connect_uri! Bad user, bad!
I'll push a fix.
You can just change:
if (!*inst->connect_uri) { ERROR("rlm_rest (%s): Skipping pre-connect, connect_uri not specified", inst->xlat_name); return candle; }
in rest.c: if (!inst->connect_uri) { ERROR("rlm_rest (%s): Skipping pre-connect, connect_uri not specified", inst->xlat_name); return candle; }
Or as a work around, just set the connect URI to any URL on the server you're using, that's the recommended configuration anyway, as it means there's no add latency establishing the TCP connection the first time a handle is used to service a request.
Thanks for the bug report.
Note: Before 3.0.3 (unreleased) rlm_rest is marked as an unstable module.
It was the large bit chunk of C code I wrote, and although the code organisation and general style is ok, corner cases aren't always dealt with gracefully.
When it was written, it involved changes to the FreeRADIUS core API to support new features, and unfortunately that API changed considerably between the time the module was written and FreeRADIUS 3.0.0 being released. That's part of the reason why there have been quite a few issues with it.
-Arran
Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
Me again ! The rlm_rest module now works, but... it doesn't support xml response :'( Any plan to add this in the future ? Regards, Nicolas. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
On 28 Mar 2014, at 14:13, Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> wrote:
Me again !
The rlm_rest module now works, but... it doesn't support xml response :'(
Any plan to add this in the future ?
I guess we could add something... Anyone know any advantages to using libxml2 over expat or vice versa? Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
On 03/28/2014 10:36 AM, Arran Cudbard-Bell wrote:
Anyone know any advantages to using libxml2 over expat or vice versa?
In the projects I've been involved with we use libxml2. It's powerful, robust, well supported and widely used. It's support for xpath and namespaces are essential features in many projects. -- John
On 28/03/14 15:00, John Dennis wrote:
On 03/28/2014 10:36 AM, Arran Cudbard-Bell wrote:
Anyone know any advantages to using libxml2 over expat or vice versa?
In the projects I've been involved with we use libxml2. It's powerful, robust, well supported and widely used. It's support for xpath and namespaces are essential features in many projects.
+1 - the xpath stuff (normally accessed via lxml in my case) is first-rate in libxml2.
On 28 Mar 2014, at 13:18, Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> wrote:
Woops. Yes I did comment out "connect_uri" :)
(in my defense, the configuration example said I could)
I know :/
Thanks for the quick update.
No problem.
I've noticed that the module is not in the "stable" list, but it's fine. For the moment I'm just messing around to see if it can fulfill my needs.
Sure.
If it can reach a stable point soon, even better!
I've wrapped it as a debian module and marked it stable for 3.0.3, as the initial interest in using seems to be quite high. I had three or four people contact me off list about it before 3.0.0 was released, and people are submitting bug reports for it now. -Arran
It was the large bit chunk of C code I wrote, and although the code
*the first Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
participants (8)
-
A.L.M.Buxey@lboro.ac.uk -
Alan DeKok -
Arran Cudbard-Bell -
Chaigneau, Nicolas -
Cornelius Kölbel -
John Dennis -
Phil Mayers -
Thomas Glanzmann