diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/kernel/corenetwork.te.in serefpolicy-3.5.13/policy/modules/kernel/corenetwork.te.in
--- nsaserefpolicy/policy/modules/kernel/corenetwork.te.in	2009-03-06 16:18:36.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/kernel/corenetwork.te.in	2009-03-06 16:20:06.000000000 +0100
@@ -107,6 +107,7 @@
 network_port(gatekeeper, udp,1718,s0, udp,1719,s0, tcp,1721,s0, tcp,7000,s0)
 network_port(giftd, tcp,1213,s0)
 network_port(gopher, tcp,70,s0, udp,70,s0)
+network_port(gpsd,tcp,2947,s0)
 network_port(http_cache, tcp,3128,s0, udp,3130,s0, tcp,8080,s0, tcp,8118,s0) # 8118 is for privoxy
 portcon tcp 10001-10010 gen_context(system_u:object_r:http_cache_port_t, s0)
 network_port(http, tcp,80,s0, tcp,443,s0, tcp,488,s0, tcp,8008,s0, tcp,8009,s0, tcp,8443,s0) #8443 is mod_nss default port
diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/gpsd.fc serefpolicy-3.5.13/policy/modules/services/gpsd.fc
--- nsaserefpolicy/policy/modules/services/gpsd.fc	1970-01-01 01:00:00.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/services/gpsd.fc	2009-03-06 16:20:37.000000000 +0100
@@ -0,0 +1,3 @@
+
+/usr/sbin/gpsd                 --      gen_context(system_u:object_r:gpsd_exec_t,s0)
+
diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/gpsd.if serefpolicy-3.5.13/policy/modules/services/gpsd.if
--- nsaserefpolicy/policy/modules/services/gpsd.if	1970-01-01 01:00:00.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/services/gpsd.if	2009-03-06 16:46:46.000000000 +0100
@@ -0,0 +1,89 @@
+## <summary>gpsd monitor daemon</summary>
+
+########################################
+## <summary>
+##      Execute a domain transition to run gpsd.
+## </summary>
+## <param name="domain">
+## <summary>
+##      Domain allowed to transition.
+## </summary>
+## </param>
+#
+interface(`gpsd_domtrans',`
+        gen_require(`
+                type gpsd_t, gpsd_exec_t;
+        ')
+
+        domtrans_pattern($1, gpsd_exec_t, gpsd_t)
+')
+
+########################################
+## <summary>
+##      Execute gpsd in the gpsd domain, and
+##      allow the specified role the gpsd domain.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      Domain allowed access
+##      </summary>
+## </param>
+## <param name="role">
+##      <summary>
+##      The role to be allowed the gpsd domain.
+##      </summary>
+## </param>
+## <param name="terminal">
+##      <summary>
+##      The type of the role's terminal.
+##      </summary>
+## </param>
+#
+interface(`gpsd_run',`
+        gen_require(`
+                type gpsd_t;
+        ')
+
+        gpsd_domtrans($1)
+        role $2 types gpsd_t;
+        allow gpsd_t $3:chr_file rw_term_perms;
+')
+
+########################################
+## <summary>    
+##      Read and write to gpsd shared memory.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      The type of the process performing this action.
+##      </summary>
+## </param>
+#
+interface(`gpsd_rw_shm',`
+        gen_require(`
+                type gpsd_t;
+        ')
+
+        allow $1 gpsd_t:shm rw_shm_perms;
+')
+
+########################################
+## <summary>
+##      Read/write gpsd tmpfs files.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      The type of the process performing this action.
+##      </summary>
+## </param>
+#
+interface(`gpsd_rw_tmpfs_files',`
+        gen_require(`
+                type gpsd_tmpfs_t;
+        ')
+
+        fs_search_tmpfs($1)
+        allow $1 gpsd_tmpfs_t:dir list_dir_perms;
+        rw_files_pattern($1, gpsd_tmpfs_t, gpsd_tmpfs_t)
+        read_lnk_files_pattern($1, gpsd_tmpfs_t, gpsd_tmpfs_t)
+')
diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/gpsd.te serefpolicy-3.5.13/policy/modules/services/gpsd.te
--- nsaserefpolicy/policy/modules/services/gpsd.te	1970-01-01 01:00:00.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/services/gpsd.te	2009-03-06 16:52:20.000000000 +0100
@@ -0,0 +1,55 @@
+policy_module(gpsd,1.0.0)
+
+########################################
+#
+# Declarations
+#
+
+type gpsd_t;
+type gpsd_exec_t;
+application_domain(gpsd_t, gpsd_exec_t)
+role system_r types gpsd_t;
+
+type gpsd_tmpfs_t;
+files_tmpfs_file(gpsd_tmpfs_t)
+
+########################################
+#
+# gpsd local policy
+#
+
+allow gpsd_t self:capability { setuid sys_nice setgid fowner };
+allow gpsd_t self:process setsched;
+allow gpsd_t self:shm create_shm_perms;
+allow gpsd_t self:unix_dgram_socket { create_socket_perms sendto };
+allow gpsd_t self:tcp_socket create_stream_socket_perms;
+
+manage_dirs_pattern(gpsd_t, gpsd_tmpfs_t, gpsd_tmpfs_t)
+manage_files_pattern(gpsd_t, gpsd_tmpfs_t, gpsd_tmpfs_t)
+fs_tmpfs_filetrans(gpsd_t, gpsd_tmpfs_t, { dir file })
+
+corenet_tcp_bind_all_nodes(gpsd_t)
+corenet_tcp_bind_gpsd_port(gpsd_t)
+
+term_use_unallocated_ttys(gpsd_t)
+term_setattr_unallocated_ttys(gpsd_t)
+
+auth_use_nsswitch(gpsd_t)
+
+libs_use_ld_so(gpsd_t)
+libs_use_shared_libs(gpsd_t)
+
+logging_send_syslog_msg(gpsd_t)
+
+miscfiles_read_localization(gpsd_t)
+
+optional_policy(`
+	ntpd_rw_shm(gpsd_t)
+	ntpd_rw_tmpfs_files(gpsd_t)
+')
+
+optional_policy(`
+        dbus_system_bus_client_template(gpsd, gpsd_t)
+')
+
+
diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/ntp.if serefpolicy-3.5.13/policy/modules/services/ntp.if
--- nsaserefpolicy/policy/modules/services/ntp.if	2009-03-06 16:18:36.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/services/ntp.if	2009-03-06 16:49:04.000000000 +0100
@@ -72,6 +72,45 @@
 	init_labeled_script_domtrans($1, ntpd_initrc_exec_t)
 ')
 
+#######################################
+## <summary>
+##      Read/write ntpdd tmpfs files.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      The type of the process performing this action.
+##      </summary>
+## </param>
+#
+interface(`ntpd_rw_tmpfs_files',`
+        gen_require(`
+                type ntpd_tmpfs_t;
+        ')
+
+        fs_search_tmpfs($1)
+        list_dirs_pattern($1,ntpd_tmpfs_t,ntpd_tmpfs_t)
+        rw_files_pattern($1, ntpd_tmpfs_t, ntpd_tmpfs_t)
+        read_lnk_files_pattern($1, ntpd_tmpfs_t, ntpd_tmpfs_t)
+')
+
+########################################
+## <summary>    
+##      Read and write to ntpd shared memory.
+## </summary>
+## <param name="domain">
+##      <summary>
+##      The type of the process performing this action.
+##      </summary>
+## </param>
+#
+interface(`ntpd_rw_shm',`
+        gen_require(`
+                type ntpd_t;
+        ')
+
+        allow $1 ntpd_t:shm rw_shm_perms;
+')
+
 ########################################
 ## <summary>
 ##	All of the rules required to administrate 
diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/services/ntp.te serefpolicy-3.5.13/policy/modules/services/ntp.te
--- nsaserefpolicy/policy/modules/services/ntp.te	2009-03-06 16:18:36.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/services/ntp.te	2009-03-06 16:48:00.000000000 +0100
@@ -25,6 +25,9 @@
 type ntpd_tmp_t;
 files_tmp_file(ntpd_tmp_t)
 
+type ntpd_tmpfs_t;
+files_tmpfs_file(ntpd_tmpfs_t)
+
 type ntpd_var_run_t;
 files_pid_file(ntpd_var_run_t)
 
@@ -64,6 +67,10 @@
 manage_files_pattern(ntpd_t, ntpd_tmp_t, ntpd_tmp_t)
 files_tmp_filetrans(ntpd_t, ntpd_tmp_t, { file dir })
 
+manage_dirs_pattern(ntpd_t, ntpd_tmpfs_t, ntpd_tmpfs_t)
+manage_files_pattern(ntpd_t, ntpd_tmpfs_t, ntpd_tmpfs_t)
+fs_tmpfs_filetrans(ntpd_t, ntpd_tmpfs_t, { dir file })
+
 manage_files_pattern(ntpd_t, ntpd_var_run_t, ntpd_var_run_t)
 files_pid_filetrans(ntpd_t, ntpd_var_run_t, file)
 
@@ -131,6 +138,11 @@
 ')
 
 optional_policy(`
+	gpsd_rw_shm(ntpd_t)
+	gpsd_rw_tmpfs_files(ntpd_t)
+')
+
+optional_policy(`
 	firstboot_dontaudit_use_fds(ntpd_t)
 	firstboot_dontaudit_rw_pipes(ntpd_t)
 	firstboot_dontaudit_rw_stream_sockets(ntpd_t)
diff --exclude-from=exclude -N -u -r nsaserefpolicy/policy/modules/system/unconfined.te serefpolicy-3.5.13/policy/modules/system/unconfined.te
--- nsaserefpolicy/policy/modules/system/unconfined.te	2009-03-06 16:18:37.000000000 +0100
+++ serefpolicy-3.5.13/policy/modules/system/unconfined.te	2009-03-06 16:49:59.000000000 +0100
@@ -183,6 +183,10 @@
 ')
 
 optional_policy(`
+        gpsd_run(unconfined_t, unconfined_r, { unconfined_tty_device_t unconfined_devpts_t })
+')
+
+optional_policy(`
 	iptables_run(unconfined_t, unconfined_r, { unconfined_devpts_t unconfined_tty_device_t })
 ')
 
