Menu

#2035 Placeholder: Database Name (Not the Filename)

KeePass_2.x
open
nobody
None
5
2015-08-19
2015-08-18
KK
No

Placeholders {DB_NAME} and {DB_BASENAME} apply to Filename, accordingly with and without extension.
While there is also a Database name to set in File -> Database Settings -> Database name field.

  1. Kind of confusing, it's DB_NAME and DB_BASENAME while it has nothing to do with the Database name configured in settings (please correct me if I'm wrong and if this actually can be used somehow)
  2. New Placeholder could be used as a trigger's condition (for example when triggering a post-save auto-backup); although it's clear on the Conditions tab in Trigger Edit window that "If no conditions are specified, the actions are always performed", then the thing is that Filename can be changed with proper permissions on FS level, and the Database name configured in Database settings can be changed only when accessed the DB itself.

Discussion

  • Paul

    Paul - 2015-08-18
    1. The placeholders relate to the currently active database. Anything else is up to you to code.
    2. Triggering post save only ever relates to the current database. What did you want to achieve that can't be done in this example?

    cheers, Paul

     
  • KK

    KK - 2015-08-18

    Thanks Paul :-)

    I actually trigger the "Export active database" Action on "Saved database file" Event as:
    File/URL: {DB_DIR}{ENV_DIRSEP}{DB_BASENAME}-{DT_SIMPLE}.{DB_EXT}
    File format: KeePass KDBX (2.x)
    So more like this example with the same format on output (and on save, not on open action).

    My question and/or request was to find a way to use the DB name declared in DB settings - we all can see that it's optional (no doubts about it) but is there any way to grab this name using triggers?

     
  • Paul

    Paul - 2015-08-18

    If you want to read details from the settings you need to use an external program (awk, VBS, etc) to read the config file.

    cheers, Paul

     
  • wellread1

    wellread1 - 2015-08-18

    If I understand your post correctly, you are requesting a placeholder that references the database name assigned in database settings primarily out of concern that the actual file name of the password database can be altered, or the database could be substituted, and this might pose a security threat. As far as I know database name and description in settings is a label for the user's convenience, and otherwise not used. For many other purpuses the filename and path are excellent identifiers.

    KeePass is not vulnerable to threats caused by simple renaming or substitution of database files because:

    • It only needs the location and name of the database file when it opens the database, at which time it verifies the file by opening the database with the user supplied Master Key.
    • When a database is saved or synchronized, it either overwrites any exisitng database or requires that the target database have the same Master Key as the active database.

    An event such as unauthorized renaming of substitution is only an idicator that your computer is compromised (and your database might have been stolen). In that event one should not run most software (except e.g. anti-malware or restore software) until you have neutralized the threat.

     

    Last edit: wellread1 2015-08-18
  • KK

    KK - 2015-08-19

    Ok, thank you for your answers.
    Please close the ticket if you may, it seems I am unable to do so myself.

     

Log in to post a comment.

Auth0 Logo