summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/idmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/nsswitch/idmap.c b/source3/nsswitch/idmap.c
index 92c5ca1355..d69fd68e10 100644
--- a/source3/nsswitch/idmap.c
+++ b/source3/nsswitch/idmap.c
@@ -497,7 +497,8 @@ NTSTATUS idmap_init(void)
/**** finished adding idmap_passdb backend ****/
/* sort domains so that the default is the last one */
- if (def_dom_num != num_domains-1) { /* default is not last, move it */
+ /* don't sort if no default domain defined */
+ if (def_dom_num != -1 && def_dom_num != num_domains-1) { /* default is not last, move it */
struct idmap_domain *tmp;
if (pdb_dom_num > def_dom_num) {