Bug 986338 - Traceback of sepolicy generate when generating --newtype for port
Traceback of sepolicy generate when generating --newtype for port
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: policycoreutils (Show other bugs)
All Linux
medium Severity medium
: rc
: ---
Assigned To: Daniel Walsh
BaseOS QE Security Team
Depends On:
  Show dependency treegraph
Reported: 2013-07-19 09:06 EDT by Michal Trunecka
Modified: 2014-09-30 19:35 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-10 08:17:55 EDT
Type: Bug
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 Michal Trunecka 2013-07-19 09:06:08 EDT
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>
  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
  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):
Comment 1 Miroslav Grepl 2013-09-10 08:17:55 EDT
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.