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

nixos/wpa_supplicant: prefer 'install' over 'touch/chmod/mkdir/chgrp' #121395

Merged
merged 1 commit into from
May 10, 2021

Conversation

bjornfor
Copy link
Contributor

@bjornfor bjornfor commented May 1, 2021

Motivation for this change

Ref #121293.

Untested.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels May 1, 2021
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels May 1, 2021
Comment on lines -56 to -59
if test "$(stat --printf '%G' ${suppl.userControlled.socketDir})" != "${suppl.userControlled.group}"; then
echo "ERROR: bad ownership on ${suppl.userControlled.socketDir}" >&2
exit 1
fi
Copy link
Member

Choose a reason for hiding this comment

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

Is there a downside to overwriting the group of an existin directory? Maybe we should keep this but put it before the install.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a downside to overwriting the group of an existin directory?

I don't know. I'm not really familiar with wpa_supplicant. I tested if ACLs are preserved with install, and they are.

My thinking:

Old code: configure dir once and fail if group ownership differs later.
New code: configure dir always. (The code will only fail if there is insufficient permissions to configure things.)

I don't see any benefit of the old code. The new one automates something the old code would require user action to solve.

@dotlambda dotlambda requested a review from iblech May 1, 2021 16:14
@iblech iblech removed their request for review May 1, 2021 18:19
@iblech
Copy link
Contributor

iblech commented May 1, 2021

Thank you for your work, @bjornfor! On a superficial reading, your change looks good to me -- however, I currently don't have the time to think this through properly or to test this change. Sorry!

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

Let's merge in a couple of days if no one objects.

Copy link
Contributor

@rnhmjoj rnhmjoj left a comment

Choose a reason for hiding this comment

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

I don't see any problem with the new code, too. Let's merge this.

@rnhmjoj rnhmjoj merged commit d0cbcce into NixOS:master May 10, 2021
@bjornfor bjornfor deleted the nixos-wpa-supplicant branch May 10, 2021 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants