>From f36b8d0459ce2cbd67e075637adf209e4085d8a2 Mon Sep 17 00:00:00 2001
From: Michal Zidek <mzidek@redhat.com>
Date: Thu, 24 Apr 2014 17:26:37 +0200
Subject: [PATCH] Use sss_strerror instead of strerror.

---
 Makefile.am                                        | 11 ++--
 src/confdb/confdb.c                                | 18 +++---
 src/confdb/confdb_setup.c                          |  2 +-
 src/db/sysdb.c                                     |  2 +-
 src/db/sysdb_autofs.c                              | 22 +++----
 src/db/sysdb_idmap.c                               |  2 +-
 src/db/sysdb_ops.c                                 | 68 +++++++++++-----------
 src/db/sysdb_ranges.c                              |  2 +-
 src/db/sysdb_search.c                              |  4 +-
 src/db/sysdb_selinux.c                             |  9 +--
 src/db/sysdb_services.c                            | 13 +++--
 src/db/sysdb_ssh.c                                 | 20 ++++---
 src/db/sysdb_sudo.c                                |  8 +--
 src/monitor/monitor.c                              |  2 +-
 src/monitor/monitor_sbus.c                         |  4 +-
 src/providers/ad/ad_common.c                       | 14 ++---
 src/providers/ad/ad_id.c                           |  6 +-
 src/providers/ad/ad_init.c                         | 16 ++---
 src/providers/ad/ad_srv.c                          |  2 +-
 src/providers/ad/ad_subdomains.c                   | 12 ++--
 src/providers/ad/ad_sudo.c                         |  2 +-
 src/providers/data_provider_be.c                   |  8 +--
 src/providers/dp_auth_util.c                       |  4 +-
 src/providers/dp_pam_data_util.c                   |  2 +-
 src/providers/fail_over_srv.c                      |  2 +-
 src/providers/ipa/ipa_access.c                     |  9 +--
 src/providers/ipa/ipa_auth.c                       |  4 +-
 src/providers/ipa/ipa_hbac_common.c                |  7 ++-
 src/providers/ipa/ipa_hbac_services.c              |  3 +-
 src/providers/ipa/ipa_hosts.c                      |  2 +-
 src/providers/ipa/ipa_init.c                       | 17 +++---
 src/providers/ipa/ipa_selinux.c                    |  8 +--
 src/providers/ipa/ipa_subdomains.c                 |  4 +-
 src/providers/ipa/ipa_subdomains_ext_groups.c      | 10 ++--
 src/providers/ipa/ipa_subdomains_id.c              |  4 +-
 src/providers/ipa/ipa_sudo.c                       |  2 +-
 src/providers/krb5/krb5_access.c                   |  2 +-
 src/providers/krb5/krb5_auth.c                     | 16 ++---
 src/providers/krb5/krb5_child.c                    |  4 +-
 src/providers/krb5/krb5_common.c                   |  4 +-
 .../krb5/krb5_delayed_online_authentication.c      |  4 +-
 src/providers/krb5/krb5_init.c                     |  2 +-
 src/providers/krb5/krb5_init_shared.c              |  2 +-
 src/providers/krb5/krb5_utils.c                    |  4 +-
 src/providers/ldap/ldap_child.c                    |  4 +-
 src/providers/ldap/ldap_common.c                   |  2 +-
 src/providers/ldap/ldap_id.c                       |  2 +-
 src/providers/ldap/ldap_id_cleanup.c               |  2 +-
 src/providers/ldap/ldap_init.c                     | 18 +++---
 src/providers/ldap/sdap.c                          |  2 +-
 src/providers/ldap/sdap_access.c                   |  3 +-
 src/providers/ldap/sdap_async.c                    | 15 +++--
 src/providers/ldap/sdap_async_autofs.c             | 18 +++---
 src/providers/ldap/sdap_async_connection.c         |  2 +-
 src/providers/ldap/sdap_async_enum.c               |  2 +-
 src/providers/ldap/sdap_async_groups_ad.c          |  8 +--
 src/providers/ldap/sdap_async_initgroups.c         | 51 ++++++++--------
 src/providers/ldap/sdap_async_nested_groups.c      | 24 ++++----
 src/providers/ldap/sdap_async_services.c           | 14 ++---
 src/providers/ldap/sdap_async_sudo.c               | 14 +++--
 src/providers/ldap/sdap_async_sudo_hostinfo.c      | 11 ++--
 src/providers/ldap/sdap_async_users.c              |  4 +-
 src/providers/ldap/sdap_autofs.c                   |  4 +-
 src/providers/ldap/sdap_child_helpers.c            |  5 +-
 src/providers/ldap/sdap_domain.c                   |  4 +-
 src/providers/ldap/sdap_dyndns.c                   |  2 +-
 src/providers/ldap/sdap_id_op.c                    |  7 ++-
 src/providers/ldap/sdap_idmap.c                    |  6 +-
 src/providers/ldap/sdap_reinit.c                   |  6 +-
 src/providers/ldap/sdap_sudo.c                     | 39 +++++++------
 src/providers/ldap/sdap_sudo_cache.c               |  6 +-
 src/providers/ldap/sdap_utils.c                    |  2 +-
 src/providers/proxy/proxy_auth.c                   |  2 +-
 src/providers/proxy/proxy_child.c                  |  2 +-
 src/providers/proxy/proxy_id.c                     | 44 +++++++-------
 src/providers/proxy/proxy_services.c               |  6 +-
 src/python/pysss.c                                 |  2 +-
 src/resolv/async_resolv.c                          |  4 +-
 src/resolv/async_resolv_utils.c                    |  2 +-
 src/responder/autofs/autofssrv.c                   |  2 +-
 src/responder/autofs/autofssrv_cmd.c               | 10 ++--
 src/responder/autofs/autofssrv_dp.c                |  2 +-
 src/responder/common/negcache.c                    | 12 ++--
 src/responder/common/responder_common.c            |  8 +--
 src/responder/common/responder_dp.c                |  2 +-
 src/responder/common/responder_get_domains.c       |  5 +-
 src/responder/nss/nsssrv_cmd.c                     | 22 +++----
 src/responder/nss/nsssrv_mmap_cache.c              |  2 +-
 src/responder/nss/nsssrv_netgroup.c                | 11 ++--
 src/responder/nss/nsssrv_services.c                | 12 ++--
 src/responder/pac/pacsrv_cmd.c                     |  8 +--
 src/responder/pam/pamsrv.c                         |  2 +-
 src/responder/ssh/sshsrv.c                         |  4 +-
 src/responder/ssh/sshsrv_cmd.c                     |  2 +-
 src/responder/ssh/sshsrv_dp.c                      |  2 +-
 src/responder/sudo/sudosrv.c                       |  2 +-
 src/responder/sudo/sudosrv_cmd.c                   |  6 +-
 src/responder/sudo/sudosrv_dp.c                    |  4 +-
 src/responder/sudo/sudosrv_get_sudorules.c         | 26 +++++----
 src/responder/sudo/sudosrv_query.c                 |  2 +-
 src/tools/sss_groupadd.c                           |  5 +-
 src/tools/sss_groupdel.c                           |  4 +-
 src/tools/sss_groupshow.c                          | 18 +++---
 src/tools/sss_seed.c                               |  8 +--
 src/tools/sss_sync_ops.c                           |  4 +-
 src/tools/sss_useradd.c                            | 12 ++--
 src/tools/sss_userdel.c                            |  8 +--
 src/tools/sss_usermod.c                            |  2 +-
 src/tools/tools_mc_util.c                          |  2 +-
 src/util/child_common.c                            |  2 +-
 src/util/server.c                                  | 14 ++---
 111 files changed, 481 insertions(+), 446 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8d3d366..f95c1f2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1290,7 +1290,7 @@ resolv_tests_LDADD = \
     $(SSSD_LIBS) \
     $(CHECK_LIBS) \
     $(CARES_LIBS) \
-    libsss_debug.la \
+    $(SSSD_INTERNAL_LTLIBS) \
     libsss_test_common.la
 
 refcount_tests_SOURCES = \
@@ -2347,12 +2347,13 @@ krb5_child_CFLAGS = \
     $(POPT_CFLAGS) \
     $(KRB5_CFLAGS)
 krb5_child_LDADD = \
-    libsss_debug.la \
     $(TALLOC_LIBS) \
     $(POPT_LIBS) \
     $(DHASH_LIBS) \
     $(KRB5_LIBS) \
-    $(CLIENT_LIBS)
+    $(CLIENT_LIBS) \
+    $(SSSD_INTERNAL_LTLIBS) \
+    $(NULL)
 
 ldap_child_SOURCES = \
     src/providers/ldap/ldap_child.c \
@@ -2370,7 +2371,9 @@ ldap_child_LDADD = \
     $(TALLOC_LIBS) \
     $(POPT_LIBS) \
     $(DHASH_LIBS) \
-    $(KRB5_LIBS)
+    $(KRB5_LIBS) \
+    $(SSSD_INTERNAL_LTLIBS) \
+    $(NULL)
 
 gpo_child_SOURCES = \
     src/providers/ad/ad_gpo_child.c \
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index 674a2c4..d693aa0 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -212,7 +212,7 @@ done:
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Failed to add [%s] to [%s], error [%d] (%s)\n",
-                  attribute, section, ret, strerror(ret));
+                  attribute, section, ret, sss_strerror(ret));
     }
     return ret;
 }
@@ -289,7 +289,7 @@ done:
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Failed to get [%s] from [%s], error [%d] (%s)\n",
-                  attribute, section, ret, strerror(ret));
+                  attribute, section, ret, sss_strerror(ret));
     }
     return ret;
 }
@@ -364,7 +364,7 @@ done:
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Failed to set [%s] from [%s], error [%d] (%s)\n",
-               attribute, section, ret, strerror(ret));
+               attribute, section, ret, sss_strerror(ret));
     }
     return ret;
 }
@@ -485,7 +485,7 @@ failed:
     talloc_free(values);
     DEBUG(SSSDBG_CRIT_FAILURE,
           "Failed to get [%s] from [%s], error [%d] (%s)\n",
-              attribute, section, ret, strerror(ret));
+              attribute, section, ret, sss_strerror(ret));
     return ret;
 }
 
@@ -541,7 +541,7 @@ failed:
     talloc_free(tmp_ctx);
     DEBUG(SSSDBG_CRIT_FAILURE,
           "Failed to read [%s] from [%s], error [%d] (%s)\n",
-              attribute, section, ret, strerror(ret));
+              attribute, section, ret, sss_strerror(ret));
     return ret;
 }
 
@@ -592,7 +592,7 @@ failed:
     talloc_free(tmp_ctx);
     DEBUG(SSSDBG_CRIT_FAILURE,
           "Failed to read [%s] from [%s], error [%d] (%s)\n",
-              attribute, section, ret, strerror(ret));
+              attribute, section, ret, sss_strerror(ret));
     return ret;
 }
 
@@ -649,7 +649,7 @@ failed:
     talloc_free(tmp_ctx);
     DEBUG(SSSDBG_CRIT_FAILURE,
           "Failed to read [%s] from [%s], error [%d] (%s)\n",
-              attribute, section, ret, strerror(ret));
+              attribute, section, ret, sss_strerror(ret));
     return ret;
 }
 
@@ -686,7 +686,7 @@ done:
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Failed to get [%s] from [%s], error [%d] (%s)\n",
-                  attribute, section, ret, strerror(ret));
+                  attribute, section, ret, sss_strerror(ret));
     }
     return ret;
 }
@@ -1323,7 +1323,7 @@ int confdb_get_domains(struct confdb_ctx *cdb,
         if (ret) {
             DEBUG(SSSDBG_FATAL_FAILURE,
                   "Error (%d [%s]) retrieving domain [%s], skipping!\n",
-                      ret, strerror(ret), domlist[i]);
+                      ret, sss_strerror(ret), domlist[i]);
             continue;
         }
 
