mirror of
https://github.com/projectatomic/bubblewrap.git
synced 2026-02-07 03:47:18 +01:00
This allows environment variables to be set when running bwrap itself (perhaps a custom LD_LIBRARY_PATH), but cleared for the command that runs in the container, without having to enumerate all the variables. Because PWD is set later, as a side-effect of changing directory, this actually clears everything except PWD. A portable program would check for clearenv() (and if not found, fall back to using environ = NULL), but bubblewrap is Linux-specific, and Linux C libraries (at least glibc and musl) do have clearenv(). Signed-off-by: Simon McVittie <smcv@collabora.com>