Skip to contentSkip to conversation

Make httpd_manage_all_user_content() do what it advertises

PATCH New Dominick Grift 2 participants 4 messages Feb 11, 2013 – Feb 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make httpd_manage_all_user_content() do what it advertises

apache.if +8 -2
index 83e899c..9bf189f 100644
@@ -1070,8 +1070,14 @@
 ## <rolecap/>
 #
 interface(`apache_manage_all_user_content',`
-	refpolicywarn(`$0($*) has been deprecated, use apache_manage_all_content() instead.')
-	apache_manage_all_content($1)
+	gen_require(`
+		type httpd_user_content_t, httpd_user_content_rw_t, httpd_user_content_ra_t)
+		type httpd_user_htaccess_t, httpd_user_script_exec_t;
+	')
+
+	manage_dirs_pattern($1, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t }, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t })
+	manage_files_pattern($1, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t httpd_user_htaccess_t }, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t httpd_user_htaccess_t})
+	manage_lnk_files_pattern($1, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t }, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t })
 ')
 
 ########################################
#1 lore raw

PATCH 1/1 Make httpd_manage_all_user_content() do what it advertises

On Mon, 2013-02-11 at 21:15 +0100, Dominick Grift wrote:

Sven, see if this does what you want. If it does then i will commit it.

Quoted 22 lines
apache.if +8 -2
index 83e899c..9bf189f 100644
@@ -1070,8 +1070,14 @@
 ## <rolecap/>
 #
 interface(`apache_manage_all_user_content',`
-	refpolicywarn(`$0($*) has been deprecated, use apache_manage_all_content() instead.')
-	apache_manage_all_content($1)
+	gen_require(`
+		type httpd_user_content_t, httpd_user_content_rw_t, httpd_user_content_ra_t)
+		type httpd_user_htaccess_t, httpd_user_script_exec_t;
+	')
+
+	manage_dirs_pattern($1, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t }, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t })
+	manage_files_pattern($1, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t httpd_user_htaccess_t }, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t httpd_user_htaccess_t})
+	manage_lnk_files_pattern($1, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t }, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t })
 ')
 
 ########################################
#2 lore raw

PATCH 1/1 Make httpd_manage_all_user_content() do what it advertises

Looks ok to me. Too bad templates cannot create interfaces, otherwise we could have apache_content_template create the apache_manage_all_*_content interfaces.

Quoted 26 lines · Dominick Grift

On Mon, 2013-02-11 at 21:15 +0100, Dominick Grift wrote:

Sven, see if this does what you want. If it does then i will commit it.

apache.if line 1073

Quoted 10 lines
apache.if +0 -1
index 83e899c..9bf189f 100644
@@ -1070,8 +1070,14 @@
 ## <rolecap/>
 #
 interface(`apache_manage_all_user_content',`
-     refpolicywarn(`$0($*) has been deprecated, use

apache_manage_all_content() instead.')

apache.if

Quoted 3 lines
apache.if +2 -1
-     apache_manage_all_content($1)
+     gen_require(`
+             type httpd_user_content_t, httpd_user_content_rw_t,

httpd_user_content_ra_t)

apache.if

Quoted 4 lines
apache.if +4 -0
+             type httpd_user_htaccess_t, httpd_user_script_exec_t;
+     ')
+
+     manage_dirs_pattern($1, { httpd_user_content_t

httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t }, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t })

Quoted 14 lines

apache.if line 1079

Quoted 1 line
apache.if +1 -0
+     manage_files_pattern($1, { httpd_user_content_t

httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t httpd_user_htaccess_t }, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t httpd_user_htaccess_t})

apache.if line 1080

Quoted 1 line
apache.if +1 -0
+     manage_lnk_files_pattern($1, { httpd_user_content_t

httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t }, { httpd_user_content_t httpd_user_content_rw_t httpd_user_content_ra_t httpd_user_script_exec_t })

Quoted 3 lines
apache.if +0 -0
 ')
 
 ########################################

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.tresys.com/pipermail/refpolicy/attachments/20130211/7a4f3c01/attachment.html

#3 lore raw

PATCH 1/1 Make httpd_manage_all_user_content() do what it advertises

Quoted 3 lines · Sven Vermeulen

Looks ok to me. Too bad templates cannot create interfaces, otherwise we could have apache_content_template create the apache_manage_all_*_content interfaces.

Alright, i merged this solution. commit id 37da3a4