Skip to content

Goupile: lookup localhost for NSS - #103

Open
phanirithvij wants to merge 1 commit into
Koromix:masterfrom
phanirithvij:patch-1
Open

Goupile: lookup localhost for NSS#103
phanirithvij wants to merge 1 commit into
Koromix:masterfrom
phanirithvij:patch-1

Conversation

@phanirithvij

Copy link
Copy Markdown
Contributor

Instead of looking up www.example.com we can look up localhost instead and avoid requiring a network connection.

@Koromix

Koromix commented Feb 25, 2026

Copy link
Copy Markdown
Owner

I don't know that it's enough, unfortunately. When I wrote that code (quite angrily, as you can see from the comments), I seem to remember that it was not enough and Goupile would crash when making an SMTP call later on. Because it would finally try to resolve a real domain (the SMTP server) and load some new NSS stuff, and get killed by the kernel for violating the seccomp filters or at the very least, not find the NSS module it wanted.

I was recently able to remove all of this NSS preload workaround with the use of the c-ares DNS resolver instead. It worked well... except that for some reason, inside Landlock sometimes it would fail to resolve correctly, and I was not able to find out why. I plan to fix this and go back to c-ares eventually.

In the meantime, using localhost or a fake domain would be okay if can we prove that it does not crash later when some other NSS shared library has to be loaded.

@phanirithvij

Copy link
Copy Markdown
Contributor Author

I think e2e tests are the only way to ensure we catch anything.

I have a very basic playwright test I wrote for nixpkgs which goes through filling a single entry as a non-root user and exports it and checks the contents still match.

I am still debugging it, but will share here once I fix some issue.

@Koromix

Koromix commented Feb 25, 2026

Copy link
Copy Markdown
Owner

That would certainly be nice to have ++ :)

@Koromix
Koromix force-pushed the master branch 3 times, most recently from 1f5272f to b2e5f3e Compare April 24, 2026 15:52
@Koromix
Koromix force-pushed the master branch 3 times, most recently from edfedf3 to 56a51c8 Compare May 6, 2026 19:09
@Koromix
Koromix force-pushed the master branch 8 times, most recently from 327250b to d628b1c Compare June 24, 2026 07:51
@Koromix
Koromix force-pushed the master branch 2 times, most recently from 2c9a089 to d557a5b Compare June 29, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants