Issue Details (XML | Word | Printable)

Key: CORE-4691
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Pavel Cisar
Votes: 0
Watchers: 2

If you were logged in you would be able to see more operations.
Firebird Core

Wrong database location resolution when DatabaseAccess restriced to specified directories

Created: 12/Feb/15 12:33 PM   Updated: 30/Mar/15 04:15 PM
Component/s: GSTAT
Affects Version/s: 2.5.0, 2.5.1, 2.5.2, 2.5.2 Update 1, 2.5.3, 2.5.3 Update 1
Fix Version/s: None

 Description  « Hide
gstat (without user/pwd parameters, just -h header scan) doesn't open database in CWD when db filename is specified without full path and filename is located in directory listed in DatabaseAccess spec.


srv:/ssd # /opt/firebird/bin/gstat -h mydb.fdb
Database "/sata/mydb.fdb"

when specifying path it opens correct file:
srv:/ssd # /opt/firebird/bin/gstat -h /ssd/mydb.fdb
Database "/ssd/mydb.fdb"

DatabaseAccess = Restrict /data/db;/data/db2;/sata;/ssd;/ramfs

gstat tries to resolve the given filename via aliases.conf in order to support aliases. In 2.5 it was intended that ResolveDatabaseAlias() routine was modified to transform relative paths via DatabaseAccess. But it should have been done only for the engine, not for utilities that also use ResolveDatabaseAlias()

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov added a comment - 12/Feb/15 12:44 PM
Looking at the code, NBACKUP should be also affected.

Alexander Peshkov added a comment - 12/Feb/15 02:36 PM
Pavel, can you reproduce it in trunk?

Pavel Cisar added a comment - 19/Feb/15 01:57 PM
Yes, I can reproduce with snapshot (19th Feb).

Alexander Peshkov added a comment - 19/Feb/15 02:06 PM
But what about FB3, i.e. trunk?

Alexander Peshkov added a comment - 30/Mar/15 04:15 PM
Pavel, I can add a check for presence of mydb.fdb in current directory. This will fix a case you mention here. But imagine a case when one does the following:

srv:/ssd # gbak -c copy.fbk restored.fdb

Where should be created restored.fdb? In /data/db or in /ssd? I'm afraid there is no good answer.