Re: rlm_perl bug

2003-07-16 Thread Manuel Sousa
On Wed, 2003-07-16 at 09:45, Boian Jordanov wrote:
> On _ 2003-07-01 at 20:20, Manuel Sousa wrote:
> > Hi all,
> > 
> > I just tried the latest CVS (couple of hours ago) version and found a
> > bug when using 2 instances of the module.
> 
> There is a patch against latest CVS that should fix it. Enjoy. 

First of all thanks for your work,

I've applied the patch (against pre3 and it went in ok), but i still
have the same problem. Bellow i send some logs.

Another thing i've come upon is that i wanted to change the
request->simul_count from within the perl script (using a perl script in
the session phase) and wonder if it is possible. For now i did a crude
patch to modules.c where if i return USERLOCK it considers the case
where it there are already more users logged in than there should.

I'm willing to test others scripts/patches so if you want to you may
either send me a email or to the list and i'll try it.

Again thanks,
Manuel Sousa

=LOG=
(both have func_accounting = accounting)
Using perl at 0x81162a0
rlm_perl: rlm_perl:: PERL2
  modcall[accounting]: module "perl1" returns ok
radius_xlat:  'night'

( perl1 => func_accounting = accounting ; perl2 => func_accounting =
accounting2 )
Using perl at 0x81162a0
rlm_perl: perl_embed:: module = /servicos/freeradius/sbin/perl1.pl ,
func = accounting exit status= Global symbol "$stdin" requires explicit
package name. Global symbol "$stdout" requires explicit package name.
Global symbol "$stderr" requires explicit package name. Undefined
subroutine &main::accounting called.
  modcall[accounting]: module "perl1" returns reject
modcall: group group returns reject
Using perl at 0x8120288
rlm_perl: rlm_perl:: PERL2
  modcall[accounting]: module "perl2" returns ok

=END LOG=

=SCRIPT=
perl1
sub accounting{
&radiusd::radlog(1,"rlm_perl:: PERL1");
return RLM_MODULE_OK;
}

perl2
sub accounting{ # Later sub accounting2
&radiusd::radlog(1,"rlm_perl:: PERL2");
return RLM_MODULE_OK;
}
=END SCRIPT=



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


Re: User Survey - Which DB backend do you use?

2003-07-14 Thread Manuel Sousa
Hi,

> I would like to take a quick straw poll.
> 
> a) If you use a Database backend for FreeRadius which one do you use?

MySQL

Manuel Sousa



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


rlm_perl bug

2003-07-01 Thread Manuel Sousa
Hi all,

I just tried the latest CVS (couple of hours ago) version and found a
bug when using 2 instances of the module.
I noticed that using 2 different instances the perl code of second
instance replaces the code of the first instance, i give a couple of
examples bellow to show the results i got.

Thanks,
Manuel Sousa

=RADIUSD.CONF=
modules {
...
perl perl1{
module = ${sbindir}/perl1.pl
func_accounting = accounting
func_authentication = authenticate
func_preacct = preacct
func_checksimul = checksimul
func_xlat = xlat
}


perl perl2{
module = ${sbindir}/perl2.pl
func_accounting = accounting
func_authentication = authenticate
func_preacct = preacct
func_checksimul = checksimul
func_xlat = xlat
}
...
}
accounting {
acct_unique
redundant{
group{
perl1{
fail = return
notfound = 1
noop = 2
ok   = 3
updated  = 4
reject   = return   # useful for the
examples bellow
userlock = 6
invalid  = 7
handled  = 8
}
primarysqlserver{
fail = return
notfound = 1
noop = 2
ok   = 3
updated  = 4
reject   = 5
userlock = 6
invalid  = 7
handled  = 8
}
fail  = 1
notfound = return
noop  = 2
ok  = return
updated = 3
reject = 7  # for the examples 2 
userlock = 4
invalid = 5
handled = 6
}
perl2
}
}
=END RADIUSD.CONF=
=SCRIPTS=
perl1
sub accounting{
radiusd::radlog(1,"rlm_perl:: PERL1");
return RLM_MODULE_FAIL;
}   

perl2
sub accounting{
&radiusd::radlog(1,"rlm_perl:: PERL2");
return RLM_MODULE_OK;
}
=END SCRIPTS=
=LOGS=
with 1st version of both scripts and radiusd.conf

perl1 script should have printed PERL1 and returned failed
>...
>rlm_perl: rlm_perl:: PERL2
>  modcall[accounting]: module "perl1" returns ok
>...

Changing perl2 function to accounting2 both in radiusd.conf and script
the results are:

>rlm_perl: perl_embed:: module = /servicos/freeradius-cvs/sbin/perl1.pl
, func = accounting exit status= Undefined subroutine &main::accounting
>called.
>  modcall[accounting]: module "perl1" returns reject
>modcall: group group returns reject
>rlm_perl: rlm_perl:: PERL2
>  modcall[accounting]: module "perl2" returns ok

Note that the perl1 script still has the accounting sub, but perl2
doesn't have it, and in my opinion all of perl1 code was replaced by
perl2.

Finaly i defined functions accounting and accounting2 on perl1 script,
and replaced on module perl2 : module = ${sbindir}/perl2.pl => module =
${sbindir}/perl1.pl.
This way it works as perl1.pl has both the functions and perl1 module
perl code is replaced by module perl2 perl code which is the same.
It's a crude way to get it working, but if some1 else got the same
problems i did might help while a the bug isn't fixed.

