Bug 431413 - [regression] policygentool is broken
Summary: [regression] policygentool is broken
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: selinux-policy
Version: 5.1
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-02-04 11:06 UTC by Andreas Thienemann
Modified: 2008-05-21 16:06 UTC (History)
0 users

Fixed In Version: RHBA-2008-0465
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 16:06:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0465 0 normal SHIPPED_LIVE selinux-policy bug fix update 2008-05-20 14:36:31 UTC

Description Andreas Thienemann 2008-02-04 11:06:14 UTC
[root@localhost ~]# rpm -q selinux-policy-devel
selinux-policy-devel-2.4.6-106.el5_1.3
[root@localhost ~]# /usr/share/selinux/devel/policygentool 
Traceback (most recent call last):
  File "/usr/share/selinux/devel/policygentool", line 25, in ?
    import polgen
ImportError: No module named polgen
[root@localhost ~]# 

The version from 5.0 did work, this seems to be a regression/rebase problem.

[root@localhost ~]# scp
athienem@porkchop:/mnt/redhat/released/RHEL-5-Server/GOLD/i386/os/Server/selinux-policy-devel-2.4.6-30.el5.noarch.rpm
.
[root@localhost ~]# cd /tmp
[root@localhost tmp]# rpm2cpio <
/root/selinux-policy-devel-2.4.6-30.el5.noarch.rpm | cpio -id
4730 blocks
[root@localhost tmp]# cd usr/share/selinux/devel
[root@localhost devel]# ls
example.fc  example.if  example.te  include  Makefile  policygentool  policyhelp
[root@localhost devel]# ./policygentool 
./policygentool ModuleName Executable
[root@localhost devel]#

Comment 1 Andreas Thienemann 2008-02-04 11:23:03 UTC
A short patch fixing the initial problems:

--- policygentool.orig  2008-02-04 12:14:18.000000000 +0100
+++ policygentool       2008-02-04 12:21:13.000000000 +0100
@@ -21,8 +21,10 @@
 #
 #  
 import os, sys, getopt
+sys.path.append('/usr/share/system-config-selinux/');
 import re
 import polgen
+import polgengui
 def errorExit(error):
        sys.stderr.write("%s: " % sys.argv[0])
        sys.stderr.write("%s\n" % error)
@@ -73,8 +75,8 @@
                4  User Application
                """
                input = sys.stdin.readline().rstrip()
-               if input > "0" and input < 5:
-                       type = int(type)
+               if input > "0" and input < "5":
+                       type = int(input)
                        break
 
        print 'If the module uses pidfiles, what is the pidfile called?'


It's not enough though, the script fails with the gen_policy call.

Traceback (most recent call last):
  File "./policygentool", line 111, in ?
    gen_policy(
NameError: name 'gen_policy' is not defined


Comment 2 Daniel Walsh 2008-02-04 21:03:47 UTC
If you just remove the polgen line, does it work?

Comment 3 Daniel Walsh 2008-02-04 21:12:47 UTC
Reverting back to previous version

selinux-policy-2.4.6-119

Comment 4 RHEL Program Management 2008-02-04 21:17:12 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 5 RHEL Program Management 2008-02-04 21:19:04 UTC
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.

Comment 11 errata-xmlrpc 2008-05-21 16:06:51 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0465.html



Note You need to log in before you can comment on or make changes to this bug.