On Fri, Aug 08, 2014 at 10:48:11AM +0200, Lukas Slebodnik wrote:
On (07/08/14 19:46), Jakub Hrozek wrote:
>Hi,
>
>the attached patches change the replace-space-in-name functionality
>after discussion on the list. In short:
> - only space can be substituted
> - for only one character, not a string
> - the option is now set in the [sssd] section because it works for
> any responder
>
>For more details, please see the attached patches.
>From 4ebeea258ec01cf08bebfa4a5a110320c3c0898d Mon Sep 17 00:00:00 2001
>From: Jakub Hrozek <jhrozek(a)redhat.com>
>Date: Tue, 5 Aug 2014 10:12:34 +0200
>Subject: [PATCH 1/6] Only replace space with the specified substitution
>
>https://fedorahosted.org/sssd/ticket/2397
>
>- make sss_replace_whitespaces only replace space (' ') not any
> whitespace
>- make sss_replace_whitespaces only replace a single char, not the whole
> string
>- rename CONFDB_NSS_OVERRIDE_DEFAULT_WHITESPACE to
> CONFDB_NSS_OVERRIDE_DEFAULT_SPACE
>- rename the override_default_whitespace option to override_space
>- rename sss_replace_whitespaces() to sss_replace_space()
>- rename sss_reverse_replace_whitespaces() to sss_reverse_replace_space()
>- rename nctx->override_default_wsp_str to nctx->override_space
>- make the return value of sss_replace_space non-const to avoid freeing
> the result without compilation warnings
>---
//snip
>--- a/src/util/util.h
>+++ b/src/util/util.h
>@@ -566,11 +566,11 @@ errno_t name_to_well_known_sid(const char *dom, const char
*name,
> const char **sid);
>
> /* from string_utils.c */
>-const char * sss_replace_whitespaces(TALLOC_CTX *mem_ctx,
>- const char *orig_name,
>- const char *replace_string);
>-char * sss_reverse_replace_whitespaces(TALLOC_CTX *mem_ctx,
>- char *orig_name,
>- const char *replace_string);
>+char * sss_replace_space(TALLOC_CTX *mem_ctx,
>+ const char *orig_name,
>+ const char *replace_string);
>+char * sss_reverse_replace_space(TALLOC_CTX *mem_ctx,
>+ char *orig_name,
>+ const char *replace_string);
>
> #endif /* __SSSD_UTIL_H__ */
>--
>1.9.3
>
I don't know why did you change the same lines twice:
1st time in this patch: functions werere renamed.
2nt time in next patch "const char *replace_string" was replaced with
character.
In my opinion, it can be done in one patch.
Done as well as all the other changes you requested. Please see the
attached patches.