Re: freeradius and MS SQL -- anyone got it working?

2005-10-04 Thread Duane Cox
Hope this helps.
If you are running freeradius as other than root.root, make sure that this user 
or group can read /etc/odbc/
Also read my previous post.  Adjust to your liking or system...


cd /usr/src 
rm -fr unixODBC-2.2.11
tar -zxvf unixODBC-2.2.11.tar.gz 
cd unixODBC-2.2.11 
sed -i s/void yyerror/#define YY_FLUSH_BUFFER\n\n/ sqp/lex.l 
./configure --prefix=/usr --libexecdir=/usr/sbin --localstatedir=/var 
--sysconfdir=/etc/odbc --enable-ltdllib --with-gnu-ld --disa
ble-gui 
make 
make install 
find doc -name Makefile* -exec rm {} \; 
chmod 644 doc/{lst,ProgrammerManual/Tutorial}/* 
install -v -m755 -d /usr/share/doc/unixODBC-2.2.11 
cp -v -R doc/* /usr/share/doc/unixODBC-2.2.11 
rmdir /etc/odbc/ODBCDataSources 
chown -fR root.odbc /etc/odbc 
chmod 750 /etc/odbc 
chmod 640 /etc/odbc/*

cd /usr/src 
rm -fr freetds-0.63
tar -zxvf freetds-0.63.tar.gz 
cd freetds-0.63 
./configure --prefix=/usr --libexecdir=/usr/sbin --localstatedir=/var 
--sysconfdir=/etc --with-unixodbc=/usr/lib --disable-apps 
make 
make install 
rm -f /etc/{freetds,locales}.conf

cd /usr/src 
rm -fr freeradius-1.0.5 
tar -zxvf freeradius-1.0.5.tar.gz 
cd freeradius-1.0.5 
patch -Np1 -i ../freeradius-1.0.5-stdout_log-1.patch 
./configure --prefix=/usr --libexecdir=/usr/sbin --localstatedir=/var 
--sysconfdir=/etc --with-raddbdir=/srv/radiusd --with-logdir
=/var/log --with-radacctdir=/srv/radiusd/acct --with-gnu-ld 
--without-rlm_x99_token 
make 
make install

cat /etc/odbc.ini
[MSSQL-DB]
description = FreeRADIUS ODBC for MSSQL 7.0
driver  = FreeTDS
server  = mssql.yourdomain.com
port= 1433
database= mydatabase
tds_version = 7.0
language= us_english

cat /etc/odbcinst.ini
[FreeTDS]
description = FreeTDS driver for MSSQL
driver  = /usr/lib/libtdsodbc.so
setup   = /usr/lib/libtdsS.so
fileusage   = 1

cat /srv/radiusd/mssql.conf
sql {
driver = rlm_sql_unixodbc
server = MSSQL-DB

login = mylogin
password = mypassword

radius_db = mydatabase

acct_table1 = radacct
acct_table2 = radacct

authcheck_table = radcheck
authreply_table = radreply
 [SNIP...]


- Original Message - 
From: Erik Ågren [EMAIL PROTECTED]
To: 'FreeRadius users mailing list' freeradius-users@lists.freeradius.org
Sent: Tuesday, October 04, 2005 3:57 AM
Subject: SV: freeradius and MS SQL -- anyone got it working?


 Hi

 If Anyone got this to work, couldn't you give me an example of how its done.
 Including necessary changes in the odbc.ini (and where to put it) and the 
 other files that I have to change.

 I'm trying to connect using iodbc, but when starting up FreeRADIUS I get the 
 following:

 rlm_sql (sql): Driver rlm_sql_iodbc (module rlm_sql_iodbc) loaded and linked 
 rlm_sql (sql): Attempting to connect to @MSSQL:/
rlm_sql (sql): starting 0 rlm_sql (sql): Attempting to connect rlm_sql_iodbc #0
 sql_create_socket: SQLConnectfailed:  [iODBC][Driver Manager]Specified driver 
 could not be loaded rlm_sql (sql): Failed to
connect DB handle #0 rlm_sql (sql): starting 1 rlm_sql (sql): starting 2 
rlm_sql (sql): starting 3 rlm_sql (sql): starting 4
rlm_sql (sql): Failed to connect to any SQL server.

 ***

 rlm_sql (sql): Attempting to connect to @MSSQL:/

 This looks strange, but I just tried to use the DSN name, as suggested. Any 
 suggestion about what to do here?


 Thanx

 /Erik


 -Ursprungligt meddelande-
 Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Arne Götje (???)
 Skickat: den 1 oktober 2005 08:58
 Till: freeradius-users@lists.freeradius.org
 Ämne: Re: freeradius and MS SQL -- anyone got it working?

 On Friday 30 September 2005 21:28, Duane Cox wrote:
  There are a few qwerks with getting FreeRadius to work with MSSQL.

 thought so... :)

  First thing, the FreeTDS files have been removed (more like
  abandonded) from FreeRadius.
  If you really want to call FreeTDS direclty, you will have to download
  the files from the attic.
  But more than that you will also have to update the files as they do
  not currently compile properly, they are a bit old.
  I would suggest to go with unixodbc or iodbc, even though using
  FreeTDS is IMHO the best way, it's not supported.

 oh... ok, then I'll go with unixodbc.

  Second, in order to get MSSQL to work with the current version of
  FreeRadius 1.0.5, you will need to install either unixodbc or iodbc.
  I chose unixodbc; and in doing so it requires FreeTDS.  So install
  both FreeTDS and unixODBC.
 
  Third.  You will need to include mssql.conf and call rlm_sql_unixodbc.
  The mssql.conf has to many tricks to it.  First the default driver is
  invalid and the server is really the DSN and must match that name
  found in /etc/odbc.ini.  Also /etc/odbc.ini must be readable by the
  freeradius daemon.  Also, there is an extra statement in the
  mssql.conf that is totaly not used and can

Re: freeradius and MS SQL -- anyone got it working?

2005-10-04 Thread Alan DeKok
Duane Cox [EMAIL PROTECTED] wrote:
 Hope this helps.
...

  Added as doc/mssql.

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


Re: freeradius and MS SQL -- anyone got it working?

2005-10-01 Thread Arne Götje (高盛華)
On Friday 30 September 2005 21:28, Duane Cox wrote:
 There are a few qwerks with getting FreeRadius to work with MSSQL.

thought so... :)

 First thing, the FreeTDS files have been removed (more like
 abandonded) from FreeRadius.
 If you really want to call FreeTDS direclty, you will have to
 download the files from the attic.
 But more than that you will also have to update the files as they do
 not currently compile properly, they are a bit old.
 I would suggest to go with unixodbc or iodbc, even though using
 FreeTDS is IMHO the best way, it's not supported.

oh... ok, then I'll go with unixodbc.

 Second, in order to get MSSQL to work with the current version of
 FreeRadius 1.0.5, you will need to install either unixodbc or iodbc. 
 I chose unixodbc; and in doing so it requires FreeTDS.  So install
 both FreeTDS and unixODBC.

 Third.  You will need to include mssql.conf and call
 rlm_sql_unixodbc.  The mssql.conf has to many tricks to it.  First
 the default driver is invalid and the server is really the DSN and
 must match that name found in /etc/odbc.ini.  Also /etc/odbc.ini must
 be readable by the freeradius daemon.  Also, there is an extra
 statement in the mssql.conf that is totaly not used and can be
 deleted; it's authenticate_query.

 These things should help you out.  If you need any further
 assistance, ie. configure/make commands and file contents ask again.

Thanks. :)

Could you give me an example how the /etc/odbc.ini has to look like?

Cheers
Arne
-- 
Arne Götje (高盛華) [EMAIL PROTECTED]
PGP/GnuPG key: 1024D/685D1E8C
Fingerprint: 2056 F6B7 DEA8 B478 311F  1C34 6E9F D06E 685D 1E8C
Key available at wwwkeys.pgp.net.   Encrypted e-mail preferred.



pgpPOfX8g5J3U.pgp
Description: PGP signature
- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: freeradius and MS SQL -- anyone got it working?

2005-09-30 Thread Duane Cox

There are a few qwerks with getting FreeRadius to work with MSSQL.

First thing, the FreeTDS files have been removed (more like abandonded) from 
FreeRadius.
If you really want to call FreeTDS direclty, you will have to download the 
files from the attic.
But more than that you will also have to update the files as they do not 
currently compile properly, they are a bit old.
I would suggest to go with unixodbc or iodbc, even though using FreeTDS is 
IMHO the best way, it's not supported.


Second, in order to get MSSQL to work with the current version of FreeRadius 
1.0.5, you will need to install either unixodbc or iodbc.  I chose unixodbc; 
and in doing so it requires FreeTDS.  So install both FreeTDS and unixODBC.


Third.  You will need to include mssql.conf and call rlm_sql_unixodbc.  The 
mssql.conf has to many tricks to it.  First the default driver is invalid 
and the server is really the DSN and must match that name found in 
/etc/odbc.ini.  Also /etc/odbc.ini must be readable by the freeradius 
daemon.  Also, there is an extra statement in the mssql.conf that is totaly 
not used and can be deleted; it's authenticate_query.


These things should help you out.  If you need any further assistance, ie. 
configure/make commands and file contents ask again.


Good Luck
Duane



Hi list,

What is the status of MS SQL support for freeradius? Did anyone get it
working? And if yes, which version do you use and what is required to
get it work?
I'm currently using freeradius 1.0.2 on Debian Sarge and I didn't manage
to get it connect to the MS SQL server. As the rlm_sql_freetds module
states that it is under development ans so, not enabled by default, I
was wondering, if the iODBC or the unixodbc modules would work and if
yes, how to set this up (aside from freeradius.. seems the 'drivers'
are missing, whatever this means).

Need some help here. Anyone?

Cheers
Arne

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


Re: freeradius and MS SQL -- anyone got it working?

2005-09-30 Thread Alan DeKok
Duane Cox [EMAIL PROTECTED] wrote:
 First thing, the FreeTDS files have been removed (more like abandonded) from 
 FreeRadius.

  It was abandoned at the specific request of the FreeTDS project
members, who told us the FreeTDS API used by the module was not
stable, and shouldn't be used by anyone.

 Second, in order to get MSSQL to work with the current version of FreeRadius 
 1.0.5, you will need to install either unixodbc or iodbc.  I chose unixodbc; 
 and in doing so it requires FreeTDS.  So install both FreeTDS and unixODBC.

 Oh, so it *does* work with the unixODBC module, like I said.  Why
then the comments about the freetds module?

 Third.  You will need to include mssql.conf and call rlm_sql_unixodbc.  The 
 mssql.conf has to many tricks to it.  First the default driver is invalid 
 and the server is really the DSN and must match that name found in 
 /etc/odbc.ini.  Also /etc/odbc.ini must be readable by the freeradius 
 daemon.  Also, there is an extra statement in the mssql.conf that is totaly 
 not used and can be deleted; it's authenticate_query.

  Please submit patches to the files  docs.  We'll be glad to fix any
issues with the project.

  Alan DeKok.

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


Re: freeradius and MS SQL -- anyone got it working?

2005-09-29 Thread Alan DeKok
Arne =?utf-8?q?G=C3=B6tje?= (=?utf-8?q?=E9=AB=98=E7=9B=9B=E8=8F=AF?=) [EMAIL 
PROTECTED] wrote:
 I'm currently using freeradius 1.0.2 on Debian Sarge and I didn't manage
 to get it connect to the MS SQL server. As the rlm_sql_freetds module
 states that it is under development ans so, not enabled by default, I
 was wondering, if the iODBC or the unixodbc modules would work and if
 yes, how to set this up (aside from freeradius.. seems the 'drivers'
 are missing, whatever this means).

  The iodbc or unixodbc drivers should work.  There have been reports
of them working with MS SQL in the past.

  As for the drivers being missing, the rlm_sql_* files are just the
interface between FreeRADIUS and the iODBC libraries.  If you don't
have the iODBC libraries (or other DB libraries), then the FreeRADIUS
modules that require them will not be built or installed.

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