summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2016-12-07 17:44:25 +0100
committerJeremy Allison <jra@samba.org>2016-12-12 20:19:10 +0100
commit3de634d7a04f9e1cb8fda9dfb50b3675ab88b4fc (patch)
tree6237fdfec560f40bf34c85abe6cff0e8a7aa5e77
parent46337ce43c84a9cbedb6310a6291040a5e252b84 (diff)
downloadsamba-3de634d7a04f9e1cb8fda9dfb50b3675ab88b4fc.tar.gz
s3-testparm: Print error if the default backend is incorrect
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--source3/utils/testparm.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index c330ad16959..e0cfaf14d9f 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -313,6 +313,32 @@ static int do_global_checks(void)
fprintf(stderr, "'algorithmic rid base' must be even.\n\n");
}
+ if (lp_server_role() != ROLE_STANDALONE) {
+ const char *default_backends[] = {
+ "tdb", "tdb2", "ldap", "autorid", "hash"
+ };
+ const char *idmap_backend;
+ bool valid_backend = false;
+ uint32_t i;
+ bool ok;
+
+ idmap_backend = lp_idmap_default_backend();
+
+ for (i = 0; i < ARRAY_SIZE(default_backends); i++) {
+ ok = strequal(idmap_backend, default_backends[i]);
+ if (ok) {
+ valid_backend = true;
+ }
+ }
+
+ if (!valid_backend) {
+ ret = 1;
+ fprintf(stderr, "ERROR: Do not use the '%s' backend "
+ "as the default idmap backend!\n\n",
+ idmap_backend);
+ }
+ }
+
#ifndef HAVE_DLOPEN
if (lp_preload_modules()) {
fprintf(stderr, "WARNING: 'preload modules = ' set while loading "