[PR #38] [MERGED] Fix arguments passed to child process during execvp in --shell=none mode #3520

Closed
opened 2026-05-05 10:02:56 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/38
Author: @ghost
Created: 8/20/2015
Status: Merged
Merged: 8/21/2015
Merged by: @netblue30

Base: masterHead: shell-none-args


📝 Commits (1)

  • 6277509 Fix arguments passed to child process during execvp in --shell=none mode

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/firejail/sandbox.c (+1 -1)

📄 Description

Without this patch, firejail handles arguments differently in --shell=none mode. For example, this is a normal command:

$ firejail --debug /bin/echo 1 2 3
...
Starting /bin/echo 1 2 3 
execvp argument 0: /bin/bash
execvp argument 1: -c
execvp argument 2: /bin/echo 1 2 3 
Child process initialized
1 2 3

But when you execute it with --shell=none, it drops the first argument, and only "2 3" is printed:

firejail --debug --shell=none /bin/echo 1 2 3
...
execvp argument 0: /bin/echo
execvp argument 1: 1
execvp argument 2: 2
execvp argument 3: 3
Child process initialized
2 3

This patch makes the --shell=none command work the same as a normal command:

firejail --debug --shell=none /bin/echo 1 2 3
...
execvp argument 0: /bin/echo
execvp argument 1: 1
execvp argument 2: 2
execvp argument 3: 3
Child process initialized
1 2 3

This does mean that existing scripts that use --shell=none will have to be changed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/38 **Author:** [@ghost](https://github.com/ghost) **Created:** 8/20/2015 **Status:** ✅ Merged **Merged:** 8/21/2015 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `shell-none-args` --- ### 📝 Commits (1) - [`6277509`](https://github.com/netblue30/firejail/commit/6277509c3ad62a383a09415e5b8dcaa0a450c966) Fix arguments passed to child process during execvp in --shell=none mode ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/sandbox.c` (+1 -1) </details> ### 📄 Description Without this patch, firejail handles arguments differently in `--shell=none` mode. For example, this is a normal command: ``` $ firejail --debug /bin/echo 1 2 3 ... Starting /bin/echo 1 2 3 execvp argument 0: /bin/bash execvp argument 1: -c execvp argument 2: /bin/echo 1 2 3 Child process initialized 1 2 3 ``` But when you execute it with `--shell=none`, it drops the first argument, and only "2 3" is printed: ``` firejail --debug --shell=none /bin/echo 1 2 3 ... execvp argument 0: /bin/echo execvp argument 1: 1 execvp argument 2: 2 execvp argument 3: 3 Child process initialized 2 3 ``` This patch makes the `--shell=none` command work the same as a normal command: ``` firejail --debug --shell=none /bin/echo 1 2 3 ... execvp argument 0: /bin/echo execvp argument 1: 1 execvp argument 2: 2 execvp argument 3: 3 Child process initialized 1 2 3 ``` This does mean that existing scripts that use `--shell=none` will have to be changed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:02:56 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#3520
No description provided.