trying to use Post-Auth-Type REJECT to insert users
Hi, The high level goal is to have a new radius server "slurp" all the users on a DSL ATM aggregation link into a SQL database. We are taking over a bunch of users from a defunct ISP and don't have the UserName / Password data. What I'm thinking is that there should be a way to have Post-Auth-Type REJECT do two SQL insert commands. Then when the user tries to auth again there will be a valid user. Will this work ?? How to have two SQL statements run when this event is triggered??? Is there a better way ?? mucho thanks.;
The high level goal is to have a new radius server "slurp" all the users on a DSL ATM aggregation link into a SQL database. We are taking over a bunch of users from a defunct ISP and don't have the UserName / Password data.
What I'm thinking is that there should be a way to have Post-Auth-Type REJECT do two SQL insert commands. Then when the user tries to auth again there will be a valid user.
Will this work ??
Only for PAP requests. They will have both username and clear text password in them. It won't work with any other authentication method.
How to have two SQL statements run when this event is triggered???
See man unlang.
Is there a better way ??
Don't they have a backup of their user database on a tape/DVD? Ivan Kalik Kalik Informatika ISP
On Sun, Mar 15, 2009 at 4:35 PM, <tnt@kalik.net> wrote:
Is there a better way ??
Don't they have a backup of their user database on a tape/DVD?
Unlikely. We had a similar situation once (also with DSL ATM), and the only user data we got was usernames and encrypted (with some unknown encryption) passwords. We ended up doing it the hard way, full migration (which involves giving out new usernames and passwords).
Hi, Their isnt' a backup..... So I'm having problems with: postauth_query = "INSERT INTO ${authcheck_table} VALUES (NULL,'%{User-Name}','Password', '==', '%{User-Password:-Chap-Password}');" postauth_query = "INSERT INTO ${usergroup_table} values ('%{User-Name}','Dynamic','');" I want BOTH SQL statements to insert data. At present the first INSERT runs, but the second one doesn't. I cant seem to sort out how to do in unlang. help ?? thanks 2009/3/15 Fajar A. Nugraha <fajar@fajar.net>:
On Sun, Mar 15, 2009 at 4:35 PM, <tnt@kalik.net> wrote:
Is there a better way ??
Don't they have a backup of their user database on a tape/DVD?
Unlikely. We had a similar situation once (also with DSL ATM), and the only user data we got was usernames and encrypted (with some unknown encryption) passwords. We ended up doing it the hard way, full migration (which involves giving out new usernames and passwords). - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dave Sinclair wrote:
Hi,
Their isnt' a backup.....
So I'm having problems with:
postauth_query = "INSERT INTO ${authcheck_table} VALUES (NULL,'%{User-Name}','Password', '==', '%{User-Password:-Chap-Password}');" postauth_query = "INSERT INTO ${usergroup_table} values ('%{User-Name}','Dynamic','');"
I want BOTH SQL statements to insert data. At present the first INSERT runs, but the second one doesn't. I cant seem to sort out how to do in unlang.
help ?? thanks It's possible in the current GIT stable branch, i.e. you can use rlm_sql xlat to do insert queries and it'll expand to the number of rows inserted, or a null string ('') on error. You could also theoretically wrap the two statements together as a transaction (depending on what DB you were using).
Arran -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAknFHTsACgkQcaklux5oVKJvvQCcDmVMvdQsFX1uPg95ZsjEjiKH IasAn1wEDiAPHTi79MNkMTuzGS7hN2pA =usyd -----END PGP SIGNATURE-----
participants (4)
-
Arran Cudbard-Bell -
Dave Sinclair -
Fajar A. Nugraha -
tnt@kalik.net