diff options
author | Topi Miettinen <toiwoton@gmail.com> | 2020-10-15 23:28:32 +0300 |
---|---|---|
committer | Topi Miettinen <toiwoton@gmail.com> | 2020-10-16 21:54:04 +0300 |
commit | aabd38f4972de076354991ffda4f5ce5b7f59d7e (patch) | |
tree | c0595e81b9c870012ce9084f16ab0dc7d674318a /src/firejail/profile.c | |
parent | Merge pull request #3672 from hlein/fix-py-shebang (diff) | |
download | firejail-aabd38f4972de076354991ffda4f5ce5b7f59d7e.tar.gz firejail-aabd38f4972de076354991ffda4f5ce5b7f59d7e.tar.zst firejail-aabd38f4972de076354991ffda4f5ce5b7f59d7e.zip |
Apply --rmenv immediately to help to avoid the env var length check
Remove environment variables with --rmenv immediately. This fixes
removing long environment variables (LS_COLORS generated by vivid),
previously the length filter would trip before the command was
processed.
This changes user visible behavior slightly, for example --rmenv=LANG
now applies also to Firejail, while earlier it would only apply to
sandboxed program.
Partially fixes #3673, but not handling `rmenv` in profiles.
Also suggest --rmenv when there are problems with enviroment
variables.
Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
Diffstat (limited to 'src/firejail/profile.c')
-rw-r--r-- | src/firejail/profile.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/firejail/profile.c b/src/firejail/profile.c index 8c29fe81c..ed736521a 100644 --- a/src/firejail/profile.c +++ b/src/firejail/profile.c | |||
@@ -912,6 +912,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
912 | return 0; | 912 | return 0; |
913 | } | 913 | } |
914 | if (strncmp(ptr, "rmenv ", 6) == 0) { | 914 | if (strncmp(ptr, "rmenv ", 6) == 0) { |
915 | unsetenv(ptr + 6); // Remove also immediately from Firejail itself | ||
915 | env_store(ptr + 6, RMENV); | 916 | env_store(ptr + 6, RMENV); |
916 | return 0; | 917 | return 0; |
917 | } | 918 | } |