[unixODBC-support] ODBCConfig not loading setup library

Ludo Brands ludo.brands at free.fr
Wed Apr 7 15:26:11 BST 2010


I'm porting a windows driver to unixodbc. The combined driver-setup library
comes with a GUI for ConfigDSN. The library is compiled on Ubuntu 9.10
(32-bit).  ODBCConfig on Ubuntu loads the configuration screen correctly
when adding or configuring a DSN. When I install the library on Fedora 10
and Suse 11.1 I get a "Could not construct property list for (my driver)". I
took a look at the source code for ODBCConfig and figured out that
ODBCConfig (callbacks.c) tries to run ConfigDSN from the driver setup
library (SQLConfigDataSource.c) and, if that fails, tries to construct a
list of properties. I'm not implementing ODBCINSTGetProperties, hence the
error message. Question is, why does ODBCConfig fail to load ConfigDSN on
Fedora and Suse while running correctly on Ubuntu? 
Other tests I ran:
- the driver part of the library works fine with unixodbc on Fedora and
Suse. 
- nm lists ConfigDSN as an exported routine in the driver library on all
platforms. ODBCConfig uses libltdl to load the library and nm is also part
of libtool. 
- on Ubuntu ODBCConfig depends on libltdl.so while on Fedora and Suse it
doesn't. The unixodbc sources 2.2.12 suggest that libltdl is compiled in
statically. Strangely enough, the drivermanager libodbc.so has similar
dependency differences on the different platforms but loads the driver
library correctly.
- I've added a debug write to console to check whether ConfigDSN fails
because not entered or returning false: ConfigDSN isn't entered. As a side
note: when a user hits "cancel" during ConfigDSN I used to return false
combined with a call to SQLPostInstallerError and a custom error message
"user canceled configuration". This is fine according to Microsoft specs but
with ODBCConfig, returning false goes on building a driver properties list
which, in my case, always fails...
- a debug write to console in the main library entry routine, isn't executed
neither on Fedora and Suse. 
- I haven't tried to recompile the library on Fedore or Suse since the
driver part of the library runs fine as well as the installer program that
uses the same graphics library as the driver. 
- my driver installer program calls SQLConfigDataSource to add a DSN. As
expected this works fine on Ubuntu but fails on Fedora and Suse.
- the driver library isn't PIC enabled and Fedora (SELinux) refuses to load
the library when ODBCConfig tries to open the file. chcon solves that
problem. It's worth mentioning as this confirms that the path to the setup
library is correct and that the library is loaded in memory at some point.
Suse doesn't require PIC libraries.
 
Any idea on what is going wrong? 
 
How do I get access to the log created by inst_logPushMsg? By the looks of
it, it is all in memory. This could give further infomation on where things
go wrong...
 
Thanks a lot, Ludo
 
PS: Packages containing ODBCConfig for the 3 platforms differ greatly. I
don't know how to get the version number of ODBCConfig. "About" doesn't show
a version number and the sources don't show support for commandline
parameters.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20100407/dc802bae/attachment.html>


More information about the unixODBC-support mailing list