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

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