diff options
author | Topi Miettinen <toiwoton@gmail.com> | 2020-02-18 20:38:00 +0200 |
---|---|---|
committer | Topi Miettinen <topimiettinen@users.noreply.github.com> | 2020-02-22 08:27:24 +0000 |
commit | 1ad2d54c014a49f6ad0b487dd0d9b361cb4d299e (patch) | |
tree | 415eb19d90e2ed1de7236c784c1e28d3acfbcaab /configure.ac | |
parent | Whitelist more /usr/share for okular and others (diff) | |
download | firejail-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 'configure.ac')
-rw-r--r-- | configure.ac | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 8ee2fbadc..3c9f901cb 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -184,6 +184,15 @@ AS_IF([test "x$enable_contrib_install" = "xno"], | |||
184 | ) | 184 | ) |
185 | AC_SUBST(HAVE_CONTRIB_INSTALL) | 185 | AC_SUBST(HAVE_CONTRIB_INSTALL) |
186 | 186 | ||
187 | HAVE_SELINUX="" | ||
188 | AC_ARG_ENABLE([selinux], | ||
189 | AS_HELP_STRING([--enable-selinux], [SELinux labeling support])) | ||
190 | AS_IF([test "x$enable_selinux" = "xyes"], [ | ||
191 | HAVE_SELINUX="-DHAVE_SELINUX" | ||
192 | EXTRA_LDFLAGS+=" -lselinux " | ||
193 | AC_SUBST(HAVE_SELINUX) | ||
194 | ]) | ||
195 | |||
187 | # checking pthread library | 196 | # checking pthread library |
188 | AC_CHECK_LIB([pthread], [main], [], AC_MSG_ERROR([*** POSIX thread support not installed ***])) | 197 | AC_CHECK_LIB([pthread], [main], [], AC_MSG_ERROR([*** POSIX thread support not installed ***])) |
189 | AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed ***])) | 198 | AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed ***])) |
@@ -223,5 +232,6 @@ echo " EXTRA_CFLAGS: $EXTRA_CFLAGS" | |||
223 | echo " fatal warnings: $HAVE_FATAL_WARNINGS" | 232 | echo " fatal warnings: $HAVE_FATAL_WARNINGS" |
224 | echo " Gcov instrumentation: $HAVE_GCOV" | 233 | echo " Gcov instrumentation: $HAVE_GCOV" |
225 | echo " Install contrib scripts: $HAVE_CONTRIB_INSTALL" | 234 | echo " Install contrib scripts: $HAVE_CONTRIB_INSTALL" |
235 | echo " SELinux labeling support: $HAVE_SELINUX" | ||
226 | echo " Install as a SUID executable: $HAVE_SUID" | 236 | echo " Install as a SUID executable: $HAVE_SUID" |
227 | echo | 237 | echo |