Re: rlm_perl problems]

2009-07-30 Thread Igor Smitran
Garber, Neal wrote:
 Igor: I hope you weren't offended by my assumption - I wasn't sure, based 
 upon your comment, and I was just trying to help.  If I offended you, I 
 apologize.  By the way, out of curiosity, did the patch work for you on 2.1.7 
 also?
   
Don't worry, i wasn't offended at all.
No need to apologize. I am often misunderstood because english is not my
native language.
I will try to patch 2.1.7 during weekend on my test server.  2.1.6 that
i have problems with is on my production server. Recently i wanted to
put some extra scripts into it and that's when i ran into rlm_perl problems.
Beside rlm_problem server was working just fine. When it crashed because
of rlm_perl i made a workaround by using one perl instance and defining
different functions.
Anyway, i will let you know about my 2.1.7 installation on saturday or
sunday.

Igor
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-29 Thread Igor Smitran


Ivan Kalik wrote:
 Why? Alan is not the only developer. Read the copyright for rlm_perl code.
I know that Boian is responsible for making our life easier :) I was
asking if this patch is going to be included in next release. That is
the comment i was expecting. Sorry for misunderstanding.

Igor
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-29 Thread Igor Smitran
Garber, Neal wrote:
 The error is in rlm_perl and appears related to thread data management, not 
 the O/S and not perl (I run FreeBSD and you run CentOS; we even have 
 different versions of perl).  Boian can explain the change far better than I 
 can; but, my interpretation of the change is that the thread specific data 
 key is now created upon perl module instantiation and stored with the 
 instance data (so there's now a separate key for each perl instance we 
 defined in FreeRadius).  (Perhaps someone will correct me if I interpreted it 
 incorrectly.)

 When you say you're not good in C, if you are mean you are unsure how to 
 apply the patch, try this:

 1. Put the .diff file in the directory with rlm_perl.c (src/modules/rlm_perl 
 is the directory).  
 2. Then use the patch command to update rlm_perl.c (it creates 
 rlm_perl.c.orig as a backup and updates rlm_perl.c): 
   patch rlm_perl.c rlm_perl.diff
 3. Rebuild/install FreeRadius from source
 4. Test
 5. Say thank you to Boian (and Ivan as he helped also)..
   
I know how to patch. I was just trying to find out what was the error.
That's the part i was thinking of when i said not good in C :)
You are right, i forgot to say thank you to all. :)
Thank you Ivan, thank you Boian.

Igor
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-29 Thread Boian Jordanov


On Jul 29, 2009, at 9:32 AM, Igor Smitran wrote:


 know that Boian is responsible for making our life easier :) I was
asking if this patch is going to be included in next release. That is
the comment i was expecting. Sorry for misunderstanding.


Sure I will pull the changes back to repository. 
-

List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: rlm_perl problems]

2009-07-29 Thread Garber, Neal
 I know how to patch. I was just trying to find out what was the error.

Igor: I hope you weren't offended by my assumption - I wasn't sure, based upon 
your comment, and I was just trying to help.  If I offended you, I apologize.  
By the way, out of curiosity, did the patch work for you on 2.1.7 also?

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-28 Thread Igor Smitran
Boian Jordanov wrote:

 On Jul 26, 2009, at 12:59 AM, si...@blic.net si...@blic.net wrote:

 Igor wrote:

 I have tried 2.1.7 and got same error. I will try to compile it with
 --enable-developer and see if i can find out anything from gdb output.
 I realy don't know why would this happen because exactly the same
 setup worked on
 older releases. All i did was to compile the new version (2.1.6) and
 then copy
 old raddb dir.

 I am not sure why i got so many no debugging symbols found but i
 did per
 doc/bugs instructions.
 This is gdb output:

 Try attached patch.

I didn't try it yet and i am not very good in C. Error that I and Neal
had is something regarding OS or...? I don't see anyone else having this
problem except me and Neal.
Also, i didn't see any comment from Alan. If this is something that was
already been discussed here i am sorry for bringing it up again, but i
would realy like to hear Alan about this.
Boian, would you like to explain what was the cause of this error?

Thank you,
Igor
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-28 Thread Ivan Kalik
 I didn't try it yet and i am not very good in C. Error that I and Neal
 had is something regarding OS or...? I don't see anyone else having this
 problem except me and Neal.
 Also, i didn't see any comment from Alan. If this is something that was
 already been discussed here i am sorry for bringing it up again, but i
 would realy like to hear Alan about this.

Why? Alan is not the only developer. Read the copyright for rlm_perl code.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: rlm_perl problems]

2009-07-28 Thread Garber, Neal
 I didn't try it yet and i am not very good in C. Error that I and Neal
 had is something regarding OS or...? I don't see anyone else having this
 problem except me and Neal.

The error is in rlm_perl and appears related to thread data management, not the 
O/S and not perl (I run FreeBSD and you run CentOS; we even have different 
versions of perl).  Boian can explain the change far better than I can; but, my 
interpretation of the change is that the thread specific data key is now 
created upon perl module instantiation and stored with the instance data (so 
there's now a separate key for each perl instance we defined in FreeRadius).  
(Perhaps someone will correct me if I interpreted it incorrectly.)

When you say you're not good in C, if you are mean you are unsure how to apply 
the patch, try this:

1. Put the .diff file in the directory with rlm_perl.c (src/modules/rlm_perl is 
the directory).  
2. Then use the patch command to update rlm_perl.c (it creates rlm_perl.c.orig 
as a backup and updates rlm_perl.c): 
patch rlm_perl.c rlm_perl.diff
3. Rebuild/install FreeRadius from source
4. Test
5. Say thank you to Boian (and Ivan as he helped also)..

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-27 Thread Boian Jordanov


On Jul 26, 2009, at 12:59 AM, si...@blic.net si...@blic.net wrote:


Igor wrote:


I have tried 2.1.7 and got same error. I will try to compile it with
--enable-developer and see if i can find out anything from gdb  
output.
I realy don't know why would this happen because exactly the same  
setup worked on
older releases. All i did was to compile the new version (2.1.6)  
and then copy

old raddb dir.


I am not sure why i got so many no debugging symbols found but i  
did per

doc/bugs instructions.
This is gdb output:


Try attached patch.



rlm_perl.diff.gz
Description: GNU Zip compressed data



Best Regards,
Boian Jordanov
RD Expert
Orbitel - Next Generation Telecom
tel. +359 2 4004 723
tel. +359 2 4004 002





-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

RE: rlm_perl problems]

2009-07-27 Thread Garber, Neal
Boian,

SUCCESS!  Thank you , thank you, thank you!  I applied the patch to my test 
2.1.6 system and it eliminated the Seg Fault and all of the strange behaviour.  
My perl scripts now function as they do in Production.  I am extremely grateful 
for the time you spent debugging this issue and creating a patch in such a 
timely manner.

I hope Igor experiences a similar euphoria..

Thanks again..

-Original Message-
From: freeradius-users-bounces+neal.garber=energyeast@lists.freeradius.org 
[mailto:freeradius-users-bounces+neal.garber=energyeast@lists.freeradius.org]
 On Behalf Of Boian Jordanov
Sent: Monday, July 27, 2009 10:09 AM
To: si...@blic.net; FreeRadius users mailing list
Cc: Boian Jordanov
Subject: Re: rlm_perl problems]


On Jul 26, 2009, at 12:59 AM, si...@blic.net si...@blic.net wrote:

 Igor wrote:

 I have tried 2.1.7 and got same error. I will try to compile it with
 --enable-developer and see if i can find out anything from gdb  
 output.
 I realy don't know why would this happen because exactly the same  
 setup worked on
 older releases. All i did was to compile the new version (2.1.6)  
 and then copy
 old raddb dir.

 I am not sure why i got so many no debugging symbols found but i  
 did per
 doc/bugs instructions.
 This is gdb output:

Try attached patch.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: rlm_perl problems]

2009-07-25 Thread sigor


On Sat, 25 Jul 2009 00:01 , 'Garber, Neal' neal.gar...@energyeast.com sent:

Igor: Can you rebuild FR and look at the output of rlm_perl on
your system to see if you see similar errors?

I will setup testing 2.1.6 freeradius and try the same configuration on it.

After that i will setup 2.1.7pre and try it again. Since it is a weekend i am 
not
sure how soon is that going to be.

I will post the results of my testing after i am done.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: rlm_perl problems]

2009-07-25 Thread sigor


On Sat, 25 Jul 2009 12:26:42 , si...@blic.net sent:



On Sat, 25 Jul 2009 00:01 , 'Garber, Neal' neal.gar...@energyeast.com sent:

Igor: Can you rebuild FR and look at the output of rlm_perl on
your system to see if you see similar errors?


I have tried 2.1.7 and got same error. I will try to compile it with
--enable-developer and see if i can find out anything from gdb output.
I realy don't know why would this happen because exactly the same setup worked 
on
older releases. All i did was to compile the new version (2.1.6) and then copy
old raddb dir.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: rlm_perl problems]

2009-07-25 Thread sigor
Igor wrote:

I have tried 2.1.7 and got same error. I will try to compile it with
--enable-developer and see if i can find out anything from gdb output.
I realy don't know why would this happen because exactly the same setup worked 
on
older releases. All i did was to compile the new version (2.1.6) and then copy
old raddb dir.

I am not sure why i got so many no debugging symbols found but i did per
doc/bugs instructions.
This is gdb output:

gdb radiusd
GNU gdb Fedora (6.8-27.el5)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as i386-redhat-linux-gnu...
(no debugging symbols found)
(gdb) set logging file gdb-radiusd.log
(gdb) set logging on
Copying output to gdb-radiusd.log.
(gdb) set args -X -x -n radiusd_dialup -l /var/log/radius/dialup/radius.log
(gdb) run
Starting program: /usr/local/freeradius/sbin/radiusd -X -x -n radiusd_dialup -l
/var/log/radius/dialup/radius.log
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0xb7fe0ad0 (LWP 11159)]
GOT CLONE -1208087856 0x9c56290

Program received signal SIGSEGV, Segmentation fault.
0x0041a0f5 in rlmperl_call (instance=0x9a0d5e0, request=0x9cad318,
function_name=0x9a07258 authorize) at rlm_perl.c:708
708 exitstatus = POPi;
(gdb) info threads
* 1 Thread 0xb7fe0ad0 (LWP 11159)  0x0041a0f5 in rlmperl_call
(instance=0x9a0d5e0, request=0x9cad318, function_name=0x9a07258 authorize) at
rlm_perl.c:708
(gdb) thread apply all bt full

Thread 1 (Thread 0xb7fe0ad0 (LWP 11159)):
#0  0x0041a0f5 in rlmperl_call (instance=0x9a0d5e0, request=0x9cad318,
function_name=0x9a07258 authorize) at rlm_perl.c:708
sp = (SV **) 0x9cc8088
vp = value optimized out
exitstatus = 0
n_a = 46
rad_reply_hv = (HV *) 0x9cb58a8
rad_check_hv = (HV *) 0x9c88500
rad_config_hv = value optimized out
rad_request_hv = (HV *) 0x9c93e9c
rad_request_proxy_hv = (HV *) 0x9c8bd68
rad_request_proxy_reply_hv = (HV *) 0x9cb58cc
interp = value optimized out
#1  0x08061834 in modcall ()
No symbol table info available.
#2  0x0805e790 in indexed_modcall ()
No symbol table info available.
#3  0x0805ea7c in module_authorize ()
No symbol table info available.
#4  0x0804e37f in rad_authenticate ()
No symbol table info available.
#5  0x0806c5fa in radius_handle_request ()
No symbol table info available.
#6  0x0806450c in thread_pool_addrequest ()
No symbol table info available.
#7  0x08069969 in event_socket_handler ()
No symbol table info available.
#8  0x00154085 in fr_event_loop (el=0x9c528d8) at event.c:400
ef = (fr_event_fd_t *) 0x9c52988
i = 1
rcode = 1
when = {tv_sec = 1248559880, tv_usec = 267216}
wake = value optimized out
read_fds = {fds_bits = {1048576, 0 repeats 31 times}}
#9  0x0806a666 in radius_event_process ()
No symbol table info available.
#10 0x080625d6 in main ()
No symbol table info available.
(gdb)



-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-24 Thread Ivan Kalik
 I am using Freeradius 2.1.6.

 I have a working setup of freeradius with perl scripts inside authorize
 and accounting sections.
 Everything works great when i am using only one script.
 But. if i add another script to do some other stuff for example in
 post-auth section i get errors in log and freeradius dies.

 Error i get is:
 Error: rlm_perl: perl_embed:: module =
 /etc/raddb/config_dialup/perl_script_2.pl , func = post_auth exit
 status= Undefined subroutine main::post_auth called.

Have you defined func_post_auth?

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-24 Thread Igor Smitran
Ivan Kalik wrote:
 Have you defined func_post_auth?

 Ivan Kalik
 Kalik Informatika ISP
   
Left everything by default. Made script by using example.pl as template.
Both scripts are looking exactly the same, except that i don't use
default function names for perl_script_1.

perl perl_script_1 {
module = ${confdir}/config_dialup/perl_script_1.pl
func_authorize = authorize_check_username
func_accounting = accounting_check_username
}

perl perl_script_2 {

module = ${confdir}/config_dialup/perl_script_2.pl
}

This means that perl will use default function names for perl_script_2 and 
different function names for perl_script_1, right? or am i missing something?


Igor
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-24 Thread Ivan Kalik
 Ivan Kalik wrote:
 Have you defined func_post_auth?

 Ivan Kalik
 Kalik Informatika ISP

 Left everything by default. Made script by using example.pl as template.
 Both scripts are looking exactly the same, except that i don't use
 default function names for perl_script_1.

 perl perl_script_1 {
 module = ${confdir}/config_dialup/perl_script_1.pl
 func_authorize = authorize_check_username
 func_accounting = accounting_check_username
 }

 perl perl_script_2 {

 module = ${confdir}/config_dialup/perl_script_2.pl
 }

Is that a no? Neither of these instances you have posted has
func_post_auth defined.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-24 Thread Igor Smitran


Ivan Kalik wrote:
 perl perl_script_1 {
 module = ${confdir}/config_dialup/perl_script_1.pl
 func_authorize = authorize_check_username
 func_accounting = accounting_check_username
 }

 perl perl_script_2 {

 module = ${confdir}/config_dialup/perl_script_2.pl
 }
 

 Is that a no? Neither of these instances you have posted has
 func_post_auth defined.

 Ivan Kalik
 Kalik Informatika ISP

Yes, that is a no. I only defined functions for which i changed names.
Didn't define functions that are left with default name. I did it that
way because in original perl all func_* are commented out.
Here is an example. i was using authorize section for this:
Just tested it. It doesn't work in both cases, with func_authorize
defined and without it.

In authorize section i have put dummy:

authorize {
*
dummy
*
}


in modules/perl:

perl dummy {
module = ${confdir}/scripts/dummy.pl
func_authorize = authorize
}

in dummy.pl:

