lurcher / unixODBC

The unixODBC Project goals are to develop and promote unixODBC to be the definitive standard for ODBC on non MS Windows platforms.
GNU Lesser General Public License v2.1
100 stars 52 forks source link

Feature request: allow installed driver configs to live in /usr #163

Open amluto opened 6 months ago

amluto commented 6 months ago

In recent years, Linux distributions have moved in the direction of separating files: /usr contains files that actually belong to the distribution (although /usr/local/ is still there, etc), and /etc contains non-default configuration. The end goal would be for distributions to be able to leave /etc mostly blank or perhaps to have all-commented-out files in it.

There are certainly tricky exceptions: /etc/nsswitch.conf, /etc/hosts, /etc/resolve.conf, /etc/os-release, and quite a few others. These mostly get handled by symlinks, and the ones that don't are considered annoying and people are slowly working on them.

/etc/odbcinst.ini is a somewhat annoying special case. Drivers get installed, but they don't work until entries get added to /etc/odbcinst.ini, but making /etc/odbcinst.ini be a symlink to somewhere in /usr would make little sense.

So here's my feature request: make driver config locations more flexible. As a baseline improvement, right now driver configs come from the "system" path and the "user" path (in _SQLGetInstalledDrivers). Add a third path, e.g. /usr/lib/unixODBC/odbcinst.ini.

As an IMO better improvement, add an entire directory and get all the ini files in it, for example /usr/lib/unixODBC/odbcinst.d/*.ini. This would allow individual packages to install ODBC drivers without all touching the same file and thus requiring an installation and uninstallation script: the packages could just contain files, and the presence of the files would be sufficient for the driver to work.

(I don't actually represent any distribution, but I am doing some container work, and I currently have a special case for /etc/odbcinst.ini.)