aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/restricted_shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firejail/restricted_shell.c')
-rw-r--r--src/firejail/restricted_shell.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/firejail/restricted_shell.c b/src/firejail/restricted_shell.c
index da4e9d332..ee6e94957 100644
--- a/src/firejail/restricted_shell.c
+++ b/src/firejail/restricted_shell.c
@@ -61,7 +61,20 @@ int restricted_shell(const char *user) {
61 ptr = strchr(args, '\n'); 61 ptr = strchr(args, '\n');
62 if (ptr) 62 if (ptr)
63 *ptr = '\0'; 63 *ptr = '\0';
64 64
65 // if nothing follows, continue
66 char *ptr2 = args;
67 int found = 0;
68 while (*ptr2 != '\0') {
69 if (*ptr2 != ' ' && *ptr2 != '\t') {
70 found = 1;
71 break;
72 }
73 }
74 if (!found)
75 continue;
76
77 // process user
65 if (strcmp(user, usr) == 0) { 78 if (strcmp(user, usr) == 0) {
66 restricted_user = strdup(user); 79 restricted_user = strdup(user);
67 // extract program arguments 80 // extract program arguments