Bug 1039269

Summary: [abrt] policycoreutils-devel-2.2.2-3.fc20: manpage.py:551:_format_boolean_desc:KeyError: 'kerberos_enabled'
Product: [Fedora] Fedora Reporter: Dominick Grift <dominick.grift>
Component: policycoreutilsAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/0aa745fdd8fa6711f124aeadc53740823ac1f83c
Whiteboard: abrt_hash:4e011c7a60404d493cf6eab918c0fb2f490f44dd
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-30 00:45:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description Dominick Grift 2013-12-07 12:01:22 UTC
Description of problem:
I was building a selinux-policy rpm package using the fedora spec but with different policy

I suspect this bug is due to hard-coding but i am not sure

Version-Release number of selected component:
policycoreutils-devel-2.2.2-3.fc20

Additional info:
reporter:       libreport-2.1.9
cmdline:        /usr/bin/python -Es /usr/bin/sepolicy manpage -a -p /home/dominick/rpmbuild/BUILDROOT/selinux-policy-1-1.fc20.x86_64/usr/share/man/man8/ -w -r /home/dominick/rpmbuild/BUILDROOT/selinux-policy-1-1.fc20.x86_64
dso_list:       policycoreutils-python-2.2.2-3.fc20.x86_64
executable:     /usr/bin/sepolicy
kernel:         3.11.9-300.fc20.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
manpage.py:551:_format_boolean_desc:KeyError: 'kerberos_enabled'

Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 644, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 320, in manpage
    m = ManPage(domain, path, args.root,args.source_files, args.web)
  File "/usr/lib64/python2.7/site-packages/sepolicy/manpage.py", line 440, in __init__
    self.__gen_man_page()
  File "/usr/lib64/python2.7/site-packages/sepolicy/manpage.py", line 519, in __gen_man_page
    self._nsswitch_domain()
  File "/usr/lib64/python2.7/site-packages/sepolicy/manpage.py", line 607, in _nsswitch_domain
    """ % (self._format_boolean_desc(b),(", ".join(nsswitch_types)), b, b)
  File "/usr/lib64/python2.7/site-packages/sepolicy/manpage.py", line 551, in _format_boolean_desc
    desc = self.booleans_dict[b][2][0].lower() + self.booleans_dict[b][2][1:]
KeyError: 'kerberos_enabled'

Local variables in innermost frame:
self: <sepolicy.manpage.ManPage instance at 0x2ce6b48>
b: 'kerberos_enabled'

Comment 1 Dominick Grift 2013-12-07 12:01:27 UTC
Created attachment 833867 [details]
File: backtrace

Comment 2 Dominick Grift 2013-12-07 12:01:29 UTC
Created attachment 833868 [details]
File: environ

Comment 3 Miroslav Grepl 2013-12-09 11:41:34 UTC
This is a problem with policy.xml handling which is needed by sepolicy-manpage.

Comment 4 Daniel Walsh 2013-12-13 13:49:30 UTC
Miroslav do you have a fix?

Comment 5 Miroslav Grepl 2013-12-16 10:51:47 UTC
Ok, I believe we need to run semanage-manpage with "--source_files" argument.

Dominick,
could you try to add this argument in the spec file for "semanage-manpage" calling?

Comment 6 Dominick Grift 2013-12-16 12:37:17 UTC
At least it does not segfault, but i need to dig into this a bit deeper because i might need to adjust the option.

I ran a quick test, and these were the results of that:

+ /usr/bin/sepolicy manpage --source_files -a -p /home/dominick/rpmbuild/BUILDROOT/selinux-policy-4.100.99-99.fc20.x86_64/usr/share/man/man8/ -w -r /home/dominick/rpmbuild/BUILDROOT/selinux-policy-4.100.99-99.fc20.x86_64
IOError: [Errno 2] No such file or directory: '/home/dominick/rpmbuild/BUILDROOT/selinux-policy-4.100.99-99.fc20.x86_64file_contexts'
error: Bad exit status from /var/tmp/rpm-tmp.LtXnGJ (%install)

when adding this to the spec file:

/usr/bin/sepolicy manpage --source_files -a -p %{buildroot}/usr/share/man/man8/ -w -r %{buildroot}
mkdir %{buildroot}%{_usr}/share/selinux/devel/html
htmldir=`compgen -d %{buildroot}%{_usr}/share/man/man8/`
mv ${htmldir}/* %{buildroot}%{_usr}/share/selinux/devel/html
rm -rf ${htmldir}

Also i could not find "--source_files" in "man sepolicy-manpage"

I think i need to take a little more time to test this

Comment 7 Dominick Grift 2013-12-16 12:50:11 UTC
its looking for file_contexts file in the wrong place with --source_files argument. The file_contexts file is not in %{buildroot} or %{buildroot}/

With documentation of the --source_files argument it is kind of hard for me to determine what to specify without looking up the source of the script

Comment 8 Dominick Grift 2013-12-16 12:50:51 UTC
Oops, s/With/Without

Comment 9 Miroslav Grepl 2013-12-19 20:24:32 UTC
Yeap, you are right. The problem is with a custom buildroot where these files are needed and we need to change the code to say it to the user.

Comment 10 Fedora End Of Life 2015-05-29 09:56:30 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Fedora End Of Life 2015-06-30 00:45:58 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.