Re: perl and additional response attributes

2005-11-07 Thread Emil Wilmanski
Thx...
Ver. 1.19 of rlm_perl working fine.

Why radius 1.0.5 tag is so old (r 1.13) for rlm_perl?


Dnia 06-11-2005, nie o godzinie 17:09 +0200, Boyan Jordanov napisał(a):
> On Saturday 05 November 2005 20:42, Emil Wilmanski wrote:
> > I'm testing freeradius 1.0.5. I want to add some additional attributes
> > to Access-Accept response using rlm_perl module but when I put perl into
> > "post-auth" block, when I start server it says:
> >
> > radiusd.conf: "perl" modules aren't allowed in 'post-auth' sections --
> > they have no such method.
> 
> Grab rlm_perl version 1.19 from CVS and use it instead of rlm_perl that comes 
> with 1.0.5
> 


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


perl and additional response attributes

2005-11-05 Thread Emil Wilmanski
Hi,
I'm testing freeradius 1.0.5. I want to add some additional attributes
to Access-Accept response using rlm_perl module but when I put perl into
"post-auth" block, when I start server it says:

radiusd.conf: "perl" modules aren't allowed in 'post-auth' sections --
they have no such method.

In freeradius 1.0.2 it is working...

How to add additional parameters using some code? (without "radreply")
--
Emilus.

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


post-auth and perl module

2005-10-24 Thread Emil Wilmanski

Hello,

I'm using freeradius 1.0.2 where I have implemented some methods using 
perl module.

I have implemented: post_auth, start_accounting, stop_accounting.
The post_auth method I use to set some additional parameters for user 
fe.: ChilliSpot-Max-Total-Octets, Session-Timeout, 
WISPr-Bandwidth-Max-Up, WISPr-Bandwidth-Max-Down.


I want to upgrade freeradius to 1.0.5 but when I start radius server it 
say that prel module is not allowed in post-auth.

So how to set some additional prameters to response to client?
Why you remove perl function from post-auth?

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


rlm_perl and perl modules

2005-04-23 Thread Emil Wilmanski
Hi,

I'm still fighting with rlm_perl module. I try CVS version and still I
have the same problem to use Perl libs.

But now I try compile freeradius on Debian with 
--with-threads=no

And I still have problem to use libs but now I don't have "relocation
error" but "Naruszenie ochrony pamięci" (memory access violation). And I
still can't use perl modules in my program :)




> > from your next mail i see that rlm_perl is linked against
> > libperl.so.5.8 So infact you are using different libs and that's why
you
> > have a rellocation problems. Maybe you have more that one perl on
your
> > system ?

> Hmmm... I din't install perl from src... it is instaled only from
> package so it is only one.  (I hope :) )
> libperl.so.5.8.4 and libperl.so.5.8 are symlinks to libperl.so
> so is the same libperl for 5.8 and 5.8.4


> Maybe there are problem with paths to libs? Freeradius use standard
> paths nut Debian use it's own diffrent paths...??
--
EW

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


Re: reached maximum clones 33 cannot grow

2005-04-23 Thread Emil Wilmanski
> Use rlm_perl from cvs. There was a bug in xlat which cause rlm_perl not to
> release an interpeter on exit from perl_xlat, and this way after few
> calls all will be marked as busy. 
> 

Good to read this... I was thinking that it is problem with my
enveroment.

--
EW

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


Re: rlm_perl and perl modules

2005-04-21 Thread Emil Wilmanski
Dnia 21-04-2005, czw o godzinie 10:57 +0300, Boian Jordanov napisał(a):
> Ok you can see that your perl come with libperl.so.5.8.4 and i guess
> that DBI.so is linked against this libperl.so.5.8.4
> 

# ldd /usr/lib/perl5/auto/DBI/DBI.so 
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e8f000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x8000)

If I use right command to test if DBI is linked with libperl so it is
not... I have install DBI 1.48 from src and 

# ldd /usr/local/lib/perl/5.8.4/auto/DBI/DBI.so
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e8f000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x8000)

Is the same.

> from your next mail i see that rlm_perl is linked against
> libperl.so.5.8 So infact you are using different libs and that's why you
> have a rellocation problems. Maybe you have more that one perl on your
> system ?

Hmmm... I din't install perl from src... it is instaled only from
package so it is only one.  (I hope :) )
libperl.so.5.8.4 and libperl.so.5.8 are symlinks to libperl.so
so is the same libperl for 5.8 and 5.8.4


Maybe there are problem with paths to libs? Freeradius use standard
paths nut Debian use it's own diffrent paths...??


-- 
Emil Wilmanski <[EMAIL PROTECTED]>
Galeria-M


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


Re: rlm_perl and perl modules

2005-04-20 Thread Emil Wilmanski
> Check against which libperl is linked rlm_perl

 ldd rlm_perl-1.0.2.so 
libperl.so.5.8 => /usr/lib/libperl.so.5.8 (0xb7ec3000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7ebf000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7e9d000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d69000)
libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1 (0xb7d3c000)
libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb7d28000)
libresolv.so.2 => /lib/tls/i686/cmov/libresolv.so.2 (0xb7d16000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7d05000)
libcrypto.so.0.9.7 => /usr/lib/i686/cmov/libcrypto.so.0.9.7
(0xb7c06000)
libssl.so.0.9.7 => /usr/lib/i686/cmov/libssl.so.0.9.7 (0xb7bd5000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x8000)


# ldconfig -p | grep libperl.so.5.8
libperl.so.5.8 (libc6) => /usr/lib/libperl.so.5.8
??
--
EW

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


Re: rlm_perl and perl modules

2005-04-20 Thread Emil Wilmanski
> Check output of perl -V, see if it does include "useshrplib=true"? and
> "libperl=libperl.so". 

$perl -V | grep -i useshrplib
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN
-Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr
-Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5
-Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local
-Dsitelib=/usr/local/share/perl/5.8.4
-Dsitearch=/usr/local/lib/perl/5.8.4 -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1
-Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm
-Duseshrplib -Dlibperl=libperl.so.5.8.4 -Dd_dosuid -des'
libc=/lib/libc-2.3.2.so, so=so, useshrplib=true,
libperl=libperl.so.5.8.4

All ok.

> Check output of "perl -MExtUtils::Embed -e ccopts
> -e ldopts" 

 $perl -MExtUtils::Embed -e ccopts -e ldopts
-Wl,-E  -L/usr/local/lib /usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a
-L/usr/lib/perl/5.8/CORE -lperl -ldl -lm -lpthread -lc -lcrypt
 -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64  -I/usr/lib/perl/5.8/CORE 


[EMAIL PROTECTED]:/usr/lib$ ls -l | grep libperl
-rw-r--r--   1 root root  1400854 2005-03-08 11:15 libperl.a
lrwxrwxrwx   1 root root   14 2005-04-16 16:28 libperl.so ->
libperl.so.5.8
lrwxrwxrwx   1 root root   16 2005-04-16 16:28 libperl.so.5.8 ->
libperl.so.5.8.4
-rw-r--r--   1 root root  1150824 2005-03-08 11:15 libperl.so.5.8.4

> Check against which libperl is linked rlm_perl
> 

Hmmm. how to test it??

--
EW


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


Re: rlm_perl and perl modules

2005-04-19 Thread Emil Wilmanski
> I don't know about "any", must normally they *should* work.
> For example, I use the following:
> use strict;
> use DBI;

Hmmm... I need DBI to work :)

> 
> Write a normal perl script that uses the module's functions and see if that
> works.
> 

All of normal scripts work perfect with any module... Only radius say
that have problem with libs. I don't know why.maybe somebody have any
idea... Maybe perl 5.8.4 is not for this, or I have to compile
freeradius with some other flags. I just use dpkg-buildpackage. 
Any idea? Maybe wrong path to libs? (how to set it?)

Thanx for any help.

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


Re: rlm_perl and perl modules

2005-04-19 Thread Emil Wilmanski
Dnia 19-04-2005, wto o godzinie 11:03 +0200, Emil Wilmanski napisał(a):

> Can I use any perl modules in rlm_perl script?

I don't know what the problem is... noone of perl modules dos work... 

Can't load '/usr/local/lib/perl/5.8.4/auto/Data/Dumper/Dumper.so' for
module
Data::Dumper: /usr/local/lib/perl/5.8.4/auto/Data/Dumper/Dumper.so:
undefined symbol: Perl_sv_cmp at /usr/lib/perl/5.8/XSLoader.pm line 68.
 at /usr/local/lib/perl/5.8.4/Data/Dumper.pm line 27

I have sth wrong with perl libs ?
It is problem with my system?

-- 
EW


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


reached maximum clones 33 cannot grow

2005-04-19 Thread Emil Wilmanski
Problem like this:

radius_xlat: Running registered xlat function of module perl for string
'getAuthTableName %u'
reached maximum clones 33 cannot grow
radius_xlat:  'SELECT id,UserName,Attribute,Value,op FROM  WHERE
Username = 'test2' ORDER BY id'
rlm_sql (sql): Reserving sql socket id: 1
rlm_sql_mysql: query:  SELECT id,UserName,Attribute,Value,op FROM  WHERE
Username = 'test2' ORDER BY id
rlm_sql_mysql: MYSQL check_error: 1064 received
rlm_sql_getvpdata: database query error
rlm_sql (sql): SQL query error; rejecting user
rlm_sql (sql): Released sql socket id: 1
  modcall[authorize]: module "sql" returns fail for request 22
modcall: group authorize returns fail for request 22

I use:
authcheck_table = "%{perl:getAuthTableName %u}"

it just return table name based on UserName:

if($action eq "getAuthTableName"){
return $config{'macchecktable'} if $a =~ /^\w\w-\w\w-\w\w-\w
\w-\w\w-\w\w/;
return $config{'userchecktable'};
}

-- 
EW


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


rlm_perl and perl modules

2005-04-19 Thread Emil Wilmanski
Hi,

Can I use any perl modules in rlm_perl script?
I try to use DBI and I get 

freeradius: relocation error: /usr/lib/perl5/auto/DBI/DBI.so: undefined
symbol: Perl_Gthr_key_ptr

I try to use Socket and I get

freeradius: relocation error: /usr/lib/perl/5.8/auto/Socket/Socket.so:
undefined symbol: Perl_Tstack_sp_ptr

I'm using Debian with perl 5.8.4 
DBI 1.46 (but I tested with newest end older)

---


> > Ok... I use rlm_perl module:
> > 
> > sql_user_name = "%{perl:/etc/freeradius/scripts/UserRealName}"
> 
>   Huh?  I have no idea what you think you're doing here.
> 
> > but I have new problem... I try to use Mysql perl module...
> > 
> > use Mysql;
> 
>   Why is your perl script doing SQL stuff?
> 
>   Alan DeKok.
> 

I use chillispot feature to login users by his mac. So I have diffrent
radmaccheck which have UserName, MacAddresWithClientId, ClientPassword.
So user can log automaticaly (when hi start chilli try to log user)
using radmaccheck table or hi can login normaly by his username and
password using radcheck table. BUT... if he login automatic or by
user/password it is the same user... so every logs in tables (accounting
and so...) are made using his login. So UserRealName script test if
login is mac or not. If it is mac, script return real username to log
all data as this user. Second script choos table to auth user.
So I need use database connection in script to get user real name from
table. 
Now I'm using exec to run scripts (PHP and shell) (PHP is faster than
Perl for short scripts like this)
But running scripts every time is slow (chilli get sometimes timeout
waiting for radius response). So I'm looking for better method to do
this staff.

-- 
EW


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


Radius in demon mode problem.

2005-04-19 Thread Emil Wilmanski
Hi,

When I start radius with
freeradius -X 
everythin working ok. But when I run freeradius in demon mode (from
Debian startup scripts) it can't authorize anybody. 