diff --git a/src/confdb/confdb_setup.c b/src/confdb/confdb_setup.c
index 857725f..f172d9c 100644
--- a/src/confdb/confdb_setup.c
+++ b/src/confdb/confdb_setup.c
@@ -157,7 +157,7 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb)
     ret = sss_ini_config_file_open(init_data, config_file);
     if (ret != EOK) {
         DEBUG(SSSDBG_TRACE_FUNC,
-              "sss_ini_config_file_open failed: %s [%d]\n", strerror(ret),
+              "sss_ini_config_file_open failed: %s [%d]\n", sss_strerror(ret),
                ret);
         if (ret == ENOENT) {
             /* sss specific error denoting missing configuration file */
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index 626ec0d..3b1f250 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -1723,7 +1723,7 @@ done:
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Could not determine primary name: [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
     }
     talloc_free(tmp_ctx);
     return ret;
diff --git a/src/db/sysdb_autofs.c b/src/db/sysdb_autofs.c
index 218e9c0..c18320a 100644
--- a/src/db/sysdb_autofs.c
+++ b/src/db/sysdb_autofs.c
@@ -125,28 +125,28 @@ sysdb_save_autofsmap(struct sss_domain_info *domain,
                                  SYSDB_AUTOFS_MAP_OC);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set map object class [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
     ret = sysdb_attrs_add_string(attrs, SYSDB_AUTOFS_MAP_NAME, autofsmapname);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set map name [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
     ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, name);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set name attribute [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
     ret = sysdb_attrs_add_time_t(attrs, SYSDB_LAST_UPDATE, now);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set sysdb lastUpdate [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
@@ -155,14 +155,14 @@ sysdb_save_autofsmap(struct sss_domain_info *domain,
                                   (now + cache_timeout) : 0));
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set sysdb cache expire [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
     ret = sysdb_store_custom(domain, name, AUTOFS_MAP_SUBDIR, attrs);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "sysdb_store_custom failed [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
@@ -206,7 +206,7 @@ sysdb_get_map_byname(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Cannot sanitize map [%s] error [%d]: %s\n",
-               map_name, ret, strerror(ret));
+               map_name, ret, sss_strerror(ret));
         goto done;
     }
 
@@ -276,21 +276,21 @@ sysdb_save_autofsentry(struct sss_domain_info *domain,
                                  SYSDB_AUTOFS_ENTRY_OC);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set entry object class [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
     ret = sysdb_attrs_add_string(attrs, SYSDB_AUTOFS_ENTRY_KEY, key);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set entry key [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
     ret = sysdb_attrs_add_string(attrs, SYSDB_AUTOFS_ENTRY_VALUE, value);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set entry key [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
@@ -303,7 +303,7 @@ sysdb_save_autofsentry(struct sss_domain_info *domain,
     ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, name);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set name attribute [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/db/sysdb_idmap.c b/src/db/sysdb_idmap.c
index 7d34267..14e4fdf 100644
--- a/src/db/sysdb_idmap.c
+++ b/src/db/sysdb_idmap.c
@@ -257,7 +257,7 @@ sysdb_idmap_store_mapping(struct sss_domain_info *domain,
     ret = sysdb_transaction_commit(domain->sysdb);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "Could not commit transaction: [%s]\n", strerror(ret));
+              "Could not commit transaction: [%s]\n", sss_strerror(ret));
         goto done;
     }
     in_transaction = false;
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 252097f..5690dbb 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -222,7 +222,7 @@ int sysdb_delete_recursive(struct sysdb_ctx *sysdb,
         }
         if (ret) {
             DEBUG(SSSDBG_TRACE_FUNC, "Search error: %d (%s)\n",
-                                     ret, strerror(ret));
+                                     ret, sss_strerror(ret));
         }
         goto done;
     }
@@ -346,7 +346,7 @@ done:
         DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
 
     talloc_zfree(tmp_ctx);
@@ -410,7 +410,7 @@ done:
         DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -466,7 +466,7 @@ done:
         DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
 
     talloc_zfree(tmp_ctx);
@@ -585,7 +585,7 @@ done:
         DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -641,7 +641,7 @@ done:
         DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
 
     talloc_zfree(tmp_ctx);
@@ -701,7 +701,7 @@ done:
         DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -763,7 +763,7 @@ done:
         DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -1027,7 +1027,7 @@ done:
         ldb_transaction_cancel(domain->sysdb->ldb);
     }
     if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -1107,7 +1107,7 @@ int sysdb_add_basic_user(struct sss_domain_info *domain,
 
 done:
     if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -1438,7 +1438,7 @@ done:
         ret = ldb_transaction_commit(domain->sysdb->ldb);
         ret = sysdb_error_to_errno(ret);
     } else {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
         ldb_transaction_cancel(domain->sysdb->ldb);
     }
     talloc_zfree(tmp_ctx);
@@ -1490,7 +1490,7 @@ int sysdb_add_basic_group(struct sss_domain_info *domain,
 
 done:
     if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -1642,7 +1642,7 @@ done:
         ret = ldb_transaction_commit(domain->sysdb->ldb);
         ret = sysdb_error_to_errno(ret);
     } else {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
         ldb_transaction_cancel(domain->sysdb->ldb);
     }
     talloc_zfree(tmp_ctx);
@@ -1704,7 +1704,7 @@ int sysdb_add_incomplete_group(struct sss_domain_info *domain,
 
 done:
     if (ret != EOK) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -1748,7 +1748,7 @@ int sysdb_mod_group_member(struct sss_domain_info *domain,
 
 fail:
     if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(msg);
     return ret;
@@ -1796,7 +1796,7 @@ int sysdb_add_basic_netgroup(struct sss_domain_info *domain,
 
 done:
     if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(msg);
     return ret;
@@ -1870,7 +1870,7 @@ done:
     }
 
     if (ret != EOK) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
         ldb_transaction_cancel(domain->sysdb->ldb);
     }
     talloc_zfree(tmp_ctx);
@@ -2041,7 +2041,7 @@ fail:
     }
 
     if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -2074,7 +2074,7 @@ int sysdb_store_group(struct sss_domain_info *domain,
     if (ret && ret != ENOENT) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "sysdb_search_group_by_name failed for %s with: [%d][%s].\n",
-              name, ret, strerror(ret));
+              name, ret, sss_strerror(ret));
         goto done;
     }
     if (ret == ENOENT) {
@@ -2165,7 +2165,7 @@ int sysdb_store_group(struct sss_domain_info *domain,
 
 done:
     if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -2300,7 +2300,7 @@ int sysdb_cache_password(struct sss_domain_info *domain,
 
 fail:
     if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -2497,7 +2497,7 @@ int sysdb_store_custom(struct sss_domain_info *domain,
 
 done:
     if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
         ldb_transaction_cancel(domain->sysdb->ldb);
     } else {
         ret = ldb_transaction_commit(domain->sysdb->ldb);
@@ -2642,7 +2642,7 @@ fail:
         DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -2700,7 +2700,7 @@ fail:
         DEBUG(SSSDBG_TRACE_INTERNAL, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -2804,7 +2804,7 @@ int sysdb_delete_user(struct sss_domain_info *domain,
     return EOK;
 
 fail:
-    DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+    DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     talloc_zfree(tmp_ctx);
     return ret;
 }
@@ -2862,7 +2862,7 @@ fail:
         DEBUG(SSSDBG_TRACE_INTERNAL, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -2920,7 +2920,7 @@ int sysdb_delete_group(struct sss_domain_info *domain,
     return EOK;
 
 fail:
-    DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+    DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     talloc_zfree(tmp_ctx);
     return ret;
 }
@@ -2975,7 +2975,7 @@ fail:
     if (ret == ENOENT) {
         DEBUG(SSSDBG_TRACE_FUNC, "Entry not found\n");
     } else {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -3001,7 +3001,7 @@ int sysdb_delete_netgroup(struct sss_domain_info *domain,
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_TRACE_FUNC,
               "sysdb_search_netgroup_by_name failed: %d (%s)\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
         goto done;
     } else if (ret == ENOENT) {
         DEBUG(SSSDBG_TRACE_FUNC,
@@ -3017,7 +3017,7 @@ int sysdb_delete_netgroup(struct sss_domain_info *domain,
 
 done:
     if (ret != EOK) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_free(tmp_ctx);
     return ret;
@@ -3041,7 +3041,7 @@ int sysdb_delete_by_sid(struct sysdb_ctx *sysdb,
     ret = sysdb_search_object_by_sid(tmp_ctx, domain, sid_str, NULL, &res);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "search by sid failed: %d (%s)\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
@@ -3065,7 +3065,7 @@ int sysdb_delete_by_sid(struct sysdb_ctx *sysdb,
 
 done:
     if (ret != EOK) {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_free(tmp_ctx);
     return ret;
@@ -3212,7 +3212,7 @@ int sysdb_cache_auth(struct sss_domain_info *domain,
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "sysdb_search_user_by_name failed [%d][%s].\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         if (ret == ENOENT) ret = ERR_ACCOUNT_UNKNOWN;
         goto done;
     }
@@ -3591,7 +3591,7 @@ done:
     if (ret == ENOENT) {
         DEBUG(SSSDBG_TRACE_FUNC, "No such entry.\n");
     } else if (ret) {
-        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
 
     talloc_zfree(tmp_ctx);
diff --git a/src/db/sysdb_ranges.c b/src/db/sysdb_ranges.c
index 431afd1..ba37a99 100644
--- a/src/db/sysdb_ranges.c
+++ b/src/db/sysdb_ranges.c
@@ -251,7 +251,7 @@ errno_t sysdb_range_create(struct sysdb_ctx *sysdb, struct range_info *range)
 
 done:
     if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
index ff14c4a..dcc1fba 100644
--- a/src/db/sysdb_search.c
+++ b/src/db/sysdb_search.c
@@ -391,7 +391,7 @@ int sysdb_initgroups(TALLOC_CTX *mem_ctx,
     ret = sysdb_getpwnam(tmp_ctx, domain, name, &res);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_getpwnam failed: [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -946,7 +946,7 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx,
         direct_sysdb_count = 0;
     } else if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_entry failed: [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/db/sysdb_selinux.c b/src/db/sysdb_selinux.c
index 2dbbb75..c57004d 100644
--- a/src/db/sysdb_selinux.c
+++ b/src/db/sysdb_selinux.c
@@ -54,7 +54,7 @@ sysdb_add_selinux_entity(struct sysdb_ctx *sysdb,
     ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, objectclass);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set map object class [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         return ret;
     }
 
@@ -74,7 +74,7 @@ sysdb_add_selinux_entity(struct sysdb_ctx *sysdb,
 
 done:
     if (ret) {
-        DEBUG(SSSDBG_TRACE_LIBS, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_LIBS, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -172,7 +172,8 @@ done:
     }
 
     if (ret) {
-        DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret,
+              sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -319,7 +320,7 @@ done:
     if (ret == ENOENT) {
         DEBUG(SSSDBG_TRACE_FUNC, "No SELinux root entry found\n");
     } else if (ret) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
 
     talloc_free(tmp_ctx);
diff --git a/src/db/sysdb_services.c b/src/db/sysdb_services.c
index 5f2315e..84c418d 100644
--- a/src/db/sysdb_services.c
+++ b/src/db/sysdb_services.c
@@ -385,7 +385,7 @@ sysdb_store_service(struct sss_domain_info *domain,
         if (ret != EOK) {
             DEBUG(SSSDBG_MINOR_FAILURE,
                   "Could not remove missing attributes: [%s]\n",
-                   strerror(ret));
+                   sss_strerror(ret));
             goto done;
         }
     }
@@ -522,7 +522,7 @@ sysdb_svc_add(TALLOC_CTX *mem_ctx,
 done:
     if (ret) {
         DEBUG(SSSDBG_TRACE_INTERNAL,
-              "Error: %d (%s)\n", ret, strerror(ret));
+              "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_free(tmp_ctx);
     return ret;
@@ -595,7 +595,7 @@ sysdb_svc_update(struct sysdb_ctx *sysdb,
 done:
     if (ret) {
         DEBUG(SSSDBG_TRACE_INTERNAL,
-              "Error: %d (%s)\n", ret, strerror(ret));
+              "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_free(msg);
     return ret;
@@ -628,7 +628,7 @@ sysdb_svc_remove_alias(struct sysdb_ctx *sysdb,
 done:
     if (ret) {
         DEBUG(SSSDBG_TRACE_INTERNAL,
-              "Error: %d (%s)\n", ret, strerror(ret));
+              "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(msg);
     return ret;
@@ -705,7 +705,7 @@ done:
 
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_TRACE_INTERNAL,
-              "Error: %d (%s)\n", ret, strerror(ret));
+              "Error: %d (%s)\n", ret, sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
@@ -826,7 +826,8 @@ fail:
         DEBUG(SSSDBG_TRACE_INTERNAL, "No such entry\n");
     }
     else if (ret) {
-        DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret,
+              sss_strerror(ret));
     }
     talloc_zfree(tmp_ctx);
     return ret;
diff --git a/src/db/sysdb_ssh.c b/src/db/sysdb_ssh.c
index 7dd98cf..e639dc4 100644
--- a/src/db/sysdb_ssh.c
+++ b/src/db/sysdb_ssh.c
@@ -34,7 +34,8 @@ sysdb_update_ssh_host(struct sss_domain_info *domain,
                              attrs);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Error storing host %s [%d]: %s\n", name, ret, strerror(ret));
+              "Error storing host %s [%d]: %s\n", name, ret,
+              sss_strerror(ret));
         return ret;
     }
 
@@ -80,14 +81,15 @@ sysdb_store_ssh_host(struct sss_domain_info *domain,
     ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, SYSDB_SSH_HOST_OC);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Could not set object class [%d]: %s\n", ret, strerror(ret));
+              "Could not set object class [%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
     ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, name);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Could not set name attribute [%d]: %s\n", ret, strerror(ret));
+              "Could not set name attribute [%d]: %s\n", ret,
+              sss_strerror(ret));
         goto done;
     }
 
@@ -109,7 +111,7 @@ sysdb_store_ssh_host(struct sss_domain_info *domain,
                     if (ret != EOK) {
                         DEBUG(SSSDBG_OP_FAILURE,
                               "Could not add name alias %s [%d]: %s\n",
-                               el->values[i].data, ret, strerror(ret));
+                               el->values[i].data, ret, sss_strerror(ret));
                         goto done;
                     }
                 }
@@ -122,7 +124,7 @@ sysdb_store_ssh_host(struct sss_domain_info *domain,
             if (ret != EOK) {
                 DEBUG(SSSDBG_OP_FAILURE,
                       "Could not add name alias %s [%d]: %s\n",
-                       alias, ret, strerror(ret));
+                       alias, ret, sss_strerror(ret));
                 goto done;
             }
         }
@@ -134,7 +136,7 @@ sysdb_store_ssh_host(struct sss_domain_info *domain,
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Could not get sysdb sshPublicKey [%d]: %s\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -143,7 +145,7 @@ sysdb_store_ssh_host(struct sss_domain_info *domain,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Could not set sysdb lastUpdate [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     }
 
@@ -204,7 +206,7 @@ sysdb_update_ssh_known_host_expire(struct sss_domain_info *domain,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Could not set known_hosts expire time [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     }
 
@@ -253,7 +255,7 @@ sysdb_search_ssh_hosts(TALLOC_CTX *mem_ctx,
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Error looking up host [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     } if (ret == ENOENT) {
         DEBUG(SSSDBG_TRACE_FUNC, "No such host\n");
diff --git a/src/db/sysdb_sudo.c b/src/db/sysdb_sudo.c
index 261ed82..5619f85 100644
--- a/src/db/sysdb_sudo.c
+++ b/src/db/sysdb_sudo.c
@@ -397,7 +397,7 @@ sysdb_get_sudo_user_info(TALLOC_CTX *mem_ctx,
             sysdb_groupnames[num_groups] = NULL;
         } else if (ret != ENOENT) {
             DEBUG(SSSDBG_CRIT_FAILURE, "Error looking up group [%d]: %s\n",
-                                        ret, strerror(ret));
+                                        ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -429,14 +429,14 @@ sysdb_save_sudorule(struct sss_domain_info *domain,
                                  SYSDB_SUDO_CACHE_OC);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set rule object class [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         return ret;
     }
 
     ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, rule_name);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set name attribute [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         return ret;
     }
 
@@ -444,7 +444,7 @@ sysdb_save_sudorule(struct sss_domain_info *domain,
                              SUDORULE_SUBDIR, attrs);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "sysdb_store_custom failed [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 39f4e64..414b2bb 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -2854,7 +2854,7 @@ int main(int argc, const char *argv[])
                  "SSSD couldn't load the configuration database.\n");
             sss_log(SSS_LOG_ALERT,
                    "SSSD couldn't load the configuration database [%d]: %s.\n",
-                    ret, strerror(ret));
+                    ret, sss_strerror(ret));
             break;
         }
         return 4;
diff --git a/src/monitor/monitor_sbus.c b/src/monitor/monitor_sbus.c
index 544407c..e883672 100644
--- a/src/monitor/monitor_sbus.c
+++ b/src/monitor/monitor_sbus.c
@@ -171,7 +171,7 @@ errno_t monitor_common_rotate_logs(struct confdb_ctx *confdb,
     ret = rotate_debug_files();
     if (ret) {
         sss_log(SSS_LOG_ALERT, "Could not rotate debug files! [%d][%s]\n",
-                               ret, strerror(ret));
+                               ret, sss_strerror(ret));
         return ret;
     }
 
@@ -182,7 +182,7 @@ errno_t monitor_common_rotate_logs(struct confdb_ctx *confdb,
                          &debug_level);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) [%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         /* Try to proceed with the old value */
         debug_level = old_debug_level;
     }
diff --git a/src/providers/ad/ad_common.c b/src/providers/ad/ad_common.c
index 96a2188..67250af 100644
--- a/src/providers/ad/ad_common.c
+++ b/src/providers/ad/ad_common.c
@@ -315,7 +315,7 @@ ad_get_common_options(TALLOC_CTX *mem_ctx,
         if (ret != EOK) {
             DEBUG(SSSDBG_FATAL_FAILURE,
                   "Setting ad_hostname failed [%s].\n",
-                   strerror(ret));
+                   sss_strerror(ret));
             goto done;
         }
     }
@@ -367,7 +367,7 @@ ad_get_common_options(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Could not set domain case-sensitive: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
@@ -436,7 +436,7 @@ _ad_servers_init(struct ad_service *service,
             if (ret != EOK) {
                 DEBUG(SSSDBG_FATAL_FAILURE,
                       "Failed to add service discovery to failover: [%s]",
-                       strerror(ret));
+                       sss_strerror(ret));
                 goto done;
             }
 
@@ -453,7 +453,7 @@ _ad_servers_init(struct ad_service *service,
             if (ret != EOK) {
                 DEBUG(SSSDBG_FATAL_FAILURE,
                       "Failed to add service discovery to failover: [%s]",
-                       strerror(ret));
+                       sss_strerror(ret));
                 goto done;
             }
 
@@ -663,7 +663,7 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx,
                                      ad_resolve_callback, service);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
-              "Failed to add failover callback! [%s]\n", strerror(ret));
+              "Failed to add failover callback! [%s]\n", sss_strerror(ret));
         goto done;
     }
 
@@ -671,7 +671,7 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx,
                                      ad_resolve_callback, service);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
-              "Failed to add failover callback! [%s]\n", strerror(ret));
+              "Failed to add failover callback! [%s]\n", sss_strerror(ret));
         goto done;
     }
 
@@ -822,7 +822,7 @@ ad_resolve_callback(void *private_data, struct fo_server *server)
 done:
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "Error: [%s]\n", strerror(ret));
+              "Error: [%s]\n", sss_strerror(ret));
     }
     talloc_free(tmp_ctx);
     return;
diff --git a/src/providers/ad/ad_id.c b/src/providers/ad/ad_id.c
index f9bf83e..ab355a0 100644
--- a/src/providers/ad/ad_id.c
+++ b/src/providers/ad/ad_id.c
@@ -495,7 +495,7 @@ ad_enumeration_send(TALLOC_CTX *mem_ctx,
     subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret);
     if (subreq == NULL) {
         DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         goto fail;
     }
     tevent_req_set_callback(subreq, ad_enumeration_conn_done, req);
@@ -527,7 +527,7 @@ ad_enumeration_conn_done(struct tevent_req *subreq)
         } else {
             DEBUG(SSSDBG_MINOR_FAILURE,
                   "Domain enumeration failed to connect to " \
-                   "LDAP server: (%d)[%s]\n", ret, strerror(ret));
+                   "LDAP server: (%d)[%s]\n", ret, sss_strerror(ret));
             tevent_req_error(req, ret);
         }
         return;
@@ -764,7 +764,7 @@ ad_enum_cross_dom_members(struct sdap_options *opts,
             ret = ad_group_add_member(opts, dom, msgs[i]->dn, group_only[mi]);
             if (ret != EOK) {
                 DEBUG(SSSDBG_MINOR_FAILURE, "Failed to add [%s]: %s\n",
-                      group_only[mi], strerror(ret));
+                      group_only[mi], sss_strerror(ret));
                 continue;
             }
         }
diff --git a/src/providers/ad/ad_init.c b/src/providers/ad/ad_init.c
index 0a54d39..8f6baae 100644
--- a/src/providers/ad/ad_init.c
+++ b/src/providers/ad/ad_init.c
@@ -125,7 +125,7 @@ common_ad_init(struct be_ctx *bectx)
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Could not parse common options: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
@@ -141,7 +141,7 @@ common_ad_init(struct be_ctx *bectx)
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Failed to init AD failover service: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
@@ -193,7 +193,7 @@ sssm_ad_id_init(struct be_ctx *bectx,
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "setup_child failed [%d][%s].\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     }
 
@@ -225,7 +225,7 @@ sssm_ad_id_init(struct be_ctx *bectx,
     ret = setup_tls_config(ad_ctx->sdap_id_ctx->opts->basic);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "setup_tls_config failed [%s]\n", strerror(ret));
+              "setup_tls_config failed [%s]\n", sss_strerror(ret));
         goto done;
     }
 
@@ -250,7 +250,7 @@ sssm_ad_id_init(struct be_ctx *bectx,
         ret = be_fo_set_dns_srv_lookup_plugin(bectx, hostname);
         if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE, "Unable to set SRV lookup plugin "
-                                        "[%d]: %s\n", ret, strerror(ret));
+                                        "[%d]: %s\n", ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -262,7 +262,7 @@ sssm_ad_id_init(struct be_ctx *bectx,
                             ad_ctx->sdap_id_ctx);
     if (ret != EOK && ret != EEXIST) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups "
-              "will not work [%d]: %s\n", ret, strerror(ret));
+              "will not work [%d]: %s\n", ret, sss_strerror(ret));
     }
 
     *ops = &ad_id_ops;
@@ -319,7 +319,7 @@ sssm_ad_auth_init(struct be_ctx *bectx,
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Could not initialize krb5_child settings: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
@@ -386,7 +386,7 @@ sssm_ad_access_init(struct be_ctx *bectx,
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Could not initialize access provider options: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto fail;
     }
 
diff --git a/src/providers/ad/ad_srv.c b/src/providers/ad/ad_srv.c
index 53d8a87..631dd76 100644
--- a/src/providers/ad/ad_srv.c
+++ b/src/providers/ad/ad_srv.c
@@ -522,7 +522,7 @@ static void ad_get_client_site_done(struct tevent_req *subreq)
                                        &state->forest);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Unable to retrieve site name [%d]: %s\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         ret = ENOENT;
         goto done;
     }
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
index efe4b3f..cd8b794 100644
--- a/src/providers/ad/ad_subdomains.c
+++ b/src/providers/ad/ad_subdomains.c
@@ -523,7 +523,7 @@ static void ad_subdomains_retrieve(struct ad_subdomains_ctx *ctx,
     req = sdap_id_op_connect_send(req_ctx->sdap_op, req_ctx, &ret);
     if (req == NULL) {
         DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -557,7 +557,7 @@ static void ad_subdomains_get_conn_done(struct tevent_req *req)
         } else {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Failed to connect to AD server: [%d](%s)\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
         }
 
         goto fail;
@@ -731,7 +731,7 @@ static void ad_subdomains_get_root_domain_done(struct tevent_req *req)
         } else {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Failed to search the AD server: [%d](%s)\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         }
         goto fail;
     }
@@ -769,7 +769,7 @@ static void ad_subdomains_get_root_domain_done(struct tevent_req *req)
     req = sdap_id_op_connect_send(ctx->root_op, ctx, &ret);
     if (req == NULL) {
         DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -848,7 +848,7 @@ static void ad_subdomains_root_conn_done(struct tevent_req *req)
         } else {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Failed to connect to AD server: [%d](%s)\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         }
 
         goto fail;
@@ -1009,7 +1009,7 @@ static void ad_subdomains_get_slave_domain_done(struct tevent_req *req)
         } else {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Failed to search the AD server: [%d](%s)\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         }
         tevent_req_error(req, ret);
         return;
diff --git a/src/providers/ad/ad_sudo.c b/src/providers/ad/ad_sudo.c
index 53ce5af..03ed05b 100644
--- a/src/providers/ad/ad_sudo.c
+++ b/src/providers/ad/ad_sudo.c
@@ -39,7 +39,7 @@ int ad_sudo_init(struct be_ctx *be_ctx,
     ret = sdap_sudo_init(be_ctx, id_ctx->sdap_id_ctx, ops, pvt_data);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize LDAP SUDO [%d]: %s\n",
-                                 ret, strerror(ret));
+                                 ret, sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index dbd48b2..8b4439c 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -796,7 +796,7 @@ static void acctinfo_initgroups_callback(struct be_req *be_req,
     if (ret != EOK) {
         DEBUG(SSSDBG_TRACE_FUNC,
               "Error contacting NSS responder: %d [%s]\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
     }
 
 done:
@@ -1590,7 +1590,7 @@ static int be_sudo_handler(struct sbus_request *dbus_req, void *user_data)
 fail:
     /* send reply back immediately */
     be_sudo_handler_callback(be_req, DP_ERR_FATAL, ret,
-                             err_msg ? err_msg : strerror(ret));
+                             err_msg ? err_msg : sss_strerror(ret));
     return EOK;
 }
 
