[PR #7079] [MERGED] bugfix: add localhost lines to /etc/hosts #6307

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

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/7079
Author: @kmk3
Created: 2/25/2026
Status: Merged
Merged: 2/26/2026
Merged by: @kmk3

Base: masterHead: hosts-add-localhost


📝 Commits (1)

  • 6f69d92 bugfix: add localhost lines to /etc/hosts

📊 Changes

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

View changed files

📝 src/firejail/fs_hostname.c (+2 -0)

📄 Description

Currently only the sandbox hostname is mapped to the default IP
addresses in /etc/hosts.

Default hosts file:

$ cat /etc/hosts
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1        localhost
::1              localhost

Before:

$ firejail --quiet --noprofile --hostname=foo cat /etc/hosts
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1 foo
::1 foo

After:

$ firejail --quiet --noprofile --hostname=foo cat /etc/hosts
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1 foo
127.0.0.1 localhost
::1 foo
::1 localhost

This is a follow-up to #7077.

Fixes #7048.

Reported-by: @liloman


🔄 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/7079 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 2/25/2026 **Status:** ✅ Merged **Merged:** 2/26/2026 **Merged by:** [@kmk3](https://github.com/kmk3) **Base:** `master` ← **Head:** `hosts-add-localhost` --- ### 📝 Commits (1) - [`6f69d92`](https://github.com/netblue30/firejail/commit/6f69d92bf31d3bebf0c2072e574f2bd1fd1f417c) bugfix: add localhost lines to /etc/hosts ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/fs_hostname.c` (+2 -0) </details> ### 📄 Description Currently only the sandbox hostname is mapped to the default IP addresses in /etc/hosts. Default hosts file: $ cat /etc/hosts # Static table lookup for hostnames. # See hosts(5) for details. 127.0.0.1 localhost ::1 localhost Before: $ firejail --quiet --noprofile --hostname=foo cat /etc/hosts # Static table lookup for hostnames. # See hosts(5) for details. 127.0.0.1 foo ::1 foo After: $ firejail --quiet --noprofile --hostname=foo cat /etc/hosts # Static table lookup for hostnames. # See hosts(5) for details. 127.0.0.1 foo 127.0.0.1 localhost ::1 foo ::1 localhost This is a follow-up to #7077. Fixes #7048. Reported-by: @liloman --- <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:54:31 -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#6307
No description provided.