freeradius segmentation fault

2003-02-28 Thread Abel Alejandro
freeradius (running a cvs snapshot of like 1 week) is crashing when
I run it as radiusd -y -z -f or without the -f. But when
I run freeradius as radiusd -X it doesn't crash.

I am using rlm_sql_sybase as my SQL driver for both authorize and
accounting.
The radiusd starts OK, serve a few requests then crashes. Heres a gdb
backtrace.

(gdb) bt
#0  0x281005dc in kill () from /usr/lib/libc_r.so.4
#1  0x2815045d in abort () from /usr/lib/libc_r.so.4
#2  0x2814eeea in _thread_leave_cancellation_point () from
/usr/lib/libc_r.so.4
#3  0x2814fd33 in _thread_leave_cancellation_point () from
/usr/lib/libc_r.so.4
#4  0x281500c1 in free () from /usr/lib/libc_r.so.4
#5  0x2813d9d6 in fclose () from /usr/lib/libc_r.so.4
#6  0x804fd5b in vradlog (lvl=4, fmt=0x28233320 rlm_sql_sybase(sql_query):
Unexpected return value from ct_results()\n%s,
ap=0xbfa85b2c \004K#(ˬ\r\b) at log.c:169
#7  0x804fde4 in radlog (lvl=4, msg=0x28233320 rlm_sql_sybase(sql_query):
Unexpected return value from ct_results()\n%s)
at log.c:216
#8  0x2823249b in sql_query (sqlsocket=0x80da8c0, config=0x80b5400,
querystr=0xbfa86dcc UPDATE r_radacct SET AcctStartTime = '2003-02-28
09:47:06', AcctStartDelay = '45', ConnectInfo_start = '' WHERE AcctSessionId
= '335845320' AND UserName = 'gmorales' AND NASIPAddress = '196.12.179.5'
...) at sql_sybase.c:440
#9  0x2822d8d7 in rlm_sql_query (sqlsocket=0x80da8c0, inst=0x80daaa0,
query=0xbfa86dcc UPDATE r_radacct SET AcctStartTime = '2003-02-28
09:47:06', AcctStartDelay = '45', ConnectInfo_start = '' WHERE AcctSessionId
= '335845320' AND UserName = 'gmorales' AND NASIPAddress = '196.12.179.5'
...) at sql.c:380
#10 0x2822c99b in rlm_sql_accounting (instance=0x80daaa0, request=0x81c6500)
at rlm_sql.c:715
#11 0x8054ca2 in call_modsingle (component=3, sp=0x8120200,
request=0x81c6500, default_result=7) at modcall.c:198
#12 0x8054e10 in modcall (component=3, c=0x8120200, request=0x81c6500) at
modcall.c:304
#13 0x8054cf3 in call_modgroup (component=3, g=0x8120100, request=0x81c6500,
default_result=7) at modcall.c:220
#14 0x8054dc3 in modcall (component=3, c=0x8120100, request=0x81c6500) at
modcall.c:296
#15 0x805441b in indexed_modcall (comp=3, idx=0, request=0x81c6500) at
modules.c:449
#16 0x8054a02 in module_accounting (acct_type=0, request=0x81c6500) at
modules.c:793
#17 0x804f4ad in rad_accounting (request=0x81c6500) at acct.c:69
#18 0x804d20e in rad_respond (request=0x81c6500, fun=0x804f448
rad_accounting) at radiusd.c:1444
#19 0x8056754 in request_handler_thread (arg=0x81209c0) at threads.c:210
#20 0x280da1b4 in _thread_start () from /usr/lib/libc_r.so.4
#21 0x0 in ?? ()
(gdb)


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


freetds driver.

2003-02-23 Thread Abel Alejandro



Hello I got the freetds driver working with the 
current snapshot of freeradius + freetds6.0. I am using MSSQL 2000 to test my 
code.

Use this code with caution, I do not fully 
understand the radius code and it may have severe memory or leaks
or any other errors that may format your hard 
drive.

you can get the code  http://196.12.160.4/~elec/freetds.tgz

Abel Alejandro.


Cannot visit the cvs web for radiusd

2003-01-22 Thread Abel Alejandro

Error: $cvstreedefault points to a repository (local) not defined in
%CVSROOT (edit your configuration file
/web/pages/us.freeradius.org/cvsweb.conf)


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



IPPOOL modified to use SQL...

2002-05-27 Thread Abel Alejandro








If anyone interested, i modified rlm_ippool.c to work
with SQL. This code was made to solve my problem, I needed

Ippool to work (it worked, but wasnt releasing ip
for some reason) and I needed a database that I could access

From the
web. This code will NOT work with other
method for authorize than SQL. If you use another method with this code

The module will NOT release ips from bad username/passwords. Also the sql information is hard coded you will need to edit it.

And the last thing, to avoid running
the STOP multiple times, I hard coded the code to run the STOP on one instance
only.