use strict;
use vars qw(%RAD_REQUEST %RAD_REPLY %RAD_CHECK);
use Data::Dumper;
#my %RAD_REQUEST;
#my %RAD_REPLY;
#my %RAD_CHECK;
use constantRLM_MODULE_REJECT=0;#  /* immediately
reject the request */
use constantRLM_MODULE_FAIL=  1;#  /* module failed,
don't reply */
use constantRLM_MODULE_OK=2;#  /* the module is OK,
continue */
use constantRLM_MODULE_HANDLED=   3;#  /* the module
handled the request, so stop. */
use constantRLM_MODULE_INVALID=   4;#  /* the module
considers the request invalid. */
use constantRLM_MODULE_USERLOCK=  5;#  /* reject the
request (user is locked out) */
use constantRLM_MODULE_NOTFOUND=  6;#  /* user not found */
use constantRLM_MODULE_NOOP=  7;#  /* module succeeded
without doing anything */
use constantRLM_MODULE_UPDATED=   8;#  /* OK (pairs
modified) */
use constantRLM_MODULE_NUMCODES=  9;#  /* How many return
codes there are */

sub authorize {
radiusd::radlog(0, DUMMY);
return RLM_MODULE_OK;
}


It ends with freeradius crashing. If i disable all other perl calls and
leave only dummy.pl works with no problems. Same goes for other way
around. Basicaly, any combination that involves only one perl script
works without any problems. If i use two perl scripts in any combination
freeradius crashes.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: rlm_perl problems

2009-07-24 Thread Garber, Neal
I've been debating sending a similar message to the list as well.  I am also 
experiencing the same problem with 2.1.6 (undefined subroutines that *clearly* 
exist in the script) and Seg Faults.  I have reinstalled perl and then 
reinstalled FreeRadius to see if I can work around the issue with no success.  

Even the example.pl that comes with FR 2.1.6 fails.  Currently, I have some of 
my scripts disabled to workaround the problem.

-Original Message-
From: freeradius-users-bounces+neal.garber=energyeast@lists.freeradius.org 
[mailto:freeradius-users-bounces+neal.garber=energyeast@lists.freeradius.org]
 On Behalf Of Igor Smitran
Sent: Friday, July 24, 2009 8:30 AM
To: freeradius-users@lists.freeradius.org
Subject: rlm_perl problems]

I am using Freeradius 2.1.6.

I have a working setup of freeradius with perl scripts inside authorize
and accounting sections.
Everything works great when i am using only one script.
But. if i add another script to do some other stuff for example in
post-auth section i get errors in log and freeradius dies.

Error i get is:
Error: rlm_perl: perl_embed:: module =
/etc/raddb/config_dialup/perl_script_2.pl , func = post_auth exit
status= Undefined subroutine main::post_auth called.

My perl setup is like this:

perl perl_script_1 {
module = ${confdir}/config_dialup/perl_script_1.pl
func_authorize = authorize_check_username
func_accounting = accounting_check_username
}

perl perl_script_2 {
module = ${confdir}/config_dialup/perl_script_2.pl
}



If i put everything into one script, like this:


perl perl_script_1 {
module = ${confdir}/config_dialup/perl_script_1.pl
func_authorize = authorize_check_username
func_accounting = accounting_check_username
}

perl perl_script_2 {
module = ${confdir}/config_dialup/perl_script_1.pl
}

then everything is ok. Did any of you had these problems?

Thank you


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-24 Thread Ivan Kalik
 It ends with freeradius crashing. If i disable all other perl calls and
 leave only dummy.pl works with no problems. Same goes for other way
 around. Basicaly, any combination that involves only one perl script
 works without any problems. If i use two perl scripts in any combination
 freeradius crashes.

Let me see if I understand well: you can run multiple perl module
instances as long as they execute same script; if different instances run
different scripts - freeradius crashes!

I will try to emulate this tonight. I haven't tried this scenario. But I
can run perl + radcheck (also perl script, but not called through perl
module) without problems.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: rlm_perl problems]

2009-07-24 Thread Garber, Neal
Here's a small excerpt from debug output I have showing this problem:

Tue Jul 21 09:32:36 2009 : Error: rlm_perl: perl_embed:: module = 
/usr/local/etc/raddb/write_log_data.pl , func = post_auth_reject exit status= 
Undefined subroutine main::post_auth_reject called.
Segmentation fault: 11 (core dumped)

Subroutine post_auth_reject definitely exists in write_log_data.pl and this 
same script/config is working in my Production 2.0.3 and 2.0.5 systems.


