freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Castellano, Nicholas" <Nicholas_Castellano AT acml.com>
- To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
- Subject: Re: freetds and freeradius
- Date: Wed, 25 Sep 2002 13:33:14 -0400
The freetds module in freeradius will only work with freetds-0.53. Much has
changed since then.
I tried to work up a patch for freeradius, so that it can work with our
current code. Here it is, for what it's worth. I haven't even tried
compiling the updated code, so it may or may not compile, and may or may not
run.
Give it a shot, and let me know if it does the trick.
Cheers,
--nick
-----Original Message-----
From: bounce-freetds-145195 AT franklin.oit.unc.edu
[mailto:bounce-freetds-145195 AT franklin.oit.unc.edu]
Sent: Wednesday, September 25, 2002 4:27 AM
To: TDS Development Group
Subject: [freetds] Re: freetds and freeradius
-----Original Message-----
From: Andrew G. Buenaventura
Sent: Wednesday, September 25, 2002 4:26 PM
To: TDS Development Group
Subject: [freetds] Re: freetds and freeradius
After installing the CVS copy of freetds, I am NOW getting the following
error messages when I run make in freeradius. I am referring this matter to
this list because I am assuming that this could be a problem with freetds
since it is not present before I changed to the CVS copy of freetds. Please
inform me if this is not the case.
gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -g
-Wsha dow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wnested-externs -I../.. -I../../.. /../include -c sql_freetds.c -o
sql_freetds.o In file included from sql_freetds.c:13:
/usr/local/include/tds.h:622: warning: declaration of `connect' shadows
global d eclaration
sql_freetds.c: In function `sql_init_socket':
sql_freetds.c:67: warning: passing arg 1 of `tds_connect' from incompatible
poin ter type
sql_freetds.c:67: warning: passing arg 2 of `tds_connect' from incompatible
poin ter type
sql_freetds.c:67: too many arguments to function `tds_connect'
sql_freetds.c:72: warning: implicit declaration of function
`sql_destroy_socket'
sql_freetds.c: At top level:
sql_freetds.c:108: warning: `sql_destroy_socket' was used with no prototype
befo re its definition
sql_freetds.c:108: warning: `sql_destroy_socket' was declared implicitly
`extern ' and later `static'
sql_freetds.c:83: warning: previous declaration of `sql_destroy_socket'
sql_freetds.c: In function `sql_query':
sql_freetds.c:153: structure has no member named `msg_info'
sql_freetds.c: In function `sql_store_result':
sql_freetds.c:200: warning: implicit declaration of function
`sql_num_fields'
sql_freetds.c:230: warning: implicit declaration of function
`sql_free_result'
sql_freetds.c: At top level:
sql_freetds.c:246: warning: `sql_num_fields' was used with no prototype
before i ts definition
sql_freetds.c:246: warning: `sql_num_fields' was declared implicitly
`extern' an d later `static'
sql_freetds.c:200: warning: previous declaration of `sql_num_fields'
sql_freetds.c: In function `sql_num_rows':
sql_freetds.c:270: warning: implicit declaration of function
`sql_affected_rows'
sql_freetds.c: In function `sql_fetch_row':
sql_freetds.c:337: warning: passing arg 1 of `tds_convert' from incompatible
poi nter type
sql_freetds.c:337: warning: passing arg 6 of `tds_convert' from incompatible
poi nter type
sql_freetds.c:337: too many arguments to function `tds_convert'
sql_freetds.c: At top level:
sql_freetds.c:388: warning: `sql_free_result' was used with no prototype
before its definition
sql_freetds.c:388: warning: `sql_free_result' was declared implicitly
`extern' a nd later `static'
sql_freetds.c:354: warning: previous declaration of `sql_free_result'
sql_freetds.c:440: warning: `sql_affected_rows' was used with no prototype
befor e its definition
sql_freetds.c:440: warning: `sql_affected_rows' was declared implicitly
`extern' and later `static'
sql_freetds.c:270: warning: previous declaration of `sql_affected_rows'
gmake[10]: *** [sql_freetds.o] Error 1
gmake[10]: Leaving directory
`/usr/local/src/radiusd/src/modules/rlm_sql/drivers
/rlm_sql_freetds'
gmake[9]: *** [common] Error 1
gmake[9]: Leaving directory
`/usr/local/src/radiusd/src/modules/rlm_sql/drivers'
gmake[8]: *** [static] Error 2
gmake[8]: Leaving directory
`/usr/local/src/radiusd/src/modules/rlm_sql/drivers'
gmake[7]: *** [common] Error 1
gmake[7]: Leaving directory `/usr/local/src/radiusd/src/modules/rlm_sql'
gmake[6]: *** [static] Error 2
gmake[6]: Leaving directory `/usr/local/src/radiusd/src/modules/rlm_sql'
gmake[5]: *** [common] Error 1
gmake[5]: Leaving directory `/usr/local/src/radiusd/src/modules'
gmake[4]: *** [all] Error 2
gmake[4]: Leaving directory `/usr/local/src/radiusd/src/modules'
gmake[3]: *** [common] Error 1
gmake[3]: Leaving directory `/usr/local/src/radiusd/src'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/usr/local/src/radiusd/src'
gmake[1]: *** [common] Error 1
gmake[1]: Leaving directory `/usr/local/src/radiusd'
make: *** [all] Error 2
---
You are currently subscribed to freetds as: [andrew AT teamyehey.com] To
unsubscribe, forward this message to
$subst('Email.Unsub')
---
You are currently subscribed to freetds as: [Nicholas_Castellano AT acml.com]
To unsubscribe, forward this message to
$subst('Email.Unsub')
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that for certain accounts we do not accept
orders and/or instructions by e-mail, and for those accounts we will not be
responsible for carrying out such orders and/or instructions. Kindly refrain
from sending orders or instructions by e-mail unless you have confirmed that
we accept such communications for your account. Please also note that to
satisfy regulatory requirements we review the outgoing and incoming e-mail
correspondence of staff members serving certain functions.
diff -u
freeradius-0.7.1/src/modules/rlm_sql/drivers/rlm_sql_freetds.orig/sql_freetds.c
freeradius-0.7.1/src/modules/rlm_sql/drivers/rlm_sql_freetds/sql_freetds.c
---
freeradius-0.7.1/src/modules/rlm_sql/drivers/rlm_sql_freetds.orig/sql_freetds.c
Thu Jul 11 12:28:59 2002
+++
freeradius-0.7.1/src/modules/rlm_sql/drivers/rlm_sql_freetds/sql_freetds.c
Wed Sep 25 13:27:29 2002
@@ -13,18 +13,6 @@
#include <tds.h>
#include <tdsconvert.h>
-
-
-/*************************************************************************
- *
- * External functions
- *
- *************************************************************************/
-
-extern int tds_send_cancel(TDSSOCKET *tds);
-extern int tds_process_cancel(TDSSOCKET *tds);
-
-
/*************************************************************************
*
* Function: sql_init_socket
@@ -36,6 +24,7 @@
rlm_sql_freetds_sock *freetds_sock;
char *query;
int marker;
+ TDSCONTEXT *context;
/* Allocating memory for the new socket */
sqlsocket->conn = (rlm_sql_freetds_sock
*)rad_malloc(sizeof(rlm_sql_freetds_sock));
@@ -48,14 +37,11 @@
tds_set_passwd (freetds_sock->tds_login, config->sql_password);
/* Do connection */
- freetds_sock->tds_socket = (void *) tds_connect(
- freetds_sock->tds_login,
-#ifdef HAVE_TDS_GET_LOCALE
- tds_get_locale(),
-#endif
- (void *)freetds_sock);
-
- if (freetds_sock->tds_socket == NULL)
+ context = tds_alloc_context();
+ freetds_sock->tds_socket = (void *) tds_alloc_socket(context, 512);
+ tds_set_parent(freetds_sock->tds_socket, NULL);
+ if (tds_connect(freetds_sock->tds_socket, freetds_sock->tds_login)
+ != TDS_SUCCEED)
{
radlog(L_ERR, "rlm_sql_freetds: Can't connect to the database
server");
sql_destroy_socket(sqlsocket, config);
@@ -139,7 +125,6 @@
{
/* XXX determine if return above suggests returning SQL_DOWN or not */
radlog(L_ERR, "rlm_sql_freetds: Can't execute the query");
- radlog(L_ERR, "rlm_sql_freetds: %s",
freetds_sock->tds_socket->msg_info->message);
return -1;
}
@@ -274,6 +259,8 @@
TDSRESULTINFO *result_info;
TDSCOLINFO **columns;
int numfields, column, retcode;
+ CONV_RESULT cr;
+ int len;
sqlsocket->row = NULL;
@@ -314,16 +301,15 @@
/* Converting the fields to a CHAR data type */
for (column = 0; column < numfields; column++)
{
- tds_convert(
-#ifdef HAVE_TDS_GET_LOCALE
- tds_get_locale(),
-#endif
+ len = tds_convert(
+ freetds_sock->tds_socket->tds_ctx,
columns[column]->column_type,
&result_info->current_row[columns[column]->column_offset],
-1,
SYBCHAR,
- (char *)freetds_sock->row[column],
- columns[column]->column_size);
+ &cr);
+ memcpy(freetds_sock->row[column], cr.c, len);
+ freetds_sock->row[column][len] = '\0';
}
sqlsocket->row = freetds_sock->row;
return 0;
-
freetds and freeradius,
Andrew G. Buenaventura, 09/24/2002
- <Possible follow-up(s)>
- Re: freetds and freeradius, Steve Langasek, 09/24/2002
- Re: freetds and freeradius, Andrew G. Buenaventura, 09/24/2002
- Re: freetds and freeradius, Castellano, Nicholas, 09/24/2002
- Re: freetds and freeradius, Andrew G. Buenaventura, 09/25/2002
- Re: freetds and freeradius, Andrew G. Buenaventura, 09/25/2002
- Re: freetds and freeradius, Castellano, Nicholas, 09/25/2002
Archive powered by MHonArc 2.6.24.