Just submitted bug #3 ...Did you guys have a problem with bugzilla? Anyway, added a couple little things. The db name is no longer static, can be defined using sql { sql_file = "foo123" } Code checks if the file actually exists instead of dumbly touch'ing one without any content. And added a few more error checks. Anyway. A few questions. I plan on adding a few more features in the module such as supporting the "v2" functions of sqlite. Would that be welcome? Also, how to I make radiusd fail to launch if it's unable to open the database? I'm returning -1 but it still goes ahead and launches. Gabriel Blanchard Network Administrator/Development TekSavvy Solutions Inc. 330 Richmond Street, Suite 205 Chatham, ON, N7M 1P7 T: 519-360-4705 C: 519-437-0564
On 7/14/09 5:19 PM, Gabriel Blanchard wrote:
Just submitted bug #3 ...Did you guys have a problem with bugzilla?
Anyway, added a couple little things.
The db name is no longer static, can be defined using sql { sql_file = "foo123" }
You're already in a sql block, is there a reason to repeat that in the parameter name? (Almost) none of the other sql parameters have. Wichert.
On 14-Jul-09, at 11:22 AM, Wichert Akkerman wrote:
You're already in a sql block, is there a reason to repeat that in the parameter name? (Almost) none of the other sql parameters have.
No this is to define the file name itself of the db for sqlite. In the current version designed by Apple in order to change the name you literally have to recompile Freeradius. -Gabe
Gabriel Blanchard wrote:
No this is to define the file name itself of the db for sqlite. In the current version designed by Apple in order to change the name you literally have to recompile Freeradius.
The question was: In a module called "sql", do you need a configuration parameter "sql_file". Or, could it just be "file"? My $0.02 is that it should be "file". Alan DeKok.
On 14-Jul-09, at 1:25 PM, Alan DeKok wrote:
The question was:
In a module called "sql", do you need a configuration parameter "sql_file". Or, could it just be "file"?
My $0.02 is that it should be "file".
Well it appears that rlm_sql_sqlite definitely works. Although I don't see any reason to use it other than authentication. sqlite> INSERT INTO radreply (username, attribute, op, value) Values ('test@test', 'Password', '==','test'); sqlite> .quit $ echo "User-Name=test@test,Password=test,Framed-Protocol=PPP " | /usr/ local/bin/radclient 127.0.0.1 auth testing123 Received response ID 43, code 2, length = 38 User-Password = "test" Is this change welcome at all? Should I submit a patch? -Gabe
On 14-Jul-09, at 3:06 PM, Gabriel Blanchard wrote:
Well it appears that rlm_sql_sqlite definitely works. Although I don't see any reason to use it other than authentication.
sqlite> INSERT INTO radreply (username, attribute, op, value) Values ('test@test', 'Password', '==','test'); sqlite> .quit
$ echo "User-Name=test@test,Password=test,Framed-Protocol=PPP " | / usr/ local/bin/radclient 127.0.0.1 auth testing123 Received response ID 43, code 2, length = 38 User-Password = "test"
Sorry for being rather noisy today. Fixed up a few stupid mistakes in my syntax and the schema for radreply and radcheck $ sqlite3 sqlite_radcheck.db SQLite version 3.4.0 Enter ".help" for instructions sqlite> CREATE TABLE radcheck ( ...> id integer not null primary key, ...> username varchar(64) NOT NULL default '', ...> attribute varchar(64) NOT NULL default '', ...> op char(2) NOT NULL DEFAULT '=', ...> value varchar(253) NOT NULL default '' ...> ) ; sqlite> CREATE TABLE radreply ( ...> id integer not null primary key, ...> username varchar(64) NOT NULL default '', ...> attribute varchar(64) NOT NULL default '', ...> op char(2) NOT NULL DEFAULT '=', ...> value varchar(253) NOT NULL default '' ...> ) ; sqlite> INSERT INTO radcheck (username, attribute, op, value) Values ('test@test', 'Cleartext-Password', ':=','test'); sqlite> INSERT INTO radreply (username, attribute, op, value) Values ('test@test', 'Framed-IP-Address', '+=','127.0.0.1'); echo "User-Name=test@test,Password=test,Framed-Protocol=PPP " | /usr/ local/bin/radclient 127.0.0.1 auth testing123 Received response ID 54, code 2, length = 26 Framed-IP-Address = 127.0.0.1 [sql] User found in radcheck table [sql] expand: SELECT id, username, attribute, value, op FROM radreply WHERE username = '%{User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radreply WHERE username = 'test@test' ORDER BY id rlm_sql_sqlite: sqlite3_prepare() = 0 rlm_sql_sqlite: sqlite3_step = 100 rlm_sql_sqlite: sqlite3_step = 101 rlm_sql_sqlite: sqlite3_finalize() = 0 rlm_sql (sql): Released sql socket id: 4 ++[sql] returns ok
participants (3)
-
Alan DeKok -
Gabriel Blanchard -
Wichert Akkerman