Description of problem: Short story: # semanage port -a -t openvpn_port_t 1194 /usr/sbin/semanage: Traceback (most recent call last): File "/usr/sbin/semanage", line 302, in ? errorExit(error.args[0]) File "/usr/sbin/semanage", line 83, in errorExit sys.stderr.write("%s\n" % error) UnicodeEncodeError: 'ascii' codec can't encode characters in position 20-21: ordinal not in range(128) # echo $LANG pl_PL.UTF-8 It works with "C" locale. Version-Release number of selected component (if applicable): policycoreutils-1.33.6-3.fc6 How reproducible: Always Additional info: similar problems exist with setroubleshotd and sealert.
Fixed in policycoreutils-1_33_8-3
Which is still neither in fedora 6 updates nor in proposed updates.
Sorry about that, Upstream changed the API of libselinux which caused us to pull back the version of policycoreutils. So libselinux went into testing today. libselinux-1.33.4-2.fc6.i386.rpm I will put that out for a couple of days in testing, and once it moves to final, I can put policycoreutils into testing. If you want to test the newpackages, they are available for RHEL5 right now on ftp://people.redhat.com/dwalsh/SELinux/RHEL5 libselinux/policycoreutils for RHEL5 should work fine on FC6.
It still errors on Fedora 7. Locale is pl_PL.UTF-8 Jun 6 09:02:44 s1.crocom.com.pl setroubleshoot: [rpc.ERROR] exception UnicodeEncodeError: 'ascii' codec can't encode character u'\u0142' in position 3: ordinal not in range(128) Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 780, in handle_client_io self.receiver.feed(data) File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 621, in feed self.process() File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 613, in process self.dispatchFunc(self.header, self.body) File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 821, in default_request_handler self.emit_rpc(rpc_id, 'method_return', rpc_callback_def, *return_args) File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 726, in emit_rpc rpc_xml = convert_rpc_to_xml(rpc_id, rpc_def, *args) File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 199, in convert_rpc_to_xml arg_node.addChild(arg_value.get_xml_nodes(doc, arg_name)) Jun 6 09:02:44 s1.crocom.com.pl setroubleshoot: [rpc.ERROR] could send data on socket ({unix}/var/run/setroubleshoot/setroubleshoot_server): (32, 'Broken pipe') Jun 6 09:02:48 s1.crocom.com.pl setroubleshoot: [rpc.ERROR] exception UnicodeEncodeError: 'ascii' codec can't encode character u'\u0142' in position 3: ordinal not in range(128) Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 780, in handle_client_io self.receiver.feed(data) File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 621, in feed self.process() File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 613, in process self.dispatchFunc(self.header, self.body) File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 821, in default_request_handler self.emit_rpc(rpc_id, 'method_return', rpc_callback_def, *return_args) File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 726, in emit_rpc rpc_xml = convert_rpc_to_xml(rpc_id, rpc_def, *args) File "/usr/lib/python2.5/site-packages/setroubleshoot/rpc.py", line 199, in convert_rpc_to_xml arg_node.addChild(arg_value.get_xml_nodes(doc, arg_name)) Jun 6 09:02:48 s1.crocom.com.pl setroubleshoot: [rpc.ERROR] could send data on socket ({unix}/var/run/setroubleshoot/setroubleshoot_server): (32, 'Broken pipe')
Fedora 8's semanage is still broken with pl_PL(.UTF8). I've come into this when installing selinux-policy-targeted (its install script is calling the first command I'm demonstrating) [root@pensja ~]# setenv LANG pl_PL [root@pensja ~]# semanage user -a -P unconfined -R "unconfined_r system_r" -r s0-s0:c0.c1023 unconfined_u Failed to translate booleans. [Errno 2] No such file or directory: '/usr/share/selinux/devel/policy.xml' /usr/sbin/semanage: Traceback (most recent call last): File "/usr/sbin/semanage", line 352, in <module> errorExit(error.args[0]) File "/usr/sbin/semanage", line 98, in errorExit sys.stderr.write("%s\n" % error) File "/usr/lib/python2.5/codecs.py", line 303, in write data, consumed = self.encode(object, self.errors) File "/usr/lib/python2.5/encodings/iso8859_2.py", line 12, in encode return codecs.charmap_encode(input,errors,encoding_table) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 1: ordinal not in range(128) [root@pensja ~]# semanage user -l Failed to translate booleans. [Errno 2] No such file or directory: '/usr/share/selinux/devel/policy.xml' Etykiety MLS/ MLS/ /usr/sbin/semanage: ascii [root@pensja ~]# unsetenv LANG [root@pensja ~]# semanage user -l Failed to translate booleans. [Errno 2] No such file or directory: '/usr/share/selinux/devel/policy.xml' Labeling MLS/ MLS/ SELinux User Prefix MCS Level MCS Range SELinux Roles guest_u guest s0 s0 guest_r (now it works) pl.po doesn't look suspicious and I don't know Python at all.
I forgot to mention: this is policycoreutils-2.0.31-15.fc8 from F8's updates-testing. With F8-standard policycoreutils-2.0.31-7.fc8 everything is the same except for the "Failed to translate booleans." messages (which probably have their own bugzilla ID).
If you comment out these two lines in /usr/sbin/semanage does it work fine for you? #sys.stderr = codecs.getwriter(locale.getpreferredencoding())(sys.__stderr__, 'replace') #sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.__stdout__, 'replace')
Fixed in policycoreutils-2.0.31-18
I've downloaded policycoreutils-2.0.31-18.fc8 from Koji and can confirm that this time it's really fixed. Thanks a lot!