Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 468636

Summary: net-misc/openvpn-2.3.0 & sec-policy/selinux-openvpn-2.20120725-r12: missing /tmp type
Product: Gentoo Linux Reporter: Vincent Brillault <gentoo>
Component: SELinuxAssignee: Sven Vermeulen (RETIRED) <swift>
Status: RESOLVED FIXED    
Severity: normal CC: selinux
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard: sec-policy r2
Package list:
Runtime testing required: ---

Description Vincent Brillault 2013-05-05 08:49:08 UTC
The new openvpn seems to use /tmp. The following errors occur when starting it:
'''
 # /etc/init.d/openvpn start
 * Starting openvpn ...
 * start-stop-daemon: failed to start `/usr/sbin/openvpn'
 * Check your logs to see why startup failed      [ !! ]
 * ERROR: openvpn failed to start

==> openvpn.log <==
Options error: Temporary directory (--tmp-dir) fails with '/tmp': Permission denied

==> avc.log <==
...: avc:  denied  { read write search } for  pid=1613 comm="openvpn" name="/" dev="tmpfs" ino=3830 ipaddr=..... scontext=staff_u:system_r:openvpn_t tcontext=system_u:object_r:tmp_t tclass=dir
'''

A grep 'tmp_dir' in the openvpn source seems to reveal that no folder is created in tmp_dir, only files (calls to create_temp_file and check_file_access only). The following declarations are enough to make openvpn start:
'''
type openvpn_tmp_t;
files_tmp_file(openvpn_tmp_t);
manage_files_pattern(openvpn_t, openvpn_tmp_t, openvpn_tmp_t);
files_tmp_filetrans(openvpn_t, openvpn_tmp_t, file);
'''
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2013-06-23 10:06:50 UTC
Is in repo, will be in rev 2
Comment 2 Sven Vermeulen (RETIRED) gentoo-dev 2013-07-21 16:25:53 UTC
In repo, ~arch (rev 2 of the policies)
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2013-08-15 07:46:32 UTC
r2 is now stable