For example, if you have three
instances called a, b and c, you can edit the code to do the STOP for a only. Otherwise it will run

For the tree of them which is
unnecessary.



http://core.friendspr.com/~elec/rlm_ipsql.c

http://core.friendspr.com/~elec/Makefile.in

http://core.friendspr.com/~elec/configure.in



Abel Alejandro










IPPOOL is not giving all the ip addresses.

2002-05-22 Thread Abel Alejandro

IPPOOL seems that it cannot give all the ip addresses on the range,
it starts giving addresses but if there are 50 ip's it only gives 10.

FreeBSD 4.5-STABLE running Freeradius from of 19/05/02 (cvs).

ippool arecibo {
session-db = ${dbdir}/arecibo.db
ip-index = ${dbdir}/arecibo-ip.db
range-start = 196.12.182.65
range-stop = 196.12.182.121
netmask = 255.255.255.192
cache-size = 1024
}

That is the configuration for the ippool, it runs fine, it assigns addresses
and everything looks okay.
However looking it in debug mode, I see a not very normal behaviour. It
start giving the address
on random sequences for example, instead of first assign 196.12.182.65 it
give 196.12.182.73 (first time, with virgin db).

I modified rlm_ippool.c to be a little more verbose, and on the creation of
the database it does create
the ip address list in order. Like this:

Adding IP 196.12.182.65 state 0
Adding IP 196.12.182.66 state 0
Adding IP 196.12.182.67 state 0
Adding IP 196.12.182.68 state 0

Until it reaches 196.12.182.121 (which is correct.)

In the other hand when looking for ip address (virgin db, all ip are suposed
to be state 0)
it search them in random order.  Like this:

rlm_ippool: Searching for an entry for nas/port: 10.50.2.1/3328
Found IP 196.12.182.114 state 1
Found IP 196.12.182.82 state 0

It started with 114 then jumped back to 82.


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



RE: IPPOOL is not giving all the ip addresses.

2002-05-22 Thread Abel Alejandro



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Kostas
Kalevras
Sent: Wednesday, May 22, 2002 9:06 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: IPPOOL is not giving all the ip addresses.

On Wed, 22 May 2002, Abel Alejandro wrote:

 IPPOOL seems that it cannot give all the ip addresses on the range,
 it starts giving addresses but if there are 50 ip's it only gives 10.

Hmm, from what i tested right now it will give out all the ips.

Okay one more thing I got now from the logs. Right now I have rm -rf the
db*
And restarted radiusd, a (cmd: cat radius.log | grep = Stop | wc -l)
reports 66 stop's, but I don't see a rlm_ippool: Deallocated entry for
ip/port: not even one in the radius.log

It seems radiusd can not deallocate ip's?


***
***
Scanned by an email protection software that checks: Content, Attachments, Security 
and Viruses
Brought to you by ICENetworks.com, eScan and MailScan
***
***

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



RE: IPPOOL is not giving all the ip addresses.

2002-05-22 Thread Abel Alejandro



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Kostas
Kalevras
Sent: Wednesday, May 22, 2002 9:31 AM
To: [EMAIL PROTECTED]
Subject: RE: IPPOOL is not giving all the ip addresses.

On Wed, 22 May 2002, Abel Alejandro wrote:

 Okay one more thing I got now from the logs. Right now I have rm -rf
the
 db*
 And restarted radiusd, a (cmd: cat radius.log | grep = Stop | wc
-l)
 reports 66 stop's, but I don't see a rlm_ippool: Deallocated entry
for
 ip/port: not even one in the radius.log

 It seems radiusd can not deallocate ip's?

That is a debugging message and it will not normally show up in the
radius.log

Forgot to mention, I am running radiusd -X  radius.log

***
***
Scanned by an email protection software that checks: Content, Attachments, Security 
and Viruses
Brought to you by ICENetworks.com, eScan and MailScan
***
***

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



RE: IPPOOL is not giving all the ip addresses.

2002-05-22 Thread Abel Alejandro



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Kostas
Kalevras
Sent: Wednesday, May 22, 2002 9:41 AM
To: [EMAIL PROTECTED]
Subject: RE: IPPOOL is not giving all the ip addresses.

On Wed, 22 May 2002, Abel Alejandro wrote:

 Forgot to mention, I am running radiusd -X  radius.log

Stupid question. Is the ippool module listed in the accounting section
in
radiusd.conf?
The accounting packet should be an accounting stop for a nas/port
combination
that has an allocated ip assigned to it.

Yes its. The ippool module is called 'arecibo' and its in both authorize
and accounting. 

For example, when I started radiusd this morning the first IP to be
assigned was 196.12.182.73. Then radiusd got the Acct-Status-Type = Stop
for 196.12.182.73 and it said modcall[accounting]: module arecibo
returns ok
But no deallocationg was done.


***
***
Scanned by an email protection software that checks: Content, Attachments, Security 
and Viruses
Brought to you by ICENetworks.com, eScan and MailScan
***
***

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