--- nsaserefpolicy/policy/modules/apps/nsplugin.fc	1969-12-31 19:00:00.000000000 -0500
+++ serefpolicy-3.5.5/policy/modules/apps/nsplugin.fc	2008-08-25 10:50:15.000000000 -0400
@@ -0,0 +1,8 @@
+
+/usr/lib(64)?/nspluginwrapper/npviewer.bin	--	gen_context(system_u:object_r:nsplugin_exec_t,s0)
+/usr/lib(64)?/nspluginwrapper/plugin-config	--	gen_context(system_u:object_r:nsplugin_config_exec_t,s0)
+/usr/lib(64)?/mozilla/plugins-wrapped(/.*)?			gen_context(system_u:object_r:nsplugin_rw_t,s0)
+
+HOME_DIR/\.adobe(/.*)?			gen_context(system_u:object_r:nsplugin_home_t,s0)
+HOME_DIR/\.macromedia(/.*)?		gen_context(system_u:object_r:nsplugin_home_t,s0)
+HOME_DIR/\.gstreamer-.*			gen_context(system_u:object_r:nsplugin_home_t,s0)
--- nsaserefpolicy/policy/modules/apps/nsplugin.if	1969-12-31 19:00:00.000000000 -0500
+++ serefpolicy-3.5.5/policy/modules/apps/nsplugin.if	2008-08-25 10:50:15.000000000 -0400
@@ -0,0 +1,291 @@
+
+## <summary>policy for nsplugin</summary>
+
+########################################
+## <summary>
+##	Create, read, write, and delete
+##	nsplugin rw files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`nsplugin_manage_rw_files',`
+	gen_require(`
+		type nsplugin_rw_t;
+	')
+
+	allow $1 nsplugin_rw_t:file manage_file_perms;
+	allow $1 nsplugin_rw_t:dir rw_dir_perms;
+')
+
+########################################
+## <summary>
+##	Manage nsplugin rw files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`nsplugin_manage_rw',`
+	gen_require(`
+		type nsplugin_rw_t;
+	')
+
+         manage_dirs_pattern($1, nsplugin_rw_t, nsplugin_rw_t)
+         manage_files_pattern($1, nsplugin_rw_t, nsplugin_rw_t)
+         manage_lnk_files_pattern($1, nsplugin_rw_t, nsplugin_rw_t)
+')
+
+#######################################
+## <summary>
+##	The per role template for the nsplugin module.
+## </summary>
+## <desc>
+##	<p>
+##	This template creates a derived domains which are used
+##	for nsplugin web browser.
+##	</p>
+##	<p>
+##	This template is invoked automatically for each user, and
+##	generally does not need to be invoked directly
+##	by policy writers.
+##	</p>
+## </desc>
+## <param name="userdomain_prefix">
+##	<summary>
+##	The prefix of the user domain (e.g., user
+##	is the prefix for user_t).
+##	</summary>
+## </param>
+## <param name="user_domain">
+##	<summary>
+##	The type of the user domain.
+##	</summary>
+## </param>
+## <param name="user_role">
+##	<summary>
+##	The role associated with the user domain.
+##	</summary>
+## </param>
+#
+template(`nsplugin_per_role_template_notrans',`
+	gen_require(`
+		type nsplugin_rw_t;
+		type nsplugin_t;
+		type nsplugin_config_t;
+		type nsplugin_home_t;
+		type nsplugin_exec_t;
+		type nsplugin_config_exec_t;
+		type $1_tmpfs_t;
+	')
+
+	role $3 types nsplugin_t;
+	role $3 types nsplugin_config_t;
+
+	allow nsplugin_t $2:process signull;
+
+	list_dirs_pattern($2, nsplugin_rw_t, nsplugin_rw_t)
+	read_files_pattern($2, nsplugin_rw_t, nsplugin_rw_t)
+	read_lnk_files_pattern($2, nsplugin_rw_t, nsplugin_rw_t)
+	can_exec($2, nsplugin_rw_t)
+
+	allow nsplugin_t $1_tmpfs_t:file { read getattr };
+
+	#Leaked File Descriptors
+	dontaudit nsplugin_t $2:tcp_socket rw_socket_perms;
+	dontaudit nsplugin_t $2:udp_socket rw_socket_perms;
+	dontaudit nsplugin_t $2:unix_stream_socket rw_socket_perms;
+	dontaudit nsplugin_t $2:unix_dgram_socket rw_socket_perms;
+	dontaudit nsplugin_config_t $2:tcp_socket rw_socket_perms;
+	dontaudit nsplugin_config_t $2:udp_socket rw_socket_perms;
+	dontaudit nsplugin_config_t $2:unix_stream_socket rw_socket_perms;
+	allow nsplugin_t $2:unix_stream_socket connectto;
+	dontaudit nsplugin_t $2:process ptrace;
+
+	allow $2 nsplugin_t:process { getattr ptrace signal_perms };
+	allow $2 nsplugin_t:unix_stream_socket connectto;
+
+	# Connect to pulseaudit server
+	stream_connect_pattern(nsplugin_t, user_home_t, user_home_t, $2)
+	gnome_stream_connect(nsplugin_t, $2)
+
+	userdom_use_user_terminals($1, nsplugin_t)
+	userdom_use_user_terminals($1, nsplugin_config_t)
+
+	xserver_common_app($1, nsplugin_t)
+
+')
+
+#######################################
+## <summary>
+##	The per role template for the nsplugin module.
+## </summary>
+## <desc>
+##	<p>
+##	This template creates a derived domains which are used
+##	for nsplugin web browser.
+##	</p>
+##	<p>
+##	This template is invoked automatically for each user, and
+##	generally does not need to be invoked directly
+##	by policy writers.
+##	</p>
+## </desc>
+## <param name="userdomain_prefix">
+##	<summary>
+##	The prefix of the user domain (e.g., user
+##	is the prefix for user_t).
+##	</summary>
+## </param>
+## <param name="user_domain">
+##	<summary>
+##	The type of the user domain.
+##	</summary>
+## </param>
+## <param name="user_role">
+##	<summary>
+##	The role associated with the user domain.
+##	</summary>
+## </param>
+#
+template(`nsplugin_per_role_template',`
+	gen_require(`
+		type nsplugin_exec_t;
+		type nsplugin_config_exec_t;
+	')
+
+	nsplugin_per_role_template_notrans($1, $2, $3)
+
+	domtrans_pattern($2, nsplugin_exec_t, nsplugin_t)
+	domtrans_pattern($2, nsplugin_config_exec_t, nsplugin_config_t)
+')
+
+#######################################
+## <summary>
+##	The per role template for the nsplugin module.
+## </summary>
+## <desc>
+##	<p>
+##	This template creates a derived domains which are used
+##	for nsplugin web browser.
+##	</p>
+##	<p>
+##	This template is invoked automatically for each user, and
+##	generally does not need to be invoked directly
+##	by policy writers.
+##	</p>
+## </desc>
+## <param name="userdomain_prefix">
+##	<summary>
+##	The prefix of the user domain (e.g., user
+##	is the prefix for user_t).
+##	</summary>
+## </param>
+## <param name="user_domain">
+##	<summary>
+##	The type of the user domain.
+##	</summary>
+## </param>
+#
+interface(`nsplugin_domtrans_user',`
+	gen_require(`
+		type nsplugin_exec_t;
+		type nsplugin_t;
+	')
+
+	domtrans_pattern($2, nsplugin_exec_t, nsplugin_t)
+')
+#######################################
+## <summary>
+##	The per role template for the nsplugin module.
+## </summary>
+## <desc>
+##	<p>
+##	This template creates a derived domains which are used
+##	for nsplugin web browser.
+##	</p>
+##	<p>
+##	This template is invoked automatically for each user, and
+##	generally does not need to be invoked directly
+##	by policy writers.
+##	</p>
+## </desc>
+## <param name="userdomain_prefix">
+##	<summary>
+##	The prefix of the user domain (e.g., user
+##	is the prefix for user_t).
+##	</summary>
+## </param>
+## <param name="user_domain">
+##	<summary>
+##	The type of the user domain.
+##	</summary>
+## </param>
+#
+interface(`nsplugin_domtrans_user_config',`
+	gen_require(`
+		type nsplugin_config_exec_t;
+		type nsplugin_config_t;
+	')
+
+	domtrans_pattern($2, nsplugin_config_exec_t, nsplugin_config_t)
+')
+
+########################################
+## <summary>
+##	Search nsplugin rw directories.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`nsplugin_search_rw_dir',`
+	gen_require(`
+		type nsplugin_rw_t;
+	')
+
+	allow $1 nsplugin_rw_t:dir search_dir_perms;
+')
+
+########################################
+## <summary>
+##	Read nsplugin rw files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`nsplugin_read_rw_files',`
+	gen_require(`
+		type nsplugin_rw_t;
+	')
+
+	read_files_pattern($1, nsplugin_rw_t, nsplugin_rw_t)
+')
+
+########################################
+## <summary>
+##	Exec nsplugin rw files.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed access.
+##	</summary>
+## </param>
+#
+interface(`nsplugin_rw_exec',`
+	gen_require(`
+		type nsplugin_rw_t;
+	')
+
+	can_exec($1, nsplugin_rw_t)
+')
--- nsaserefpolicy/policy/modules/apps/nsplugin.te	1969-12-31 19:00:00.000000000 -0500
+++ serefpolicy-3.5.5/policy/modules/apps/nsplugin.te	2008-08-25 10:50:15.000000000 -0400
@@ -0,0 +1,223 @@
+
+policy_module(nsplugin, 1.0.0)
+
+########################################
+#
+# Declarations
+#
+
+## <desc>
+## <p>
+## Allow nsplugin code to execmem/execstack
+## </p>
+## </desc>
+gen_tunable(allow_nsplugin_execmem, false)
+
+type nsplugin_exec_t;
+application_executable_file(nsplugin_exec_t)
+
+type nsplugin_config_exec_t;
+application_executable_file(nsplugin_config_exec_t)
+
+type nsplugin_rw_t;
+files_type(nsplugin_rw_t)
+
+type nsplugin_tmp_t;
+files_tmp_file(nsplugin_tmp_t)
+
+type nsplugin_home_t;
+files_poly_member(nsplugin_home_t)
+userdom_user_home_content(user, nsplugin_home_t)
+typealias nsplugin_home_t alias user_nsplugin_home_t;
+
+type nsplugin_t;
+type nsplugin_config_t;
+application_domain(nsplugin_t, nsplugin_exec_t)
+application_domain(nsplugin_config_t, nsplugin_config_exec_t)
+
+########################################
+#
+# nsplugin local policy
+#
+allow nsplugin_t self:fifo_file rw_file_perms;
+allow nsplugin_t self:process { ptrace getsched setsched signal_perms };
+
+allow nsplugin_t self:sem create_sem_perms;
+allow nsplugin_t self:shm create_shm_perms;
+allow nsplugin_t self:msgq create_msgq_perms;
+allow nsplugin_t self:unix_stream_socket { connectto create_stream_socket_perms };
+
+tunable_policy(`allow_nsplugin_execmem',`
+	allow nsplugin_t self:process { execstack execmem };
+	allow nsplugin_config_t self:process { execstack execmem };
+')
+	
+manage_dirs_pattern(nsplugin_t, nsplugin_home_t, nsplugin_home_t)
+exec_files_pattern(nsplugin_t, nsplugin_home_t, nsplugin_home_t)
+manage_files_pattern(nsplugin_t, nsplugin_home_t, nsplugin_home_t)
+manage_lnk_files_pattern(nsplugin_t, nsplugin_home_t, nsplugin_home_t)
+userdom_user_home_dir_filetrans(user, nsplugin_t, nsplugin_home_t, {file dir})
+unprivuser_dontaudit_write_home_content_files(nsplugin_t)
+
+corecmd_exec_bin(nsplugin_t)
+corecmd_exec_shell(nsplugin_t)
+
+corenet_all_recvfrom_unlabeled(nsplugin_t)
+corenet_all_recvfrom_netlabel(nsplugin_t)
+corenet_tcp_connect_flash_port(nsplugin_t)
+corenet_tcp_connect_pulseaudio_port(nsplugin_t)
+corenet_tcp_connect_http_port(nsplugin_t)
+corenet_tcp_sendrecv_generic_if(nsplugin_t)
+corenet_tcp_sendrecv_all_nodes(nsplugin_t)
+
+domain_dontaudit_read_all_domains_state(nsplugin_t)
+
+dev_read_rand(nsplugin_t)
+dev_read_sound(nsplugin_t)
+dev_write_sound(nsplugin_t)
+dev_read_video_dev(nsplugin_t)
+dev_write_video_dev(nsplugin_t)
+dev_getattr_dri_dev(nsplugin_t)
+
+kernel_read_kernel_sysctls(nsplugin_t)
+kernel_read_system_state(nsplugin_t)
+
+files_read_usr_files(nsplugin_t)
+files_read_etc_files(nsplugin_t)
+files_read_config_files(nsplugin_t)
+
+fs_list_inotifyfs(nsplugin_t)
+fs_manage_tmpfs_files(nsplugin_t)
+fs_getattr_tmpfs(nsplugin_t)
+fs_getattr_xattr_fs(nsplugin_t)
+
+term_dontaudit_getattr_all_user_ptys(nsplugin_t)
+term_dontaudit_getattr_all_user_ttys(nsplugin_t)
+
+auth_use_nsswitch(nsplugin_t)
+
+libs_use_ld_so(nsplugin_t)
+libs_use_shared_libs(nsplugin_t)
+libs_exec_ld_so(nsplugin_t)
+
+miscfiles_read_localization(nsplugin_t)
+miscfiles_read_fonts(nsplugin_t)
+
+unprivuser_manage_tmp_dirs(nsplugin_t)
+unprivuser_manage_tmp_files(nsplugin_t)
+unprivuser_manage_tmp_sockets(nsplugin_t)
+userdom_tmp_filetrans_user_tmp(user, nsplugin_t, { file dir sock_file })
+unprivuser_read_tmpfs_files(nsplugin_t)
+unprivuser_rw_semaphores(nsplugin_t)
+unprivuser_delete_tmpfs_files(nsplugin_t)
+
+unprivuser_read_home_content_symlinks(nsplugin_t)
+unprivuser_read_home_content_files(nsplugin_t)
+unprivuser_read_tmp_files(nsplugin_t)
+userdom_write_user_tmp_sockets(user, nsplugin_t)
+unprivuser_dontaudit_append_home_content_files(nsplugin_t)
+userdom_dontaudit_manage_user_tmp_files(user, nsplugin_t)
+
+optional_policy(`
+	alsa_read_rw_config(nsplugin_t)
+')
+
+optional_policy(`
+	gnome_exec_gconf(nsplugin_t)
+	gnome_manage_user_gnome_config(user, nsplugin_t)
+	allow nsplugin_t gnome_home_t:sock_file write;
+')
+
+optional_policy(`
+	mozilla_read_user_home_files(user, nsplugin_t)
+	mozilla_write_user_home_files(user, nsplugin_t)
+')
+
+optional_policy(`
+	mplayer_exec(nsplugin_t)
+')
+
+optional_policy(`
+	unconfined_execmem_signull(nsplugin_t)
+	unconfined_delete_tmpfs_files(nsplugin_t)
+')
+
+optional_policy(`
+	xserver_stream_connect_xdm_xserver(nsplugin_t)
+	xserver_xdm_rw_shm(nsplugin_t)
+	xserver_read_xdm_tmp_files(nsplugin_t)
+	xserver_read_xdm_pid(nsplugin_t)
+	xserver_read_user_xauth(user, nsplugin_t)
+	xserver_use_user_fonts(user, nsplugin_t)
+	xserver_manage_home_fonts(nsplugin_t)
+	xserver_dontaudit_rw_xdm_home_files(nsplugin_t)
+')
+
+########################################
+#
+# nsplugin_config local policy
+#
+
+allow nsplugin_config_t self:capability { sys_nice setuid setgid };
+allow nsplugin_config_t self:process { setsched sigkill getsched execmem };
+#execing pulseaudio
+dontaudit nsplugin_t self:process { getcap setcap };
+
+allow nsplugin_config_t self:fifo_file rw_file_perms;
+allow nsplugin_config_t self:unix_stream_socket create_stream_socket_perms;
+
+fs_list_inotifyfs(nsplugin_config_t)
+
+can_exec(nsplugin_config_t, nsplugin_rw_t)
+manage_dirs_pattern(nsplugin_config_t, nsplugin_rw_t, nsplugin_rw_t)
+manage_files_pattern(nsplugin_config_t, nsplugin_rw_t, nsplugin_rw_t)
+manage_lnk_files_pattern(nsplugin_config_t, nsplugin_rw_t, nsplugin_rw_t)
+
+manage_dirs_pattern(nsplugin_config_t, nsplugin_home_t, nsplugin_home_t)
+manage_files_pattern(nsplugin_config_t, nsplugin_home_t, nsplugin_home_t)
+manage_lnk_files_pattern(nsplugin_config_t, nsplugin_home_t, nsplugin_home_t)
+
+corecmd_exec_bin(nsplugin_config_t)
+corecmd_exec_shell(nsplugin_config_t)
+
+kernel_read_system_state(nsplugin_config_t)
+
+files_read_etc_files(nsplugin_config_t)
+files_read_usr_files(nsplugin_config_t)
+files_dontaudit_search_home(nsplugin_config_t)
+files_list_tmp(nsplugin_config_t)
+
+auth_use_nsswitch(nsplugin_config_t)
+
+libs_use_ld_so(nsplugin_config_t)
+libs_use_shared_libs(nsplugin_config_t)
+
+miscfiles_read_localization(nsplugin_config_t)
+miscfiles_read_fonts(nsplugin_config_t)
+
+userdom_search_all_users_home_content(nsplugin_config_t)
+
+tunable_policy(`use_nfs_home_dirs',`
+	fs_manage_nfs_dirs(nsplugin_t)
+	fs_manage_nfs_files(nsplugin_t)
+	fs_manage_nfs_dirs(nsplugin_config_t)
+	fs_manage_nfs_files(nsplugin_config_t)
+')
+
+tunable_policy(`use_samba_home_dirs',`
+	fs_manage_cifs_dirs(nsplugin_t)
+	fs_manage_cifs_files(nsplugin_t)
+	fs_manage_cifs_dirs(nsplugin_config_t)
+	fs_manage_cifs_files(nsplugin_config_t)
+')
+
+domtrans_pattern(nsplugin_config_t, nsplugin_exec_t, nsplugin_t)
+
+optional_policy(`
+	xserver_read_home_fonts(nsplugin_config_t)
+')
+
+optional_policy(`
+	mozilla_read_user_home_files(user, nsplugin_config_t)
+')
+
--- nsaserefpolicy/policy/modules/kernel/corenetwork.te.in	2008-08-11 11:23:34.000000000 -0400
+++ serefpolicy-3.5.5/policy/modules/kernel/corenetwork.te.in	2008-08-25 10:50:15.000000000 -0400
@@ -91,6 +93,7 @@
 network_port(distccd, tcp,3632,s0)
 network_port(dns, udp,53,s0, tcp,53,s0)
 network_port(fingerd, tcp,79,s0)
+network_port(flash, tcp,1935,s0, udp,1935,s0)
 network_port(ftp_data, tcp,20,s0)
 network_port(ftp, tcp,21,s0)
 network_port(gatekeeper, udp,1718,s0, udp,1719,s0, tcp,1721,s0, tcp,7000,s0)
