RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 986338 - Traceback of sepolicy generate when generating --newtype for port
Summary: Traceback of sepolicy generate when generating --newtype for port
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: policycoreutils
Version: 7.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-19 13:06 UTC by Michal Trunecka
Modified: 2014-09-30 23:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-10 12:17:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Michal Trunecka 2013-07-19 13:06:08 UTC
Description of problem:

Traceback occurs only when port context is given:

# sepolicy generate -p mypolicy -w /home   -n testpolicy --newtype -t newtype_port_t
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 568, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 448, in generate
    print mypolicy.generate(args.path)
  File "/usr/lib64/python2.7/site-packages/sepolicy/generate.py", line 1351, in generate
    out += "%s # %s\n" % (self.write_te(out_dir), _("Type Enforcement file"))
  File "/usr/lib64/python2.7/site-packages/sepolicy/generate.py", line 1216, in write_te
    fd.write(self.generate_te())
  File "/usr/lib64/python2.7/site-packages/sepolicy/generate.py", line 1040, in generate_te
    newte += self.generate_default_rules()
  File "/usr/lib64/python2.7/site-packages/sepolicy/generate.py", line 1005, in generate_default_rules
    return self.DEFAULT_TYPES[self.type][1]()
  File "/usr/lib64/python2.7/site-packages/sepolicy/generate.py", line 878, in generate_new_rules
    newte += re.sub("TEMPLATETYPE", t[:-len(i)], self.DEFAULT_EXT[i].te_rules)
AttributeError: 'module' object has no attribute 'te_rules'



Version-Release number of selected component (if applicable):
policycoreutils-2.1.14-66.el7.x86_64

Comment 1 Miroslav Grepl 2013-09-10 12:17:55 UTC
Also should be fixed in the latest builds.


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