aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/main.c
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2020-12-22 17:14:41 +0100
committerLibravatar smitsohu <smitsohu@gmail.com>2020-12-22 17:14:41 +0100
commit91588630ebe436e0586c6234ffda518ebd8501aa (patch)
treef69226b1d9b522409100bc08a6ecf49ed8366f5d /src/firejail/main.c
parentnoroot option: create mapping of firejail group (diff)
downloadfirejail-91588630ebe436e0586c6234ffda518ebd8501aa.tar.gz
firejail-91588630ebe436e0586c6234ffda518ebd8501aa.tar.zst
firejail-91588630ebe436e0586c6234ffda518ebd8501aa.zip
Diffstat (limited to 'src/firejail/main.c')
-rw-r--r--src/firejail/main.c13
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