[PR #2712] [MERGED] Add private-cwd option to control working directory within jail #4492

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

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/2712
Author: @apmorton
Created: 5/20/2019
Status: Merged
Merged: 5/24/2019
Merged by: @smitsohu

Base: masterHead: features/private-cwd


📝 Commits (1)

  • 99a9f8d Add private-cwd option to control working directory within jail

📊 Changes

10 files changed (+155 additions, -1 deletions)

View changed files

📝 src/firejail/firejail.h (+3 -0)
📝 src/firejail/fs_home.c (+15 -0)
📝 src/firejail/main.c (+15 -0)
📝 src/firejail/profile.c (+13 -1)
📝 src/firejail/sandbox.c (+4 -0)
📝 src/firejail/usage.c (+2 -0)
📝 src/man/firejail-profile.txt (+6 -0)
📝 src/man/firejail.txt (+42 -0)
📝 test/fs/fs.sh (+3 -0)
test/fs/private-cwd.exp (+52 -0)

📄 Description

Main motivating use case for this patch is within compiler-explorer.

We want to use relative paths in profile include statements, which requires a specific working directory when launching firejail.

However, we also need to ensure the application within firejail runs in another working directory.

--private-cwd causes the jail to change to the users home directory
--private-cwd=/path causes the jail to change to the specified directory once inside the filesystem namespace of the jail


🔄 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/2712 **Author:** [@apmorton](https://github.com/apmorton) **Created:** 5/20/2019 **Status:** ✅ Merged **Merged:** 5/24/2019 **Merged by:** [@smitsohu](https://github.com/smitsohu) **Base:** `master` ← **Head:** `features/private-cwd` --- ### 📝 Commits (1) - [`99a9f8d`](https://github.com/netblue30/firejail/commit/99a9f8d680ea5a613506d5f0a1804bf97a5d69f3) Add private-cwd option to control working directory within jail ### 📊 Changes **10 files changed** (+155 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/firejail.h` (+3 -0) 📝 `src/firejail/fs_home.c` (+15 -0) 📝 `src/firejail/main.c` (+15 -0) 📝 `src/firejail/profile.c` (+13 -1) 📝 `src/firejail/sandbox.c` (+4 -0) 📝 `src/firejail/usage.c` (+2 -0) 📝 `src/man/firejail-profile.txt` (+6 -0) 📝 `src/man/firejail.txt` (+42 -0) 📝 `test/fs/fs.sh` (+3 -0) ➕ `test/fs/private-cwd.exp` (+52 -0) </details> ### 📄 Description Main motivating use case for this patch is within [compiler-explorer](https://github.com/mattgodbolt/compiler-explorer). We want to use relative paths in profile include statements, which requires a specific working directory when launching firejail. However, we also need to ensure the application *within* firejail runs in another working directory. `--private-cwd` causes the jail to change to the users home directory `--private-cwd=/path` causes the jail to change to the specified directory once inside the filesystem namespace of the jail --- <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:21:09 -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#4492
No description provided.