Skip to contentSkip to conversation

Allow openvpn temporary files

PATCH New Sven Vermeulen 2 participants 2 messages May 9, 2013 – May 14, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow openvpn temporary files

When launching OpenVPN, it fails to start and the following error is displayed in the openvpn.log file:

Options error: Temporary directory (--tmp-dir) fails with '/tmp': Permission denied

The AVC denial shows an attempt to read/write/search in tmp_t directory. A quick check through the code does not show any attempts to create directories, only temporary file, so create an openvpn_tmp_t with the proper file transition towards it.

See also https://bugs.gentoo.org/show_bug.cgi?id=468636

---
 openvpn.te | 6 ++++++
 1 file changed, 6 insertions(+)
openvpn.te +6 -0
index ad85917..ac11789 100644
@@ -32,6 +32,9 @@ init_script_file(openvpn_initrc_exec_t)
 type openvpn_status_t;
 logging_log_file(openvpn_status_t)
 
+type openvpn_tmp_t;
+files_tmp_file(openvpn_tmp_t)
+
 type openvpn_var_log_t;
 logging_log_file(openvpn_var_log_t)
 
@@ -62,6 +65,9 @@ filetrans_pattern(openvpn_t, openvpn_etc_t, openvpn_etc_rw_t, file)
 allow openvpn_t openvpn_status_t:file manage_file_perms;
 logging_log_filetrans(openvpn_t, openvpn_status_t, file, "openvpn-status.log")
 
+allow openvpn_t openvpn_tmp_t:file manage_file_perms;
+files_tmp_filetrans(openvpn_t, openvpn_tmp_t, file)
+
 manage_dirs_pattern(openvpn_t, openvpn_var_log_t, openvpn_var_log_t)
 append_files_pattern(openvpn_t, openvpn_var_log_t, openvpn_var_log_t)
 create_files_pattern(openvpn_t, openvpn_var_log_t, openvpn_var_log_t)
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 1/1 Allow openvpn temporary files

Quoted 6 lines · Sven Vermeulen

When launching OpenVPN, it fails to start and the following error is displayed in the openvpn.log file:

Options error: Temporary directory (--tmp-dir) fails with '/tmp': Permission denied

Quoted 6 lines

The AVC denial shows an attempt to read/write/search in tmp_t directory. A quick check through the code does not show any attempts to create directories, only temporary file, so create an openvpn_tmp_t with the proper file transition towards it.

See also https://bugs.gentoo.org/show_bug.cgi?id=468636

Merged.

Quoted 30 lines
---
 openvpn.te | 6 ++++++
 1 file changed, 6 insertions(+)
openvpn.te +6 -0
index ad85917..ac11789 100644
@@ -32,6 +32,9 @@ init_script_file(openvpn_initrc_exec_t)
 type openvpn_status_t;
 logging_log_file(openvpn_status_t)
 
+type openvpn_tmp_t;
+files_tmp_file(openvpn_tmp_t)
+
 type openvpn_var_log_t;
 logging_log_file(openvpn_var_log_t)
 
@@ -62,6 +65,9 @@ filetrans_pattern(openvpn_t, openvpn_etc_t, openvpn_etc_rw_t, file)
 allow openvpn_t openvpn_status_t:file manage_file_perms;
 logging_log_filetrans(openvpn_t, openvpn_status_t, file, "openvpn-status.log")
 
+allow openvpn_t openvpn_tmp_t:file manage_file_perms;
+files_tmp_filetrans(openvpn_t, openvpn_tmp_t, file)
+
 manage_dirs_pattern(openvpn_t, openvpn_var_log_t, openvpn_var_log_t)
 append_files_pattern(openvpn_t, openvpn_var_log_t, openvpn_var_log_t)
 create_files_pattern(openvpn_t, openvpn_var_log_t, openvpn_var_log_t)
Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com