idmap_hash: only allow the hash module for default idmap config.
authorMichael Adam <obnox@samba.org>
Mon, 14 Mar 2016 16:07:34 +0000 (17:07 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Mar 2016 00:08:32 +0000 (01:08 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11786

This module only makes sense as the default idmap config
("idmap config * : backend = hash" ...)

Pair-Programmed-With: Guenther Deschner <gd@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/idmap_hash/idmap_hash.c

index ed9cc208d5788d63ff7affa04729a178f8d49649..0aba36c30352a39ca08840ae2c1fa172aa65469f 100644 (file)
@@ -112,6 +112,13 @@ static NTSTATUS idmap_hash_initialize(struct idmap_domain *dom)
        size_t num_domains = 0;
        int i;
 
+       if (!strequal(dom->name, "*")) {
+               DBG_ERR("Error: idmap_hash configured for domain '%s'. "
+                       "But the hash module can only be used for the default "
+                       "idmap configuration.\n", dom->name);
+               return NT_STATUS_INVALID_PARAMETER;
+       }
+
        /* If the domain SID hash table has been initialized, assume
           that we completed this function previously */