Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong database location resolution when DatabaseAccess restriced to specified directories [CORE4691] #4999

Open
firebird-automations opened this issue Feb 12, 2015 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pcisar

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.

Example:

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()

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Looking at the code, NBACKUP should be also affected.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Pavel, can you reproduce it in trunk?

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

Yes, I can reproduce with 2.5.4.26840 snapshot (19th Feb).

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

But what about FB3, i.e. trunk?

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment