Skip to content

Conversation

@edolstra
Copy link
Member

@edolstra edolstra commented Dec 5, 2025

Motivation

Taken from #5265.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions bot added the new-cli Relating to the "nix" command label Dec 5, 2025
struct passwd * pw = peer.uidKnown ? getpwuid(peer.uid) : 0;
std::string user = pw ? pw->pw_name : std::to_string(peer.uid);
auto pw = peer.uid ? getpwuid(*peer.uid) : nullptr;
std::string user = pw ? pw->pw_name : peer.uid ? std::to_string(*peer.uid) : "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty string case seems suspicious

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better than the previous behavior where it would call std::to_string() on an uninitialized uid field. The empty string won't match with anything in trusted-user except *.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But all the code paths from getPeerInfo initialized all members or failed with a SysError (which gets removed now). What's the rationale for it? That was needed for the TCP store somehow?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is in, shouldn't the unix socket keep getting the same error handling treatment?

@Ericson2314
Copy link
Member

Ericson2314 commented Dec 5, 2025

Yay thanks for extracting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-cli Relating to the "nix" command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants