Firebird Server ↔ Jaybird JDBC: DatabaseAccess Restriction Impact on Connection Paths
0 reputation · 06 Jun 2020, 22:14 UTC
0 reputation · 06 Jun 2020, 22:14 UTC
Goal: Ensure that a Jaybird JDBC connection string that works on a local development Firebird instance also succeeds in a production environment where the server runs under a restricted account and enforces the DatabaseAccess restriction.
Constraint: In Firebird 3.0+ the default DatabaseAccess setting is 'Restrict', limiting the server to directories listed in the configuration. A path that is permissible on a developer workstation (often because the server runs with elevated privileges or the setting has been overridden) may fall outside the whitelist in production, causing an 'unavailable database' error. The documentation does not give a clear migration path for existing applications that rely on arbitrary database locations, and it remains unclear how DatabaseAccess interacts with the ExternalFileAccess parameter for external tables and UDFs.
When you move from a developer workstation to a production machine that runs Firebird under a restricted account, the DatabaseAccess setting in firebird.conf can block Jaybird JDBC connections that previously worked. In Firebird 3.0+ the default is Restrict, which allows database files only in directories listed in the configuration. If the production database resides outside that list, Jaybird will return an unavailable database error.
DatabaseAccess; it simply passes the database file name to the server, which then applies the restriction.ExternalFileAccess, which is independent but also respects a separate whitelist when set to Restrict.DatabaseAccess=Full restores the pre‑3.0 behavior: any absolute path is accepted, but the server can access the entire filesystem.DatabaseAccess=Restrict, the DatabaseAccess whitelist in firebird.conf must include every directory that contains a database file used by the application.ExternalFileAccess=Restrict, any external file referenced by a stored procedure or UDF must also be on its whitelist; otherwise the operation fails silently or with a generic error.DatabaseAccess=None) to 3.0+ requires adding the existing database directories to the whitelist if you wish to keep the restrictive mode.Locate the absolute path of the database file that Jaybird uses in production (e.g., C:\Data\ProdDB.fdb).
Open firebird.conf and set:
DatabaseAccess=Restrict
DatabaseAccess=\C:\Data
Add each directory that contains a database file.Check the ExternalFileAccess setting. If your stored procedures or UDFs read external files, add those directories to the ExternalFileAccess whitelist or set it to Full for a temporary test.
Restart the Firebird service under the restricted account.
From the same service account, run a simple Jaybird JDBC test:
String url = "jdbc:firebirdsql://localhost:3050/C:/Data/ProdDB.fdb";
Connection con = DriverManager.getConnection(url, "SYSDBA", "masterkey");
System.out.println("Connected: " + con.isValid(1));
If the connection succeeds, the whitelist is correct.Audit any external file access. If a UDF fails, verify the file path against the ExternalFileAccess whitelist.
Once verified, consider tightening the ExternalFileAccess to Restrict again if you switched to Full for testing.
Could you confirm the current value of ExternalFileAccess in your firebird.conf and whether any stored procedures or UDFs read external files? This will determine if you need to adjust that whitelist as well.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.