[IBPP-DISCUSS] Problem with IBPP and Firebird libfbembeded
IBPP is a C++ client class library for FirebirdSQL
Status: Inactive
Brought to you by:
epocman
From: Tony W. <ton...@mw...> - 2014-03-26 14:20:17
|
Olivier, I have come across a problem with using IBPP and the Firebird embedded server (libfbembed.so) under Linux which could be worked around with Firebird 2.1 but not with Firebird 2.5. The problem is with use of the security database. In Firebird 2.1, the FIREBIRD environment variable was fully respected. However, in Firebird 2.5, it is ignored for the security database. Personally, I regard this as a defect in Firebird 2.5. However, when using libfbembed.so rather than libfbclient.so, there is a workaround (arguably the proper approach) which breaks IBPP. You can explore the problem with "isql" under classic builds. This is linked to libfbembed.so and exhibits the following behaviour when opening a local database (i.e. no host name specified). 1. When called with a -user argument or with the ISC_USER environment variable set, it tries to open the security database even though it will not try to verify the user. If the current user is not a member of the "firebird" group, this will fail. 2. When called without a -user argument and without the ISC_USER environment variable set, it does not access the security database and opens the selected database using only unix permissions to control access. This works regardless of whether the current user is a member of the firebird group. However, when trying the same with IBPP, the DB->Connect() call verifies that the username is non-empty and returns a logic error if no username is specified. It is thus impossible to use IBPP with the Firebird 2.5 embedded server unless the user is a member of the firebird group (which may not be desirable or possible). Only a minor change is required to remove this (helpful?) check and a patch is attached, which appears to work on my system. The patch also includes some other changes introduced to make use of the embedded server easier (i.e. instead of softlinking it to fbclient.so). This replaces your "TODO" with unix dynamic library loading, choosing the library from an ordered list of library names added to the top of _ibpp.cpp. This list tries "libfbembed.so.2.5", "libfbembed.so.2.1" and "libfbclient.so.2" in that order. It can also be overridden by specifying the environment variable FBLIB which is then assumed to be the Firebird Client Library Name. Regards Tony Whyman MWA |