Alan DeKok wrote:
> Bjorn Nordbo <[EMAIL PROTECTED]> wrote:
> > Now, this is progress! When I include all the neccesary libraries by
> > exporting the LIBS variable set to "-lldap -llber -lsocket -lrt -lnsl
> > -lresolv -lssl -lcrypto" it compiles. Note that I use OpenSSL and
> > libx509 seems to be included in libssl.
>
> I don't know why it wouldn't work in the 'configure' script. That
> already checks for -lssl -lresolv, etc.
>
> Can you look at the 'config.log' file from a failed configure
> attempt, and see *where* it's failing to link to the libraries?
I'll try to find out why it failed tomorrow; but as I have spendt a few
hours today learning gdb (a suprisingly pleasant experience btw), I have
can answer your other question:
> > FreeRADIUS start fine, connects to the server and handles a request
> > just fine, before it dumps core:
>
> Hmm.. can you run gdb? See 'doc/BUGS'
>
> That looks like a simple bug to fix.
Heres part of my debugging session:
Breakpoint 1, call_modsingle (component=1, sp=0x178868, request=0x17b118,
default_result=6) at modcall.c:202
202 int myresult = default_result;
(gdb) c
Continuing.
modcall[authorize]: module "files" returns notfound
Breakpoint 1, call_modsingle (component=1, sp=0x178dd8, request=0x17b118,
default_result=6) at modcall.c:202
202 int myresult = default_result;
(gdb) s
204 safe_lock(sp->modinst);
(gdb) n
205 myresult = sp->modinst->entry->module->methods[component](
(gdb) print request->packet
$1 = (RADIUS_PACKET *) 0x17b058
(gdb) s
ldap_authorize (instance=0x126dc8, request=0x17b118) at rlm_ldap.c:764
764 LDAPMessage *result = NULL;
(gdb) print request->packet
$2 = (RADIUS_PACKET *) 0x0
(gdb) c
Continuing.
rlm_ldap: - authorize
rlm_ldap: performing user authorization for xxxxxxxx
radius_xlat: '(uid=pr-test-1)'
radius_xlat: 'ou=plus-users,dc=telenor,dc=net'
ldap_get_conn: Got Id: 0
rlm_ldap: attempting LDAP reconnection
rlm_ldap: (re)connect to localhost:1389:389, authentication 0
rlm_ldap: bind as ou=plus-users,dc=telenor,dc=net/xxxxxxxx
rlm_ldap: waiting for bind result ...
rlm_ldap: performing search in ou=plus-users,dc=telenor,dc=net, with filter
(uid=pr-test-1)
rlm_ldap: object not found or got ambiguous search result
rlm_ldap: search failed
Program received signal SIGSEGV, Segmentation fault.
0xdec50 in pairadd (first=0x38, add=0x17c1a0) at valuepair.c:128
128 if (*first == NULL) {
(gdb) bt
#0 0xdec50 in pairadd (first=0x38, add=0x17c1a0) at valuepair.c:128
#1 0xfef5319c in ldap_authorize (instance=0x126dc8, request=0x17b118)
at rlm_ldap.c:827
#2 0x37e04 in call_modsingle (component=1, sp=0x178dd8, request=0x17b118,
default_result=6) at modcall.c:205
#3 0x380fc in modcall (component=1, c=0x178dd8, request=0x17b118)
at modcall.c:288
#4 0x37e84 in call_modgroup (component=1, g=0x178828, request=0x17b118,
default_result=6) at modcall.c:227
#5 0x38084 in modcall (component=1, c=0x178828, request=0x17b118)
at modcall.c:281
#6 0x3724c in indexed_modcall (comp=1, idx=0, request=0x17b118)
at modules.c:456
#7 0x37784 in module_authorize (autz_type=0, request=0x17b118)
at modules.c:633
#8 0x31ba0 in rad_authenticate (request=0x17b118) at auth.c:518
#9 0x29ac4 in rad_respond (request=0x17b118, fun=0x318fc <rad_authenticate>)
at radiusd.c:1524
#10 0x294dc in rad_process (request=0x17b118, dospawn=0) at radiusd.c:1272
#11 0x28efc in main (argc=2, argv=0xffbefb1c) at radiusd.c:1069
(gdb)
As you can see; the problem is that request->packet is set to null after
the call to ldap_authorize(). I can't see why this happens, but it causes
FreeRADIUS to dump in pairadd() later on. request points to the same
address both before an after the call to ldap_authorize().
I have compiled FreeRADIUS w/o optimalization and given --enable-developer
before running it through gdb.
--
We tend to meet any new situation by reorganising; and a wonderful method
it can be for creating the illusion of progress while producing confusion,
inefficiency and demoralisation. -- Gaius Petronius, 60 AD
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html