>modcall: entering group group
>rlm_perl: rlm_perl:: PERL1
>  modcall[accounting]: module "perl1" returns fail
>modcall: group group returns fail
>rlm_perl: rlm_perl:: PERL2
>  modcall[accounting]: module "perl2" returns ok
>modcall: group redundant returns ok
=END LOGS=


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


Re: 802.1x client

2003-06-30 Thread Manuel Sousa
Hi,

I use xsupplicant (http://www.open1x.org/), hope it helps

Manuel Sousa

On Mon, 2003-06-30 at 10:56, [EMAIL PROTECTED] wrote:
> Hello everybody
> I am searching a 802.1x client and i just found the AEGIS client but it is very
> slow too authenticate
> So if somebody have a client for me, i would be gratefull
> Thanks
> 
> 
> -
> This mail sent through IMP: http://horde.org/imp/
> 
> - 
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


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


Using primary and secondary databse and rlm_sqlcounter

2003-06-27 Thread Manuel Sousa
Hi all,

I'm trying to use 2 different MySQL databases so that in the case of
the primary failing there's a secondary database in order to do the
authentication.
This setup is working if i don't use rlm_sqlcounter to check if the
users already used their time.
I tried doing the same thing (group) for rlm_sqlcounter, but it seems
rlm_sqlcounter succeeds when it doesn't manage to connect to the
database. It seems to me that it considers the sql error as if it
returned that the user hasn't still used any time.
Wonder if any1 managed to get a similar setup to work or as any ideas,
bellow i send the radiusd.conf part and partial log.

Thanks in advance,
Manuel Sousa

>From : http://www.frontios.com/freeradius.html
  group {
sql2 {
  fail  = 1
  notfound = return
  noop  = 2
  ok  = return
  updated = 3
  reject = return
  userlock = 4
  invalid = 5
  handled = 6
}
sql {
  fail  = 1
  notfound = return
  noop  = 2
  ok  = return
  updated = 3
  reject = return
  userlock = 4
  invalid = 5
  handled = 6
}
  }

Part of the Log:

rlm_sqlcounter: Entering module authorize code
sqlcounter_expand:  'SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='%{User-Name}''
radius_xlat:  'SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='z57''
sqlcounter_expand:  '%{sql2:SELECT SUM(AcctSessionTime) FROM radacct
WHERE UserName='z57'}'
radius_xlat: Running registered xlat function of module sql2 for string
'SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='z57''
rlm_sql (sql2): - sql_xlat
radius_xlat:  'SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='z57''
rlm_sql (sql2): Ignoring unconnected handle
rlm_sql (sql2): There are no DB handles to use!
radius_xlat:  ''
rlm_sqlcounter: (Check item - counter) is greater than zero
rlm_sqlcounter: Authorized user z57, check_item=600, counter=0
rlm_sqlcounter: Sent Reply-Item for user z57, Type=Session-Timeout,
value=600
  modcall[authorize]: module "noresetcounter2" returns ok
modcall: group group returns ok



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


Re: rlm_acct_unique possible bug

2003-06-17 Thread Manuel Sousa
Really didn't notice that, happened couple of times, wonder why pppd
sends 2 acct-starts and sometimes with different session IDs.
Sorry to report this as it ain't a bug then, and thanks for the fast
reply.

Manuel Sousa


On Tue, 2003-06-17 at 14:54, Chris Parker wrote:
> At 02:24 PM 6/17/2003 +0100, Manuel Sousa wrote:
> >Hi, all
> >
> >I've been using freeradius and noticed that sometimes the
> >Acct-Unique-Session-ID gave me different values for the same inputs.
> >A partial output of radiusd -X is:
> >
> >rlm_acct_unique: Hashing 'Acct-Session-Id = "3EEF21621014",User-Name =
> >"noc"'
> >rlm_acct_unique: Acct-Unique-Session-ID = "889e46aba4217ad4".
> >
> >rlm_acct_unique: Hashing 'Acct-Session-Id = "3EEF21631014",User-Name =
> >"noc"'
> >rlm_acct_unique: Acct-Unique-Session-ID = "6836c775ae8a6c48".
> >
> >Wonder if anyone else experienced the same problem. I'm using
> >freeradius-0.8.1.
> 
> Look closer at the Acct-Session-Id, particulary the 8th position.  Your
> first line has a '2', your second line has a '3'.  They are not the same,
> hence the hash result is not the same.
> 
> -Chris
> --
> \\\|||///  \  StarNet Inc.  \ Chris Parker
> \ ~   ~ /   \   WX *is* Wireless!\   Director, Engineering
> | @   @ |\   http://www.starnetwx.net \  (847) 963-0116
> oOo---(_)---oOo--\--
>\ Wholesale Internet Services - http://www.megapop.net
> 
> 
> 
> - 
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


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


rlm_acct_unique possible bug

2003-06-17 Thread Manuel Sousa
Hi, all

I've been using freeradius and noticed that sometimes the
Acct-Unique-Session-ID gave me different values for the same inputs.
A partial output of radiusd -X is:

rlm_acct_unique: Hashing 'Acct-Session-Id = "3EEF21621014",User-Name =
"noc"'
rlm_acct_unique: Acct-Unique-Session-ID = "889e46aba4217ad4".

rlm_acct_unique: Hashing 'Acct-Session-Id = "3EEF21631014",User-Name =
"noc"'
rlm_acct_unique: Acct-Unique-Session-ID = "6836c775ae8a6c48".

Wonder if anyone else experienced the same problem. I'm using
freeradius-0.8.1.

Thanks in advance,
Manuel Sousa


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