nixos/shadow: create setuid wrapper for chsh
This allows non-declarative users to change their login shells.
https://github.com/NixOS/nixpkgs/pull/41966 will make this possible
for declarative users as well if the system config explicitly allows it.
commit925b028f1779027d65ef75ecc87563c45805d0c3
authorAneesh Agrawal <aneeshusa@gmail.com>
dateSun 26 Aug 2018, 22:33 (8 years ago)
parentca11db8
nixos/modules/programs/shadow.nix+3−2
@@ -108,8 +108,9 @@ in
108108 newgrp.source = "${pkgs.shadow.out}/bin/newgrp";
109109 newuidmap.source = "${pkgs.shadow.out}/bin/newuidmap";
110110 newgidmap.source = "${pkgs.shadow.out}/bin/newgidmap";
111− } // (if config.users.mutableUsers then {
111+ } // lib.optionalAttrs config.users.mutableUsers {
112+ chsh.source = "${pkgs.shadow.out}/bin/chsh";
112113 passwd.source = "${pkgs.shadow.out}/bin/passwd";
113− } else {});
114+ };
114115 };
115116}