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

Don’t use entire /etc/nsswitch.conf file #2975

Merged
merged 1 commit into from Jul 13, 2019

Conversation

matthewbauer
Copy link
Member

The default nsswitch.conf(5) file in most distros can handle many
different things including host name, user names, groups, etc. In Nix,
we want to limit the amount of impurities that come from these things.
As a result, we should only allow nss to be used for gethostbyname(3)
and getservent(3).

/cc @Ericson2314

The default nsswitch.conf(5) file in most distros can handle many
different things including host name, user names, groups, etc. In Nix,
we want to limit the amount of impurities that come from these things.
As a result, we should only allow nss to be used for gethostbyname(3)
and getservent(3).

/cc @Ericson2314
@Ericson2314
Copy link
Member

Ericson2314 commented Jun 27, 2019

A specific issue is that when fetching a private repo, OpenSSH will end up using nscds which gets the unboxed user with uid 1000 rather than nixbld with uid in the sandbox. This makes it look up config files in the real users' home directory. It can't read those and it's just a warning, but a rather nasty warning (and if ssh does fail later it rarely says why). This red herring has wasted lots of people's time.

For reference, on NixOS that line today is:

hosts:     files mymachines dns myhostname

@Ericson2314
Copy link
Member

We do need to rebuild the daemon to test this, so don't merge before that!

@matthewbauer
Copy link
Member Author

mymachines and myhostname should not be necessary.

@edolstra edolstra merged commit 2f853b2 into NixOS:master Jul 13, 2019
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.

None yet

3 participants