pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/1005-Removing-filesystem-encoding-check.patch

6ec482
From 71c6e313993ff468d3c5c58a2555825bebc09083 Mon Sep 17 00:00:00 2001
6ec482
From: =?UTF-8?q?Tibor=20Dudl=C3=A1k?= <tdudlak@redhat.com>
6ec482
Date: Fri, 10 Aug 2018 13:16:38 +0200
6ec482
Subject: [PATCH] Removing filesystem encoding check
6ec482
6ec482
RHEL doesn't support the generic locale "C.UTF-8"
6ec482
See BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1590680
6ec482
6ec482
Revertis commit: e1bd827bbf56970ddd02ec174bf2317b64e75514
6ec482
---
6ec482
 install/conf/ipa.conf                 |  3 +--
6ec482
 install/share/ipa-httpd.conf.template |  1 -
6ec482
 ipalib/errors.py                      | 11 -----------
6ec482
 ipalib/plugable.py                    |  5 -----
6ec482
 ipatests/test_cmdline/test_cli.py     | 24 +-----------------------
6ec482
 5 files changed, 2 insertions(+), 42 deletions(-)
6ec482
6ec482
diff --git a/install/conf/ipa.conf b/install/conf/ipa.conf
6ec482
index c5fc518f803d379287043b405efeb46dd53a6b28..e15437b1804203ab85caaea420dde8fc12b15070 100644
6ec482
--- a/install/conf/ipa.conf
6ec482
+++ b/install/conf/ipa.conf
6ec482
@@ -48,8 +48,7 @@ WSGISocketPrefix /run/httpd/wsgi
6ec482
 
6ec482
 # Configure mod_wsgi handler for /ipa
6ec482
 WSGIDaemonProcess ipa processes=$WSGI_PROCESSES threads=1 maximum-requests=500 \
6ec482
-  user=ipaapi group=ipaapi display-name=%{GROUP} \
6ec482
-  lang=C.UTF-8 locale=C.UTF-8
6ec482
+  user=ipaapi group=ipaapi display-name=%{GROUP}
6ec482
 WSGIImportScript /usr/share/ipa/wsgi.py process-group=ipa application-group=ipa
6ec482
 WSGIScriptAlias /ipa /usr/share/ipa/wsgi.py
6ec482
 WSGIScriptReloading Off
6ec482
diff --git a/install/share/ipa-httpd.conf.template b/install/share/ipa-httpd.conf.template
6ec482
index 210d5d3883705b25b36050f50fdc1b49e830eb81..39bcfcca791c76f034224c00c9c2f85b652f78bb 100644
6ec482
--- a/install/share/ipa-httpd.conf.template
6ec482
+++ b/install/share/ipa-httpd.conf.template
6ec482
@@ -4,5 +4,4 @@
6ec482
 Environment=KRB5CCNAME=$KRB5CC_HTTPD
6ec482
 Environment=GSS_USE_PROXY=yes
6ec482
 Environment=KDCPROXY_CONFIG=$KDCPROXY_CONFIG
6ec482
-Environment=LC_ALL=C.UTF-8
6ec482
 ExecStartPre=$IPA_HTTPD_KDCPROXY
6ec482
diff --git a/ipalib/errors.py b/ipalib/errors.py
6ec482
index 6356d523e8c0ac63e8892292dd9991c9ee8211aa..ae940798779d20cb83b7f96a625c6facfe983f95 100644
6ec482
--- a/ipalib/errors.py
6ec482
+++ b/ipalib/errors.py
6ec482
@@ -453,17 +453,6 @@ class EnvironmentError(PublicError):
6ec482
     errno = 912
6ec482
 
6ec482
 
6ec482
-class SystemEncodingError(PublicError):
6ec482
-    """
6ec482
-    **913** Raised when system encoding is not UTF-8
6ec482
-    """
6ec482
-
6ec482
-    errno = 913
6ec482
-    format = _(
6ec482
-        "System encoding must be UTF-8, '%(encoding)s' is not supported. "
6ec482
-        "Set LC_ALL=\"C.UTF-8\", or LC_ALL=\"\" and LC_CTYPE=\"C.UTF-8\"."
6ec482
-    )
6ec482
-
6ec482
 ##############################################################################
6ec482
 # 1000 - 1999: Authentication errors
6ec482
 class AuthenticationError(PublicError):
6ec482
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
6ec482
index 3a5a322f4b753302c58af9cfcb5a29f09e8350bb..535df5c007d99b73e5ff31f5fc4813c0fcf956ac 100644
6ec482
--- a/ipalib/plugable.py
6ec482
+++ b/ipalib/plugable.py
6ec482
@@ -491,11 +491,6 @@ class API(ReadOnly):
6ec482
         handler.setFormatter(ipa_log_manager.Formatter(LOGGING_FORMAT_STDERR))
6ec482
         root_logger.addHandler(handler)
6ec482
 
6ec482
-        # check after logging is set up but before we create files.
6ec482
-        fse = sys.getfilesystemencoding()
6ec482
-        if fse.lower() not in {'utf-8', 'utf8'}:
6ec482
-            raise errors.SystemEncodingError(encoding=fse)
6ec482
-
6ec482
         # Add file handler:
6ec482
         if self.env.mode in ('dummy', 'unit_test'):
6ec482
             return  # But not if in unit-test mode
6ec482
diff --git a/ipatests/test_cmdline/test_cli.py b/ipatests/test_cmdline/test_cli.py
6ec482
index b660532bd6e8db964b8287845ed1b5ebbcb43b9b..60309c58f250a263c8c3d13b0b47773b2db9e4d0 100644
6ec482
--- a/ipatests/test_cmdline/test_cli.py
6ec482
+++ b/ipatests/test_cmdline/test_cli.py
6ec482
@@ -1,8 +1,6 @@
6ec482
-import contextlib
6ec482
-import os
6ec482
 import shlex
6ec482
-import subprocess
6ec482
 import sys
6ec482
+import contextlib
6ec482
 import tempfile
6ec482
 
6ec482
 import nose
6ec482
@@ -19,8 +17,6 @@ if six.PY3:
6ec482
 
6ec482
 TEST_ZONE = u'zoneadd.%(domain)s' % api.env
6ec482
 
6ec482
-HERE = os.path.abspath(os.path.dirname(__file__))
6ec482
-BASE_DIR = os.path.abspath(os.path.join(HERE, os.pardir, os.pardir))
6ec482
 
6ec482
 
6ec482
 @pytest.mark.tier0
6ec482
@@ -325,24 +321,6 @@ class TestCLIParsing(object):
6ec482
             )
6ec482
 
6ec482
 
6ec482
-def test_cli_fsencoding():
6ec482
-    # https://pagure.io/freeipa/issue/5887
6ec482
-    env = {
6ec482
-        key: value for key, value in os.environ.items()
6ec482
-        if not key.startswith(('LC_', 'LANG'))
6ec482
-    }
6ec482
-    env['LC_ALL'] = 'C'
6ec482
-    env['PYTHONPATH'] = BASE_DIR
6ec482
-    p = subprocess.Popen(
6ec482
-        [sys.executable, '-m', 'ipaclient', 'help'],
6ec482
-        stdout=subprocess.PIPE,
6ec482
-        stderr=subprocess.PIPE,
6ec482
-        env=env,
6ec482
-    )
6ec482
-    out, err = p.communicate()
6ec482
-    assert p.returncode > 0, (out, err)
6ec482
-    assert b'System encoding must be UTF-8' in err, (out, err)
6ec482
-
6ec482
 
6ec482
 IPA_NOT_CONFIGURED = b'IPA is not configured on this system'
6ec482
 IPA_CLIENT_NOT_CONFIGURED = b'IPA client is not configured on this system'
6ec482
-- 
6ec482
2.20.1
6ec482