==> radius.log <==
Tue Apr 19 10:38:48 2005 : Info: Using deprecated naslist file.  Support
for this will go away soon.
Tue Apr 19 10:38:48 2005 : Info: rlm_exec: Wait=yes but no output
defined. Did you mean output=none?
Tue Apr 19 10:38:48 2005 : Info: rlm_sql (sql): Driver rlm_sql_mysql
(module rlm_sql_mysql) loaded and linked
Tue Apr 19 10:38:48 2005 : Info: rlm_sql (sql): Attempting to connect to
[EMAIL PROTECTED]:/radius
Tue Apr 19 10:38:48 2005 : Info: rlm_sql_mysql: Starting connect to
MySQL server for #0
Tue Apr 19 10:38:48 2005 : Info: rlm_sql_mysql: Starting connect to
MySQL server for #1
Tue Apr 19 10:38:48 2005 : Info: Ready to process requests.
Tue Apr 19 10:39:04 2005 : Error: Discarding duplicate request from
client ln_nas01:32979 - ID: 244 due   to unfinished
request 0
Tue Apr 19 10:39:04 2005 : Info: Detach perl 0x81fefe8
Tue Apr 19 10:39:04 2005 : rlm_perl: rlm_perl::Detaching. Reloading.
Done.
Tue Apr 19 10:39:04 2005 : Info: detach at 0x81fefe8 returned status 0
Tue Apr 19 10:39:04 2005 : Info: Detach perl 0x8237590
Tue Apr 19 10:39:04 2005 : rlm_perl: rlm_perl::Detaching. Reloading.
Done.
Tue Apr 19 10:39:04 2005 : Info: detach at 0x8237590 returned status 0
Tue Apr 19 10:39:04 2005 : Info: Detach perl 0x826f548
Tue Apr 19 10:39:04 2005 : rlm_perl: rlm_perl::Detaching. Reloading.
Done.
Tue Apr 19 10:39:04 2005 : Info: detach at 0x826f548 returned status 0
Tue Apr 19 10:39:04 2005 : Info: Detach perl 0x82a7590
Tue Apr 19 10:39:04 2005 : rlm_perl: rlm_perl::Detaching. Reloading.
Done.
Tue Apr 19 10:39:04 2005 : Info: detach at 0x82a7590 returned status 0
Tue Apr 19 10:39:04 2005 : Info: Detach perl 0x81ba658

It is sth. with rlm_perl but in -X mode works OK...

-- 
EW


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


Re: Radius performance

2005-04-15 Thread Emil Wilmanski
> Emil Wilmanski <[EMAIL PROTECTED]> wrote:
> > Ok... I use rlm_perl module:
> > 
> > sql_user_name = "%{perl:/etc/freeradius/scripts/UserRealName}"
> 
>   Huh?  I have no idea what you think you're doing here.
> 
> > but I have new problem... I try to use Mysql perl module...
> > 
> > use Mysql;
> 
>   Why is your perl script doing SQL stuff?
> 
>   Alan DeKok.
> 

I use chillispot feature to login users by his mac. So I have diffrent
radmaccheck which have UserName, MacAddresWithClientId, ClientPassword.
So user can log automaticaly (when hi start chilli try to log user)
using radmaccheck table or hi can login normaly by his username and
password using radcheck table. BUT... if he login automatic or by
user/password it is the same user... so every logs in tables (accounting
and so...) are made using his login. So UserRealName script test if
login is mac or not. If it is mac, script return real username to log
all data as this user. Second script choos table to auth user.
So I need use database connection in script to get user real name from
table. 
Now I'm using exec to run scripts (PHP and shell) (PHP is faster than
Perl for short scripts like this)
But running scripts every time is slow (chilli get sometimes timeout
waiting for radius response). So I'm looking for better method to do
this staff.

--
EW


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


Re: Radius performance

2005-04-15 Thread Emil Wilmanski

> > It is possible tu run this scripts as biuldin like "rlm_perl", to
> just
> > run some method... not run it every time?
> 
>   If it's a Perl script, 

Ok... I use rlm_perl module:

sql_user_name = "%{perl:/etc/freeradius/scripts/UserRealName}"

but I have new problem... I try to use Mysql perl module...

use Mysql;

and get this.

freeradius: relocation error: /usr/lib/perl5/auto/DBI/DBI.so: undefined
symbol: Perl_Gthr_key_ptr

