From ebe074be567bc489560fb88505dd7f4aabd86b06 Mon Sep 17 00:00:00 2001
From: Daniel J Walsh
++## This template creates a derived domains which are used ++## for nsplugin web browser. ++##
++##++## This template is invoked automatically for each user, and ++## generally does not need to be invoked directly ++## by policy writers. ++##
++##++## Transition to confined qemu domains from unconfined user ++##
++##
@@ -26689,7 +27007,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
## This template creates a user domain, types, and
## rules for the user's tty, pty, home directories,
## tmp, and tmpfs files.
-@@ -1187,12 +1180,11 @@
+@@ -1187,12 +1184,11 @@
# and may change other protocols
tunable_policy(`user_tcp_server',`
corenet_tcp_bind_all_nodes($1_t)
@@ -26704,16 +27022,20 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
# Run pppd in pppd_t by default for user
-@@ -1201,7 +1193,7 @@
+@@ -1201,7 +1197,11 @@
')
optional_policy(`
- setroubleshoot_stream_connect($1_t)
+ nsplugin_per_role_template($1, $1_usertype, $1_r)
++ ')
++
++ optional_policy(`
++ polkit_per_role_template($1, $1_usertype, $1_r)
')
')
-@@ -1278,8 +1270,6 @@
+@@ -1278,8 +1278,6 @@
# Manipulate other users crontab.
allow $1_t self:passwd crontab;
@@ -26722,7 +27044,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
kernel_read_software_raid_state($1_t)
kernel_getattr_core_if($1_t)
kernel_getattr_message_if($1_t)
-@@ -1357,13 +1347,6 @@
+@@ -1357,13 +1355,6 @@
# But presently necessary for installing the file_contexts file.
seutil_manage_bin_policy($1_t)
@@ -26736,7 +27058,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
optional_policy(`
userhelper_exec($1_t)
')
-@@ -1416,6 +1399,7 @@
+@@ -1416,6 +1407,7 @@
dev_relabel_all_dev_nodes($1)
files_create_boot_flag($1)
@@ -26744,7 +27066,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
# Necessary for managing /boot/efi
fs_manage_dos_files($1)
-@@ -1781,10 +1765,14 @@
+@@ -1781,10 +1773,14 @@
template(`userdom_user_home_content',`
gen_require(`
attribute $1_file_type;
@@ -26760,7 +27082,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -1880,11 +1868,11 @@
+@@ -1880,11 +1876,11 @@
#
template(`userdom_search_user_home_dirs',`
gen_require(`
@@ -26774,7 +27096,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -1914,11 +1902,11 @@
+@@ -1914,11 +1910,11 @@
#
template(`userdom_list_user_home_dirs',`
gen_require(`
@@ -26788,7 +27110,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -1962,12 +1950,12 @@
+@@ -1962,12 +1958,12 @@
#
template(`userdom_user_home_domtrans',`
gen_require(`
@@ -26804,7 +27126,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -1997,10 +1985,10 @@
+@@ -1997,10 +1993,10 @@
#
template(`userdom_dontaudit_list_user_home_dirs',`
gen_require(`
@@ -26817,7 +27139,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2032,11 +2020,47 @@
+@@ -2032,11 +2028,47 @@
#
template(`userdom_manage_user_home_content_dirs',`
gen_require(`
@@ -26867,7 +27189,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2068,10 +2092,10 @@
+@@ -2068,10 +2100,10 @@
#
template(`userdom_dontaudit_setattr_user_home_content_files',`
gen_require(`
@@ -26880,7 +27202,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2101,11 +2125,11 @@
+@@ -2101,11 +2133,11 @@
#
template(`userdom_read_user_home_content_files',`
gen_require(`
@@ -26894,7 +27216,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2135,11 +2159,11 @@
+@@ -2135,11 +2167,11 @@
#
template(`userdom_dontaudit_read_user_home_content_files',`
gen_require(`
@@ -26909,7 +27231,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2169,10 +2193,10 @@
+@@ -2169,10 +2201,14 @@
#
template(`userdom_dontaudit_write_user_home_content_files',`
gen_require(`
@@ -26919,10 +27241,14 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
- dontaudit $2 $1_home_t:file write;
+ dontaudit $2 user_home_t:file write;
++ fs_dontaudit_list_nfs($2)
++ fs_dontaudit_rw_nfs_files($2)
++ fs_dontaudit_list_cifs($2)
++ fs_dontaudit_rw_cifs_files($2)
')
########################################
-@@ -2202,11 +2226,11 @@
+@@ -2202,11 +2238,11 @@
#
template(`userdom_read_user_home_content_symlinks',`
gen_require(`
@@ -26936,7 +27262,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2236,11 +2260,11 @@
+@@ -2236,11 +2272,11 @@
#
template(`userdom_exec_user_home_content_files',`
gen_require(`
@@ -26950,7 +27276,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2270,10 +2294,10 @@
+@@ -2270,10 +2306,10 @@
#
template(`userdom_dontaudit_exec_user_home_content_files',`
gen_require(`
@@ -26963,7 +27289,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2305,12 +2329,12 @@
+@@ -2305,12 +2341,12 @@
#
template(`userdom_manage_user_home_content_files',`
gen_require(`
@@ -26979,7 +27305,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2342,10 +2366,10 @@
+@@ -2342,10 +2378,10 @@
#
template(`userdom_dontaudit_manage_user_home_content_dirs',`
gen_require(`
@@ -26992,7 +27318,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2377,12 +2401,12 @@
+@@ -2377,12 +2413,12 @@
#
template(`userdom_manage_user_home_content_symlinks',`
gen_require(`
@@ -27008,7 +27334,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2414,12 +2438,12 @@
+@@ -2414,12 +2450,12 @@
#
template(`userdom_manage_user_home_content_pipes',`
gen_require(`
@@ -27024,7 +27350,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2451,12 +2475,12 @@
+@@ -2451,12 +2487,12 @@
#
template(`userdom_manage_user_home_content_sockets',`
gen_require(`
@@ -27040,7 +27366,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2501,11 +2525,11 @@
+@@ -2501,11 +2537,11 @@
#
template(`userdom_user_home_dir_filetrans',`
gen_require(`
@@ -27054,7 +27380,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2550,11 +2574,11 @@
+@@ -2550,11 +2586,11 @@
#
template(`userdom_user_home_content_filetrans',`
gen_require(`
@@ -27068,7 +27394,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2594,11 +2618,11 @@
+@@ -2594,11 +2630,11 @@
#
template(`userdom_user_home_dir_filetrans_user_home_content',`
gen_require(`
@@ -27082,7 +27408,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2628,11 +2652,11 @@
+@@ -2628,11 +2664,11 @@
#
template(`userdom_write_user_tmp_sockets',`
gen_require(`
@@ -27096,7 +27422,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2662,11 +2686,11 @@
+@@ -2662,11 +2698,11 @@
#
template(`userdom_list_user_tmp',`
gen_require(`
@@ -27110,7 +27436,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2698,10 +2722,10 @@
+@@ -2698,10 +2734,10 @@
#
template(`userdom_dontaudit_list_user_tmp',`
gen_require(`
@@ -27123,7 +27449,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2733,10 +2757,10 @@
+@@ -2733,10 +2769,10 @@
#
template(`userdom_dontaudit_manage_user_tmp_dirs',`
gen_require(`
@@ -27136,7 +27462,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2766,12 +2790,12 @@
+@@ -2766,12 +2802,12 @@
#
template(`userdom_read_user_tmp_files',`
gen_require(`
@@ -27152,7 +27478,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2803,10 +2827,10 @@
+@@ -2803,10 +2839,10 @@
#
template(`userdom_dontaudit_read_user_tmp_files',`
gen_require(`
@@ -27165,7 +27491,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2838,10 +2862,48 @@
+@@ -2838,10 +2874,48 @@
#
template(`userdom_dontaudit_append_user_tmp_files',`
gen_require(`
@@ -27216,7 +27542,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2871,12 +2933,12 @@
+@@ -2871,12 +2945,12 @@
#
template(`userdom_rw_user_tmp_files',`
gen_require(`
@@ -27232,7 +27558,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2908,10 +2970,10 @@
+@@ -2908,10 +2982,10 @@
#
template(`userdom_dontaudit_manage_user_tmp_files',`
gen_require(`
@@ -27245,7 +27571,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2943,12 +3005,12 @@
+@@ -2943,12 +3017,12 @@
#
template(`userdom_read_user_tmp_symlinks',`
gen_require(`
@@ -27261,7 +27587,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -2980,11 +3042,11 @@
+@@ -2980,11 +3054,11 @@
#
template(`userdom_manage_user_tmp_dirs',`
gen_require(`
@@ -27275,7 +27601,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -3016,11 +3078,11 @@
+@@ -3016,11 +3090,11 @@
#
template(`userdom_manage_user_tmp_files',`
gen_require(`
@@ -27289,7 +27615,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -3052,11 +3114,11 @@
+@@ -3052,11 +3126,11 @@
#
template(`userdom_manage_user_tmp_symlinks',`
gen_require(`
@@ -27303,7 +27629,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -3088,11 +3150,11 @@
+@@ -3088,11 +3162,11 @@
#
template(`userdom_manage_user_tmp_pipes',`
gen_require(`
@@ -27317,7 +27643,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -3124,11 +3186,11 @@
+@@ -3124,11 +3198,11 @@
#
template(`userdom_manage_user_tmp_sockets',`
gen_require(`
@@ -27331,7 +27657,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -3173,10 +3235,10 @@
+@@ -3173,10 +3247,10 @@
#
template(`userdom_user_tmp_filetrans',`
gen_require(`
@@ -27344,7 +27670,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
files_search_tmp($2)
')
-@@ -3217,10 +3279,10 @@
+@@ -3217,10 +3291,10 @@
#
template(`userdom_tmp_filetrans_user_tmp',`
gen_require(`
@@ -27357,7 +27683,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -3248,6 +3310,42 @@
+@@ -3248,6 +3322,42 @@
##
##
#
@@ -27400,7 +27726,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
template(`userdom_rw_user_tmpfs_files',`
gen_require(`
type $1_tmpfs_t;
-@@ -4225,11 +4323,11 @@
+@@ -4225,11 +4335,11 @@
#
interface(`userdom_search_staff_home_dirs',`
gen_require(`
@@ -27414,7 +27740,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -4245,10 +4343,10 @@
+@@ -4245,10 +4355,10 @@
#
interface(`userdom_dontaudit_search_staff_home_dirs',`
gen_require(`
@@ -27427,7 +27753,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -4264,11 +4362,11 @@
+@@ -4264,11 +4374,11 @@
#
interface(`userdom_manage_staff_home_dirs',`
gen_require(`
@@ -27441,7 +27767,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
')
########################################
-@@ -4283,16 +4381,16 @@
+@@ -4283,16 +4393,16 @@
#
interface(`userdom_relabelto_staff_home_dirs',`
gen_require(`
@@ -27461,7 +27787,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
## users home directory.
##
##
-@@ -4301,38 +4399,32 @@
+@@ -4301,38 +4411,32 @@
##
##
#
@@ -27509,7 +27835,7 @@ diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/userdo
##
##
##