Blame SOURCES/0053-UTIL-Expose-replace_char-as-sss_replace_char.patch

ecf709
From 3a3b761bc89aa860ca7e6af323c3e0425306014c Mon Sep 17 00:00:00 2001
ecf709
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
ecf709
Date: Sun, 26 Mar 2017 01:49:53 +0100
ecf709
Subject: [PATCH 53/54] UTIL: Expose replace_char() as sss_replace_char()
ecf709
MIME-Version: 1.0
ecf709
Content-Type: text/plain; charset=UTF-8
ecf709
Content-Transfer-Encoding: 8bit
ecf709
ecf709
This method is going to be used in the follow-up patch for replacing ','
ecf709
by ':' so we can keep the domain resolution order option consitent with
ecf709
the way it's set on IPA side and still keep consistent with the way
ecf709
lists are represented on sssd.conf file.
ecf709
ecf709
Related:
ecf709
https://pagure.io/SSSD/sssd/issue/3001
ecf709
ecf709
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
ecf709
ecf709
Reviewed-by: Sumit Bose <sbose@redhat.com>
ecf709
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
ecf709
---
ecf709
 src/util/string_utils.c | 12 ++++++------
ecf709
 src/util/util.h         |  5 +++++
ecf709
 2 files changed, 11 insertions(+), 6 deletions(-)
ecf709
ecf709
diff --git a/src/util/string_utils.c b/src/util/string_utils.c
ecf709
index 872b7e29e55e8628085affd07f3363019aae5ee9..1215ec96a57089a13f455812adf5a0b0812afa6d 100644
ecf709
--- a/src/util/string_utils.c
ecf709
+++ b/src/util/string_utils.c
ecf709
@@ -22,10 +22,10 @@
ecf709
 
ecf709
 #include "util/util.h"
ecf709
 
ecf709
-static char *replace_char(TALLOC_CTX *mem_ctx,
ecf709
-                          const char *in,
ecf709
-                          const char match,
ecf709
-                          const char sub)
ecf709
+char *sss_replace_char(TALLOC_CTX *mem_ctx,
ecf709
+                       const char *in,
ecf709
+                       const char match,
ecf709
+                       const char sub)
ecf709
 {
ecf709
     char *p;
ecf709
     char *out;
ecf709
@@ -63,7 +63,7 @@ char * sss_replace_space(TALLOC_CTX *mem_ctx,
ecf709
         return talloc_strdup(mem_ctx, orig_name);
ecf709
     }
ecf709
 
ecf709
-    return replace_char(mem_ctx, orig_name, ' ', subst);
ecf709
+    return sss_replace_char(mem_ctx, orig_name, ' ', subst);
ecf709
 }
ecf709
 
ecf709
 char * sss_reverse_replace_space(TALLOC_CTX *mem_ctx,
ecf709
@@ -81,7 +81,7 @@ char * sss_reverse_replace_space(TALLOC_CTX *mem_ctx,
ecf709
         return talloc_strdup(mem_ctx, orig_name);
ecf709
     }
ecf709
 
ecf709
-    return replace_char(mem_ctx, orig_name, subst, ' ');
ecf709
+    return sss_replace_char(mem_ctx, orig_name, subst, ' ');
ecf709
 }
ecf709
 
ecf709
 errno_t guid_blob_to_string_buf(const uint8_t *blob, char *str_buf,
ecf709
diff --git a/src/util/util.h b/src/util/util.h
ecf709
index 82760940269ad8883e725e3a5cf463486c9cfd36..2170c5fb7cffda3910d2b58e33ec7abe3ec4a7d4 100644
ecf709
--- a/src/util/util.h
ecf709
+++ b/src/util/util.h
ecf709
@@ -600,6 +600,11 @@ errno_t name_to_well_known_sid(const char *dom, const char *name,
ecf709
                                const char **sid);
ecf709
 
ecf709
 /* from string_utils.c */
ecf709
+char *sss_replace_char(TALLOC_CTX *mem_ctx,
ecf709
+                       const char *in,
ecf709
+                       const char match,
ecf709
+                       const char sub);
ecf709
+
ecf709
 char * sss_replace_space(TALLOC_CTX *mem_ctx,
ecf709
                          const char *orig_name,
ecf709
                          const char replace_char);
ecf709
-- 
ecf709
2.9.3
ecf709