sys-apps/policycoreutils-2.4 (+pam -audit -dbus, python2_7 target): semanage login -m -s sysadm_u root fails with the following stacktrace: Traceback (most recent call last): File "/usr/lib/python-exec/python2.7/semanage", line 844, in <module> do_parser() File "/usr/lib/python-exec/python2.7/semanage", line 823, in do_parser args.func(args) File "/usr/lib/python-exec/python2.7/semanage", line 201, in handleLogin OBJECT.modify(args.login, args.seuser, args.range) File "/usr/lib64/python2.7/site-packages/seobject.py", line 592, in modify self.__modify(name, sename, serange) File "/usr/lib64/python2.7/site-packages/seobject.py", line 587, in __modify self.mylog.log("login", name,sename=self.sename,serange=self.serange, serole=",".join(serole), oldserole=",".join(oldserole), oldsename=self.oldsename, oldserange=self.oldserange); File "/usr/lib64/python2.7/site-packages/seobject.py", line 109, in log message += " sename=" + sename TypeError: cannot concatenate 'str' and 'NoneType' objects Possibly fixed upstream. Here is the same bug affecting Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734806 Comments indicate that the issue has been patched, but there is no indication of which version contains the patch. Reproducible: Always Steps to Reproduce: 1. semanage login -m -s sysadm_u root Actual Results: Stacktrace in description Expected Results: SELinux user role should be updated
It has been fixed here: https://github.com/SELinuxProject/selinux/commit/4fbc6623eba0d32f1cc8609d605a6b5a2e051e15 It will be in the next release. You can apply the patch in /etc/portage/patches till then if required. Until then it is only in the git release (version -9999).
Confirmed fixed with the patch. FYI, I did this to work around the issue until the update: mkdir -p /etc/portage/patches/sys-apps/policycoreutils-2.4 cd /etc/portage/patches/sys-apps/policycoreutils-2.4 wget https://github.com/SELinuxProject/selinux/commit/4fbc6623eba0d32f1cc8609d605a6b5a2e051e15.patch emerge -1v sys-apps/policycoreutils After that, the command ran successfully.
sys-apps/policycoreutils-2.4-r2 is now in the tree with this patch in.
2.4-r2 is stable