aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/pulseaudio.c
diff options
context:
space:
mode:
authorLibravatar Topi Miettinen <toiwoton@gmail.com>2020-02-18 20:38:00 +0200
committerLibravatar Topi Miettinen <topimiettinen@users.noreply.github.com>2020-02-22 08:27:24 +0000
commit1ad2d54c014a49f6ad0b487dd0d9b361cb4d299e (patch)
tree415eb19d90e2ed1de7236c784c1e28d3acfbcaab /src/firejail/pulseaudio.c
parentWhitelist more /usr/share for okular and others (diff)
downloadfirejail-1ad2d54c014a49f6ad0b487dd0d9b361cb4d299e.tar.gz
firejail-1ad2d54c014a49f6ad0b487dd0d9b361cb4d299e.tar.zst
firejail-1ad2d54c014a49f6ad0b487dd0d9b361cb4d299e.zip
Add support for SELinux labeling
Running `firejail --noprofile --private-bin=bash,ls ls -1Za /usr/bin` shows that the SELinux labels are not correct: ``` user_u:object_r:user_tmpfs_t:s0 . system_u:object_r:usr_t:s0 .. user_u:object_r:user_tmpfs_t:s0 bash user_u:object_r:user_tmpfs_t:s0 ls ``` After fixing this: ``` system_u:object_r:bin_t:s0 . system_u:object_r:usr_t:s0 .. system_u:object_r:shell_exec_t:s0 bash system_u:object_r:bin_t:s0 ls ``` Most copied files and created directories should now have correct labels (bind mounted objects keep their labels). This is useful to avoid having to change the SELinux rules when using Firejail.
Diffstat (limited to 'src/firejail/pulseaudio.c')
-rw-r--r--src/firejail/pulseaudio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/firejail/pulseaudio.c b/src/firejail/pulseaudio.c
index 57095a53c..a8fb838ab 100644
--- a/src/firejail/pulseaudio.c
+++ b/src/firejail/pulseaudio.c
@@ -87,6 +87,7 @@ void pulseaudio_init(void) {
87 // create the new user pulseaudio directory 87 // create the new user pulseaudio directory
88 if (mkdir(RUN_PULSE_DIR, 0700) == -1) 88 if (mkdir(RUN_PULSE_DIR, 0700) == -1)
89 errExit("mkdir"); 89 errExit("mkdir");
90 selinux_relabel_path(RUN_PULSE_DIR, RUN_PULSE_DIR);
90 // mount it nosuid, noexec, nodev 91 // mount it nosuid, noexec, nodev
91 fs_remount(RUN_PULSE_DIR, MOUNT_NOEXEC, 0); 92 fs_remount(RUN_PULSE_DIR, MOUNT_NOEXEC, 0);
92 93