OpenWrt Forum Archive

Topic: Kamikaze 7.09+FreeRADIUS+MySQL=False Reject (+Seg Fault Solution)

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

First to put it into context:
I'm in the process of building a hotspot sytem and have moved across from DD-WRT to OpenWRT/X-WRT, at this point I have X-WRT brcm 2.4 installed but have been configuring via SSH, I have intermediate Linux experience.

The MySQL database is hosted on a remote standard issue web server, I have successfully built an almost identical configuration (including the same remote database) on my Xubuntu x64 (Gutsy) Desktop machine, using radtest I get the correct responses to valid and invalid users.

But using radtest against OpenWRT I get "rad_recv: Access-Reject" it seems to be having issues talking to the database.

radiusd -fX output:

rad_recv: Access-Request packet from host 192.168.1.13:33790, id=57, length=60
        User-Name = "testuser"
        User-Password = "testpass"
        NAS-IP-Address = 255.255.255.255
        NAS-Port = 0
  Processing the authorize section of radiusd.conf
modcall: entering group authorize for request 0
  modcall[authorize]: module "preprocess" returns ok for request 0
    rlm_realm: No '@' in User-Name = "testuser", looking up realm NULL
    rlm_realm: No such realm "NULL"
  modcall[authorize]: module "suffix" returns noop for request 0
radius_xlat:  'testuser'
rlm_sql (sql): sql_set_user escaped user --> 'testuser'
radius_xlat:  'SELECT id, UserName, Attribute, Value, op           FROM radcheck           WHERE Username = 'testuser'           ORDER BY id'
rlm_sql (sql): Reserving sql socket id: 4
rlm_sql: Failed to create the pair: Unknown attribute "Password"
rlm_sql (sql): Error getting data from database
rlm_sql (sql): SQL query error; rejecting user
rlm_sql (sql): Released sql socket id: 4
  modcall[authorize]: module "sql" returns fail for request 0
modcall: leaving group authorize (returns fail) for request 0
There was no response configured: rejecting request 0
Server rejecting request 0.
Finished request 0

It's probably something simple I'm overlooking but I would really appreciate any help at all.

FOR ALL USERS WITH FREERADIUS SEG FAULT ISSUES
* The FreeRADIUS seg fault issue is with a new version of OpenSSL and an old version of FreeRADIUS
* A newer version of FreeRADIUS (1.1.6) can be installed by adding "http://sigil.eecs.harvard.edu/OpenWRT/K … /packages/" to your repository list
* This solved my seg fault issues and no longer requires symlinks
* FreeRADIUS 1.1.6 is much more modular so there will most likely be extra freeradius-mod's to install to achieve your result eg: I had to install freeradius-mod-detail, freeradius-mod-files, freeradius-mod-pap, freeradius-mod-preprocess, freeradius-mod-radutmp, freeradius-mod-realm as well as the usual sql modules

Not sure if the above as a suitable work around or if it's contributing to my problem but it "looks" like it solves the issue.

Thanks,
Jordan.

Hi,

It looks that something strainged with the sql query or the database.

radius_xlat:  'SELECT id, UserName, Attribute, Value, op FROM radcheck WHERE Username = 'testuser' ORDER BY id'

The query selects here no attribute name "Password", but this is needed to create a "pair".

rlm_sql: Failed to create the pair: Unknown attribute "Password"
rlm_sql (sql): Error getting data from database
rlm_sql (sql): SQL query error; rejecting user

I would have a look at the database or in the code of this module.
Try a look in the buglist of this module.

gl
regards
j0inty

Thanks for the rapid reply.

The query is identical to the query used by my working Xubuntu testbed, I've even tried copying the radiusd and slq configs across from my testbed to the router with the same result.

rlm_sql doesn't appear in the buglist at all and none of the other bugs with related (my)sql programs seemed relevant to this issue.

I don't even know where I should start looking to fix this: Failed to create the pair: Unknown attribute "Password"

Any ideas? Anyone??

Thanks,
Jordan.

UPDATE: Seems to be an issue with crypted passwords, I've rebuilt my database with clear text passwords and all is good big_smile

So it would seem the above is a suitable workaround for the FreeRADIUS seg fault issue.

Jordan.

LOL....No crypted or hashed passwords...

That sounds bad. big_smile

But If it work now, every thing is good.
I would use encrypted Client Server Connections for the DB Connections.

Thanks for the tip, at this point the goal is just to get it work, I will add other niceties and complexities later.

Jordan.

For some reason the above repository has since become unavailable, but I managed to find the same files here: http://downloads.openwrt.org/snapshots/ … /packages/

Unfortunatly it's not a repository, so you need to feed the entire URL into ipkg as well as the URL of all dependancy packages, eg:

ipkg install http://downloads.openwrt.org/snapshots/packages-mipsel/packages/freeradius-mod-sql-mysql_1.1.6-1_mipsel.ipk http://downloads.openwrt.org/snapshots/packages-mipsel/packages/freeradius-mod-sql_1.1.6-1_mipsel.ipk and so on.

Other than that all seems to be going well so far.

Jordan.

The discussion might have continued from here.