aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-17 21:59:41 +0100
committerMax Kellermann <max@duempel.org>2014-02-17 22:13:53 +0100
commit1ddd00433ee4eb60818e8bd587d6f3ccfec70b8f (patch)
tree590ccdba4bd6d003727e5589dd8cfb140cd90bab
parentde160bb2d1c04977fba2c0910bb98f9f602b5c73 (diff)
downloadmpd-1ddd00433ee4eb60818e8bd587d6f3ccfec70b8f.tar.gz
mpd-1ddd00433ee4eb60818e8bd587d6f3ccfec70b8f.tar.xz
mpd-1ddd00433ee4eb60818e8bd587d6f3ccfec70b8f.zip
db/Configured: disallow both "db_file" and "database"
This is misconfiguration, and MPD should abort.
-rw-r--r--src/db/Configured.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/db/Configured.cxx b/src/db/Configured.cxx
index 0cec7efd0..a6194dc5c 100644
--- a/src/db/Configured.cxx
+++ b/src/db/Configured.cxx
@@ -23,6 +23,7 @@
#include "config/ConfigGlobal.hxx"
#include "config/ConfigData.hxx"
#include "config/ConfigError.hxx"
+#include "util/Error.hxx"
#include "Log.hxx"
Database *
@@ -32,9 +33,12 @@ CreateConfiguredDatabase(EventLoop &loop, DatabaseListener &listener,
const struct config_param *param = config_get_param(CONF_DATABASE);
const struct config_param *path = config_get_param(CONF_DB_FILE);
- if (param != nullptr && path != nullptr)
- LogWarning(config_domain,
- "Found both 'database' and 'db_file' setting - ignoring the latter");
+ if (param != nullptr && path != nullptr) {
+ error.Format(config_domain,
+ "Found both 'database' (line %d) and 'db_file' (line %d) setting",
+ param->line, path->line);
+ return nullptr;
+ }
if (!have_storage) {
if (param != nullptr)