-Original Message-
From: freeradius-users-bounces+neal.garber=energyeast@lists.freeradius.org 
[mailto:freeradius-users-bounces+neal.garber=energyeast@lists.freeradius.org]
 On Behalf Of Ivan Kalik
Sent: Friday, July 24, 2009 10:43 AM
To: FreeRadius users mailing list
Subject: Re: rlm_perl problems]

 It ends with freeradius crashing. If i disable all other perl calls and
 leave only dummy.pl works with no problems. Same goes for other way
 around. Basicaly, any combination that involves only one perl script
 works without any problems. If i use two perl scripts in any combination
 freeradius crashes.

Let me see if I understand well: you can run multiple perl module
instances as long as they execute same script; if different instances run
different scripts - freeradius crashes!

I will try to emulate this tonight. I haven't tried this scenario. But I
can run perl + radcheck (also perl script, but not called through perl
module) without problems.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-24 Thread Igor Smitran


Ivan Kalik wrote:
 It ends with freeradius crashing. If i disable all other perl calls and
 leave only dummy.pl works with no problems. Same goes for other way
 around. Basicaly, any combination that involves only one perl script
 works without any problems. If i use two perl scripts in any combination
 freeradius crashes.
 

 Let me see if I understand well: you can run multiple perl module
 instances as long as they execute same script; if different instances run
 different scripts - freeradius crashes!

 I will try to emulate this tonight. I haven't tried this scenario. But I
 can run perl + radcheck (also perl script, but not called through perl
 module) without problems.
Yes, i can define multiple perl instances as long as they call same perl
script. It looks like two different perl scripts cannot coexist in
memory at the same time. Workaround for now is to have one perl script
active and through func_* definitions have different functions called
and do tasks needed, like i stated in one of my examples earlier in this
thread.

P.S. chekrad works for me too, i use it for simultaneous-use. I was
trying to use unlang as much as possible, but there are two tasks left
that i need perl for.


Thank you,
Igor
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: rlm_perl problems]

2009-07-24 Thread Garber, Neal
Igor,

What version of perl and what O/S are you using?  I'm using FreeBSD 7.2 with 
perl 5.8.9.  The reason I hadn't submitted this sooner is I wanted to rule out 
an issue with perl (our Productions servers are running an older version of 
FreeBSD and perl).

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-24 Thread Igor Smitran
Garber, Neal wrote:
 Igor,

 What version of perl and what O/S are you using?  I'm using FreeBSD 7.2 with 
 perl 5.8.9.  The reason I hadn't submitted this sooner is I wanted to rule 
 out an issue with perl (our Productions servers are running an older version 
 of FreeBSD and perl).
perl, v5.8.8 built for x86_64-linux-thread-multi, installed with yum
OS: CentOS X64,  kernel 2.6.18-128.1.10.el5

freeradius installed from rpm,
rpm made with freeradius.spec file:
%define _prefix /usr/local/freeradius
%configure --prefix=%{_prefix} \
--with-system-libtool \
--disable-ltdl-install \
--with-ltdl-lib=/usr/lib \
--with-ltdl-include=/usr/include \
--with-large-files --with-udpfromto --with-edir \
--with-rlm-krb5-include-dir=/usr/kerberos/include \
--with-rlm-krb5-lib-dir=/usr/kerberos/lib \
--with-logdir=/var/log/radius


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl problems]

2009-07-24 Thread Ivan Kalik
 Garber, Neal wrote:
 Igor,

 What version of perl and what O/S are you using?  I'm using FreeBSD 7.2
 with perl 5.8.9.  The reason I hadn't submitted this sooner is I wanted
 to rule out an issue with perl (our Productions servers are running an
 older version of FreeBSD and perl).
 perl, v5.8.8 built for x86_64-linux-thread-multi, installed with yum
 OS: CentOS X64,  kernel 2.6.18-128.1.10.el5

 freeradius installed from rpm,
 rpm made with freeradius.spec file:
 %define _prefix /usr/local/freeradius
 %configure --prefix=%{_prefix} \
 --with-system-libtool \
 --disable-ltdl-install \
 --with-ltdl-lib=/usr/lib \
 --with-ltdl-include=/usr/include \
 --with-large-files --with-udpfromto --with-edir \
 --with-rlm-krb5-include-dir=/usr/kerberos/include \
 --with-rlm-krb5-lib-dir=/usr/kerberos/lib \
 --with-logdir=/var/log/radius

Slackware 12.1, perl 5.8.7.

I am afraid I can't emulate this. test1 and test2 run copies of
example.pl. I have edited them so they are not identical (just in case).
Result:

...
[files] users: Matched entry tnt at line 1
++[files] returns ok
rlm_perl: Added pair User-Name = tnt
rlm_perl: Added pair User-Password = x
rlm_perl: Added pair NAS-Port = 0
rlm_perl: Added pair NAS-IP-Address = 212.200.152.xx
rlm_perl: Added pair Cleartext-Password = x
++[test1] returns ok
++[expiration] returns noop
++[logintime] returns noop
++[pap] returns updated
Found Auth-Type = PAP
+- entering group PAP {...}
[pap] login attempt with password x
[pap] Using clear text password x
[pap] User authenticated successfully
++[pap] returns ok
+- entering group post-auth {...}
rlm_perl: Added pair User-Name = tnt
rlm_perl: Added pair User-Password = x
rlm_perl: Added pair NAS-IP-Address = 212.200.152.xx
rlm_perl: Added pair NAS-Port = 0
rlm_perl: Added pair Cleartext-Password = x
rlm_perl: Added pair Auth-Type = PAP
++[test2] returns ok
++[exec] returns noop
Sending Access-Accept of id 104 to 127.0.0.1 port 37266
Finished request 0.
Going to the next request
Waking up in 4.9 seconds.
Cleaning up request 0 ID 104 with timestamp +5
Ready to process requests.

Two perl instances running different perl scripts! I would suggest
following instructions in doc/bugs to find out what is causing the
segfault.

PS. My test server is running 2.1.7 pre-release
(http://git.freeradius.org/pre/). Try upgrading to that and see if the
problem goes away.

Ivan Kalik
Kalik Informatika ISP

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


RE: rlm_perl problems]

2009-07-24 Thread Garber, Neal
 Two perl instances running different perl scripts! I would suggest
 following instructions in doc/bugs to find out what is causing the
 segfault.

rlm_perl is acting very strangely on my 2.1.6 test system (beyond what 
I've already mentioned).  I have two instances of a script called
write_log_data.pl that are called in post_auth.  One instance is called
write_log_accept (post_auth = post_auth_accept) and the other is
write_log_reject (post_auth = post_auth_reject).  I have another
script called dumplists.pl that is not called in post_auth at all.  
When I was testing (trying to recreate SegFault), post_auth_accept
was calling dumplists.pl (I added subroutines post_auth_accept and
post_auth_reject to dumplists.pl and had them write msgs via
radiusd::radlog).  I changed the message in dumplists.pl 
post_auth_accept and restarted.  Now rlm_perl properly called
script write_log_data.pl sub post_auth_accept - but output an
error that it couldn't find it.  So, it returned reject which
caused an attempt to call write_log_data sub post_auth_reject;
which also output an error saying it couldn't find it (undefined
subroutine as Igor and I described in previous msgs).

So, I took your advice above and rebuilt FR with symbols and ran
Under gdb.  But, I also decided to look back at the build output for rlm_perl.  
I believe the errors below are causing my problems (redundant
declarations coming from /usr/include).  I'm thinking it should be
using the perl version of the definitions as opposed to the version 
in /usr/include.  I'll test this theory..

I can post the FR debug and gdb output if someone thinks the errors
below are normal.

Igor: Can you rebuild FR and look at the output of rlm_perl on
your system to see if you see similar errors?

Here is the output from building rlm_perl on my system:

