View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001383||Anope Development (1.9.x series)||Other||public||2012-03-06 01:00||2012-05-07 03:11|
|Summary||0001383: Database file backup fails for DatabaseFile with path|
I'm not very happy with
Anope::string newname = "backups/" + DatabaseFile + "." + stringify(tm->tm_year) + stringify(tm->tm_mon) + stringify(tm->tm_mday);
(both in modules/database/db_flatfile.cpp and modules/database/db_plain.cpp).
At first, if the DatabaseFile is configured to an absolute path like
database = "/var/lib/anope/anope.db"
the code above will try to backup a database file to
backups/var/lib/anope/anope.db.NNNN (number depends on date)
which will very likely fail. Please consider using the base name of
A second thing, the filename created has a small risk for collisions.
Please consider padding (preferred as this keeps backup files sorted)
or insert separators between the date components.
|Tags||No tags attached.|
||I've added the ability for the directory databases are stored in to be changed at runtime in 675b113c3e03cf1917b2a731c21fe82b5f1f2b2b by command line options. I've also added options to cmake to allow installing binaries/libs/configs/whatever in directories other than the default, if you want to use those you define one or more of BIN_DIR, DB_DIR, DOC_DOC, LIB_DIR, CONF_DIR, LOCALE_DIR, or LOGS_DIR in ./Config for cmake.|
||For now I have pushed a fix for the backup database name collision.|
||The database configuration option actually is supposed to just be a name. I'm not sure if we want to support saving and loading databases from outside of the services data directory.|
|2012-03-06 01:00||cbiedl||New Issue|
|2012-03-06 03:04||Adam||Note Added: 0006093|
|2012-03-07 10:13||Adam||Note Added: 0006094|
|2012-03-07 10:14||Adam||Status||new => acknowledged|
|2012-05-07 03:11||Adam||Note Added: 0006147|
|2012-05-07 03:11||Adam||Status||acknowledged => resolved|
|2012-05-07 03:11||Adam||Resolution||open => fixed|
|2012-05-07 03:11||Adam||Assigned To||=> Adam|