Skip to content

Commit 2b1beba

Browse files
committed
apache: allow nginx -t
nginx needs to be executable by system administrators to be able to run various actions, including the critical test option -t. This provides appropriate execution authority to do so. Signed-off-by: Antonio Enrico Russo <[email protected]>
1 parent 64310d1 commit 2b1beba

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

policy/modules/services/apache.if

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ template(`apache_role',`
134134
type httpd_user_content_t, httpd_user_htaccess_t;
135135
type httpd_user_script_t, httpd_user_script_exec_t;
136136
type httpd_user_ra_content_t, httpd_user_rw_content_t;
137+
attribute_role httpd_helper_roles;
137138
')
138139

139140
role $4 types httpd_user_script_t;
@@ -156,6 +157,10 @@ template(`apache_role',`
156157
allow $2 httpd_user_script_exec_t:file { manage_file_perms relabel_file_perms };
157158
allow $2 httpd_user_script_exec_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms };
158159

160+
# for nginx -t
161+
apache_domtrans($3)
162+
roleattribute $4 httpd_helper_roles;
163+
159164
userdom_user_home_dir_filetrans($2, httpd_user_content_t, dir, "public_html")
160165
userdom_user_home_dir_filetrans($2, httpd_user_content_t, dir, "web")
161166
userdom_user_home_dir_filetrans($2, httpd_user_content_t, dir, "www")

policy/modules/services/apache.te

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ files_config_file(httpd_config_t)
282282
type httpd_helper_t;
283283
type httpd_helper_exec_t;
284284
application_domain(httpd_helper_t, httpd_helper_exec_t)
285-
role httpd_helper_roles types httpd_helper_t;
285+
role httpd_helper_roles types { httpd_helper_t httpd_t };
286286

287287
type httpd_initrc_exec_t;
288288
init_script_file(httpd_initrc_exec_t)

0 commit comments

Comments
 (0)