Bug 431413 - [regression] policygentool is broken
[regression] policygentool is broken
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: selinux-policy (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Daniel Walsh
: Regression
Depends On:
  Show dependency treegraph
Reported: 2008-02-04 06:06 EST by Andreas Thienemann
Modified: 2008-05-21 12:06 EDT (History)
0 users

See Also:
Fixed In Version: RHBA-2008-0465
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-21 12:06:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andreas Thienemann 2008-02-04 06:06:14 EST
[root@localhost ~]# rpm -q selinux-policy-devel
[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
[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 06:23:03 EST
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
 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)
        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 ?
NameError: name 'gen_policy' is not defined
Comment 2 Daniel Walsh 2008-02-04 16:03:47 EST
If you just remove the polgen line, does it work?
Comment 3 Daniel Walsh 2008-02-04 16:12:47 EST
Reverting back to previous version

Comment 4 RHEL Product and Program Management 2008-02-04 16:17:12 EST
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
Comment 5 RHEL Product and Program Management 2008-02-04 16:19:04 EST
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 12:06:51 EDT
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.


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