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

Bug 468832

Summary: <sys-apps/policycoreutils-2.1.14-r2 sepolicy transition fails with Python key error
Product: Gentoo Linux Reporter: Sven Vermeulen (RETIRED) <swift>
Component: SELinuxAssignee: Sven Vermeulen (RETIRED) <swift>
Status: VERIFIED FIXED    
Severity: normal CC: selinux
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard: selinux-utils
Package list:
Runtime testing required: ---

Description Sven Vermeulen (RETIRED) gentoo-dev 2013-05-07 08:30:48 UTC
# sepolicy transition -s staff_t -t portage_t
Traceback (most recent call last):
  File "/usr/bin/sepolicy-2.7", line 465, in <module>
    args.func(args)
  File "/usr/bin/sepolicy-2.7", line 309, in transition
    mytrans.output()
  File "/usr/lib64/python2.7/site-packages/sepolicy/transition.py", line 76, in output
    print self.out(self.source)
  File "/usr/lib64/python2.7/site-packages/sepolicy/transition.py", line 72, in out
    buf+= self.out(x, seen, "%s%s ... " % (header, name))
  File "/usr/lib64/python2.7/site-packages/sepolicy/transition.py", line 67, in out
    for t in self.sdict[name]["map"]:
KeyError: 'map'


Reproducible: Always
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2013-05-07 09:08:34 UTC
We can check if the key "map" is in the dictionary and only then continue. Application seems to work with that:

"""
# sepolicy transition -s sysadm_t -t portage_t
sysadm_t @ portage_exec_t --> portage_t
sysadm_t ... dhcpc_t ... initrc_t ... puppet_t @ portage_exec_t --> portage_t
sysadm_t ... dhcpc_t ... initrc_t ... puppet_t ... portage_fetch_t @ portage_exec_t --> portage_t
sysadm_t ... dhcpc_t ... initrc_t ... crond_t @ portage_exec_t --> portage_t
sysadm_t ... dhcpc_t ... initrc_t ... crond_t ... system_cronjob_t @ portage_exec_t --> portage_t

# sepolicy transition -s staff_t -t portage_t

# 
"""
Comment 2 Sven Vermeulen (RETIRED) gentoo-dev 2013-05-07 09:36:01 UTC
In main tree, ~arch'ed
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2013-06-16 18:24:45 UTC
Stabilized