pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Pavel Raiskup <praiskup@redhat.com>
To: pgsql-odbc@postgresql.org
Cc: hhorak@redhat.com, Nick Gorham <nick@lurcher.org>
Cc: unixodbc-dev@mailman.unixodbc.org
Subject: Re: Is the linking with -lodbc necessary? (--with-odbc)
Date: Wed, 13 Nov 2013 11:53 +0100
Message-ID: <4151671.3GJgm720Rh@nb.usersys.redhat.com> (raw )
In-Reply-To: <1409513.mLKAv12qaO@nb.usersys.redhat.com >
References: <1769926.65KUyECjFr@nb.usersys.redhat.com >
<1409513.mLKAv12qaO@nb.usersys.redhat.com >
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
> I attached possible solution.
I removed too much code in the previous patch. Attached once again.
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Attachments:
0001-DM-Don-t-load-plugins-linked-back-against-libodbc.so.patch (text/x-patch, 20.1K) download
From ae88c2c28534699f1620d2cae6bb01c9f100f4ba Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Wed, 13 Nov 2013 10:37:30 +0100
Subject: [PATCH] DM: don't load plugins linked back against libodbc.so
Previously, DM tried to load and work with such plugins. This
could result on some arm and s390 architectures (linux) to
problems with resolving API symbols.
As a solution we should not try to load such moudules and rather
fail with proper explanation. This should force plugin developers
to not link against libodbc.so as there should not be any real
need.
For more info look at:
http://www.postgresql.org/message-id/1769926.65KUyECjFr@nb.usersys.redhat.com
---
DriverManager/DriverManager.exp | 1 +
DriverManager/Makefile.am | 9 +-
DriverManager/SQLConnect.c | 224 ++++++++++++++++------------------------
DriverManager/drivermanager.h | 16 ++-
configure.in | 2 +
odbcinst/Makefile.am | 2 +-
6 files changed, 108 insertions(+), 146 deletions(-)
diff --git a/DriverManager/DriverManager.exp b/DriverManager/DriverManager.exp
index bb09bdb..39b801f 100644
--- a/DriverManager/DriverManager.exp
+++ b/DriverManager/DriverManager.exp
@@ -159,3 +159,4 @@ uodbc_get_stats
uodbc_stats_error
ODBCSetTryWaitValue
ODBCGetTryWaitValue
+__UNIXODBC_PLUGIN_GUARD
diff --git a/DriverManager/Makefile.am b/DriverManager/Makefile.am
index d5d7421..d7162d9 100644
--- a/DriverManager/Makefile.am
+++ b/DriverManager/Makefile.am
@@ -18,16 +18,17 @@ libodbc_la_LIBADD = \
$(LIBICONV)
libodbc_la_LDFLAGS = \
- -version-info @LIB_VERSION@ \
+ -version-info @LIBINST_VERSION@ \
-no-undefined \
-export-dynamic \
-export-symbols @srcdir@/DriverManager.exp
libodbc_la_DEPENDENCIES = $(LTDLDEPS) \
../lst/liblstlc.la \
- ../log/libloglc.la \
- ../ini/libinilc.la \
- ../odbcinst/libodbcinstlc.la
+ ../log/libloglc.la \
+ ../ini/libinilc.la \
+ ../odbcinst/libodbcinstlc.la \
+ DriverManager.exp
libodbc_la_SOURCES = \
SQLAllocConnect.c \
diff --git a/DriverManager/SQLConnect.c b/DriverManager/SQLConnect.c
index 306e951..a107792 100644
--- a/DriverManager/SQLConnect.c
+++ b/DriverManager/SQLConnect.c
@@ -614,122 +614,85 @@ static char const rcsid[]= "$RCSfile: SQLConnect.c,v $ $Revision: 1.66 $";
static struct driver_func template_func[] =
{
- /* 00 */ { SQL_API_SQLALLOCCONNECT, "SQLAllocConnect", (void*)SQLAllocConnect },
- /* 01 */ { SQL_API_SQLALLOCENV, "SQLAllocEnv", (void*)SQLAllocEnv },
- /* 02 */ { SQL_API_SQLALLOCHANDLE, "SQLAllocHandle", (void*)SQLAllocHandle },
- /* 03 */ { SQL_API_SQLALLOCSTMT, "SQLAllocStmt", (void*)SQLAllocStmt },
- /* 04 */ { SQL_API_SQLALLOCHANDLESTD, "SQLAllocHandleStd", (void*)SQLAllocHandleStd },
- /* 05 */ { SQL_API_SQLBINDCOL, "SQLBindCol", (void*)SQLBindCol },
- /* 06 */ { SQL_API_SQLBINDPARAM, "SQLBindParam", (void*)SQLBindParam },
- /* 07 */ { SQL_API_SQLBINDPARAMETER, "SQLBindParameter", (void*)SQLBindParameter },
- /* 08 */ { SQL_API_SQLBROWSECONNECT, "SQLBrowseConnect",
- (void*)SQLBrowseConnect, (void*)SQLBrowseConnectW },
- /* 09 */ { SQL_API_SQLBULKOPERATIONS, "SQLBulkOperations", (void*)SQLBulkOperations },
- /* 10 */ { SQL_API_SQLCANCEL, "SQLCancel", (void*)SQLCancel },
- /* 11 */ { SQL_API_SQLCLOSECURSOR, "SQLCloseCursor", (void*)SQLCloseCursor },
- /* 12 */ { SQL_API_SQLCOLATTRIBUTE, "SQLColAttribute",
- (void*)SQLColAttribute, (void*)SQLColAttributeW },
- /* 13 */ { SQL_API_SQLCOLATTRIBUTES, "SQLColAttributes",
- (void*)SQLColAttributes, (void*)SQLColAttributesW },
- /* 14 */ { SQL_API_SQLCOLUMNPRIVILEGES, "SQLColumnPrivileges",
- (void*)SQLColumnPrivileges, (void*)SQLColumnPrivilegesW },
- /* 15 */ { SQL_API_SQLCOLUMNS, "SQLColumns",
- (void*)SQLColumns, (void*)SQLColumnsW },
- /* 16 */ { SQL_API_SQLCONNECT, "SQLConnect",
- (void*)SQLConnect, (void*)SQLConnectW },
- /* 17 */ { SQL_API_SQLCOPYDESC, "SQLCopyDesc", (void*)SQLCopyDesc },
- /* 18 */ { SQL_API_SQLDATASOURCES, "SQLDataSources",
- (void*)SQLDataSources, (void*)SQLDataSourcesW },
- /* 19 */ { SQL_API_SQLDESCRIBECOL, "SQLDescribeCol",
- (void*)SQLDescribeCol, (void*)SQLDescribeColW },
- /* 20 */ { SQL_API_SQLDESCRIBEPARAM, "SQLDescribeParam", (void*)SQLDescribeParam },
- /* 21 */ { SQL_API_SQLDISCONNECT, "SQLDisconnect", (void*)SQLDisconnect },
- /* 22 */ { SQL_API_SQLDRIVERCONNECT, "SQLDriverConnect",
- (void*)SQLDriverConnect, (void*)SQLDriverConnectW },
- /* 23 */ { SQL_API_SQLDRIVERS, "SQLDrivers",
- (void*)SQLDrivers, (void*)SQLDriversW },
- /* 24 */ { SQL_API_SQLENDTRAN, "SQLEndTran", (void*)SQLEndTran },
- /* 25 */ { SQL_API_SQLERROR, "SQLError",
- (void*)SQLError, (void*)SQLErrorW },
- /* 26 */ { SQL_API_SQLEXECDIRECT, "SQLExecDirect",
- (void*)SQLExecDirect, (void*)SQLExecDirectW },
- /* 27 */ { SQL_API_SQLEXECUTE, "SQLExecute", (void*)SQLExecute },
- /* 28 */ { SQL_API_SQLEXTENDEDFETCH, "SQLExtendedFetch", (void*)SQLExtendedFetch },
- /* 29 */ { SQL_API_SQLFETCH, "SQLFetch", (void*)SQLFetch },
- /* 30 */ { SQL_API_SQLFETCHSCROLL, "SQLFetchScroll", (void*)SQLFetchScroll },
- /* 31 */ { SQL_API_SQLFOREIGNKEYS, "SQLForeignKeys",
- (void*)SQLForeignKeys, (void*)SQLForeignKeysW },
- /* 32 */ { SQL_API_SQLFREEENV, "SQLFreeEnv", (void*)SQLFreeEnv },
- /* 33 */ { SQL_API_SQLFREEHANDLE, "SQLFreeHandle", (void*)SQLFreeHandle },
- /* 34 */ { SQL_API_SQLFREESTMT, "SQLFreeStmt", (void*)SQLFreeStmt },
- /* 35 */ { SQL_API_SQLFREECONNECT, "SQLFreeConnect", (void*)SQLFreeConnect },
- /* 36 */ { SQL_API_SQLGETCONNECTATTR, "SQLGetConnectAttr",
- (void*)SQLGetConnectAttr, (void*)SQLGetConnectAttrW },
- /* 37 */ { SQL_API_SQLGETCONNECTOPTION, "SQLGetConnectOption",
- (void*)SQLGetConnectOption, (void*)SQLGetConnectOptionW },
- /* 38 */ { SQL_API_SQLGETCURSORNAME, "SQLGetCursorName",
- (void*)SQLGetCursorName, (void*)SQLGetCursorNameW },
- /* 39 */ { SQL_API_SQLGETDATA, "SQLGetData", (void*)SQLGetData },
- /* 40 */ { SQL_API_SQLGETDESCFIELD, "SQLGetDescField",
- (void*)SQLGetDescField, (void*)SQLGetDescFieldW },
- /* 41 */ { SQL_API_SQLGETDESCREC, "SQLGetDescRec",
- (void*)SQLGetDescRec, (void*)SQLGetDescRecW },
- /* 42 */ { SQL_API_SQLGETDIAGFIELD, "SQLGetDiagField",
- (void*)SQLGetDiagField, (void*)SQLGetDiagFieldW },
- /* 43 */ { SQL_API_SQLGETENVATTR, "SQLGetEnvAttr", (void*)SQLGetEnvAttr },
- /* 44 */ { SQL_API_SQLGETFUNCTIONS, "SQLGetFunctions", (void*)SQLGetFunctions },
- /* 45 */ { SQL_API_SQLGETINFO, "SQLGetInfo",
- (void*)SQLGetInfo, (void*)SQLGetInfoW },
- /* 46 */ { SQL_API_SQLGETSTMTATTR, "SQLGetStmtAttr",
- (void*)SQLGetStmtAttr, (void*)SQLGetStmtAttrW },
- /* 47 */ { SQL_API_SQLGETSTMTOPTION, "SQLGetStmtOption", (void*)SQLGetStmtOption },
- /* 48 */ { SQL_API_SQLGETTYPEINFO, "SQLGetTypeInfo",
- (void*)SQLGetTypeInfo, (void*)SQLGetTypeInfoW },
- /* 49 */ { SQL_API_SQLMORERESULTS, "SQLMoreResults", (void*)SQLMoreResults },
- /* 50 */ { SQL_API_SQLNATIVESQL, "SQLNativeSql",
- (void*)SQLNativeSql, (void*)SQLNativeSqlW },
- /* 51 */ { SQL_API_SQLNUMPARAMS, "SQLNumParams", (void*)SQLNumParams },
- /* 52 */ { SQL_API_SQLNUMRESULTCOLS, "SQLNumResultCols", (void*)SQLNumResultCols },
- /* 53 */ { SQL_API_SQLPARAMDATA, "SQLParamData", (void*)SQLParamData },
- /* 54 */ { SQL_API_SQLPARAMOPTIONS, "SQLParamOptions", (void*)SQLParamOptions },
- /* 55 */ { SQL_API_SQLPREPARE, "SQLPrepare",
- (void*)SQLPrepare, (void*)SQLPrepareW },
- /* 56 */ { SQL_API_SQLPRIMARYKEYS, "SQLPrimaryKeys",
- (void*)SQLPrimaryKeys, (void*)SQLPrimaryKeysW },
- /* 57 */ { SQL_API_SQLPROCEDURECOLUMNS, "SQLProcedureColumns",
- (void*)SQLProcedureColumns, (void*)SQLProcedureColumnsW },
- /* 58 */ { SQL_API_SQLPROCEDURES, "SQLProcedures",
- (void*)SQLProcedures, (void*)SQLProceduresW },
- /* 59 */ { SQL_API_SQLPUTDATA, "SQLPutData", (void*)SQLPutData },
- /* 60 */ { SQL_API_SQLROWCOUNT, "SQLRowCount", (void*)SQLRowCount },
- /* 61 */ { SQL_API_SQLSETCONNECTATTR, "SQLSetConnectAttr",
- (void*)SQLSetConnectAttr, (void*)SQLSetConnectAttrW },
- /* 62 */ { SQL_API_SQLSETCONNECTOPTION, "SQLSetConnectOption",
- (void*)SQLSetConnectOption, (void*)SQLSetConnectOptionW },
- /* 63 */ { SQL_API_SQLSETCURSORNAME, "SQLSetCursorName",
- (void*)SQLSetCursorName, (void*)SQLSetCursorNameW },
- /* 64 */ { SQL_API_SQLSETDESCFIELD, "SQLSetDescField",
- (void*)SQLSetDescField, (void*)SQLSetDescFieldW },
- /* 65 */ { SQL_API_SQLSETDESCREC, "SQLSetDescRec", (void*)SQLSetDescRec },
- /* 66 */ { SQL_API_SQLSETENVATTR, "SQLSetEnvAttr", (void*)SQLSetEnvAttr },
- /* 67 */ { SQL_API_SQLSETPARAM, "SQLSetParam", (void*)SQLSetParam },
- /* 68 */ { SQL_API_SQLSETPOS, "SQLSetPos", (void*)SQLSetPos },
- /* 69 */ { SQL_API_SQLSETSCROLLOPTIONS, "SQLSetScrollOptions", (void*)SQLSetScrollOptions },
- /* 70 */ { SQL_API_SQLSETSTMTATTR, "SQLSetStmtAttr",
- (void*)SQLSetStmtAttr, (void*)SQLSetStmtAttrW },
- /* 71 */ { SQL_API_SQLSETSTMTOPTION, "SQLSetStmtOption", (void*)SQLSetStmtOption },
- /* 72 */ { SQL_API_SQLSPECIALCOLUMNS, "SQLSpecialColumns",
- (void*)SQLSpecialColumns, (void*)SQLSpecialColumnsW },
- /* 73 */ { SQL_API_SQLSTATISTICS, "SQLStatistics",
- (void*)SQLStatistics, (void*)SQLStatisticsW },
- /* 74 */ { SQL_API_SQLTABLEPRIVILEGES, "SQLTablePrivileges",
- (void*)SQLTablePrivileges, (void*)SQLTablePrivilegesW },
- /* 75 */ { SQL_API_SQLTABLES, "SQLTables",
- (void*)SQLTables, (void*)SQLTablesW },
- /* 76 */ { SQL_API_SQLTRANSACT, "SQLTransact", (void*)SQLTransact },
- /* 77 */ { SQL_API_SQLGETDIAGREC, "SQLGetDiagRec",
- (void*)SQLGetDiagRec, (void*)SQLGetDiagRecW },
- /* 78 */ { SQL_API_SQLCANCELHANDLE, "SQLCancelHandle", (void*)SQLCancelHandle },
+ /* 00 */ { SQL_API_SQLALLOCCONNECT, "SQLAllocConnect" },
+ /* 01 */ { SQL_API_SQLALLOCENV, "SQLAllocEnv" },
+ /* 02 */ { SQL_API_SQLALLOCHANDLE, "SQLAllocHandle" },
+ /* 03 */ { SQL_API_SQLALLOCSTMT, "SQLAllocStmt" },
+ /* 04 */ { SQL_API_SQLALLOCHANDLESTD, "SQLAllocHandleStd" },
+ /* 05 */ { SQL_API_SQLBINDCOL, "SQLBindCol" },
+ /* 06 */ { SQL_API_SQLBINDPARAM, "SQLBindParam" },
+ /* 07 */ { SQL_API_SQLBINDPARAMETER, "SQLBindParameter" },
+ /* 08 */ { SQL_API_SQLBROWSECONNECT, "SQLBrowseConnect", },
+ /* 09 */ { SQL_API_SQLBULKOPERATIONS, "SQLBulkOperations" },
+ /* 10 */ { SQL_API_SQLCANCEL, "SQLCancel" },
+ /* 11 */ { SQL_API_SQLCLOSECURSOR, "SQLCloseCursor" },
+ /* 12 */ { SQL_API_SQLCOLATTRIBUTE, "SQLColAttribute", TRUE },
+ /* 13 */ { SQL_API_SQLCOLATTRIBUTES, "SQLColAttributes", TRUE },
+ /* 14 */ { SQL_API_SQLCOLUMNPRIVILEGES, "SQLColumnPrivileges", TRUE },
+ /* 15 */ { SQL_API_SQLCOLUMNS, "SQLColumns", TRUE },
+ /* 16 */ { SQL_API_SQLCONNECT, "SQLConnect", TRUE },
+ /* 17 */ { SQL_API_SQLCOPYDESC, "SQLCopyDesc" },
+ /* 18 */ { SQL_API_SQLDATASOURCES, "SQLDataSources", TRUE },
+ /* 19 */ { SQL_API_SQLDESCRIBECOL, "SQLDescribeCol", TRUE },
+ /* 20 */ { SQL_API_SQLDESCRIBEPARAM, "SQLDescribeParam" },
+ /* 21 */ { SQL_API_SQLDISCONNECT, "SQLDisconnect" },
+ /* 22 */ { SQL_API_SQLDRIVERCONNECT, "SQLDriverConnect", TRUE },
+ /* 23 */ { SQL_API_SQLDRIVERS, "SQLDrivers", TRUE },
+ /* 24 */ { SQL_API_SQLENDTRAN, "SQLEndTran", TRUE },
+ /* 25 */ { SQL_API_SQLERROR, "SQLError", TRUE },
+ /* 26 */ { SQL_API_SQLEXECDIRECT, "SQLExecDirect", TRUE },
+ /* 27 */ { SQL_API_SQLEXECUTE, "SQLExecute" },
+ /* 28 */ { SQL_API_SQLEXTENDEDFETCH, "SQLExtendedFetch" },
+ /* 29 */ { SQL_API_SQLFETCH, "SQLFetch" },
+ /* 30 */ { SQL_API_SQLFETCHSCROLL, "SQLFetchScroll" },
+ /* 31 */ { SQL_API_SQLFOREIGNKEYS, "SQLForeignKeys", TRUE },
+ /* 32 */ { SQL_API_SQLFREEENV, "SQLFreeEnv" },
+ /* 33 */ { SQL_API_SQLFREEHANDLE, "SQLFreeHandle" },
+ /* 34 */ { SQL_API_SQLFREESTMT, "SQLFreeStmt" },
+ /* 35 */ { SQL_API_SQLFREECONNECT, "SQLFreeConnect" },
+ /* 36 */ { SQL_API_SQLGETCONNECTATTR, "SQLGetConnectAttr", TRUE },
+ /* 37 */ { SQL_API_SQLGETCONNECTOPTION, "SQLGetConnectOption", TRUE },
+ /* 38 */ { SQL_API_SQLGETCURSORNAME, "SQLGetCursorName", TRUE },
+ /* 39 */ { SQL_API_SQLGETDATA, "SQLGetData" },
+ /* 40 */ { SQL_API_SQLGETDESCFIELD, "SQLGetDescField", TRUE },
+ /* 41 */ { SQL_API_SQLGETDESCREC, "SQLGetDescRec", TRUE },
+ /* 42 */ { SQL_API_SQLGETDIAGFIELD, "SQLGetDiagField", TRUE },
+ /* 43 */ { SQL_API_SQLGETENVATTR, "SQLGetEnvAttr" },
+ /* 44 */ { SQL_API_SQLGETFUNCTIONS, "SQLGetFunctions" },
+ /* 45 */ { SQL_API_SQLGETINFO, "SQLGetInfo", TRUE },
+ /* 46 */ { SQL_API_SQLGETSTMTATTR, "SQLGetStmtAttr", TRUE },
+ /* 47 */ { SQL_API_SQLGETSTMTOPTION, "SQLGetStmtOption" },
+ /* 48 */ { SQL_API_SQLGETTYPEINFO, "SQLGetTypeInfo", TRUE },
+ /* 49 */ { SQL_API_SQLMORERESULTS, "SQLMoreResults" },
+ /* 50 */ { SQL_API_SQLNATIVESQL, "SQLNativeSql", TRUE },
+ /* 51 */ { SQL_API_SQLNUMPARAMS, "SQLNumParams" },
+ /* 52 */ { SQL_API_SQLNUMRESULTCOLS, "SQLNumResultCols" },
+ /* 53 */ { SQL_API_SQLPARAMDATA, "SQLParamData" },
+ /* 54 */ { SQL_API_SQLPARAMOPTIONS, "SQLParamOptions" },
+ /* 55 */ { SQL_API_SQLPREPARE, "SQLPrepare", TRUE },
+ /* 56 */ { SQL_API_SQLPRIMARYKEYS, "SQLPrimaryKeys", TRUE },
+ /* 57 */ { SQL_API_SQLPROCEDURECOLUMNS, "SQLProcedureColumns", TRUE },
+ /* 58 */ { SQL_API_SQLPROCEDURES, "SQLProcedures", TRUE },
+ /* 59 */ { SQL_API_SQLPUTDATA, "SQLPutData" },
+ /* 60 */ { SQL_API_SQLROWCOUNT, "SQLRowCount" },
+ /* 61 */ { SQL_API_SQLSETCONNECTATTR, "SQLSetConnectAttr", TRUE },
+ /* 62 */ { SQL_API_SQLSETCONNECTOPTION, "SQLSetConnectOption", TRUE },
+ /* 63 */ { SQL_API_SQLSETCURSORNAME, "SQLSetCursorName", TRUE },
+ /* 64 */ { SQL_API_SQLSETDESCFIELD, "SQLSetDescField", TRUE },
+ /* 65 */ { SQL_API_SQLSETDESCREC, "SQLSetDescRec" },
+ /* 66 */ { SQL_API_SQLSETENVATTR, "SQLSetEnvAttr" },
+ /* 67 */ { SQL_API_SQLSETPARAM, "SQLSetParam" },
+ /* 68 */ { SQL_API_SQLSETPOS, "SQLSetPos" },
+ /* 69 */ { SQL_API_SQLSETSCROLLOPTIONS, "SQLSetScrollOptions" },
+ /* 70 */ { SQL_API_SQLSETSTMTATTR, "SQLSetStmtAttr", TRUE },
+ /* 71 */ { SQL_API_SQLSETSTMTOPTION, "SQLSetStmtOption" },
+ /* 72 */ { SQL_API_SQLSPECIALCOLUMNS, "SQLSpecialColumns", TRUE },
+ /* 73 */ { SQL_API_SQLSTATISTICS, "SQLStatistics", TRUE },
+ /* 74 */ { SQL_API_SQLTABLEPRIVILEGES, "SQLTablePrivileges", TRUE },
+ /* 75 */ { SQL_API_SQLTABLES, "SQLTables", TRUE },
+ /* 76 */ { SQL_API_SQLTRANSACT, "SQLTransact" },
+ /* 77 */ { SQL_API_SQLGETDIAGREC, "SQLGetDiagRec", TRUE },
+ /* 78 */ { SQL_API_SQLCANCELHANDLE, "SQLCancelHandle" },
};
/*
@@ -841,10 +804,18 @@ static void *odbc_dlopen( char *libname, char **err )
if ( hand )
{
+ if ( lt_dlsym( hand, "__UNIXODBC_PLUGIN_GUARD" ))
+ {
+ lt_dlclose( hand );
+ *err = "Plugin is linked back against libodbc.so";
+ mutex_lib_exit();
+ return NULL;
+ }
+
/*
* If only one, then use the static space
*/
-
+
if ( lib_list == NULL )
{
list = &single_lib_count;
@@ -1239,25 +1210,6 @@ int __connect_part_one( DMHDBC connection, char *driver_lib, char *driver_name,
connection -> functions[ i ].funcW = NULL;
}
- /*
- * blank out ones that are in the DM to fix a big
- * with glib 2.0.6
- */
-
- if ( connection -> functions[ i ].func &&
- (void*)connection -> functions[ i ].func ==
- (void*)connection -> functions[ i ].dm_func )
- {
- connection -> functions[ i ].func = NULL;
- }
-
- if ( connection -> functions[ i ].funcW &&
- (void*)connection -> functions[ i ].funcW ==
- (void*)connection -> functions[ i ].dm_funcW )
- {
- connection -> functions[ i ].funcW = NULL;
- }
-
connection -> functions[ i ].can_supply =
( connection -> functions[ i ].func != NULL ) ||
( connection -> functions[ i ].funcW != NULL );
diff --git a/DriverManager/drivermanager.h b/DriverManager/drivermanager.h
index 8aa64f9..9ed8014 100644
--- a/DriverManager/drivermanager.h
+++ b/DriverManager/drivermanager.h
@@ -124,6 +124,16 @@
#define STATE_D1e 2
/*
+ * We wan't disallow linking moudules back against the libodbc.so. When this
+ * symbol is found in driver (plugin) corresponding driver is back linked
+ * against libodbc.so; and it is an mistake. Back story:
+ *
+ * http://www.postgresql.org/message-id/1769926.65KUyECjFr@nb.usersys.redhat.com
+ */
+
+SQLINTEGER __UNIXODBC_PLUGIN_GUARD;
+
+/*
* structure to contain the loaded lib entry points
*/
@@ -131,11 +141,7 @@ struct driver_func
{
int ordinal;
char *name;
- void *dm_func; /* this is to fix what seems a bug in */
- /* some dlopen implemnations where dlsym */
- /* will return the driver manager func */
- /* not the driver one */
- void *dm_funcW;
+ int dm_funcW;
SQLRETURN (*func)();
SQLRETURN (*funcW)(); /* function with a unicode W */
SQLRETURN (*funcA)(); /* function with a unicode A */
diff --git a/configure.in b/configure.in
index e1ce44f..24a02e4 100644
--- a/configure.in
+++ b/configure.in
@@ -498,6 +498,8 @@ AC_DEFINE([UNIXODBC_SOURCE],[],[We are building inside the unixODBC source tree]
LIB_VERSION="2:0:0"
AC_SUBST(LIB_VERSION)
+LIBINST_VERSION="3:0:0"
+AC_SUBST(LIBINST_VERSION)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_HEADERS(unixodbc_conf.h)
diff --git a/odbcinst/Makefile.am b/odbcinst/Makefile.am
index dde0ed5..fb5d9da 100644
--- a/odbcinst/Makefile.am
+++ b/odbcinst/Makefile.am
@@ -8,7 +8,7 @@ EXTRA_DIST = \
libodbcinst_la_LDFLAGS = \
-no-undefined \
- -version-info @LIB_VERSION@ \
+ -version-info @LIBINST_VERSION@ \
-export-dynamic \
-export-symbols @srcdir@/odbcinst.exp
--
1.8.4.2
view thread (8+ messages) latest in thread
Message-ID: <4151671.3GJgm720Rh@nb.usersys.redhat.com>
Permalink: ../4151671.3GJgm720Rh@nb.usersys.redhat.com/
Also on: postgresql.org/message-id/4151671.3GJgm720Rh@nb.usersys.redhat.com
copy link · copy postgr.es · copy git am
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: praiskup@redhat.com, nick@lurcher.org, unixodbc-dev@mailman.unixodbc.org
Subject: Re: Is the linking with -lodbc necessary? (--with-odbc)
In-Reply-To: <4151671.3GJgm720Rh@nb.usersys.redhat.com>
References: <1769926.65KUyECjFr@nb.usersys.redhat.com> <1409513.mLKAv12qaO@nb.usersys.redhat.com> <4151671.3GJgm720Rh@nb.usersys.redhat.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox