summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Židek <mzidek@redhat.com>2015-10-19 15:38:08 +0200
committerLukas Slebodnik <lslebodn@redhat.com>2015-11-04 09:08:12 +0100
commit43e06ff39584570817949dc5de118d2b7ca854c1 (patch)
tree544b1b9274109be6519a9e9133b9405ce915fc31
parentd0d79b53a5a16831169a3d854fd59402a99a1dd6 (diff)
downloadsssd-43e06ff39584570817949dc5de118d2b7ca854c1.tar.gz
sssd-43e06ff39584570817949dc5de118d2b7ca854c1.tar.xz
sssd-43e06ff39584570817949dc5de118d2b7ca854c1.zip
util: Continue if setlocale fails
setlocale needs some environment variables to be set in order to work. These variables are not present in some special cases. We should not fail completely in these cases but continue with the compatible C locale. Resolves: https://fedorahosted.org/sssd/ticket/2785 Reviewed-by: Michal Židek <mzidek@redhat.com>
-rw-r--r--src/sss_client/ssh/sss_ssh_client.c4
-rw-r--r--src/tools/tools_util.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/sss_client/ssh/sss_ssh_client.c b/src/sss_client/ssh/sss_ssh_client.c
index 0d206ef58..a198039ec 100644
--- a/src/sss_client/ssh/sss_ssh_client.c
+++ b/src/sss_client/ssh/sss_ssh_client.c
@@ -50,7 +50,9 @@ int set_locale(void)
c = setlocale(LC_ALL, "");
if (c == NULL) {
- return EIO;
+ /* If setlocale fails, continue with the default
+ * locale. */
+ DEBUG(SSSDBG_MINOR_FAILURE, "Unable to set locale\n");
}
errno = 0;
diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c
index 68f6588ea..f9dca7287 100644
--- a/src/tools/tools_util.c
+++ b/src/tools/tools_util.c
@@ -259,7 +259,9 @@ int set_locale(void)
c = setlocale(LC_ALL, "");
if (c == NULL) {
- return EIO;
+ /* If setlocale fails, continue with the default
+ * locale. */
+ DEBUG(SSSDBG_MINOR_FAILURE, "Unable to set locale\n");
}
errno = 0;