@@ -2459,7 +2459,7 @@ int be_process_init_sudo(struct be_ctx *be_ctx)
                                     CONFDB_MONITOR_ACTIVE_SERVICES, &services);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE, "Unable to read from confdb [%d]: %s\n",
-                                     ret, strerror(ret));
+                                     ret, sss_strerror(ret));
         goto done;
     }
 
@@ -2474,7 +2474,7 @@ int be_process_init_sudo(struct be_ctx *be_ctx)
                             CONFDB_DOMAIN_SUDO_PROVIDER, NULL, &provider);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE, "Unable to read from confdb [%d]: %s\n",
-                                     ret, strerror(ret));
+                                     ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/providers/dp_auth_util.c b/src/providers/dp_auth_util.c
index f8a30c5..a887b1f 100644
--- a/src/providers/dp_auth_util.c
+++ b/src/providers/dp_auth_util.c
@@ -125,14 +125,14 @@ bool dp_unpack_pam_request(DBusMessage *msg, TALLOC_CTX *mem_ctx,
                           authtok_data, authtok_length);
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "Failed to set auth token: %d [%s]\n", ret, strerror(ret));
+              "Failed to set auth token: %d [%s]\n", ret, sss_strerror(ret));
         return false;
     }
     ret = sss_authtok_set((*new_pd)->newauthtok, new_authtok_type,
                           new_authtok_data, new_authtok_length);
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "Failed to set auth token: %d [%s]\n", ret, strerror(ret));
+              "Failed to set auth token: %d [%s]\n", ret, sss_strerror(ret));
         return false;
     }
 
diff --git a/src/providers/dp_pam_data_util.c b/src/providers/dp_pam_data_util.c
index 705169d..2f3f64e 100644
--- a/src/providers/dp_pam_data_util.c
+++ b/src/providers/dp_pam_data_util.c
@@ -175,7 +175,7 @@ errno_t copy_pam_data(TALLOC_CTX *mem_ctx, struct pam_data *src,
 failed:
     talloc_free(pd);
     DEBUG(SSSDBG_CRIT_FAILURE,
-          "copy_pam_data failed: (%d) %s.\n", ret, strerror(ret));
+          "copy_pam_data failed: (%d) %s.\n", ret, sss_strerror(ret));
     return ret;
 }
 
diff --git a/src/providers/fail_over_srv.c b/src/providers/fail_over_srv.c
index 1b99f31..0d84a98 100644
--- a/src/providers/fail_over_srv.c
+++ b/src/providers/fail_over_srv.c
@@ -101,7 +101,7 @@ static void fo_discover_srv_done(struct tevent_req *subreq)
     ret = resolv_sort_srv_reply(&reply_list);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Could not sort the answers from DNS "
-                                    "[%d]: %s\n", ret, strerror(ret));
+                                    "[%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/providers/ipa/ipa_access.c b/src/providers/ipa/ipa_access.c
index bb8e45c..3295e40 100644
--- a/src/providers/ipa/ipa_access.c
+++ b/src/providers/ipa/ipa_access.c
@@ -232,7 +232,8 @@ static int hbac_retry(struct hbac_ctx *hbac_ctx)
         subreq = sdap_id_op_connect_send(hbac_ctx->sdap_op, hbac_ctx, &ret);
         if (!subreq) {
             DEBUG(SSSDBG_CRIT_FAILURE,
-                  "sdap_id_op_connect_send failed: %d(%s).\n", ret, strerror(ret));
+                  "sdap_id_op_connect_send failed: %d(%s).\n", ret,
+                  sss_strerror(ret));
             talloc_zfree(hbac_ctx->sdap_op);
             return ret;
         }
@@ -556,7 +557,7 @@ static void hbac_sysdb_save(struct tevent_req *req)
                               hbac_ctx->hostgroups);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Error saving hosts: [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -569,7 +570,7 @@ static void hbac_sysdb_save(struct tevent_req *req)
                               hbac_ctx->servicegroups);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Error saving services:  [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto fail;
     }
     /* Save the rules */
@@ -580,7 +581,7 @@ static void hbac_sysdb_save(struct tevent_req *req)
                               NULL, NULL, 0, NULL);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Error saving rules:  [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto fail;
     }
 
diff --git a/src/providers/ipa/ipa_auth.c b/src/providers/ipa/ipa_auth.c
index f9a0706..cf7858b 100644
--- a/src/providers/ipa/ipa_auth.c
+++ b/src/providers/ipa/ipa_auth.c
@@ -82,7 +82,7 @@ static struct tevent_req *get_password_migration_flag_send(TALLOC_CTX *memctx,
     subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret);
     if (!subreq) {
         DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -113,7 +113,7 @@ static void get_password_migration_flag_auth_done(struct tevent_req *subreq)
         } else {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Failed to connect to IPA server: [%d](%s)\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
         }
 
         tevent_req_error(req, ret);
diff --git a/src/providers/ipa/ipa_hbac_common.c b/src/providers/ipa/ipa_hbac_common.c
index 317be99..9d24f8a 100644
--- a/src/providers/ipa/ipa_hbac_common.c
+++ b/src/providers/ipa/ipa_hbac_common.c
@@ -122,7 +122,7 @@ ipa_hbac_sysdb_save(struct sss_domain_info *domain,
                              attr_name, primary_count, primary);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Could not save %s. [%d][%s]\n",
-                  primary_subdir, ret, strerror(ret));
+                  primary_subdir, ret, sss_strerror(ret));
         goto done;
     }
 
@@ -132,7 +132,7 @@ ipa_hbac_sysdb_save(struct sss_domain_info *domain,
                                  groupattr_name, group_count, groups);
         if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE, "Could not save %s. [%d][%s]\n",
-                      group_subdir, ret, strerror(ret));
+                      group_subdir, ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -153,7 +153,8 @@ done:
     }
 
     if (ret != EOK) {
-        DEBUG(SSSDBG_MINOR_FAILURE, "Error [%d][%s]\n", ret, strerror(ret));
+        DEBUG(SSSDBG_MINOR_FAILURE,
+              "Error [%d][%s]\n", ret, sss_strerror(ret));
     }
     return ret;
 }
diff --git a/src/providers/ipa/ipa_hbac_services.c b/src/providers/ipa/ipa_hbac_services.c
index 3040ce6..5035f72 100644
--- a/src/providers/ipa/ipa_hbac_services.c
+++ b/src/providers/ipa/ipa_hbac_services.c
@@ -347,7 +347,8 @@ done:
     if (ret == EOK) {
         tevent_req_done(req);
     } else {
-        DEBUG(SSSDBG_MINOR_FAILURE, "Error [%d][%s]\n", ret, strerror(ret));
+        DEBUG(SSSDBG_MINOR_FAILURE,
+              "Error [%d][%s]\n", ret, sss_strerror(ret));
         tevent_req_error(req, ret);
     }
 }
diff --git a/src/providers/ipa/ipa_hosts.c b/src/providers/ipa/ipa_hosts.c
index 64f80f0..4c12af3 100644
--- a/src/providers/ipa/ipa_hosts.c
+++ b/src/providers/ipa/ipa_hosts.c
@@ -425,7 +425,7 @@ done:
     if (ret == EOK) {
         tevent_req_done(req);
     } else {
-        DEBUG(SSSDBG_OP_FAILURE, "Error [%d][%s]\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE, "Error [%d][%s]\n", ret, sss_strerror(ret));
         tevent_req_error(req, ret);
     }
 }
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
index c1a9cc7..4764f41 100644
--- a/src/providers/ipa/ipa_init.c
+++ b/src/providers/ipa/ipa_init.c
@@ -218,7 +218,7 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
     ret = setup_tls_config(sdap_ctx->opts->basic);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "setup_tls_config failed [%d][%s].\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -235,7 +235,7 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
     ret = sdap_setup_child();
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "setup_child failed [%d][%s].\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -275,8 +275,9 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
 
             ret = be_fo_set_dns_srv_lookup_plugin(bectx, hostname);
             if (ret != EOK) {
-                DEBUG(SSSDBG_CRIT_FAILURE, "Unable to set SRV lookup plugin "
-                                            "[%d]: %s\n", ret, strerror(ret));
+                DEBUG(SSSDBG_CRIT_FAILURE,
+                      "Unable to set SRV lookup plugin [%d]: %s\n",
+                      ret, sss_strerror(ret));
                 goto done;
             }
         } else {
@@ -313,7 +314,7 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
         ret = be_fo_set_dns_srv_lookup_plugin(bectx, hostname);
         if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE, "Unable to set SRV lookup plugin "
-                                        "[%d]: %s\n", ret, strerror(ret));
+                                        "[%d]: %s\n", ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -325,7 +326,7 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
                             sdap_ctx);
     if (ret != EOK && ret != EEXIST) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups "
-              "will not work [%d]: %s\n", ret, strerror(ret));
+              "will not work [%d]: %s\n", ret, sss_strerror(ret));
     }
 
     *ops = &ipa_id_ops;
@@ -424,7 +425,7 @@ int sssm_ipa_auth_init(struct be_ctx *bectx,
     ret = setup_tls_config(sdap_auth_ctx->opts->basic);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "setup_tls_config failed [%d][%s].\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -433,7 +434,7 @@ int sssm_ipa_auth_init(struct be_ctx *bectx,
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Could not initialize krb5_child settings: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/providers/ipa/ipa_selinux.c b/src/providers/ipa/ipa_selinux.c
index 3cd1cc1..079eb82 100644
--- a/src/providers/ipa/ipa_selinux.c
+++ b/src/providers/ipa/ipa_selinux.c
@@ -947,7 +947,7 @@ ipa_get_selinux_send(TALLOC_CTX *mem_ctx,
         subreq = sdap_id_op_connect_send(state->op, state, &ret);
         if (!subreq) {
             DEBUG(SSSDBG_CRIT_FAILURE, "sdap_id_op_connect_send failed: "
-                                        "%d(%s).\n", ret, strerror(ret));
+                                        "%d(%s).\n", ret, sss_strerror(ret));
             talloc_zfree(state->op);
             goto immediate;
         }
@@ -1062,7 +1062,7 @@ ipa_get_selinux_maps_offline(struct tevent_req *req)
                                       NULL, &defaults);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_selinux_config failed [%d]: %s\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         return ret;
     }
 
@@ -1095,7 +1095,7 @@ ipa_get_selinux_maps_offline(struct tevent_req *req)
                                      attrs, &nmaps, &maps);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "sysdb_get_selinux_usermaps failed [%d]: %s\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         return ret;
     }
 
@@ -1110,7 +1110,7 @@ ipa_get_selinux_maps_offline(struct tevent_req *req)
                                 &state->hbac_rule_count, &state->hbac_rules);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "hbac_get_cached_rules failed [%d]: %s\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c
index 7103ba2..8c5a793 100644
--- a/src/providers/ipa/ipa_subdomains.c
+++ b/src/providers/ipa/ipa_subdomains.c
@@ -848,7 +848,7 @@ static void ipa_subdomains_retrieve(struct ipa_subdomains_ctx *ctx, struct be_re
     req = sdap_id_op_connect_send(req_ctx->sdap_op, req_ctx, &ret);
     if (req == NULL) {
         DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -882,7 +882,7 @@ static void ipa_subdomains_get_conn_done(struct tevent_req *req)
         } else {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Failed to connect to IPA server: [%d](%s)\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
         }
 
         goto fail;
diff --git a/src/providers/ipa/ipa_subdomains_ext_groups.c b/src/providers/ipa/ipa_subdomains_ext_groups.c
index 6feca44..a3264fc 100644
--- a/src/providers/ipa/ipa_subdomains_ext_groups.c
+++ b/src/providers/ipa/ipa_subdomains_ext_groups.c
@@ -502,7 +502,7 @@ struct tevent_req *ipa_get_ad_memberships_send(TALLOC_CTX *mem_ctx,
     subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret);
     if (subreq == NULL) {
         DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -541,7 +541,7 @@ static void ipa_get_ad_memberships_connect_done(struct tevent_req *subreq)
         } else {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Failed to connect to IPA server: [%d](%s)\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
         }
 
         goto fail;
@@ -772,7 +772,7 @@ static struct tevent_req *ipa_add_ad_memberships_send(TALLOC_CTX *mem_ctx,
     subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret);
     if (subreq == NULL) {
         DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -810,7 +810,7 @@ static void ipa_add_ad_memberships_connect_done(struct tevent_req *subreq)
         } else {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Failed to connect to IPA server: [%d](%s)\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
         }
 
         tevent_req_error(req, ret);
@@ -897,7 +897,7 @@ static void ipa_add_ad_memberships_get_group_done(struct tevent_req *subreq)
     talloc_zfree(subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Failed to read group [%s] from LDAP [%d](%s)\n",
-              state->groups[state->iter], ret, strerror(ret));
+              state->groups[state->iter], ret, sss_strerror(ret));
 
         tevent_req_error(req, ret);
         return;
diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c
index 1c4c315..e744c86 100644
--- a/src/providers/ipa/ipa_subdomains_id.c
+++ b/src/providers/ipa/ipa_subdomains_id.c
@@ -442,7 +442,7 @@ store_homedir_of_user(struct sss_domain_info *domain,
     ret = sysdb_attrs_add_string(attrs, SYSDB_HOMEDIR, homedir);
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Error setting homedir: [%s]\n",
-                                     strerror(ret));
+                                     sss_strerror(ret));
         goto done;
     }
 
@@ -465,7 +465,7 @@ store_homedir_of_user(struct sss_domain_info *domain,
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Cannot commit sysdb transaction [%d]: %s.\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/providers/ipa/ipa_sudo.c b/src/providers/ipa/ipa_sudo.c
index 4863aa5..89f48e6 100644
--- a/src/providers/ipa/ipa_sudo.c
+++ b/src/providers/ipa/ipa_sudo.c
@@ -43,7 +43,7 @@ int ipa_sudo_init(struct be_ctx *be_ctx,
     ret = sdap_sudo_init(be_ctx, id_ctx->sdap_id_ctx, ops, pvt_data);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize LDAP SUDO [%d]: %s\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/providers/krb5/krb5_access.c b/src/providers/krb5/krb5_access.c
index 7fda2a3..1b01313 100644
--- a/src/providers/krb5/krb5_access.c
+++ b/src/providers/krb5/krb5_access.c
@@ -174,7 +174,7 @@ static void krb5_access_done(struct tevent_req *subreq)
     talloc_free(subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "child failed [%d][%s].\n", ret, strerror(ret));
+              "child failed [%d][%s].\n", ret, sss_strerror(ret));
         goto fail;
     }
 
diff --git a/src/providers/krb5/krb5_auth.c b/src/providers/krb5/krb5_auth.c
index f539d50..166b8b4 100644
--- a/src/providers/krb5/krb5_auth.c
+++ b/src/providers/krb5/krb5_auth.c
@@ -140,14 +140,14 @@ static int krb5_mod_ccname(TALLOC_CTX *mem_ctx,
     ret = sysdb_transaction_start(sysdb);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "Error %d starting transaction (%s)\n", ret, strerror(ret));
+              "Error %d starting transaction (%s)\n", ret, sss_strerror(ret));
         goto done;
     }
     in_transaction = true;
 
     ret = sysdb_set_user_attr(domain, name, attrs, mod_op);
     if (ret != EOK) {
-        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -264,7 +264,7 @@ static void krb5_auth_cache_creds(struct krb5_ctx *krb5_ctx,
     ret = sss_authtok_get_password(pd->authtok, &password, NULL);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
-              "Failed to get password [%d] %s\n", ret, strerror(ret));
+              "Failed to get password [%d] %s\n", ret, sss_strerror(ret));
         *pam_status = PAM_SYSTEM_ERR;
         *dp_err = DP_ERR_OK;
         return;
@@ -362,7 +362,7 @@ static void krb5_auth_store_creds(struct sss_domain_info *domain,
 
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
-              "Failed to get password [%d] %s\n", ret, strerror(ret));
+              "Failed to get password [%d] %s\n", ret, sss_strerror(ret));
         /* password caching failures are not fatal errors */
         return;
     }
@@ -380,7 +380,7 @@ static void krb5_auth_store_creds(struct sss_domain_info *domain,
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Failed to cache password, offline auth may not work."
-                  " (%d)[%s]!?\n", ret, strerror(ret));
+                  " (%d)[%s]!?\n", ret, sss_strerror(ret));
         /* password caching failures are not fatal errors */
     }
 }
@@ -874,7 +874,7 @@ static void krb5_auth_done(struct tevent_req *subreq)
     } else if (ret != EOK) {
 
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "child failed (%d [%s])\n", ret, strerror(ret));
+              "child failed (%d [%s])\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -885,7 +885,7 @@ static void krb5_auth_done(struct tevent_req *subreq)
                         &res);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not parse child response [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
@@ -1309,7 +1309,7 @@ static void krb5_pam_handler_access_done(struct tevent_req *req)
     talloc_zfree(req);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "krb5_access request failed [%d][%s]\n", ret, strerror(ret));
+              "krb5_access request failed [%d][%s]\n", ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index 0980c7c..e1f9140 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -1101,7 +1101,7 @@ static errno_t changepw_child(struct krb5_req *kr, bool prelim)
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Failed to fetch current password [%d] %s.\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         return ERR_NO_CREDS;
     }
 
@@ -1152,7 +1152,7 @@ static errno_t changepw_child(struct krb5_req *kr, bool prelim)
     ret = sss_authtok_get_password(kr->pd->newauthtok, &newpassword, NULL);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Failed to fetch new password [%d] %s.\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         return ERR_NO_CREDS;
     }
 
diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c
index af38db0..c1931b7 100644
--- a/src/providers/krb5/krb5_common.c
+++ b/src/providers/krb5/krb5_common.c
@@ -197,7 +197,7 @@ errno_t check_and_export_options(struct dp_option *opts,
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Failed to check value of krb5_renewable_lifetime. [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -206,7 +206,7 @@ errno_t check_and_export_options(struct dp_option *opts,
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Failed to check value of krb5_lifetime. [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/providers/krb5/krb5_delayed_online_authentication.c b/src/providers/krb5/krb5_delayed_online_authentication.c
index 5f13eac..52116f8 100644
--- a/src/providers/krb5/krb5_delayed_online_authentication.c
+++ b/src/providers/krb5/krb5_delayed_online_authentication.c
@@ -91,7 +91,7 @@ static void authenticate_user(struct tevent_context *ev,
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "failed to set password in auth token [%d][%s].\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         return;
     }
 
@@ -272,7 +272,7 @@ errno_t add_user_to_delayed_online_authentication(struct krb5_ctx *krb5_ctx,
     ret = sss_authtok_get_password(new_pd->authtok, &password, &len);
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "Failed to get password [%d][%s].\n", ret, strerror(ret));
+              "Failed to get password [%d][%s].\n", ret, sss_strerror(ret));
         sss_authtok_set_empty(new_pd->authtok);
         talloc_free(new_pd);
         return ret;
diff --git a/src/providers/krb5/krb5_init.c b/src/providers/krb5/krb5_init.c
index f1c6310..f9f35f4 100644
--- a/src/providers/krb5/krb5_init.c
+++ b/src/providers/krb5/krb5_init.c
@@ -154,7 +154,7 @@ int sssm_krb5_auth_init(struct be_ctx *bectx,
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Could not initialize krb5_child settings: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto fail;
     }
 
diff --git a/src/providers/krb5/krb5_init_shared.c b/src/providers/krb5/krb5_init_shared.c
index 340eab1..44b6da9 100644
--- a/src/providers/krb5/krb5_init_shared.c
+++ b/src/providers/krb5/krb5_init_shared.c
@@ -87,7 +87,7 @@ errno_t krb5_child_init(struct krb5_ctx *krb5_auth_ctx,
         ret = open_debug_file_ex(KRB5_CHILD_LOG_FILE, &debug_filep, false);
         if (ret != EOK) {
             DEBUG(SSSDBG_FATAL_FAILURE, "Error setting up logging (%d) [%s]\n",
-                    ret, strerror(ret));
+                    ret, sss_strerror(ret));
             goto done;
         }
 
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index 0734310..4d7d949 100644
--- a/src/providers/krb5/krb5_utils.c
+++ b/src/providers/krb5/krb5_utils.c
@@ -156,7 +156,7 @@ errno_t check_if_cached_upn_needs_update(struct sysdb_ctx *sysdb,
     ret = sysdb_transaction_start(sysdb);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Error %d starting transaction (%s)\n", ret, strerror(ret));
+              "Error %d starting transaction (%s)\n", ret, sss_strerror(ret));
         goto done;
     }
     in_transaction = true;
@@ -166,7 +166,7 @@ errno_t check_if_cached_upn_needs_update(struct sysdb_ctx *sysdb,
                                                               SYSDB_MOD_REP);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "sysdb_set_entry_attr failed [%d][%s].\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c
index e2fe3f2..d6dc60d 100644
--- a/src/providers/ldap/ldap_child.c
+++ b/src/providers/ldap/ldap_child.c
@@ -513,7 +513,7 @@ int main(int argc, const char *argv[])
     ret = unpack_buffer(buf, len, ibuf);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "unpack_buffer failed.[%d][%s].\n", ret, strerror(ret));
+              "unpack_buffer failed.[%d][%s].\n", ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -530,7 +530,7 @@ int main(int argc, const char *argv[])
     ret = prepare_response(main_ctx, ccname, expire_time, kerr, &resp);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "prepare_response failed. [%d][%s].\n",
-                    ret, strerror(ret));
+                    ret, sss_strerror(ret));
         goto fail;
     }
 
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index 8133431..da86325 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -885,7 +885,7 @@ sdap_attrs_get_sid_str(TALLOC_CTX *mem_ctx,
     if (ret != EOK || el->num_values != 1) {
         DEBUG(SSSDBG_TRACE_LIBS,
               "No [%s] attribute. [%d][%s]\n",
-               sid_attr, el->num_values, strerror(ret));
+               sid_attr, el->num_values, sss_strerror(ret));
         return ENOENT;
     }
 
diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c
index c788b6b..4bcf77f 100644
--- a/src/providers/ldap/ldap_id.c
+++ b/src/providers/ldap/ldap_id.c
@@ -1218,7 +1218,7 @@ static void sdap_check_online_reinit_done(struct tevent_req *req)
     talloc_zfree(req);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to perform reinitialization "
-              "clean up [%d]: %s\n", ret, strerror(ret));
+              "clean up [%d]: %s\n", ret, sss_strerror(ret));
         /* not fatal */
     } else {
         DEBUG(SSSDBG_TRACE_FUNC, "Reinitialization clean up completed\n");
diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c
index 6b0bead..cea3363 100644
--- a/src/providers/ldap/ldap_id_cleanup.c
+++ b/src/providers/ldap/ldap_id_cleanup.c
@@ -404,7 +404,7 @@ static int cleanup_groups(TALLOC_CTX *memctx,
             ret = sysdb_delete_group(domain, name, 0);
             if (ret) {
                 DEBUG(SSSDBG_OP_FAILURE, "Group delete returned %d (%s)\n",
-                          ret, strerror(ret));
+                          ret, sss_strerror(ret));
                 goto done;
             }
         }
diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c
index 9960fd3..45dcc9b 100644
--- a/src/providers/ldap/ldap_init.c
+++ b/src/providers/ldap/ldap_init.c
@@ -146,7 +146,7 @@ static int ldap_id_init_internal(struct be_ctx *bectx,
             if (ret !=  EOK) {
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "sdap_gssapi_init failed [%d][%s].\n",
-                            ret, strerror(ret));
+                            ret, sss_strerror(ret));
                 goto done;
             }
         }
@@ -155,7 +155,7 @@ static int ldap_id_init_internal(struct be_ctx *bectx,
     ret = setup_tls_config(ctx->opts->basic);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "setup_tls_config failed [%d][%s].\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -166,7 +166,7 @@ static int ldap_id_init_internal(struct be_ctx *bectx,
     ret = sdap_setup_child();
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "setup_child failed [%d][%s].\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -174,7 +174,7 @@ static int ldap_id_init_internal(struct be_ctx *bectx,
     ret = be_fo_set_dns_srv_lookup_plugin(bectx, NULL);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to set SRV lookup plugin "
-                                    "[%d]: %s\n", ret, strerror(ret));
+                                    "[%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -185,7 +185,7 @@ static int ldap_id_init_internal(struct be_ctx *bectx,
                             ctx);
     if (ret != EOK && ret != EEXIST) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups "
-              "will not work [%d]: %s\n", ret, strerror(ret));
+              "will not work [%d]: %s\n", ret, sss_strerror(ret));
     }
 
     *ops = &sdap_id_ops;
@@ -211,7 +211,7 @@ int sssm_ldap_id_init(struct be_ctx *bectx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "ldap_id_init_internal failed [%d][%s].\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
@@ -219,7 +219,7 @@ int sssm_ldap_id_init(struct be_ctx *bectx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "sdap_id_setup_tasks failed [%d][%s].\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
@@ -459,7 +459,7 @@ int sssm_ldap_sudo_init(struct be_ctx *be_ctx,
     ret = ldap_id_init_internal(be_ctx, ops, &data);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Cannot init LDAP ID provider [%d]: %s\n",
-                                    ret, strerror(ret));
+                                    ret, sss_strerror(ret));
         return ret;
     }
 
@@ -489,7 +489,7 @@ int sssm_ldap_autofs_init(struct be_ctx *be_ctx,
     ret = ldap_id_init_internal(be_ctx, ops, &data);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Cannot init LDAP ID provider [%d]: %s\n",
-                                    ret, strerror(ret));
+                                    ret, sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c
index 9231cc2..8c04a21 100644
--- a/src/providers/ldap/sdap.c
+++ b/src/providers/ldap/sdap.c
@@ -1201,7 +1201,7 @@ int sdap_get_server_opts_from_rootdse(TALLOC_CTX *memctx,
             DEBUG(SSSDBG_MINOR_FAILURE,
                   "Error detecting Active Directory compatibility level "
                    "(%s). Continuing without AD performance enhancements\n",
-                   strerror(ret));
+                   sss_strerror(ret));
         }
     }
 
diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c
index 89d37e5..b4e0e75 100644
--- a/src/providers/ldap/sdap_access.c
+++ b/src/providers/ldap/sdap_access.c
@@ -796,7 +796,8 @@ static int sdap_access_filter_retry(struct tevent_req *req)
     subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret);
     if (!subreq) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "sdap_id_op_connect_send failed: %d (%s)\n", ret, strerror(ret));
+              "sdap_id_op_connect_send failed: %d (%s)\n", ret,
+              sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index 590cbe1..771ec17 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -1546,7 +1546,7 @@ static errno_t sdap_get_generic_parse_entry(struct sdap_handle *sh,
                            &attrs, disable_range_rtrvl);
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
-              "sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret));
+              "sdap_parse_entry failed [%d]: %s\n", ret, sss_strerror(ret));
         return ret;
     }
 
@@ -1758,7 +1758,7 @@ static errno_t sdap_x_deref_parse_entry(struct sdap_handle *sh,
                                dref, &res);
         if (ret) {
             DEBUG(SSSDBG_OP_FAILURE, "sdap_parse_deref failed [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
             goto done;
         }
 
@@ -2204,7 +2204,8 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh,
                                &res[mi]->attrs, disable_range_rtrvl);
         if (ret != EOK) {
             DEBUG(SSSDBG_MINOR_FAILURE,
-                  "sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret));
+                  "sdap_parse_entry failed [%d]: %s\n",
+                  ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -2428,7 +2429,7 @@ static void sdap_posix_check_done(struct tevent_req *subreq)
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "sdap_get_generic_ext_recv failed [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         tevent_req_error(req, ret);
         return;
     }
@@ -2567,7 +2568,8 @@ static void sdap_deref_search_done(struct tevent_req *subreq)
     talloc_zfree(subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "dereference processing failed [%d]: %s\n", ret, strerror(ret));
+              "dereference processing failed [%d]: %s\n", ret,
+              sss_strerror(ret));
         if (ret == ENOTSUP) {
             sss_log(SSS_LOG_WARNING,
                 "LDAP server claims to support deref, but deref search failed. "
@@ -2576,7 +2578,8 @@ static void sdap_deref_search_done(struct tevent_req *subreq)
                 "configuration.");
             state->sh->disable_deref = true;
         } else {
-            sss_log(SSS_LOG_WARNING, "dereference processing failed : %s", strerror(ret));
+            sss_log(SSS_LOG_WARNING, "dereference processing failed : %s",
+                    sss_strerror(ret));
         }
         tevent_req_error(req, ret);
         return;
diff --git a/src/providers/ldap/sdap_async_autofs.c b/src/providers/ldap/sdap_async_autofs.c
index 1db8d20..6053847 100644
--- a/src/providers/ldap/sdap_async_autofs.c
+++ b/src/providers/ldap/sdap_async_autofs.c
@@ -289,7 +289,7 @@ automntmaps_process_members_send(TALLOC_CTX *mem_ctx,
     ret = automntmaps_process_members_next_base(req);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "search failed [%d]: %s\n", ret, strerror(ret));
+              "search failed [%d]: %s\n", ret, sss_strerror(ret));
         goto immediate;
     }
 
@@ -748,7 +748,7 @@ sdap_autofs_setautomntent_done(struct tevent_req *subreq)
         } else {
             DEBUG(SSSDBG_OP_FAILURE,
                 "sdap_get_automntmap_recv failed [%d]: %s\n",
-                ret, strerror(ret));
+                ret, sss_strerror(ret));
         }
         tevent_req_error(req, ret);
         return;
@@ -853,7 +853,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req)
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_OP_FAILURE,
               "cache lookup for the map failed [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     }
 
@@ -891,7 +891,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req)
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
              "Cannot start sysdb transaction [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
     in_transaction = true;
@@ -901,7 +901,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req)
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
              "Cannot save autofs map entry [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
@@ -913,7 +913,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req)
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Cannot save autofs entries [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -925,7 +925,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req)
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Cannot delete autofs entries [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -935,7 +935,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req)
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
              "Cannot commit sysdb transaction [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
     in_transaction = false;
@@ -947,7 +947,7 @@ done:
         if (tret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE,
                 "Cannot cancel sysdb transaction [%d]: %s\n",
-                ret, strerror(ret));
+                ret, sss_strerror(ret));
         }
     }
     talloc_zfree(tmp_ctx);
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index a1f78c0..41ecbf4 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -1205,7 +1205,7 @@ static void sdap_kinit_done(struct tevent_req *subreq)
     } else if (ret != EOK) {
         /* A severe error while executing the child. Abort the operation. */
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "child failed (%d [%s])\n", ret, strerror(ret));
+              "child failed (%d [%s])\n", ret, sss_strerror(ret));
         tevent_req_error(req, ret);
         return;
     }
diff --git a/src/providers/ldap/sdap_async_enum.c b/src/providers/ldap/sdap_async_enum.c
index 1c69c07..791afab 100644
--- a/src/providers/ldap/sdap_async_enum.c
+++ b/src/providers/ldap/sdap_async_enum.c
@@ -166,7 +166,7 @@ static bool sdap_dom_enum_ex_connected(struct tevent_req *subreq)
         } else {
             DEBUG(SSSDBG_MINOR_FAILURE,
                   "Domain enumeration failed to connect to " \
-                   "LDAP server: (%d)[%s]\n", ret, strerror(ret));
+                   "LDAP server: (%d)[%s]\n", ret, sss_strerror(ret));
             tevent_req_error(req, ret);
         }
         return false;
diff --git a/src/providers/ldap/sdap_async_groups_ad.c b/src/providers/ldap/sdap_async_groups_ad.c
index 8db587c..b21742d 100644
--- a/src/providers/ldap/sdap_async_groups_ad.c
+++ b/src/providers/ldap/sdap_async_groups_ad.c
@@ -77,7 +77,7 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Could not build attribute map: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto immediate;
     }
 
@@ -86,7 +86,7 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Could not retrieve originalDN for group: %s\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto immediate;
     }
 
@@ -95,7 +95,7 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Could not sanitize group DN: %s\n",
-               strerror(ret));
+              sss_strerror(ret));
         goto immediate;
     }
 
@@ -120,7 +120,7 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "sdap_get_ad_match_rule_members_next_base failed: [%s]\n",
-               strerror(ret));
+              sss_strerror(ret));
         goto immediate;
     }
 
diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c
index c7169dd..cd2d1b0 100644
--- a/src/providers/ldap/sdap_async_initgroups.c
+++ b/src/providers/ldap/sdap_async_initgroups.c
@@ -87,7 +87,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
             continue;
         } else if (ret != ENOENT) {
             DEBUG(SSSDBG_CRIT_FAILURE, "search for group failed [%d]: %s\n",
-                      ret, strerror(ret));
+                      ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -107,7 +107,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Cannot start sysdb transaction [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     }
     in_transaction = true;
@@ -268,7 +268,7 @@ int sdap_initgr_common_store(struct sysdb_ctx *sysdb,
         if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE,
                   "sysdb_attrs_primary_name_list failed [%d]: %s\n",
-                      ret, strerror(ret));
+                  ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -306,7 +306,7 @@ int sdap_initgr_common_store(struct sysdb_ctx *sysdb,
                                (const char *const *) del_groups);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Membership update failed [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -595,7 +595,7 @@ sdap_nested_groups_store(struct sysdb_ctx *sysdb,
         if (ret != EOK) {
             DEBUG(SSSDBG_MINOR_FAILURE,
                   "sysdb_attrs_primary_name_list failed [%d]: %s\n",
-                    ret, strerror(ret));
+                    ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -611,7 +611,7 @@ sdap_nested_groups_store(struct sysdb_ctx *sysdb,
                                      groups, count);
     if (ret != EOK) {
         DEBUG(SSSDBG_TRACE_FUNC, "Could not add incomplete groups [%d]: %s\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
         goto done;
     }
 
@@ -1017,7 +1017,7 @@ static void sdap_initgr_nested_store(struct tevent_req *req)
     ret = sdap_initgr_store_groups(state);
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Could not save groups [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -1026,7 +1026,7 @@ static void sdap_initgr_nested_store(struct tevent_req *req)
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Could not save group memberships [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -1035,7 +1035,7 @@ static void sdap_initgr_nested_store(struct tevent_req *req)
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Could not save user memberships [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -1111,7 +1111,7 @@ sdap_initgr_store_group_memberships(struct sdap_initgr_nested_state *state)
         if (ret) {
             DEBUG(SSSDBG_MINOR_FAILURE,
                   "Could not compute memberships for group %d [%d]: %s\n",
-                      i, ret, strerror(ret));
+                      i, ret, sss_strerror(ret));
             goto done;
         }
 
@@ -1228,7 +1228,7 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state)
         if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE,
                   "sysdb_attrs_primary_name_list failed [%d]: %s\n",
-                      ret, strerror(ret));
+                      ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -1238,7 +1238,7 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state)
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Could not get direct sysdb parents for %s: %d [%s]\n",
-                   state->username, ret, strerror(ret));
+                   state->username, ret, sss_strerror(ret));
         goto done;
     }
 
@@ -1264,7 +1264,7 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state)
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Could not update sysdb memberships for %s: %d [%s]\n",
-                  state->username, ret, strerror(ret));
+                  state->username, ret, sss_strerror(ret));
         goto done;
     }
 
@@ -1325,7 +1325,7 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx,
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Could not get direct sysdb parents for %s: %d [%s]\n",
-                   group_name, ret, strerror(ret));
+                   group_name, ret, sss_strerror(ret));
         goto done;
     }
 
@@ -1338,7 +1338,7 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx,
                                                 &parents_count);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Cannot get parent groups for %s [%d]: %s\n",
-                  group_name, ret, strerror(ret));
+                  group_name, ret, sss_strerror(ret));
         goto done;
     }
     DEBUG(SSSDBG_TRACE_LIBS,
@@ -1354,7 +1354,7 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx,
         if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE,
                   "sysdb_attrs_primary_name_list failed [%d]: %s\n",
-                        ret, strerror(ret));
+                        ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -1364,7 +1364,7 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Could not build membership diff for %s [%d]: %s\n",
-                  group_name, ret, strerror(ret));
+                  group_name, ret, sss_strerror(ret));
         goto done;
     }
 
@@ -1862,7 +1862,7 @@ save_rfc2307bis_groups(struct sdap_initgr_rfc2307bis_state *state)
                                    groups, count);
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE, "Could not save groups [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -2006,7 +2006,7 @@ rfc2307bis_group_memberships_build(hash_entry_t *item, void *user_data)
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Could not get direct sysdb parents for %s: %d [%s]\n",
-                  group_name, ret, strerror(ret));
+                  group_name, ret, sss_strerror(ret));
         goto done;
     }
 
@@ -2025,7 +2025,7 @@ rfc2307bis_group_memberships_build(hash_entry_t *item, void *user_data)
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Could not build membership diff for %s [%d]: %s\n",
-                  group_name, ret, strerror(ret));
+                  group_name, ret, sss_strerror(ret));
         goto done;
     }
 
@@ -2068,7 +2068,7 @@ errno_t save_rfc2307bis_user_memberships(
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Could not get direct sysdb parents for %s: %d [%s]\n",
-                   state->name, ret, strerror(ret));
+                   state->name, ret, sss_strerror(ret));
         goto error;
     }
 
@@ -2564,7 +2564,7 @@ static void rfc2307bis_nested_groups_done(struct tevent_req *subreq)
     talloc_zfree(subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_TRACE_FUNC, "rfc2307bis_nested failed [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         tevent_req_error(req, ret);
         return;
     }