Making all in rlm_perl...
gmake[6]: Entering directory 
`/usr/ports/net/freeradius2/work/freeradius-server-2.1.6/src/modules/rlm_perl'
/usr/local/bin/libtool --mode=compile cc  -pipe -I/usr/local/include 
-L/usr/local/lib -DLDAP_DEPRECATED -pthread -Wall -D_GNU_SOURCE-g -Wshadow 
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes 
-Wmissing-prototypes -Wmissing-declarations-Wnested-externs -W 
-Wredundant-decls -Wundef 
-I/usr/ports/net/freeradius2/work/freeradius-server-2.1.6/src 
-I/usr/ports/net/freeradi   us2/work/freeradius-server-2.1.6/libltdl `perl 
-MExtUtils::Embed -e ccopts` -c rlm_perl.c
mkdir .libs
 cc -pipe -I/usr/local/include -L/usr/local/lib -DLDAP_DEPRECATED -pthread 
-Wall -D_GNU_SOURCE -g -Wshadow -Wpointer-arith -Wcast-qua   l -Wcast-align 
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations 
-Wnested-externs -W -Wredundant-decls-Wundef 
-I/usr/ports/net/freeradius2/work/freeradius-server-2.1.6/src 
-I/usr/ports/net/freeradius2/work/freeradius-server-2.1.6/liblt   dl 
-DAPPLLIB_EXP=\/usr/local/lib/perl5/5.8.9/BSDPAN\ -DHAS_FPSETMASK 
-DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/   include 
-I/usr/local/lib/perl5/5.8.9/mach/CORE -c rlm_perl.c  -fPIC -DPIC -o 
.libs/rlm_perl.o
In file included from rlm_perl.c:39:
/usr/local/lib/perl5/5.8.9/mach/CORE/perl.h:1207: warning: redundant 
redeclaration of 'strerror'
/usr/include/string.h:83: warning: previous declaration of 'strerror' was here
In file included from rlm_perl.c:39:
/usr/local/lib/perl5/5.8.9/mach/CORE/perl.h:3380: warning: redundant 
redeclaration of 'getuid'
/usr/include/unistd.h:349: warning: previous declaration of 'getuid' was here
/usr/local/lib/perl5/5.8.9/mach/CORE/perl.h:3381: warning: redundant 
redeclaration of 'geteuid'
/usr/include/unistd.h:342: warning: previous declaration of 'geteuid' was here
/usr/local/lib/perl5/5.8.9/mach/CORE/perl.h:3382: warning: redundant 
redeclaration of 'getgid'
/usr/include/unistd.h:343: warning: previous declaration of 'getgid' was here
/usr/local/lib/perl5/5.8.9/mach/CORE/perl.h:3383: warning: redundant 
redeclaration of 'getegid'
/usr/include/unistd.h:341: warning: previous declaration of 'getegid' was here
/usr/local/lib/perl5/5.8.9/mach/CORE/perl.h:3678: warning: redundant 
redeclaration of 'mktemp'
/usr/include/unistd.h:506: warning: previous declaration of 'mktemp' was here
/usr/local/lib/perl5/5.8.9/mach/CORE/perl.h:3680: warning: redundant 
redeclaration of 'atof'
/usr/include/stdlib.h:86: warning: previous declaration of 'atof' was here
In file included from rlm_perl.c:39:
/usr/local/lib/perl5/5.8.9/mach/CORE/perl.h:3771: warning: redundant 
redeclaration of 'crypt'
/usr/include/unistd.h:427: warning: previous declaration of 'crypt' was here
/usr/local/lib/perl5/5.8.9/mach/CORE/perl.h:3777: warning: redundant 
redeclaration of 'getenv'
/usr/include/stdlib.h:95: warning: previous declaration of 'getenv' was here
/usr/local/lib/perl5/5.8.9/mach/CORE/perl.h:3788: warning: redundant 
redeclaration of 'getlogin'
/usr/include/unistd.h:345: warning: previous declaration of 'getlogin' was here
rlm_perl.c: In function