Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 924686

Summary: sepolicy generate -w /home/testfiles -d amtu_t --customize -n testpolicy generates noncompilable policy
Product: Red Hat Enterprise Linux 7 Reporter: Michal Trunecka <mtruneck>
Component: policycoreutilsAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Michal Trunecka <mtruneck>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.1CC: ebenes, mgrepl, mmalik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:01:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 917049    

Description Michal Trunecka 2013-03-22 10:40:39 UTC
Description of problem:

# sepolicy generate -w /home/testfiles -d amtu_t --customize -n testpolicy
Created the following files:
/root/mypol/testpolicy.te # Type Enforcement file
/root/mypol/testpolicy.if # Interface file
/root/mypol/testpolicy.fc # File Contexts file
/root/mypol/testpolicy_selinux.spec # Spec file
/root/mypol/testpolicy.sh # Setup Script


# make -f /usr/share/selinux/devel/Makefile 
Compiling targeted testpolicy module
/usr/bin/checkmodule:  loading policy configuration from tmp/testpolicy.tmp
testpolicy.te":15:ERROR 'unknown type testpolicy_t' at token ';' on line 3230:
	allow testpolicy_t testpolicy_rw_t:dir { open read getattr lock search ioctl add_name remove_name write };
#line 15
/usr/bin/checkmodule:  error(s) encountered while parsing configuration
make: *** [tmp/testpolicy.mod] Error 1




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

Comment 1 Miroslav Grepl 2013-04-02 05:34:49 UTC
Ok, I have patch which makes it 



policy_module(testpolicy, 1.0.0)

gen_require(`
        type amtu_t;
')

type testpolicy_rw_t;
files_type(testpolicy_rw_t)

########################################
#
# testpolicy customized policy
#

manage_dirs_pattern(amtu_t, testpolicy_rw_t, testpolicy_rw_t)
manage_files_pattern(amtu_t, testpolicy_rw_t, testpolicy_rw_t)
manage_lnk_files_pattern(amtu_t, testpolicy_rw_t, testpolicy_rw_t)

Comment 2 Michal Trunecka 2013-05-14 07:05:58 UTC
Ok, this issue is fixed -> VERIFIED

But there is still the issue filed in Bug 924696 - sepolicy generate: some generated setup scripts fail

Comment 3 Ludek Smid 2014-06-13 11:01:36 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.