Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 557370

Summary: <sys-apps/policycoreutils-2.4-r2 - semanage login -m -s doesn't work
Product: Gentoo Linux Reporter: Shawn Kovalchick <bamapookie>
Component: SELinuxAssignee: Sven Vermeulen (RETIRED) <swift>
Status: RESOLVED FIXED    
Severity: normal CC: selinux
Priority: Normal    
Version: autobuilds   
Hardware: AMD64   
OS: Linux   
Whiteboard: selinux-utils
Package list:
Runtime testing required: ---

Description Shawn Kovalchick 2015-08-12 14:10:30 UTC
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
Comment 1 Jason Zaman gentoo-dev 2015-08-12 14:30:03 UTC
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).
Comment 2 Shawn Kovalchick 2015-08-12 15:16:57 UTC
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.
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2015-08-25 16:36:50 UTC
sys-apps/policycoreutils-2.4-r2 is now in the tree with this patch in.
Comment 4 Jason Zaman gentoo-dev 2015-11-22 10:41:42 UTC
2.4-r2 is stable