samples/landlock: Don't error out if a file path cannot be opened
authorMickaël Salaün <mic@digikod.net>
Thu, 7 Mar 2024 14:38:49 +0000 (15:38 +0100)
committerMickaël Salaün <mic@digikod.net>
Fri, 8 Mar 2024 17:22:18 +0000 (18:22 +0100)
commita17c60e533f5cd832e77e0d194e2e0bb663371b6
treed2a4b12d955317dabd160c103970c0f811211901
parent63817febd1f3c27f633b2bce0d6db328e59fd019
samples/landlock: Don't error out if a file path cannot be opened

Instead of creating a hard error and aborting the sandbox creation,
accept file path not usable in the LL_FS_RO and LL_FS_RW environment
variables but only print a warning.  This makes it easier to test, for
instance with LL_FS_RO="${PATH}:/usr/lib:/lib"

Print that we are going to execute the command in the sandbox before
doing so.

Rename "launch" to "execute", and improve header description.

Reviewed-by: Günther Noack <gnoack@google.com>
Link: https://lore.kernel.org/r/20240307143849.1517218-1-mic@digikod.net
[mic: Improve header description as suggested by Günther]
Signed-off-by: Mickaël Salaün <mic@digikod.net>
samples/landlock/sandboxer.c