@@ -3048,7 +3048,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq)
     talloc_zfree(subreq);
     if (ret) {
         DEBUG(SSSDBG_TRACE_ALL, "Error in initgroups: [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -3189,7 +3189,7 @@ static errno_t get_sysdb_grouplist_ex(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Error searching user [%s] by name: [%s]\n",
-               name, strerror(ret));
+               name, sss_strerror(ret));
         goto done;
     }
 
@@ -3224,7 +3224,8 @@ static errno_t get_sysdb_grouplist_ex(TALLOC_CTX *mem_ctx,
                 if (ret != EOK) {
                     DEBUG(SSSDBG_MINOR_FAILURE,
                           "Could not determine group name from [%s]: [%s]\n",
-                           (const char *)groups->values[i].data, strerror(ret));
+                           (const char *)groups->values[i].data,
+                           sss_strerror(ret));
                     goto done;
                 }
             }
diff --git a/src/providers/ldap/sdap_async_nested_groups.c b/src/providers/ldap/sdap_async_nested_groups.c
index c521e08..eb2c04f 100644
--- a/src/providers/ldap/sdap_async_nested_groups.c
+++ b/src/providers/ldap/sdap_async_nested_groups.c
@@ -654,14 +654,14 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx,
     ret = sss_hash_create(state->group_ctx, 32, &state->group_ctx->users);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to create hash table [%d]: %s\n",
-                                    ret, strerror(ret));
+                                    ret, sss_strerror(ret));
         goto immediately;
     }
 
     ret = sss_hash_create(state->group_ctx, 32, &state->group_ctx->groups);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to create hash table [%d]: %s\n",
-                                    ret, strerror(ret));
+                                    ret, sss_strerror(ret));
         goto immediately;
     }
 
@@ -709,7 +709,7 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx,
     ret = sdap_nested_group_hash_group(state->group_ctx, group);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to insert group into hash table "
-                                    "[%d]: %s\n", ret, strerror(ret));
+                                    "[%d]: %s\n", ret, sss_strerror(ret));
         goto immediately;
     }
 
@@ -852,7 +852,7 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx,
     ret = sysdb_attrs_get_string(group, SYSDB_ORIG_DN, &orig_dn);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve original dn "
-                                    "[%d]: %s\n", ret, strerror(ret));
+                                    "[%d]: %s\n", ret, sss_strerror(ret));
         goto immediately;
     }
 
@@ -872,7 +872,7 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx,
         goto immediately;
     } else if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve member list "
-                                    "[%d]: %s\n", ret, strerror(ret));
+                                    "[%d]: %s\n", ret, sss_strerror(ret));
         goto immediately;
     }
 
@@ -1271,7 +1271,7 @@ sdap_nested_group_single_step_process(struct tevent_req *subreq)
             goto done;
         } else if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE, "Unable to save user in hash table "
-                                        "[%d]: %s\n", ret, strerror(ret));
+                                        "[%d]: %s\n", ret, sss_strerror(ret));
             goto done;
         }
         break;
@@ -1314,7 +1314,7 @@ sdap_nested_group_single_step_process(struct tevent_req *subreq)
             goto done;
         } else if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE, "Unable to save group in hash table "
-                                        "[%d]: %s\n", ret, strerror(ret));
+                                        "[%d]: %s\n", ret, sss_strerror(ret));
             goto done;
         }
 
@@ -1348,7 +1348,7 @@ static void sdap_nested_group_single_step_done(struct tevent_req *subreq)
     talloc_zfree(subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Error processing direct membership "
-                                    "[%d]: %s\n", ret, strerror(ret));
+                                    "[%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -1399,7 +1399,7 @@ static void sdap_nested_group_single_done(struct tevent_req *subreq)
     talloc_zfree(subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Error processing nested groups "
-                                    "[%d]: %s\n.", ret, strerror(ret));
+                                    "[%d]: %s\n", ret, sss_strerror(ret));
         tevent_req_error(req, ret);
         return;
     }
@@ -2189,7 +2189,7 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq)
             if (ret != EOK && ret != EEXIST) {
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Unable to save user in hash table "
-                       "[%d]: %s\n", ret, strerror(ret));
+                       "[%d]: %s\n", ret, sss_strerror(ret));
                 goto done;
             }
 
@@ -2216,7 +2216,7 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq)
             } else if (ret != EOK) {
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Unable to save group in hash table "
-                       "[%d]: %s\n", ret, strerror(ret));
+                       "[%d]: %s\n", ret, sss_strerror(ret));
                 goto done;
             }
 
@@ -2265,7 +2265,7 @@ static void sdap_nested_group_deref_direct_done(struct tevent_req *subreq)
     talloc_zfree(subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Error processing direct membership "
-                                    "[%d]: %s\n", ret, strerror(ret));
+                                    "[%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/providers/ldap/sdap_async_services.c b/src/providers/ldap/sdap_async_services.c
index 54f3ffb..d6f9948 100644
--- a/src/providers/ldap/sdap_async_services.c
+++ b/src/providers/ldap/sdap_async_services.c
@@ -403,7 +403,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Failed to identify service port: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
@@ -413,7 +413,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Failed to identify service protocols: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
@@ -424,7 +424,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx,
         if (ret != EOK) {
             DEBUG(SSSDBG_MINOR_FAILURE,
                 "Failed to get case_sensitive protocols names: [%s]\n",
-                strerror(ret));
+                sss_strerror(ret));
             goto done;
         }
     }
@@ -437,7 +437,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx,
     if (ret && ret != ENOENT) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Failed to retrieve USN value: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
     if (ret == ENOENT || el->num_values == 0) {
@@ -451,7 +451,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx,
         if (ret) {
             DEBUG(SSSDBG_MINOR_FAILURE,
                   "Failed to add USN value: [%s]\n",
-                   strerror(ret));
+                   sss_strerror(ret));
             goto done;
         }
         usn_value = talloc_strdup(tmp_ctx, (const char*)el->values[0].data);
@@ -469,7 +469,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Failed to identify removed attributes: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
@@ -480,7 +480,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
               "Failed to store service in the sysdb: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/providers/ldap/sdap_async_sudo.c b/src/providers/ldap/sdap_async_sudo.c
index b4899cb..24bbb34 100644
--- a/src/providers/ldap/sdap_async_sudo.c
+++ b/src/providers/ldap/sdap_async_sudo.c
@@ -216,7 +216,8 @@ static int sdap_sudo_refresh_retry(struct tevent_req *req)
     subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret);
     if (subreq == NULL) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "sdap_id_op_connect_send() failed: %d(%s)\n", ret, strerror(ret));
+              "sdap_id_op_connect_send() failed: %d(%s)\n",
+              ret, sss_strerror(ret));
         talloc_zfree(state->sdap_op);
         state->dp_error = DP_ERR_FATAL;
         state->error = ret;
@@ -249,7 +250,7 @@ static void sdap_sudo_refresh_connect_done(struct tevent_req *subreq)
         return;
     } else if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "SUDO LDAP connection failed - %s\n", strerror(ret));
+              "SUDO LDAP connection failed - %s\n", sss_strerror(ret));
         goto fail;
     }
 
@@ -555,7 +556,8 @@ static int sdap_sudo_purge_sudoers(struct sss_domain_info *dom,
                                          &name);
             if (ret != EOK) {
                 DEBUG(SSSDBG_MINOR_FAILURE,
-                      "Failed to retrieve rule name: [%s]\n", strerror(ret));
+                      "Failed to retrieve rule name: [%s]\n",
+                      sss_strerror(ret));
                 continue;
             }
 
@@ -563,7 +565,7 @@ static int sdap_sudo_purge_sudoers(struct sss_domain_info *dom,
             if (ret != EOK) {
                 DEBUG(SSSDBG_MINOR_FAILURE,
                       "Failed to delete rule %s: [%s]\n",
-                       name, strerror(ret));
+                       name, sss_strerror(ret));
                 continue;
             }
         }
@@ -580,7 +582,7 @@ static int sdap_sudo_purge_sudoers(struct sss_domain_info *dom,
 done:
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "failed to purge sudo rules [%d]: %s\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
     }
 
     return ret;
@@ -608,7 +610,7 @@ static int sdap_sudo_store_sudoers(TALLOC_CTX *mem_ctx,
                                          _usn);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "failed to save sudo rules [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/providers/ldap/sdap_async_sudo_hostinfo.c b/src/providers/ldap/sdap_async_sudo_hostinfo.c
index 42f95df..14cd915 100644
--- a/src/providers/ldap/sdap_async_sudo_hostinfo.c
+++ b/src/providers/ldap/sdap_async_sudo_hostinfo.c
@@ -93,7 +93,8 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx,
                                  &state->hostnames, NULL);
         if (ret != EOK) {
             DEBUG(SSSDBG_MINOR_FAILURE,
-                  "Unable to parse hostnames [%d]: %s\n", ret, strerror(ret));
+                  "Unable to parse hostnames [%d]: %s\n", ret,
+                  sss_strerror(ret));
             goto done;
         } else {
             DEBUG(SSSDBG_CONF_SETTINGS,
@@ -107,7 +108,7 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx,
         if (ret != EOK) {
             DEBUG(SSSDBG_MINOR_FAILURE,
                   "Unable to parse IP addresses [%d]: %s\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
             goto done;
         } else {
             DEBUG(SSSDBG_CONF_SETTINGS, "IP addresses set to: %s\n",
@@ -121,7 +122,7 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx,
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Unable to detect IP addresses [%d]: %s\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
         }
     }
 
@@ -163,7 +164,7 @@ static void sdap_sudo_get_hostinfo_done(struct tevent_req *subreq)
     talloc_zfree(subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve hostnames [%d]: %s\n",
-                                    ret, strerror(ret));
+                                    ret, sss_strerror(ret));
         tevent_req_error(req, ret);
         return;
     }
@@ -467,7 +468,7 @@ static void sdap_sudo_get_hostnames_done(struct tevent_req *subreq)
     } else if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Could not resolve fqdn for this machine, error [%d]: %s, "
-               "resolver returned: [%d]: %s\n", ret, strerror(ret),
+               "resolver returned: [%d]: %s\n", ret, sss_strerror(ret),
                resolv_status, resolv_strerror(resolv_status));
         tevent_req_error(req, ret);
         return;
diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c
index be0536e..1e1a245 100644
--- a/src/providers/ldap/sdap_async_users.c
+++ b/src/providers/ldap/sdap_async_users.c
@@ -165,7 +165,7 @@ int sdap_save_user(TALLOC_CTX *memctx,
         ret = sysdb_attrs_add_string(user_attrs, SYSDB_SID_STR, sid_str);
         if (ret != EOK) {
             DEBUG(SSSDBG_MINOR_FAILURE, "Could not add SID string: [%s]\n",
-                                         strerror(ret));
+                                         sss_strerror(ret));
             goto done;
         }
     } else if (ret == ENOENT) {
@@ -173,7 +173,7 @@ int sdap_save_user(TALLOC_CTX *memctx,
         sid_str = NULL;
     } else {
         DEBUG(SSSDBG_MINOR_FAILURE, "Could not identify objectSID: [%s]\n",
-                                     strerror(ret));
+                                     sss_strerror(ret));
         sid_str = NULL;
     }
 
diff --git a/src/providers/ldap/sdap_autofs.c b/src/providers/ldap/sdap_autofs.c
index 5432a6f..d1187ca 100644
--- a/src/providers/ldap/sdap_autofs.c
+++ b/src/providers/ldap/sdap_autofs.c
@@ -273,7 +273,7 @@ sdap_autofs_get_map_done(struct tevent_req *subreq)
         if (ret != EOK && ret != ENOENT) {
             DEBUG(SSSDBG_OP_FAILURE,
                 "Cannot delete autofs map %s [%d]: %s\n",
-                 state->map_name, ret, strerror(ret));
+                 state->map_name, ret, sss_strerror(ret));
             tevent_req_error(req, ret);
             return;
         }
@@ -307,6 +307,6 @@ sdap_autofs_handler_done(struct tevent_req *req)
     errno_t ret;
 
     ret = sdap_autofs_get_map_recv(req, &dperr);
-    sdap_handler_done(be_req, dperr, ret, strerror(ret));
+    sdap_handler_done(be_req, dperr, ret, sss_strerror(ret));
 }
 
diff --git a/src/providers/ldap/sdap_child_helpers.c b/src/providers/ldap/sdap_child_helpers.c
index 448c5af..496f626 100644
--- a/src/providers/ldap/sdap_child_helpers.c
+++ b/src/providers/ldap/sdap_child_helpers.c
@@ -398,7 +398,8 @@ int sdap_get_tgt_recv(struct tevent_req *req,
                                &res, &krberr, &ccn, &expire_time);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "Cannot parse child response: [%d][%s]\n", ret, strerror(ret));
+              "Cannot parse child response: [%d][%s]\n", ret,
+              sss_strerror(ret));
         return ret;
     }
 
@@ -467,7 +468,7 @@ int sdap_setup_child(void)
         ret = open_debug_file_ex(LDAP_CHILD_LOG_FILE, &debug_filep, false);
         if (ret != EOK) {
             DEBUG(SSSDBG_FATAL_FAILURE, "Error setting up logging (%d) [%s]\n",
-                        ret, strerror(ret));
+                        ret, sss_strerror(ret));
             return ret;
         }
 
diff --git a/src/providers/ldap/sdap_domain.c b/src/providers/ldap/sdap_domain.c
index d7e3dc3..a5e5897 100644
--- a/src/providers/ldap/sdap_domain.c
+++ b/src/providers/ldap/sdap_domain.c
@@ -105,7 +105,7 @@ sdap_domain_add(struct sdap_options *opts,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
             "Cannot convert domain name [%s] to base DN [%d]: %s\n",
-            dom->name, ret, strerror(ret));
+            dom->name, ret, sss_strerror(ret));
         goto done;
     }
 
@@ -151,7 +151,7 @@ sdap_domain_subdom_add(struct sdap_id_ctx *sdap_id_ctx,
             if (ret != EOK) {
                 DEBUG(SSSDBG_OP_FAILURE,
                     "Cannot add new sdap domain for domain %s [%d]: %s\n",
-                    parent->name, ret, strerror(ret));
+                    parent->name, ret, sss_strerror(ret));
                 return ret;
             }
         } else {
diff --git a/src/providers/ldap/sdap_dyndns.c b/src/providers/ldap/sdap_dyndns.c
index 1c5611b..8cc74b1 100644
--- a/src/providers/ldap/sdap_dyndns.c
+++ b/src/providers/ldap/sdap_dyndns.c
@@ -218,7 +218,7 @@ sdap_dyndns_dns_addrs_done(struct tevent_req *subreq)
         ret = sdap_dyndns_addrs_diff(state, &do_update);
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE, "Could not check the diff between DNS "
-                  "and current addresses [%d]: %s\n", ret, strerror(ret));
+                  "and current addresses [%d]: %s\n", ret, sss_strerror(ret));
             tevent_req_error(req, ret);
             return;
         }
diff --git a/src/providers/ldap/sdap_id_op.c b/src/providers/ldap/sdap_id_op.c
index 508bbd2..d0ca91e 100644
--- a/src/providers/ldap/sdap_id_op.c
+++ b/src/providers/ldap/sdap_id_op.c
@@ -566,7 +566,7 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq)
             /* be is going offline as there is no more servers to try */
             DEBUG(SSSDBG_CRIT_FAILURE,
                   "Failed to connect, going offline (%d [%s])\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
             be_mark_offline(conn_cache->id_conn->id_ctx->be);
         }
         is_offline = true;
@@ -694,7 +694,8 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq)
             sdap_id_op_connect_req_complete(op, DP_ERR_OFFLINE, EAGAIN);
         } else {
             DEBUG(SSSDBG_TRACE_ALL,
-                  "notify error to op #%d: %d [%s]\n", notify_count, ret, strerror(ret));
+                  "notify error to op #%d: %d [%s]\n", notify_count, ret,
+                  sss_strerror(ret));
             sdap_id_op_connect_req_complete(op, DP_ERR_FATAL, ret);
         }
     }
@@ -748,7 +749,7 @@ static void sdap_id_op_connect_reinit_done(struct tevent_req *req)
     talloc_zfree(req);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to perform reinitialization "
-              "clean up [%d]: %s\n", ret, strerror(ret));
+              "clean up [%d]: %s\n", ret, sss_strerror(ret));
         /* not fatal */
         return;
     }
diff --git a/src/providers/ldap/sdap_idmap.c b/src/providers/ldap/sdap_idmap.c
index 3826035..9a3cea5 100644
--- a/src/providers/ldap/sdap_idmap.c
+++ b/src/providers/ldap/sdap_idmap.c
@@ -226,7 +226,7 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx,
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Could not read ID mappings from the cache: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
@@ -268,7 +268,7 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx,
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Could not add domain [%s][%s][%"SPRIid"] "
                        "to ID map: [%s]\n",
-                       dom_name, sid_str, slice_num, strerror(ret));
+                       dom_name, sid_str, slice_num, sss_strerror(ret));
                 goto done;
             }
         }
@@ -294,7 +294,7 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx,
             if (ret != EOK) {
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Could not add domain [%s][%s][%u] to ID map: [%s]\n",
-                       dom_name, sid_str, 0, strerror(ret));
+                       dom_name, sid_str, 0, sss_strerror(ret));
                 goto done;
             }
         } else {
diff --git a/src/providers/ldap/sdap_reinit.c b/src/providers/ldap/sdap_reinit.c
index 265453f..a2e5e76 100644
--- a/src/providers/ldap/sdap_reinit.c
+++ b/src/providers/ldap/sdap_reinit.c
@@ -75,7 +75,7 @@ struct tevent_req* sdap_reinit_cleanup_send(TALLOC_CTX *mem_ctx,
     ret = sdap_reinit_clear_usn(state->sysdb, state->domain);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to clear USN attributes [%d]: %s\n",
-                                    ret, strerror(ret));
+                                    ret, sss_strerror(ret));
         goto immediately;
     }
 
@@ -166,7 +166,7 @@ static errno_t sdap_reinit_clear_usn(struct sysdb_ctx *sysdb,
     ret = sysdb_search_services(tmp_ctx, domain, "", attrs, &msgs_num, &msgs);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Cannot search services [%d]: %s\n", ret, strerror(ret));
+              "Cannot search services [%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -207,7 +207,7 @@ static void sdap_reinit_cleanup_done(struct tevent_req *subreq)
     talloc_zfree(subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Domain enumeration failed [%d]: %s\n",
-                                    ret, strerror(ret));
+                                    ret, sss_strerror(ret));
         goto fail;
     }
 
