[PR #3664] [MERGED] Allowing links in netns #4840

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

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/3664
Author: @dpellegr
Created: 10/12/2020
Status: Merged
Merged: 10/13/2020
Merged by: @netblue30

Base: masterHead: master


📝 Commits (1)

📊 Changes

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

View changed files

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

📄 Description

Hello,

In Linux it is possible to expose the network of a Docker container as a network namespace of the host with the following commands:

NAME="my_container"
pid="$(docker inspect -f '{{.State.Pid}}' "$NAME")"
mkdir -p /var/run/netns
ln -nsf "/proc/$pid/ns/net" "/var/run/netns/$NAME"

However, since that is created as a symlink (and it is not a regular file), Firejail fails to recognize it:

$ /usr/bin/firejail --noprofile --netns=my_container /usr/bin/firefox
Error: invalid netns 'my_container' (/var/run/netns/my_container: not a regular file)

This tiny PR allows using symlinks as arguments of the netns option.


🔄 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/3664 **Author:** [@dpellegr](https://github.com/dpellegr) **Created:** 10/12/2020 **Status:** ✅ Merged **Merged:** 10/13/2020 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`915f279`](https://github.com/netblue30/firejail/commit/915f279a90a7493b4cd6e27314af6dab66c998ba) allowing links in netns ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/netns.c` (+1 -1) </details> ### 📄 Description Hello, In Linux it is possible to expose the network of a Docker container as a network namespace of the host with the following commands: ``` NAME="my_container" pid="$(docker inspect -f '{{.State.Pid}}' "$NAME")" mkdir -p /var/run/netns ln -nsf "/proc/$pid/ns/net" "/var/run/netns/$NAME" ``` However, since that is created as a symlink (and it is not a regular file), Firejail fails to recognize it: ``` $ /usr/bin/firejail --noprofile --netns=my_container /usr/bin/firefox Error: invalid netns 'my_container' (/var/run/netns/my_container: not a regular file) ``` This tiny PR allows using symlinks as arguments of the `netns` option. --- <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:27:32 -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#4840
No description provided.