[PR #148] [MERGED] Add '"' chars around every argument passed to bash #3547

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

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/148
Author: @brunonova
Created: 11/18/2015
Status: Merged
Merged: 11/19/2015
Merged by: @netblue30

Base: masterHead: command-line-spaces


📝 Commits (1)

  • d647b36 Add '"' chars around every argument passed to bash

📊 Changes

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

View changed files

📝 src/firejail/main.c (+3 -2)

📄 Description

This seems to fix the problem with the spaces when a program is started through a shell (Bug #58).
Starting a program without using a shell is still working.

I haven't tested this thoroughly though, so I'm not sure if this causes any other problems.


However, spaces are not the only characters that can cause problems when starting a program through a shell.
If, for example, you open a file that contains " somewhere, it will probably fail.

So, to fully fix this, " characters will have to be escaped. Other characters, like \ and ! may also have to be escaped.
Or set "shell=none" as default, which would be even easier 😄 (but I suppose this is not the default for a reason).


🔄 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/148 **Author:** [@brunonova](https://github.com/brunonova) **Created:** 11/18/2015 **Status:** ✅ Merged **Merged:** 11/19/2015 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `command-line-spaces` --- ### 📝 Commits (1) - [`d647b36`](https://github.com/netblue30/firejail/commit/d647b36609ecd1dfa2da7130628482aae9ed0321) Add '"' chars around every argument passed to bash ### 📊 Changes **1 file changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/main.c` (+3 -2) </details> ### 📄 Description This seems to fix the problem with the spaces when a program is started through a shell (Bug #58). Starting a program without using a shell is still working. I haven't tested this thoroughly though, so I'm not sure if this causes any other problems. --- However, spaces are not the only characters that can cause problems when starting a program through a shell. If, for example, you open a file that contains `"` somewhere, it will probably fail. So, to fully fix this, `"` characters will have to be escaped. Other characters, like `\` and `!` may also have to be escaped. _Or_ set "shell=none" as default, which would be even easier :smile: (but I suppose this is not the default for a reason). --- <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:03:26 -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#3547
No description provided.