diff --git a/src/providers/ldap/sdap_sudo.c b/src/providers/ldap/sdap_sudo.c
index 6809f74..2d0cb9f 100644
--- a/src/providers/ldap/sdap_sudo.c
+++ b/src/providers/ldap/sdap_sudo.c
@@ -166,7 +166,7 @@ int sdap_sudo_init(struct be_ctx *be_ctx,
         if (ret != EOK) {
              DEBUG(SSSDBG_OP_FAILURE,
                    "Unable to setup periodical refresh"
-                    "of sudo rules [%d]: %s\n", ret, strerror(ret));
+                    "of sudo rules [%d]: %s\n", ret, sss_strerror(ret));
              /* periodical updates will not work, but specific-rule update
               * is no affected by this, therefore we don't have to fail here */
         }
@@ -189,8 +189,10 @@ static void sdap_sudo_get_hostinfo_done(struct tevent_req *req)
     ret = sdap_sudo_get_hostinfo_recv(sudo_ctx, req, &hostnames, &ip_addr);
     talloc_zfree(req);
     if (ret != EOK) {
-        DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve host information - "
-              "(host filter will be disabled) [%d]: %s\n", ret, strerror(ret));
+        DEBUG(SSSDBG_CRIT_FAILURE,
+              "Unable to retrieve host information - "
+              "(host filter will be disabled) [%d]: %s\n",
+              ret, sss_strerror(ret));
         sudo_ctx->use_host_filter = false;
     }
 
@@ -202,8 +204,9 @@ static void sdap_sudo_get_hostinfo_done(struct tevent_req *req)
 
     ret = sdap_sudo_setup_periodical_refresh(sudo_ctx);
     if (ret != EOK) {
-        DEBUG(SSSDBG_OP_FAILURE, "Unable to setup periodical refresh"
-                                  "of sudo rules [%d]: %s\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE,
+              "Unable to setup periodical refreshof sudo rules [%d]: %s\n",
+              ret, sss_strerror(ret));
     }
 }
 
@@ -476,11 +479,11 @@ static void sdap_sudo_reply(struct tevent_req *req)
 
     talloc_zfree(req);
     if (ret != EOK) {
-        sdap_handler_done(be_req, DP_ERR_FATAL, ret, strerror(ret));
+        sdap_handler_done(be_req, DP_ERR_FATAL, ret, sss_strerror(ret));
         return;
     }
 
-    sdap_handler_done(be_req, dp_error, error, strerror(error));
+    sdap_handler_done(be_req, dp_error, error, sss_strerror(error));
 }
 
 void sdap_sudo_handler(struct be_req *be_req)
@@ -1025,21 +1028,22 @@ static void sdap_sudo_periodical_first_refresh_done(struct tevent_req *req)
     ret = sdap_sudo_timer_recv(req, req, &subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Sudo timer failed [%d]: %s\n", ret, strerror(ret));
+              "Sudo timer failed [%d]: %s\n", ret, sss_strerror(ret));
         goto schedule;
     }
 
     ret = sdap_sudo_full_refresh_recv(subreq, &dp_error, &error);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules "
-                                  "failed [%d]: %s)\n", ret, strerror(ret));
+                                  "failed [%d]: %s)\n", ret,
+                                  sss_strerror(ret));
         goto schedule;
     }
 
     if (dp_error != DP_ERR_OK || error != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules "
                                   "failed [dp_error: %d] ([%d]: %s)\n",
-                                  dp_error, error, strerror(error));
+                                  dp_error, error, sss_strerror(error));
         goto schedule;
     }
 
@@ -1127,21 +1131,22 @@ static void sdap_sudo_periodical_full_refresh_done(struct tevent_req *req)
     ret = sdap_sudo_timer_recv(req, req, &subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Sudo timer failed [%d]: %s\n", ret, strerror(ret));
+              "Sudo timer failed [%d]: %s\n", ret, sss_strerror(ret));
         goto schedule;
     }
 
     ret = sdap_sudo_full_refresh_recv(subreq, &dp_error, &error);
     if (ret != EOK) {
-        DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules "
-                                  "failed [%d]: %s)\n", ret, strerror(ret));
+        DEBUG(SSSDBG_OP_FAILURE,
+              "Periodical full refresh of sudo rules failed [%d]: %s)\n",
+              ret, sss_strerror(ret));
         goto schedule;
     }
 
     if (dp_error != DP_ERR_OK || error != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules "
                                   "failed [dp_error: %d] ([%d]: %s)\n",
-                                  dp_error, error, strerror(error));
+                                  dp_error, error, sss_strerror(error));
         goto schedule;
     }
 
@@ -1176,20 +1181,20 @@ static void sdap_sudo_periodical_smart_refresh_done(struct tevent_req *req)
     ret = sdap_sudo_timer_recv(req, req, &subreq);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Sudo timer failed [%d]: %s\n", ret, strerror(ret));
+              "Sudo timer failed [%d]: %s\n", ret, sss_strerror(ret));
         goto schedule;
     }
 
     ret = sdap_sudo_smart_refresh_recv(subreq, &dp_error, &error);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Periodical smart refresh of sudo rules "
-                                  "failed [%d]: %s\n", ret, strerror(ret));
+                                  "failed [%d]: %s\n", ret, sss_strerror(ret));
     }
 
     if (dp_error != DP_ERR_OK || error != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Periodical smart refresh of sudo rules "
                                   "failed [dp_error: %d] ([%d]: %s)\n",
-                                  dp_error, error, strerror(error));
+                                  dp_error, error, sss_strerror(error));
         goto schedule;
     }
 
diff --git a/src/providers/ldap/sdap_sudo_cache.c b/src/providers/ldap/sdap_sudo_cache.c
index 27203c2..41363a1 100644
--- a/src/providers/ldap/sdap_sudo_cache.c
+++ b/src/providers/ldap/sdap_sudo_cache.c
@@ -41,7 +41,7 @@ static errno_t sdap_sudo_get_usn(TALLOC_CTX *mem_ctx,
     ret = sysdb_attrs_get_string(attrs, map[SDAP_AT_SUDO_USN].sys_name, &usn);
     if (ret != EOK) {
         DEBUG(SSSDBG_MINOR_FAILURE,
-              "Failed to retrieve USN value: [%s]\n", strerror(ret));
+              "Failed to retrieve USN value: [%s]\n", sss_strerror(ret));
 
         return ret;
     }
@@ -74,7 +74,7 @@ sdap_save_native_sudorule(TALLOC_CTX *mem_ctx,
         return ret;
     } else if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not get rule name [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         return ret;
     }
 
@@ -82,7 +82,7 @@ sdap_save_native_sudorule(TALLOC_CTX *mem_ctx,
                                  (cache_timeout ? (now + cache_timeout) : 0));
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not set sysdb cache expire [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/providers/ldap/sdap_utils.c b/src/providers/ldap/sdap_utils.c
index 93a1faa..e7b9f59 100644
--- a/src/providers/ldap/sdap_utils.c
+++ b/src/providers/ldap/sdap_utils.c
@@ -40,7 +40,7 @@ sdap_attrs_add_ldap_attr(struct sysdb_attrs *ldap_attrs,
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE, "Could not get %s from the "
               "list of the LDAP attributes [%d]: %s\n",
-              attr_name, ret, strerror(ret));
+              attr_name, ret, sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/providers/proxy/proxy_auth.c b/src/providers/proxy/proxy_auth.c
index a901f0f..1165645 100644
--- a/src/providers/proxy/proxy_auth.c
+++ b/src/providers/proxy/proxy_auth.c
@@ -786,7 +786,7 @@ static void proxy_child_done(struct tevent_req *req)
         /* so we just log it any return */
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE, "Failed to cache password (%d)[%s]!?\n",
-                      ret, strerror(ret));
+                      ret, sss_strerror(ret));
         }
     }
 
diff --git a/src/providers/proxy/proxy_child.c b/src/providers/proxy/proxy_child.c
index 6bee1c7..99a28d3 100644
--- a/src/providers/proxy/proxy_child.c
+++ b/src/providers/proxy/proxy_child.c
@@ -573,7 +573,7 @@ int main(int argc, const char *argv[])
                             CONFDB_PROXY_PAM_TARGET, NULL, &pam_target);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) [%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         return 4;
     }
     if (pam_target == NULL) {
diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c
index d867ec4..45c8518 100644
--- a/src/providers/proxy/proxy_id.c
+++ b/src/providers/proxy/proxy_id.c
@@ -83,7 +83,7 @@ static int get_pw_name(struct proxy_id_ctx *ctx,
     ret = handle_getpw_result(status, pwd, dom, &del_user);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "getpwnam failed [%d]: %s\n", ret, strerror(ret));
+              "getpwnam failed [%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -101,7 +101,7 @@ static int get_pw_name(struct proxy_id_ctx *ctx,
         if (ret != EOK) {
             /* Non-fatal, attempt to canonicalize online */
             DEBUG(SSSDBG_TRACE_FUNC, "Request to cache failed [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         }
 
         if (ret == EOK && cached_pwd->count == 1) {
@@ -120,7 +120,7 @@ static int get_pw_name(struct proxy_id_ctx *ctx,
         ret = handle_getpw_result(status, pwd, dom, &del_user);
         if (ret) {
             DEBUG(SSSDBG_OP_FAILURE,
-                "getpwuid failed [%d]: %s\n", ret, strerror(ret));
+                "getpwuid failed [%d]: %s\n", ret, sss_strerror(ret));
             goto done;
         }
 
@@ -141,7 +141,7 @@ done:
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
               "proxy -> getpwnam_r failed for '%s' <%d>: %s\n",
-               name, ret, strerror(ret));
+               name, ret, sss_strerror(ret));
     }
     return ret;
 }
@@ -327,7 +327,7 @@ static int get_pw_uid(struct proxy_id_ctx *ctx,
     ret = handle_getpw_result(status, pwd, dom, &del_user);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "getpwuid failed [%d]: %s\n", ret, strerror(ret));
+              "getpwuid failed [%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -344,7 +344,7 @@ done:
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "proxy -> getpwuid_r failed for '%"SPRIuid"' <%d>: %s\n",
-               uid, ret, strerror(ret));
+               uid, ret, sss_strerror(ret));
     }
     return ret;
 }
@@ -478,7 +478,7 @@ static int enum_users(TALLOC_CTX *mem_ctx,
             default:
                 ret = EIO;
                 DEBUG(SSSDBG_OP_FAILURE, "proxy -> getpwent_r failed (%d)[%s]"
-                            "\n", ret, strerror(ret));
+                            "\n", ret, sss_strerror(ret));
                 break;
         }
     } while (again);
@@ -619,7 +619,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom,
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Could not commit transaction: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
     in_transaction = false;
@@ -671,14 +671,14 @@ static errno_t proxy_process_missing_users(struct sysdb_ctx *sysdb,
             if (ret != EOK) {
                 DEBUG(SSSDBG_MINOR_FAILURE,
                       "Cannot store ghost user entry: [%d]: %s\n",
-                       ret, strerror(ret));
+                       ret, sss_strerror(ret));
                 goto done;
             }
         } else {
             /* Unexpected error */
             DEBUG(SSSDBG_MINOR_FAILURE,
                   "Error searching cache for user [%s]: [%s]\n",
-                   grp->gr_mem[i], strerror(ret));
+                   grp->gr_mem[i], sss_strerror(ret));
             goto done;
         }
     }
@@ -805,7 +805,7 @@ static int get_gr_name(struct proxy_id_ctx *ctx,
 
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "getgrnam failed [%d]: %s\n", ret, strerror(ret));
+              "getgrnam failed [%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -817,7 +817,7 @@ static int get_gr_name(struct proxy_id_ctx *ctx,
         if (ret != EOK) {
             /* Non-fatal, attempt to canonicalize online */
             DEBUG(SSSDBG_TRACE_FUNC, "Request to cache failed [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         }
 
         if (ret == EOK && cached_grp->count == 1) {
@@ -848,7 +848,7 @@ static int get_gr_name(struct proxy_id_ctx *ctx,
 
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE,
-                "getgrgid failed [%d]: %s\n", ret, strerror(ret));
+                "getgrgid failed [%d]: %s\n", ret, sss_strerror(ret));
             goto done;
         }
 
@@ -870,7 +870,7 @@ static int get_gr_name(struct proxy_id_ctx *ctx,
     ret = save_group(sysdb, dom, grp, real_name, name, dom->group_timeout);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Cannot save group [%d]: %s\n", ret, strerror(ret));
+              "Cannot save group [%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -879,7 +879,7 @@ done:
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
               "proxy -> getgrnam_r failed for '%s' <%d>: %s\n",
-              name, ret, strerror(ret));
+              name, ret, sss_strerror(ret));
     }
     return ret;
 }
@@ -929,7 +929,7 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx,
 
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "getgrgid failed [%d]: %s\n", ret, strerror(ret));
+              "getgrgid failed [%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -948,7 +948,7 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx,
     ret = save_group(sysdb, dom, grp, grp->gr_name, NULL, dom->group_timeout);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Cannot save user [%d]: %s\n", ret, strerror(ret));
+              "Cannot save user [%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -957,7 +957,7 @@ done:
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
               "proxy -> getgrgid_r failed for '%"SPRIgid"' <%d>: %s\n",
-               gid, ret, strerror(ret));
+               gid, ret, sss_strerror(ret));
     }
     return ret;
 }
@@ -1165,7 +1165,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
     ret = handle_getpw_result(status, pwd, dom, &del_user);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "getpwnam failed [%d]: %s\n", ret, strerror(ret));
+              "getpwnam failed [%d]: %s\n", ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -1187,7 +1187,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
         if (ret != EOK) {
             /* Non-fatal, attempt to canonicalize online */
             DEBUG(SSSDBG_TRACE_FUNC, "Request to cache failed [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         }
 
         if (ret == EOK && cached_pwd->count == 1) {
@@ -1206,7 +1206,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
         ret = handle_getpw_result(status, pwd, dom, &del_user);
         if (ret) {
             DEBUG(SSSDBG_OP_FAILURE,
-                "getpwuid failed [%d]: %s\n", ret, strerror(ret));
+                "getpwuid failed [%d]: %s\n", ret, sss_strerror(ret));
             goto done;
         }
 
@@ -1331,7 +1331,7 @@ static int get_initgr_groups_process(TALLOC_CTX *memctx,
 
     default:
         DEBUG(SSSDBG_OP_FAILURE, "proxy -> initgroups_dyn failed (%d)[%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         ret = EIO;
         break;
     }
diff --git a/src/providers/proxy/proxy_services.c b/src/providers/proxy/proxy_services.c
index 16e90b0..3449655 100644
--- a/src/providers/proxy/proxy_services.c
+++ b/src/providers/proxy/proxy_services.c
@@ -301,7 +301,7 @@ enum_services(struct proxy_id_ctx *ctx,
                      * Just report the failure to save and go on */
                     DEBUG(SSSDBG_OP_FAILURE,
                             "Failed to store service [%s]. Ignoring.\n",
-                             strerror(ret));
+                             sss_strerror(ret));
                     again = true;
                     break;
                 }
@@ -319,7 +319,7 @@ enum_services(struct proxy_id_ctx *ctx,
                      * Just report the failure to save and go on */
                     DEBUG(SSSDBG_OP_FAILURE,
                             "Failed to store service [%s]. Ignoring.\n",
-                             strerror(ret));
+                             sss_strerror(ret));
                 }
                 again = true;
                 break;
@@ -345,7 +345,7 @@ done:
         if (sret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE,
                   "Could not cancel transaction! [%s]\n",
-                   strerror(sret));
+                   sss_strerror(sret));
         }
     }
     ctx->ops.endservent();
