Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process: Unshare UTS namespace, and set hostname to 'localhost' #539

Closed
wants to merge 1 commit into from

Conversation

mgorny
Copy link
Member

@mgorny mgorny commented Mar 27, 2020

Use UTS namespace to override hostname when network-sandbox is enabled.
Set it to 'localhost' as that has a better chance of being present
in /etc/hosts. This fixes tests in some packages that try to connect
to localhost via hostname obtained using gethostname(), e.g. docker-py,
and suffer resolution problems due to the system hostname not being
defined in /etc/hosts.

@mgorny mgorny requested a review from zmedico March 27, 2020 15:18
@mgorny
Copy link
Member Author

mgorny commented Mar 27, 2020

I'll send it to the ml once travis finishes.

lib/portage/process.py Outdated Show resolved Hide resolved
@mgorny mgorny force-pushed the sethostname branch 2 times, most recently from fa0dc73 to 5c2b138 Compare March 27, 2020 17:40
lib/portage/process.py Outdated Show resolved Hide resolved
lib/portage/process.py Outdated Show resolved Hide resolved
Use UTS namespace to override hostname when network-sandbox is enabled.
Set it to 'localhost' as that has a better chance of being present
in /etc/hosts.  This fixes tests in some packages that try to connect
to localhost via hostname obtained using gethostname(), e.g. docker-py,
and suffer resolution problems due to the system hostname not being
defined in /etc/hosts.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request May 5, 2020
Reported-by: Tomek L <tomek@lutel.pl>
See: gentoo/portage#539
Bug: https://bugs.gentoo.org/680456#c8
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants