Subject Re: [firebird-support] Detecting Database Directory on Server
Author Mark Pickersgill
Hello,

After reading a few of the posts on this topic, I was a bit
discouraged to see people dismiss the idea of being able to figure
out the database path from the alias name. (Or am I reading it
wrong?)

I myself am looking at implementing some backup routines that will
backup to a specific directory BELOW where the currently accessed
database is being stored. So something along the lines of:

- Connect to db via aliasname "dbalias"
- Find out the path of the database file (this seems to be available
using the Characteristics property of IBObject's TB_Connection
component).
- BackupFile := DbPath + 'Interim-' FormatDateTime('yyyymmdd', Now);
- Start the Backup service (using something like IBOAdmin components) with
the BackupFile as the file to be created as the backup.

I find it bizarre that the backup services require knowledge of
where the database or backup files are, and yet there seems to be
talk of dropping the functionality of obtaining the database path.
(Or am I reading something incorrectly?).

To my mind, if you can connect to the db using the alias, knowing
the database filename on the server isn't going to be a security
issue since you still need access to the actual database machine to
do any damage, yet with or without the db path you've still managed
to connect to the database via the alias where you can still access
information. Aliases are more of a useful abstraction to the
database name.

If it is somehow a security risk (I'd be interested in the scenario),
then would it be possible to add the ability into the aliases.conf
file to specify a directory that new databases can appear in?
Something like:
<newdbs>=D:\data\userdbs

Then when you do need to create a database or a backup file, you can
use the "folder alias" which still gives you the flexibility of
using an alias. You would of course have to limit the "folder alias"
usage to ONLY having a file name after the alias. ie, the following
would have to be prevented:
<newdbs>\..\naughty.fdb
<newdbs>\subdir\notme.fdb

The other advantage of this is that people don't HAVE to use it and
the raw db filename is not (will not be?) available from the alias.

Anyway, that's a general suggestion that (I think) would be useful
and would also solve the need to know the raw database name/path.

I'd be interested in comments on this or how other people deal with
varying backup filenames, since I'm currently in the process of
creating the backup strategy as I suggested above.

thanks
Mark

EH> Hi,

EH> how can an client detect where to place databases on the server?

EH> Elmar




EH> Yahoo! Groups Links