diff --git a/src/python/pysss.c b/src/python/pysss.c
index 668d77c..b21d998 100644
--- a/src/python/pysss.c
+++ b/src/python/pysss.c
@@ -89,7 +89,7 @@ static void PyErr_SetSssErrorWithMessage(int ret, const char *message)
 
 static void PyErr_SetSssError(int ret)
 {
-    PyErr_SetSssErrorWithMessage(ret, strerror(ret));
+    PyErr_SetSssErrorWithMessage(ret, sss_strerror(ret));
 }
 
 /*
diff --git a/src/resolv/async_resolv.c b/src/resolv/async_resolv.c
index f936124..4410856 100644
--- a/src/resolv/async_resolv.c
+++ b/src/resolv/async_resolv.c
@@ -1366,7 +1366,7 @@ resolv_gethostbyname_done(struct tevent_req *subreq)
 
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "querying hosts database failed [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         tevent_req_error(req, ret);
         return;
     }
@@ -2207,7 +2207,7 @@ resolv_sort_srv_reply(struct ares_srv_reply **reply)
         if (ret) {
             DEBUG(SSSDBG_CRIT_FAILURE,
                   "Error rearranging priority level [%d]: %s\n",
-                      ret, strerror(ret));
+                      ret, sss_strerror(ret));
             return ret;
         }
 
diff --git a/src/resolv/async_resolv_utils.c b/src/resolv/async_resolv_utils.c
index c5ae5f9..362ae78 100644
--- a/src/resolv/async_resolv_utils.c
+++ b/src/resolv/async_resolv_utils.c
@@ -112,7 +112,7 @@ static void resolv_get_domain_done(struct tevent_req *subreq)
         DEBUG(SSSDBG_OP_FAILURE,
               "Could not get fully qualified name for host name %s "
                "error [%d]: %s, resolver returned: [%d]: %s\n",
-               state->hostname, ret, strerror(ret), resolv_status,
+               state->hostname, ret, sss_strerror(ret), resolv_status,
                resolv_strerror(resolv_status));
         state->fqdn = state->hostname;
     } else {
diff --git a/src/responder/autofs/autofssrv.c b/src/responder/autofs/autofssrv.c
index bd5aa13..7210c78 100644
--- a/src/responder/autofs/autofssrv.c
+++ b/src/responder/autofs/autofssrv.c
@@ -66,7 +66,7 @@ autofs_get_config(struct autofs_ctx *actx,
                          &actx->neg_timeout);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Cannot read %s from configuration [%d]: %s\n",
-              CONFDB_AUTOFS_MAP_NEG_TIMEOUT, ret, strerror(ret));
+              CONFDB_AUTOFS_MAP_NEG_TIMEOUT, ret, sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/responder/autofs/autofssrv_cmd.c b/src/responder/autofs/autofssrv_cmd.c
index 4c9f5cf..11721d2 100644
--- a/src/responder/autofs/autofssrv_cmd.c
+++ b/src/responder/autofs/autofssrv_cmd.c
@@ -583,7 +583,7 @@ setautomntent_send(TALLOC_CTX *mem_ctx,
     } else {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Unexpected error from get_autofs_map [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -702,7 +702,7 @@ lookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx)
             } else if (ret != EOK) {
                 DEBUG(SSSDBG_OP_FAILURE,
                       "Error looking up automount maps [%d]: %s\n",
-                       ret, strerror(ret));
+                       ret, sss_strerror(ret));
                 return ret;
             }
         }
@@ -716,7 +716,7 @@ lookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx)
         if (ret != EOK && ret != ENOENT) {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Error looking automount map entries [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
             map->ready = true;
             map->found = false;
             set_autofs_map_lifetime(lookup_ctx->actx->neg_timeout, lookup_ctx, map);
@@ -986,7 +986,7 @@ sss_autofs_cmd_getautomntent(struct cli_ctx *client)
     } else if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "An unexpected error occurred: [%d][%s]\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
@@ -1285,7 +1285,7 @@ sss_autofs_cmd_getautomntbyname(struct cli_ctx *client)
     } else if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "An unexpected error occurred: [%d][%s]\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/responder/autofs/autofssrv_dp.c b/src/responder/autofs/autofssrv_dp.c
index 041f062..430a531 100644
--- a/src/responder/autofs/autofssrv_dp.c
+++ b/src/responder/autofs/autofssrv_dp.c
@@ -83,7 +83,7 @@ sss_dp_get_autofs_send(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Could not issue DP request [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto error;
     }
 
diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c
index 88dd18f..88664d3 100644
--- a/src/responder/common/negcache.c
+++ b/src/responder/common/negcache.c
@@ -650,7 +650,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache,
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Failed to store permanent user filter for [%s]"
                           " (%d [%s])\n", filter_list[i],
-                          ret, strerror(ret));
+                          ret, sss_strerror(ret));
                 continue;
             }
         }
@@ -698,7 +698,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache,
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Failed to store permanent user filter for [%s]"
                           " (%d [%s])\n", filter_list[i],
-                          ret, strerror(ret));
+                          ret, sss_strerror(ret));
                 continue;
             }
         } else {
@@ -709,7 +709,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache,
                          "Failed to store permanent user filter for"
                              " [%s:%s] (%d [%s])\n",
                              dom->name, filter_list[i],
-                             ret, strerror(ret));
+                             ret, sss_strerror(ret));
                     continue;
                 }
             }
@@ -754,7 +754,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache,
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Failed to store permanent group filter for [%s]"
                           " (%d [%s])\n", filter_list[i],
-                          ret, strerror(ret));
+                          ret, sss_strerror(ret));
                 continue;
             }
         }
@@ -802,7 +802,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache,
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Failed to store permanent group filter for"
                           " [%s] (%d [%s])\n", filter_list[i],
-                          ret, strerror(ret));
+                          ret, sss_strerror(ret));
                 continue;
             }
         } else {
@@ -813,7 +813,7 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache,
                          "Failed to store permanent group filter for"
                              " [%s:%s] (%d [%s])\n",
                              dom->name, filter_list[i],
-                             ret, strerror(ret));
+                             ret, sss_strerror(ret));
                     continue;
                 }
             }
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index 2f9db70..c1df84d 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -175,7 +175,7 @@ errno_t csv_string_to_uid_array(TALLOC_CTX *mem_ctx, const char *cvs_string,
                              &list, &list_size);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "split_on_separator failed [%d][%s].\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         goto done;
     }
 
@@ -804,7 +804,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Cannot get the client idle timeout [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -819,7 +819,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Cannnot get the default domain timeout [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -840,7 +840,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Cannnot get the default domain [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto fail;
     }
 
diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c
index df7455c..0992dcd 100644
--- a/src/responder/common/responder_dp.c
+++ b/src/responder/common/responder_dp.c
@@ -502,7 +502,7 @@ sss_dp_get_account_send(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Could not issue DP request [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto error;
     }
 
diff --git a/src/responder/common/responder_get_domains.c b/src/responder/common/responder_get_domains.c
index 1dbb9ea..72a1cb3 100644
--- a/src/responder/common/responder_get_domains.c
+++ b/src/responder/common/responder_get_domains.c
@@ -167,8 +167,9 @@ struct tevent_req *sss_dp_get_domains_send(TALLOC_CTX *mem_ctx,
                   "Last call was too recent, nothing to do!\n");
             goto immediately;
         } else if (ret != EAGAIN) {
-            DEBUG(SSSDBG_TRACE_FUNC, "check_domain_request failed with [%d][%s]\n",
-                                      ret, strerror(ret));
+            DEBUG(SSSDBG_TRACE_FUNC,
+                  "check_domain_request failed with [%d][%s]\n",
+                  ret, sss_strerror(ret));
             goto immediately;
         }
     }
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index c201d3a..5417ab1 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -152,7 +152,7 @@ void nss_update_pw_memcache(struct nss_ctx *nctx)
             if (ret != EOK && ret != ENOENT) {
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Internal failure in memory cache code: %d [%s]\n",
-                       ret, strerror(ret));
+                       ret, sss_strerror(ret));
             }
         }
 
@@ -688,7 +688,7 @@ static int delete_entry_from_memcache(struct sss_domain_info *dom, char *name,
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Internal failure in memory cache code: %d [%s]\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     }
 
@@ -2154,7 +2154,7 @@ static void nss_cmd_implicit_setpwent_done(struct tevent_req *req)
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Implicit setpwent failed with unexpected error [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 
@@ -2166,7 +2166,7 @@ static void nss_cmd_implicit_setpwent_done(struct tevent_req *req)
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Immediate retrieval failed with unexpected error "
-                  "[%d][%s]\n", ret, strerror(ret));
+                  "[%d][%s]\n", ret, sss_strerror(ret));
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 }
@@ -2247,7 +2247,7 @@ void nss_update_gr_memcache(struct nss_ctx *nctx)
             if (ret != EOK && ret != ENOENT) {
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Internal failure in memory cache code: %d [%s]\n",
-                       ret, strerror(ret));
+                       ret, sss_strerror(ret));
             }
         }
         talloc_zfree(res);
@@ -3427,7 +3427,7 @@ static void nss_cmd_implicit_setgrent_done(struct tevent_req *req)
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Implicit setgrent failed with unexpected error [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 
@@ -3439,7 +3439,7 @@ static void nss_cmd_implicit_setgrent_done(struct tevent_req *req)
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Immediate retrieval failed with unexpected error "
-                  "[%d][%s]\n", ret, strerror(ret));
+                  "[%d][%s]\n", ret, sss_strerror(ret));
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 }
@@ -3504,7 +3504,7 @@ void nss_update_initgr_memcache(struct nss_ctx *nctx,
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Failed to make request to our cache! [%d][%s]\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     }
 
@@ -3519,7 +3519,7 @@ void nss_update_initgr_memcache(struct nss_ctx *nctx,
         if (ret != EOK && ret != ENOENT) {
             DEBUG(SSSDBG_CRIT_FAILURE,
                   "Internal failure in memory cache code: %d [%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
         }
 
         /* Also invalidate his groups */
@@ -3566,7 +3566,7 @@ void nss_update_initgr_memcache(struct nss_ctx *nctx,
             if (ret != EOK && ret != ENOENT) {
                 DEBUG(SSSDBG_CRIT_FAILURE,
                       "Internal failure in memory cache code: %d [%s]\n",
-                       ret, strerror(ret));
+                       ret, sss_strerror(ret));
             }
         }
     }
@@ -3749,7 +3749,7 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx)
         if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE,
                   "Failed to make request to our cache! [%d][%s]\n",
-                      ret, strerror(ret));
+                      ret, sss_strerror(ret));
             return EIO;
         }
 
diff --git a/src/responder/nss/nsssrv_mmap_cache.c b/src/responder/nss/nsssrv_mmap_cache.c
index 41846d5..0544f63 100644
--- a/src/responder/nss/nsssrv_mmap_cache.c
+++ b/src/responder/nss/nsssrv_mmap_cache.c
@@ -1017,7 +1017,7 @@ static errno_t sss_mc_create_file(struct sss_mc_ctx *mc_ctx)
         if (ret) {
             DEBUG(SSSDBG_FATAL_FAILURE, "Failed to mark mmap file %s as"
                                          " recycled: %d(%s)\n",
-                                         mc_ctx->file, ret, strerror(ret));
+                                         mc_ctx->file, ret, sss_strerror(ret));
         }
 
         close(ofd);
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c
index 86cb8cd..bf64558 100644
--- a/src/responder/nss/nsssrv_netgroup.c
+++ b/src/responder/nss/nsssrv_netgroup.c
@@ -787,7 +787,7 @@ int nss_cmd_getnetgrent(struct cli_ctx *client)
         return EOK;
     } else if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "An unexpected error occurred: [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
 
         return nss_cmd_done(cmdctx, ret);
     }
@@ -816,7 +816,8 @@ int nss_cmd_getnetgrent(struct cli_ctx *client)
     /* Read the result strings */
     ret = nss_cmd_getnetgrent_process(cmdctx, netgr);
     if (ret != EOK) {
-        DEBUG(SSSDBG_CRIT_FAILURE, "Failed: [%d][%s]\n", ret, strerror(ret));
+        DEBUG(SSSDBG_CRIT_FAILURE,
+              "Failed: [%d][%s]\n", ret, sss_strerror(ret));
     }
     return ret;
 }
@@ -840,7 +841,7 @@ static void setnetgrent_implicit_done(struct tevent_req *req)
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Implicit setnetgrent failed with unexpected error "
-                  "[%d][%s]\n", ret, strerror(ret));
+                  "[%d][%s]\n", ret, sss_strerror(ret));
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 
@@ -860,7 +861,7 @@ static void setnetgrent_implicit_done(struct tevent_req *req)
         NSS_CMD_FATAL_ERROR(cmdctx);
     } else if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "An unexpected error occurred: [%d][%s]\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
 
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
@@ -877,7 +878,7 @@ static void setnetgrent_implicit_done(struct tevent_req *req)
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Immediate retrieval failed with unexpected error "
-                  "[%d][%s]\n", ret, strerror(ret));
+                  "[%d][%s]\n", ret, sss_strerror(ret));
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 }
diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c
index 7741768..22b2075 100644
--- a/src/responder/nss/nsssrv_services.c
+++ b/src/responder/nss/nsssrv_services.c
@@ -1024,7 +1024,7 @@ nss_cmd_getserv_done(struct tevent_req *req)
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Could not create response packet: [%s]\n",
-                   strerror(ret));
+                   sss_strerror(ret));
         }
 
         sss_cmd_done(cmdctx->cctx, cmdctx);
@@ -1303,7 +1303,7 @@ setservent_send(TALLOC_CTX *mem_ctx, struct cli_ctx *cctx)
 
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Error [%s] requesting info from domain [%s]. Skipping.\n",
-               strerror(ret), step_ctx->dctx->domain->name);
+               sss_strerror(ret), step_ctx->dctx->domain->name);
 
         step_ctx->dctx->domain = get_next_domain(step_ctx->dctx->domain, false);
     }
@@ -1489,7 +1489,7 @@ setservent_step_done(struct tevent_req *req)
     } else if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Error [%s] while retrieving info from domain [%s]. "
