diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2009-12-09 04:00:09 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-12-10 17:20:27 -0500 |
commit | 6730ad84968681d86ff7d82751fe886a2f138673 (patch) | |
tree | 509eff4b47b8aa1f96444384a6029ecda13a611e /server/providers/ldap/ldap_common.c | |
parent | cdfea28842f2ac05808f18240ca0bd48747ea837 (diff) | |
download | sssd-6730ad84968681d86ff7d82751fe886a2f138673.tar.gz sssd-6730ad84968681d86ff7d82751fe886a2f138673.tar.bz2 sssd-6730ad84968681d86ff7d82751fe886a2f138673.zip |
Consolidate code for splitting strings by separator
There were two functions for parsing strings by a separator. This patch
consolidates on the one previously used in confdb. This also allows
stripping the tokens of whitespace.
Fixes: #319
Diffstat (limited to 'server/providers/ldap/ldap_common.c')
-rw-r--r-- | server/providers/ldap/ldap_common.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/providers/ldap/ldap_common.c b/server/providers/ldap/ldap_common.c index e4f3f6bb..74b478cc 100644 --- a/server/providers/ldap/ldap_common.c +++ b/server/providers/ldap/ldap_common.c @@ -503,7 +503,6 @@ int sdap_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, struct sdap_service *service; LDAPURLDesc *lud; char **list = NULL; - int count = 0; int ret; int i; @@ -531,14 +530,14 @@ int sdap_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, } /* split server parm into a list */ - ret = sss_split_list(tmp_ctx, urls, ", ", &list, &count); + ret = split_on_separator(tmp_ctx, urls, ',', true, &list, NULL); if (ret != EOK) { DEBUG(1, ("Failed to parse server list!\n")); goto done; } /* now for each URI add a new server to the failover service */ - for (i = 0; i < count; i++) { + for (i = 0; list[i]; i++) { ret = ldap_url_parse(list[i], &lud); if (ret != LDAP_SUCCESS) { DEBUG(0, ("Failed to parse ldap URI (%s)!\n", list[i])); |