diff options
author | Gerald Carter <jerry@samba.org> | 2007-04-23 06:10:22 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:37 -0500 |
commit | b9c4009037079bddb032d582d59e9e4c7b6ceb6e (patch) | |
tree | 16df6e7560e679d509e96a2b7d06977575bdb3c4 | |
parent | 655d2b5200e96fc9a4b3b74b6a931cece03fe503 (diff) | |
download | samba-b9c4009037079bddb032d582d59e9e4c7b6ceb6e.tar.gz samba-b9c4009037079bddb032d582d59e9e4c7b6ceb6e.tar.bz2 samba-b9c4009037079bddb032d582d59e9e4c7b6ceb6e.zip |
r22473: Correct fix for setting a default compat tdb idmap backend.
Previous code would always fill in "idmap backend = tdb"
even if you defined idmap domains. My fault. I should
have tested the original patch more before committing.
(This used to be commit a60c3f6a5a92722552197f7ab133f2ec3af377f9)
-rw-r--r-- | source3/nsswitch/idmap.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/source3/nsswitch/idmap.c b/source3/nsswitch/idmap.c index 7a74f744b4..7589ee66ab 100644 --- a/source3/nsswitch/idmap.c +++ b/source3/nsswitch/idmap.c @@ -289,40 +289,42 @@ NTSTATUS idmap_init(void) dom_list = lp_idmap_domains(); - if ( dom_list && lp_idmap_backend() ) { - DEBUG(0, ("WARNING: idmap backend and idmap domains are " - "mutually excusive!\n")); - DEBUGADD(0,("idmap backend option will be IGNORED!\n")); - } else if ( lp_idmap_backend() ) { - const char **compat_list = lp_idmap_backend(); + if ( lp_idmap_backend() ) { + const char **compat_list = lp_idmap_backend(); char *p = NULL; const char *q = NULL; - compat = 1; + if ( dom_list ) { + DEBUG(0, ("WARNING: idmap backend and idmap domains are " + "mutually excusive!\n")); + DEBUGADD(0,("idmap backend option will be IGNORED!\n")); + } else { + compat = 1; - if ( (compat_backend = talloc_strdup( idmap_ctx, *compat_list )) == NULL ) { - ret = NT_STATUS_NO_MEMORY; - goto done; - } + if ( (compat_backend = talloc_strdup( idmap_ctx, *compat_list )) == NULL ) { + ret = NT_STATUS_NO_MEMORY; + goto done; + } - /* strip any leading idmap_ prefix of */ - if (strncmp(*compat_list, "idmap_", 6) == 0 ) { - q = *compat_list += 6; - DEBUG(0, ("WARNING: idmap backend uses obsolete and " - "deprecated 'idmap_' prefix.\n" - "Please replace 'idmap_%s' by '%s' in %s\n", - q, q, dyn_CONFIGFILE)); - compat_backend = talloc_strdup( idmap_ctx, q); - } else { - compat_backend = talloc_strdup( idmap_ctx, *compat_list); - } + /* strip any leading idmap_ prefix of */ + if (strncmp(*compat_list, "idmap_", 6) == 0 ) { + q = *compat_list += 6; + DEBUG(0, ("WARNING: idmap backend uses obsolete and " + "deprecated 'idmap_' prefix.\n" + "Please replace 'idmap_%s' by '%s' in %s\n", + q, q, dyn_CONFIGFILE)); + compat_backend = talloc_strdup( idmap_ctx, q); + } else { + compat_backend = talloc_strdup( idmap_ctx, *compat_list); + } - /* separate the backend and module arguements */ - if ((p = strchr(compat_backend, ':')) != NULL) { - *p = '\0'; - compat_params = p + 1; - } - } else { + /* separate the backend and module arguements */ + if ((p = strchr(compat_backend, ':')) != NULL) { + *p = '\0'; + compat_params = p + 1; + } + } + } else if ( !dom_list ) { /* Back compatible: without idmap domains and explicit idmap backend. Taking default idmap backend: tdb */ @@ -331,7 +333,6 @@ NTSTATUS idmap_init(void) compat_params = compat_backend; } - if ( ! dom_list) { dom_list = idmap_default_domain; } |