summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-07-10 17:00:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:11 -0500
commitf0f87cf7faecb9899a6a04da72e13ed6c408d01b (patch)
tree9a71ffac30238640a9546984ac1360d1f4f28695
parent608172ebe31abd4ffa9584fd3fe411cb0955f5fa (diff)
downloadsamba-f0f87cf7faecb9899a6a04da72e13ed6c408d01b.tar.gz
samba-f0f87cf7faecb9899a6a04da72e13ed6c408d01b.tar.bz2
samba-f0f87cf7faecb9899a6a04da72e13ed6c408d01b.zip
r1430: Although prepared for only one remote backend, make the 'idmap backend'
parameter a list instead of a string. This makes idmap backend = ldap:"ldap://localhost/ ldap://fallback/" possible. Volker (This used to be commit ea718347937ec0e5640b29e0e9edf6eda2b45e34)
-rw-r--r--source3/param/loadparm.c6
-rw-r--r--source3/sam/idmap.c7
2 files changed, 7 insertions, 6 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 0785c2501b..a309fde007 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -176,7 +176,7 @@ typedef struct
BOOL bWinbindTrustedDomainsOnly;
BOOL bWinbindNestedGroups;
char *szWinbindBackend;
- char *szIdmapBackend;
+ char **szIdmapBackend;
char *szAddShareCommand;
char *szChangeShareCommand;
char *szDeleteShareCommand;
@@ -1165,7 +1165,7 @@ static struct parm_struct parm_table[] = {
{N_("Winbind options"), P_SEP, P_SEPARATOR},
{"enable rid algorithm", P_BOOL, P_GLOBAL, &Globals.bEnableRidAlgorithm, NULL, NULL, FLAG_DEPRECATED},
- {"idmap backend", P_STRING, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED},
+ {"idmap backend", P_LIST, P_GLOBAL, &Globals.szIdmapBackend, NULL, NULL, FLAG_ADVANCED},
{"idmap uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_ADVANCED},
{"winbind uid", P_STRING, P_GLOBAL, &Globals.szIdmapUID, handle_idmap_uid, NULL, FLAG_HIDE},
{"idmap gid", P_STRING, P_GLOBAL, &Globals.szIdmapGID, handle_idmap_gid, NULL, FLAG_ADVANCED},
@@ -1710,7 +1710,7 @@ FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain)
FN_GLOBAL_BOOL(lp_winbind_trusted_domains_only, &Globals.bWinbindTrustedDomainsOnly)
FN_GLOBAL_BOOL(lp_winbind_nested_groups, &Globals.bWinbindNestedGroups)
-FN_GLOBAL_STRING(lp_idmap_backend, &Globals.szIdmapBackend)
+FN_GLOBAL_LIST(lp_idmap_backend, &Globals.szIdmapBackend)
FN_GLOBAL_BOOL(lp_enable_rid_algorithm, &Globals.bEnableRidAlgorithm)
#ifdef WITH_LDAP_SAMCONFIG
diff --git a/source3/sam/idmap.c b/source3/sam/idmap.c
index bbb4980c76..d541776f39 100644
--- a/source3/sam/idmap.c
+++ b/source3/sam/idmap.c
@@ -96,7 +96,7 @@ NTSTATUS smb_register_idmap(int version, const char *name, struct idmap_methods
Initialise idmap cache and a remote backend (if configured).
**********************************************************************/
-BOOL idmap_init(const char *remote_backend)
+BOOL idmap_init(const char **remote_backend)
{
if (!backends)
static_init_idmap;
@@ -115,8 +115,9 @@ BOOL idmap_init(const char *remote_backend)
}
}
- if (!remote_map && remote_backend && *remote_backend != 0) {
- char *rem_backend = smb_xstrdup(remote_backend);
+ if ((remote_map == NULL) && (remote_backend != NULL) &&
+ (*remote_backend != NULL) && (**remote_backend != '\0')) {
+ char *rem_backend = smb_xstrdup(*remote_backend);
fstring params = "";
char *pparams;