-               "Skipping.\n", strerror(ret), dctx->domain->name);
+               "Skipping.\n", sss_strerror(ret), dctx->domain->name);
         /* Continue on */
     } else {
         /* Got some results
@@ -1512,7 +1512,7 @@ setservent_step_done(struct tevent_req *req)
 
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Error [%s] requesting info from domain [%s]. Skipping.\n",
-               strerror(ret), step_ctx->dctx->domain->name);
+               sss_strerror(ret), step_ctx->dctx->domain->name);
 
         step_ctx->dctx->domain = get_next_domain(step_ctx->dctx->domain, false);
     }
@@ -1706,7 +1706,7 @@ nss_cmd_implicit_setservent_done(struct tevent_req *req)
     if (ret != EOK && ret != ENOENT) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Implicit setservent failed with unexpected error [%d][%s]\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 
@@ -1718,7 +1718,7 @@ nss_cmd_implicit_setservent_done(struct tevent_req *req)
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Immediate retrieval failed with unexpected error "
-               "[%d][%s]\n", ret, strerror(ret));
+               "[%d][%s]\n", ret, sss_strerror(ret));
         NSS_CMD_FATAL_ERROR(cmdctx);
     }
 }
diff --git a/src/responder/pac/pacsrv_cmd.c b/src/responder/pac/pacsrv_cmd.c
index 9bd7e19..29cdb1e 100644
--- a/src/responder/pac/pacsrv_cmd.c
+++ b/src/responder/pac/pacsrv_cmd.c
@@ -37,7 +37,7 @@ static errno_t pac_cmd_done(struct cli_ctx *cctx, int cmd_ret)
                          &cctx->creq->out);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "sss_packet_new failed [%d][%s].\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         return ret;
     }
 
@@ -596,7 +596,7 @@ static errno_t save_pac_user(struct pac_req_ctx *pr_ctx)
                                pr_ctx->dom->user_timeout, 0);
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE, "sysdb_store_user failed [%d][%s].\n",
-                                      ret, strerror(ret));
+                                      ret, sss_strerror(ret));
             goto done;
         }
     } else if (ret != EOK && ret != ENOENT) {
@@ -647,7 +647,7 @@ struct tevent_req *pac_save_memberships_send(struct pac_req_ctx *pr_ctx)
     ret = sysdb_search_user_by_name(state, dom, dom_name, NULL, &msg);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_user_by_name failed " \
-                                  "[%d][%s].\n", ret, strerror(ret));
+                                  "[%d][%s].\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -906,7 +906,7 @@ pac_store_membership(struct pac_req_ctx *pr_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_TRACE_INTERNAL, "sysdb_search_object_by_sid " \
                                       "for SID [%s] failed [%d][%s].\n",
-                                      grp_sid_str, ret, strerror(ret));
+                                      grp_sid_str, ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c
index c0841d2..acdb19d 100644
--- a/src/responder/pam/pamsrv.c
+++ b/src/responder/pam/pamsrv.c
@@ -184,7 +184,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "Could not create initgroups hash table: [%s]",
-               strerror(ret));
+               sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/responder/ssh/sshsrv.c b/src/responder/ssh/sshsrv.c
index 8aa603d..c6f9203 100644
--- a/src/responder/ssh/sshsrv.c
+++ b/src/responder/ssh/sshsrv.c
@@ -148,7 +148,7 @@ int ssh_process_init(TALLOC_CTX *mem_ctx,
                           &ssh_ctx->hash_known_hosts);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) [%s]\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto fail;
     }
 
@@ -159,7 +159,7 @@ int ssh_process_init(TALLOC_CTX *mem_ctx,
                          &ssh_ctx->known_hosts_timeout);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) [%s]\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto fail;
     }
 
diff --git a/src/responder/ssh/sshsrv_cmd.c b/src/responder/ssh/sshsrv_cmd.c
index ad83163..63ab2b8 100644
--- a/src/responder/ssh/sshsrv_cmd.c
+++ b/src/responder/ssh/sshsrv_cmd.c
@@ -494,7 +494,7 @@ ssh_host_pubkeys_format_known_host_hashed(TALLOC_CTX *mem_ctx,
             if (ret != EOK) {
                 DEBUG(SSSDBG_OP_FAILURE,
                       "sss_hmac_sha1() failed (%d): %s\n",
-                       ret, strerror(ret));
+                       ret, sss_strerror(ret));
                 result = NULL;
                 goto done;
             }
diff --git a/src/responder/ssh/sshsrv_dp.c b/src/responder/ssh/sshsrv_dp.c
index 90b0b57..f05a638 100644
--- a/src/responder/ssh/sshsrv_dp.c
+++ b/src/responder/ssh/sshsrv_dp.c
@@ -87,7 +87,7 @@ sss_dp_get_ssh_host_send(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Could not issue DP request [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto error;
     }
 
diff --git a/src/responder/sudo/sudosrv.c b/src/responder/sudo/sudosrv.c
index cafe9da..fbd4381 100644
--- a/src/responder/sudo/sudosrv.c
+++ b/src/responder/sudo/sudosrv.c
@@ -141,7 +141,7 @@ int sudo_process_init(TALLOC_CTX *mem_ctx,
                           &sudo_ctx->timed);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) [%s]\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         goto fail;
     }
 
diff --git a/src/responder/sudo/sudosrv_cmd.c b/src/responder/sudo/sudosrv_cmd.c
index fd8c46d..cd8781d 100644
--- a/src/responder/sudo/sudosrv_cmd.c
+++ b/src/responder/sudo/sudosrv_cmd.c
@@ -48,14 +48,14 @@ static errno_t sudosrv_cmd_send_reply(struct sudo_cmd_ctx *cmd_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Unable to create a new packet [%d]; %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     }
 
     ret = sss_packet_grow(cli_ctx->creq->out, response_len);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "Unable to create response: %s\n", strerror(ret));
+              "Unable to create response: %s\n", sss_strerror(ret));
         goto done;
     }
     sss_packet_get_body(cli_ctx->creq->out, &packet_body, &packet_len);
@@ -248,7 +248,7 @@ static void sudosrv_cmd_parse_query_done(struct tevent_req *req)
     talloc_zfree(req);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Invalid query [%d]: %s\n",
-                                    ret, strerror(ret));
+                                    ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/responder/sudo/sudosrv_dp.c b/src/responder/sudo/sudosrv_dp.c
index 18e51a9..3c3ce87 100644
--- a/src/responder/sudo/sudosrv_dp.c
+++ b/src/responder/sudo/sudosrv_dp.c
@@ -100,7 +100,7 @@ sss_dp_get_sudoers_send(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Could not issue DP request [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto error;
     }
 
@@ -173,7 +173,7 @@ sss_dp_get_sudoers_msg(void *pvt)
             ret = sysdb_attrs_get_string(info->rules[i], SYSDB_NAME, &rule_name);
             if (ret != EOK) {
                 DEBUG(SSSDBG_OP_FAILURE, "Could not get rule name [%d]: %s\n",
-                      ret, strerror(ret));
+                      ret, sss_strerror(ret));
                 goto fail;
             }
 
diff --git a/src/responder/sudo/sudosrv_get_sudorules.c b/src/responder/sudo/sudosrv_get_sudorules.c
index 4b35a1a..70ce46e 100644
--- a/src/responder/sudo/sudosrv_get_sudorules.c
+++ b/src/responder/sudo/sudosrv_get_sudorules.c
@@ -43,7 +43,8 @@ errno_t sudosrv_get_sudorules(struct sudo_dom_ctx *dctx)
         return EAGAIN;
     } else if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Error looking up user information [%d]: %s\n", ret, strerror(ret));
+              "Error looking up user information [%d]: %s\n", ret,
+              sss_strerror(ret));
         return ret;
     }
 
@@ -55,7 +56,8 @@ errno_t sudosrv_get_sudorules(struct sudo_dom_ctx *dctx)
         return EAGAIN;
     } else if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Error looking up sudo rules [%d]: %s\n", ret, strerror(ret));
+              "Error looking up sudo rules [%d]: %s\n", ret,
+              sss_strerror(ret));
         return ret;
     }
 
@@ -271,7 +273,7 @@ static void sudosrv_check_user_dp_callback(uint16_t err_maj, uint32_t err_min,
     } else if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Could not look up the user [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         sudosrv_cmd_done(dctx->cmd_ctx, ret);
         return;
     }
@@ -283,7 +285,7 @@ static void sudosrv_check_user_dp_callback(uint16_t err_maj, uint32_t err_min,
     } else if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Error getting sudo rules [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         sudosrv_cmd_done(dctx->cmd_ctx, EIO);
         return;
     }
@@ -358,7 +360,8 @@ errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx)
                                    cmd_ctx->orig_username, NULL, &groupnames);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-             "Unable to retrieve user info [%d]: %s\n", ret, strerror(ret));
+             "Unable to retrieve user info [%d]: %s\n", ret,
+             sss_strerror(ret));
         goto done;
     }
 
@@ -373,7 +376,7 @@ errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx)
                                             &expired_rules, &expired_rules_num);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve expired sudo rules "
-                                    "[%d]: %s\n", ret, strerror(ret));
+                                    "[%d]: %s\n", ret, sss_strerror(ret));
         goto done;
     }
 
@@ -418,7 +421,7 @@ errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx)
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Failed to make a request to our cache [%d]: %s\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
             goto done;
         }
     }
@@ -492,7 +495,7 @@ sudosrv_get_sudorules_dp_callback(uint16_t err_maj, uint32_t err_min,
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,
               "Failed to make a request to our cache [%d]: %s\n",
-              ret, strerror(ret));
+              ret, sss_strerror(ret));
         sudosrv_cmd_done(cmd_ctx, EIO);
         return;
     }
@@ -566,7 +569,7 @@ static errno_t sudosrv_get_sudorules_from_cache(TALLOC_CTX *mem_ctx,
         if (ret != EOK) {
             DEBUG(SSSDBG_CRIT_FAILURE,
                  "Unable to retrieve user info [%d]: %s\n",
-                  ret, strerror(ret));
+                  ret, sss_strerror(ret));
             goto done;
         }
         flags = SYSDB_SUDO_FILTER_USERINFO | SYSDB_SUDO_FILTER_INCLUDE_ALL;
@@ -584,7 +587,8 @@ static errno_t sudosrv_get_sudorules_from_cache(TALLOC_CTX *mem_ctx,
                                             &rules, &num_rules);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-             "Unable to retrieve sudo rules [%d]: %s\n", ret, strerror(ret));
+              "Unable to retrieve sudo rules [%d]: %s\n", ret,
+              sss_strerror(ret));
         goto done;
     }
 
@@ -633,7 +637,7 @@ static errno_t sudosrv_get_sudorules_query_cache(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
               "Could not construct the search filter [%d]: %s\n",
-               ret, strerror(ret));
+               ret, sss_strerror(ret));
         goto done;
     }
 
diff --git a/src/responder/sudo/sudosrv_query.c b/src/responder/sudo/sudosrv_query.c
index 4d19514..6062d62 100644
--- a/src/responder/sudo/sudosrv_query.c
+++ b/src/responder/sudo/sudosrv_query.c
@@ -401,7 +401,7 @@ errno_t sudosrv_parse_query_recv(TALLOC_CTX *mem_ctx,
                                      &domainname, &username);
     if (ret != EOK) {
         DEBUG(SSSDBG_TRACE_FUNC, "Unable to parse domain [%d]: %s\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         return ret;
     }
 
diff --git a/src/tools/sss_groupadd.c b/src/tools/sss_groupadd.c
index f71d6dd..3ec4796 100644
--- a/src/tools/sss_groupadd.c
+++ b/src/tools/sss_groupadd.c
@@ -81,7 +81,7 @@ int main(int argc, const char **argv)
     ret = init_sss_tools(&tctx);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "init_sss_tools failed (%d): %s\n", ret, strerror(ret));
+              "init_sss_tools failed (%d): %s\n", ret, sss_strerror(ret));
         if (ret == ENOENT) {
             ERROR("Error initializing the tools - no local domain\n");
         } else {
@@ -149,7 +149,8 @@ done:
 
             default:
                 DEBUG(SSSDBG_CRIT_FAILURE,
-                      "sysdb operation failed (%d)[%s]\n", ret, strerror(ret));
+                      "sysdb operation failed (%d)[%s]\n", ret,
+                      sss_strerror(ret));
                 ERROR("Transaction error. Could not add group.\n");
                 break;
         }
diff --git a/src/tools/sss_groupdel.c b/src/tools/sss_groupdel.c
index 5dcc205..f1e1782 100644
--- a/src/tools/sss_groupdel.c
+++ b/src/tools/sss_groupdel.c
@@ -75,7 +75,7 @@ int main(int argc, const char **argv)
     ret = init_sss_tools(&tctx);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "init_sss_tools failed (%d): %s\n", ret, strerror(ret));
+              "init_sss_tools failed (%d): %s\n", ret, sss_strerror(ret));
         if (ret == ENOENT) {
             ERROR("Error initializing the tools - no local domain\n");
         } else {
@@ -126,7 +126,7 @@ int main(int argc, const char **argv)
 done:
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "sysdb operation failed (%d)[%s]\n", ret, strerror(ret));
+              "sysdb operation failed (%d)[%s]\n", ret, sss_strerror(ret));
         switch (ret) {
             case ENOENT:
                 ERROR("No such group in local domain. "
diff --git a/src/tools/sss_groupshow.c b/src/tools/sss_groupshow.c
index 251e71b..a107820 100644
--- a/src/tools/sss_groupshow.c
+++ b/src/tools/sss_groupshow.c
@@ -337,7 +337,7 @@ int group_show(TALLOC_CTX *mem_ctx,
     ret = sysdb_search_group_by_name(mem_ctx, domain, name, attrs, &msg);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Search failed: %s (%d)\n", strerror(ret), ret);
+              "Search failed: %s (%d)\n", sss_strerror(ret), ret);
         goto done;
     }
 
@@ -346,7 +346,7 @@ int group_show(TALLOC_CTX *mem_ctx,
                         &group_members, &nmembers);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Group processing failed: %s (%d)\n",
-                   strerror(ret), ret);
+                   sss_strerror(ret), ret);
         goto done;
     }
 
@@ -396,7 +396,7 @@ int group_show(TALLOC_CTX *mem_ctx,
                              &root->group_members);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Recursive search failed: %s (%d)\n", strerror(ret), ret);
+              "Recursive search failed: %s (%d)\n", sss_strerror(ret), ret);
         goto done;
     }
 
@@ -512,7 +512,7 @@ int group_show_recurse(TALLOC_CTX *mem_ctx,
                                          attrs, &msg);
         if (ret) {
             DEBUG(SSSDBG_OP_FAILURE,
-                  "Search failed: %s (%d)\n", strerror(ret), ret);
+                  "Search failed: %s (%d)\n", sss_strerror(ret), ret);
             return EIO;
         }
 
@@ -521,7 +521,7 @@ int group_show_recurse(TALLOC_CTX *mem_ctx,
                             &groups[i], &new_group_members, &new_nmembers);
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE, "Group processing failed: %s (%d)\n",
-                      strerror(ret), ret);
+                      sss_strerror(ret), ret);
             return ret;
         }
 
@@ -533,7 +533,7 @@ int group_show_recurse(TALLOC_CTX *mem_ctx,
                                      &parent->group_members);
             if (ret != EOK) {
                 DEBUG(SSSDBG_OP_FAILURE, "Recursive search failed: %s (%d)\n",
-                          strerror(ret), ret);
+                          sss_strerror(ret), ret);
                 return ret;
             }
             talloc_zfree(new_group_members);
@@ -565,7 +565,7 @@ static int group_show_mpg(TALLOC_CTX *mem_ctx,
     ret = sysdb_search_user_by_name(info, domain, name, attrs, &msg);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Search failed: %s (%d)\n", strerror(ret), ret);
+              "Search failed: %s (%d)\n", sss_strerror(ret), ret);
         goto fail;
     }
 
@@ -696,7 +696,7 @@ int main(int argc, const char **argv)
     ret = init_sss_tools(&tctx);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "init_sss_tools failed (%d): %s\n", ret, strerror(ret));
+              "init_sss_tools failed (%d): %s\n", ret, sss_strerror(ret));
         if (ret == ENOENT) {
             ERROR("Error initializing the tools - no local domain\n");
         } else {
@@ -725,7 +725,7 @@ int main(int argc, const char **argv)
     /* Process result */
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "sysdb operation failed (%d)[%s]\n", ret, strerror(ret));
+              "sysdb operation failed (%d)[%s]\n", ret, sss_strerror(ret));
         switch (ret) {
             case ENOENT:
                 ERROR("No such group in local domain. "
diff --git a/src/tools/sss_seed.c b/src/tools/sss_seed.c
index 0f8a76a..3509dc6 100644
--- a/src/tools/sss_seed.c
+++ b/src/tools/sss_seed.c
@@ -746,7 +746,7 @@ static int seed_cache_user(struct seed_ctx *sctx)
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE,
                   "Failed to add user to the cache. (%d)[%s]\n",
-                   ret, strerror(ret));
+                   ret, sss_strerror(ret));
             ERROR("Failed to create user cache entry\n");
             goto done;
         }
@@ -756,7 +756,7 @@ static int seed_cache_user(struct seed_ctx *sctx)
                                sctx->uctx->password);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE, "Failed to cache password. (%d)[%s]\n",
-                                  ret, strerror(ret));
+                                  ret, sss_strerror(ret));
         ERROR("Failed to cache password\n");
         goto done;
     }
@@ -790,7 +790,7 @@ int main(int argc, const char **argv)
     ret = seed_init(sctx, argc, argv, &sctx);
     if (ret != EOK) {
         DEBUG(SSSDBG_OP_FAILURE,"Seed init failed [%d][%s]\n",
-                                 ret, strerror(ret));
+                                 ret, sss_strerror(ret));
         goto done;
     }
 
@@ -871,7 +871,7 @@ done:
     talloc_zfree(sctx);
     if (ret != EOK) {
         DEBUG(SSSDBG_TRACE_INTERNAL, "Exit error: [%d] [%s]\n",
-                                      ret, strerror(ret));
+                                      ret, sss_strerror(ret));
         ret = EXIT_FAILURE;
     } else {
         ret = EXIT_SUCCESS;
diff --git a/src/tools/sss_sync_ops.c b/src/tools/sss_sync_ops.c
index fd401cb..92de889 100644
--- a/src/tools/sss_sync_ops.c
+++ b/src/tools/sss_sync_ops.c
@@ -619,7 +619,7 @@ int userdel(TALLOC_CTX *mem_ctx,
     ret = sysdb_delete_entry(sysdb, user_dn, false);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Removing user failed: %s (%d)\n", strerror(ret), ret);
+              "Removing user failed: %s (%d)\n", sss_strerror(ret), ret);
     }
 
     flush_nscd_cache(NSCD_DB_PASSWD);
@@ -661,7 +661,7 @@ int groupdel(TALLOC_CTX *mem_ctx,
     ret = sysdb_delete_entry(sysdb, group_dn, false);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-              "Removing group failed: %s (%d)\n", strerror(ret), ret);
+              "Removing group failed: %s (%d)\n", sss_strerror(ret), ret);
     }
 
     flush_nscd_cache(NSCD_DB_GROUP);
diff --git a/src/tools/sss_useradd.c b/src/tools/sss_useradd.c
index 5943940..6edafac 100644
--- a/src/tools/sss_useradd.c
+++ b/src/tools/sss_useradd.c
@@ -116,7 +116,7 @@ int main(int argc, const char **argv)
     ret = init_sss_tools(&tctx);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "init_sss_tools failed (%d): %s\n", ret, strerror(ret));
+              "init_sss_tools failed (%d): %s\n", ret, sss_strerror(ret));
         if (ret == ENOENT) {
             ERROR("Error initializing the tools - no local domain\n");
         } else {
@@ -236,7 +236,8 @@ int main(int argc, const char **argv)
             ERROR("User's home directory already exists, not copying "
                   "data from skeldir\n");
         } else if (ret != EOK) {
-            ERROR("Cannot create user's home directory: %1$s\n", strerror(ret));
+            ERROR("Cannot create user's home directory: %1$s\n",
+                  sss_strerror(ret));
             ret = EXIT_FAILURE;
             goto fini;
         }
@@ -247,10 +248,11 @@ int main(int argc, const char **argv)
                                 tctx->octx->uid,
                                 tctx->octx->gid);
         if (ret != EOK) {
-            ERROR("Cannot create user's mail spool: %1$s\n", strerror(ret));
+            ERROR("Cannot create user's mail spool: %1$s\n",
+                  sss_strerror(ret));
             DEBUG(SSSDBG_CRIT_FAILURE,
                   "Cannot create user's mail spool: [%d][%s].\n",
-                        ret, strerror(ret));
+                        ret, sss_strerror(ret));
             ret = EXIT_FAILURE;
             goto fini;
         }
@@ -276,7 +278,7 @@ done:
 
             default:
                 DEBUG(SSSDBG_CRIT_FAILURE, "sysdb operation failed (%d)[%s]\n",
-                          tctx->error, strerror(tctx->error));
+                          tctx->error, sss_strerror(tctx->error));
                 ERROR("Transaction error. Could not add user.\n");
                 break;
         }
diff --git a/src/tools/sss_userdel.c b/src/tools/sss_userdel.c
index d085dc3..a27b535 100644
--- a/src/tools/sss_userdel.c
+++ b/src/tools/sss_userdel.c
@@ -193,7 +193,7 @@ int main(int argc, const char **argv)
     ret = init_sss_tools(&tctx);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "init_sss_tools failed (%d): %s\n", ret, strerror(ret));
+              "init_sss_tools failed (%d): %s\n", ret, sss_strerror(ret));
         if (ret == ENOENT) {
             ERROR("Error initializing the tools - no local domain\n");
         } else {
@@ -285,7 +285,7 @@ int main(int argc, const char **argv)
 
     ret = run_userdel_cmd(tctx);
     if (ret != EOK) {
-        ERROR("The post-delete command failed: %1$s\n", strerror(ret));
+        ERROR("The post-delete command failed: %1$s\n", sss_strerror(ret));
         goto fini;
     }
 
@@ -307,7 +307,7 @@ int main(int argc, const char **argv)
         if (ret == EPERM) {
             ERROR("Not removing home dir - not owned by user\n");
         } else if (ret != EOK) {
-            ERROR("Cannot remove homedir: %1$s\n", strerror(ret));
+            ERROR("Cannot remove homedir: %1$s\n", sss_strerror(ret));
             ret = EXIT_FAILURE;
             goto fini;
         }
@@ -318,7 +318,7 @@ int main(int argc, const char **argv)
 done:
     if (ret) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "sysdb operation failed (%d)[%s]\n", ret, strerror(ret));
+              "sysdb operation failed (%d)[%s]\n", ret, sss_strerror(ret));
         switch (ret) {
             case ENOENT:
                 ERROR("No such user in local domain. "
diff --git a/src/tools/sss_usermod.c b/src/tools/sss_usermod.c
index 9683c6e..d7ae14f 100644
--- a/src/tools/sss_usermod.c
+++ b/src/tools/sss_usermod.c
@@ -157,7 +157,7 @@ int main(int argc, const char **argv)
     ret = init_sss_tools(&tctx);
     if (ret != EOK) {
         DEBUG(SSSDBG_CRIT_FAILURE,
-              "init_sss_tools failed (%d): %s\n", ret, strerror(ret));
+              "init_sss_tools failed (%d): %s\n", ret, sss_strerror(ret));
         if (ret == ENOENT) {
             ERROR("Error initializing the tools - no local domain\n");
         } else {
diff --git a/src/tools/tools_mc_util.c b/src/tools/tools_mc_util.c
index 2d6f3fb..365bdc6 100644
--- a/src/tools/tools_mc_util.c
+++ b/src/tools/tools_mc_util.c
@@ -268,7 +268,7 @@ errno_t sss_mc_refresh_nested_group(struct tools_ctx *tctx,
     ret = sysdb_search_group_by_name(tctx, tctx->local, name, attrs, &msg);
     if (ret) {
         DEBUG(SSSDBG_OP_FAILURE,
-               "Search failed: %s (%d)\n", strerror(ret), ret);
+               "Search failed: %s (%d)\n", sss_strerror(ret), ret);
         return ret;
     }
 
diff --git a/src/util/child_common.c b/src/util/child_common.c
index 81bbab7..f595a6a 100644
--- a/src/util/child_common.c
+++ b/src/util/child_common.c
@@ -66,7 +66,7 @@ errno_t sss_sigchld_init(TALLOC_CTX *mem_ctx,
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE,
               "fatal error initializing children hash table: [%s]\n",
-               strerror(ret));
+               sss_strerror(ret));
         talloc_free(sigchld_ctx);
         return ret;
     }
diff --git a/src/util/server.c b/src/util/server.c
index d00db31..6488e2a 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -373,7 +373,7 @@ static void te_server_hup(struct tevent_context *ev,
     ret = monitor_common_rotate_logs(lctx->confdb, lctx->confdb_path);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE, "Could not reopen log file [%s]\n",
-                                     strerror(ret));
+                                     sss_strerror(ret));
     }
 }
 
@@ -423,7 +423,7 @@ int server_setup(const char *name, int flags,
         ret = pidfile(PID_PATH, name);
         if (ret != EOK) {
             DEBUG(SSSDBG_FATAL_FAILURE, "Error creating pidfile: %s/%s! "
-                  "(%d [%s])\n", PID_PATH, name, ret, strerror(ret));
+                  "(%d [%s])\n", PID_PATH, name, ret, sss_strerror(ret));
             return ret;
         }
     }
@@ -485,7 +485,7 @@ int server_setup(const char *name, int flags,
                              &debug_level);
         if (ret != EOK) {
             DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) "
-                                         "[%s]\n", ret, strerror(ret));
+                                         "[%s]\n", ret, sss_strerror(ret));
             return ret;
         }
 
@@ -500,7 +500,7 @@ int server_setup(const char *name, int flags,
                               &dt);
         if (ret != EOK) {
             DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) "
-                                         "[%s]\n", ret, strerror(ret));
+                                         "[%s]\n", ret, sss_strerror(ret));
             return ret;
         }
         if (dt) debug_timestamps = 1;
@@ -515,7 +515,7 @@ int server_setup(const char *name, int flags,
                               &dm);
         if (ret != EOK) {
             DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) "
-                                         "[%s]\n", ret, strerror(ret));
+                                         "[%s]\n", ret, sss_strerror(ret));
             return ret;
         }
         if (dm) debug_microseconds = 1;
@@ -529,7 +529,7 @@ int server_setup(const char *name, int flags,
                           dl, &dl);
     if (ret != EOK) {
         DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) [%s]\n",
-                                     ret, strerror(ret));
+                                     ret, sss_strerror(ret));
         return ret;
     }
     if (dl) debug_to_file = 1;
@@ -552,7 +552,7 @@ int server_setup(const char *name, int flags,
         ret = open_debug_file();
         if (ret != EOK) {
             DEBUG(SSSDBG_FATAL_FAILURE, "Error setting up logging (%d) "
-                                         "[%s]\n", ret, strerror(ret));
+                                         "[%s]\n", ret, sss_strerror(ret));
             return ret;
         }
     }
-- 
1.7.11.2

