python/sepolicy: Fix type for cgi scripts
PATCH 1/1 python/sepolicy: Fix type for cgi scripts
The type generated by apache_content_template macro for cgi scripts changed from httpd_$1_script_t to $1_script_t.
Update sepolicy accordingly.
--- python/sepolicy/sepolicy/generate.py | 2 +- python/sepolicy/sepolicy/templates/executable.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
python/sepolicy/sepolicy/generate.py +1 -1
@@ -347,7 +347,7 @@ class policy: raise ValueError(_("Name must be alpha numberic with no spaces. Consider using option \"-n MODULENAME\"")) if type == CGI: - self.name = "httpd_%s_script" % name + self.name = "%s_script" % name else: self.name = name
python/sepolicy/sepolicy/templates/executable.py +1 -1
@@ -116,7 +116,7 @@ policy_module(TEMPLATETYPE, 1.0.0) apache_content_template(TEMPLATETYPE) -permissive httpd_TEMPLATETYPE_script_t; +permissive TEMPLATETYPE_script_t; """ te_daemon_rules="""\
Signature · 1 line
2.14.3
Quoted 5 lines · Vit Mojzis
The type generated by
apache_content_templatemacro for cgi scripts changed from httpd_$1_script_t to $1_script_t.
Update sepolicy accordingly.
This seems to be a change only present in Fedora policy, not upstream refpolicy. So merging this would break users of refpolicy and potentially distributions other than Fedora. Why was this change made, and why wasn't a typealias added to preserve compatibility?
Quoted 34 lines
Signed-off-by Vit Mojzis <[email protected]>--- python/sepolicy/sepolicy/generate.py | 2 +- python/sepolicy/sepolicy/templates/executable.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)python/sepolicy/sepolicy/generate.py +1
-1@@ -347,7 +347,7 @@ class policy: raise ValueError(_("Name must be alpha numberic with no spaces. Consider using option \"-n MODULENAME\"")) if type == CGI: - self.name = "httpd_%s_script" % name + self.name = "%s_script" % name else: self.name = namepython/sepolicy/sepolicy/templates/executable.py +1
-1@@ -116,7 +116,7 @@ policy_module(TEMPLATETYPE, 1.0.0) apache_content_template(TEMPLATETYPE) -permissive httpd_TEMPLATETYPE_script_t; +permissive TEMPLATETYPE_script_t; """ te_daemon_rules="""\
Quoted 11 lines · Stephen Smalley
Quoted 5 lines · Vit Mojzis
The type generated by
apache_content_templatemacro for cgi scripts changed from httpd_$1_script_t to $1_script_t.
Update sepolicy accordingly.This seems to be a change only present in Fedora policy, not upstream
refpolicy. So merging this would break users of refpolicy and
potentially distributions other than Fedora. Why was this change made,> and why wasn't a typealias added to preserve compatibility?
Hi Stephen,
You're right with this change, however commit in our selinux-policy sources changing this is from 2013. I will look on it and add proper typealiases.
Thanks for heads up.
Lukas.
Quoted 35 lines
Quoted 34 lines
Signed-off-by Vit Mojzis <[email protected]>--- python/sepolicy/sepolicy/generate.py | 2 +- python/sepolicy/sepolicy/templates/executable.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)python/sepolicy/sepolicy/generate.py +1
-1@@ -347,7 +347,7 @@ class policy: raise ValueError(_("Name must be alpha numberic with no spaces. Consider using option \"-n MODULENAME\"")) if type == CGI: - self.name = "httpd_%s_script" % name + self.name = "%s_script" % name else: self.name = namepython/sepolicy/sepolicy/templates/executable.py +1
-1@@ -116,7 +116,7 @@ policy_module(TEMPLATETYPE, 1.0.0) apache_content_template(TEMPLATETYPE) -permissive httpd_TEMPLATETYPE_script_t; +permissive TEMPLATETYPE_script_t; """ te_daemon_rules="""\
Signature · 3 lines
Lukas Vrabec Software Engineer, Security Technologies Red Hat, Inc.