diff options
author | smitsohu <smitsohu@gmail.com> | 2020-12-22 17:14:41 +0100 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2020-12-22 17:14:41 +0100 |
commit | 91588630ebe436e0586c6234ffda518ebd8501aa (patch) | |
tree | f69226b1d9b522409100bc08a6ecf49ed8366f5d /src/firejail/main.c | |
parent | noroot option: create mapping of firejail group (diff) | |
download | firejail-91588630ebe436e0586c6234ffda518ebd8501aa.tar.gz firejail-91588630ebe436e0586c6234ffda518ebd8501aa.tar.zst firejail-91588630ebe436e0586c6234ffda518ebd8501aa.zip |
rework previous commit 45c28b808df9529aca32fdd755ac14e8101af3c1
Diffstat (limited to 'src/firejail/main.c')
-rw-r--r-- | src/firejail/main.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c index babeac1ef..544bfe83a 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -864,13 +864,12 @@ char *guess_shell(void) { | |||
864 | char *shell = NULL; | 864 | char *shell = NULL; |
865 | struct stat s; | 865 | struct stat s; |
866 | 866 | ||
867 | if (!login_shell) { // if firejail is the login shell, SHELL is set to path of firejail executable | 867 | shell = getenv("SHELL"); |
868 | shell = getenv("SHELL"); | 868 | if (shell) { |
869 | if (shell) { | 869 | invalid_filename(shell, 0); // no globbing |
870 | invalid_filename(shell, 0); // no globbing | 870 | if (!is_dir(shell) && strstr(shell, "..") == NULL && stat(shell, &s) == 0 && access(shell, X_OK) == 0 && |
871 | if (!is_dir(shell) && strstr(shell, "..") == NULL && stat(shell, &s) == 0 && access(shell, X_OK) == 0) | 871 | strcmp(shell, PATH_FIREJAIL) != 0) |
872 | return shell; | 872 | return shell; |
873 | } | ||
874 | } | 873 | } |
875 | 874 | ||
876 | // shells in order of preference | 875 | // shells in order of preference |