I use Debian with
libdbi-perl1.46-6  
perl   5.8.4-6

Maybe there is any Mysql connection to use in scripts?
How to use db data in perl scripts?
Maybe I have to use other version of modules to compatibility?

--
EW

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


Radius performance

2005-04-15 Thread Emil Wilmanski
I'm runing freeradius 1.0.2 (on Debian) with chillispot 1.0rc3 (on
WRT54G) and I have some performance question.

To help authorize users I use my own scripts with sql module:
1) to set sql_user_name (it map username from database table)
sql_user_name = "%{exec:/etc/freeradius/scripts/UserRealName}"
2) to choose auth table.
authcheck_table = "%{exec:/etc/freeradius/scripts/AuthTable}"

Time to run every script from command line is about 0.5s (my comp is
slow), sometime more... So radius every time run this scripts wait in
it.
It is possible tu run this scripts as biuldin like "rlm_perl", to just
run some method... not run it every time?
If I make scripts in PHP it is possible to use pconnect?

How to optimize it?

-- 
EW


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


Re: WLAN auth problem

2005-04-12 Thread Emil Wilmanski
I have that problem...
Now I set MACAUTH feature in chillispot and auth my clients using MAC
but I dont know what about WPA sequrity in this feature... I just
haven't test it yet.

Dnia 12-04-2005, wto o godzinie 03:26 -0700, silvia troselj napisał(a):
> Hi,
> 
> I have set up hotspot with radius authentication (AP
> connected to freeradius server) and everything works
> fine with clients that connect with wlan cards (PCI od
> PCMCIA).
> Problem is when client connecting with AP in client
> mode. How can such user be authenticated with
> freeradius?
> 
> Thanks,
> Troky
> 
> 
> 
>   
> __ 
> Do you Yahoo!? 
> Make Yahoo! your home page 
> http://www.yahoo.com/r/hs
> 
> - 
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
> 
-- 
EW


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


Re: freeradius problem

2005-04-07 Thread Emil Wilmanski
> rlm_sql (sql): Attempting to connect to [EMAIL PROTECTED]:/radius
> rlm_sql (sql): starting 0
> rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
> rlm_sql_mysql: Starting connect to MySQL server for #0
> rlm_sql_mysql: Couldn't connect socket to MySQL server
> [EMAIL PROTECTED]:radius
> rlm_sql_mysql: Mysql error 'Can't connect to local MySQL server
> through socket '/var/lib/mysql/mysql.sock' (13)'
> rlm_sql (sql): Failed to connect DB handle #0
> rlm_sql (sql): starting 1
> rlm_sql (sql): starting 2
> rlm_sql (sql): starting 3
> rlm_sql (sql): starting 4
> rlm_sql (sql): Failed to connect to any SQL server.
> Module: Instantiated sql (sql) 
>  
> when i am trying to run : mysql -uroot -hlocalhost  radius  it's
> working fine.
>  
> what can be a problem and where to configure that.

1) look into my.cnf (mysql config) find socket...
Is the same path??
what about "skip-networking"?? is ON?? if is off you can try connect on
ip address.
2) show mysql config in sql.conf


-- 
EW


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


Re: How to replace username in request

2005-04-05 Thread Emil Wilmanski
> So how can I replace User-Name (MAC) with mapped User-Name from my table
> (fe. usermap) before authenticate process (execute some program who do
> it)??

I make it like this:
in sql.conf

sql_user_name = "%{exec:/etc/freeradius/scripts/myscript.pl}"

the script return the real name of user... and it reslove my problem...
If there is a better solution of the problem please reply.

-- 
EW


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


How to replace username in request

2005-04-05 Thread Emil Wilmanski
Hi...
I'm using chillispot with freeradius 1.0.2.
Freeradius working great!!
Chilli have feature to login users using his mac address. I want to use
this feature to authenticate my users but I want to use his real
username to authenticate.
So how can I replace User-Name (MAC) with mapped User-Name from my table
(fe. usermap) before authenticate process (execute some program who do
it)??
It is possible?

-- 
EW



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