nixpkgs-suyu/nixos/modules
Klemens Nanni 8833983f26 nixos/users-groups: createHome: Ensure HOME permissions, fix description
configuration.nix(1) states

    users.extraUsers.<name>.createHome
        [...] If [...] the home directory already exists but is not
        owned by the user, directory owner and group will be changed to
        match the user.

i.e. ownership would change only if the user mismatched;  the code
however ignores the owner, it is sufficient to enable `createHome`:

    if ($u->{createHome}) {
        make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home};
        chown $u->{uid}, $u->{gid}, $u->{home};
    }

Furthermore, permissions are ignored on already existing directories and
therefore may allow others to read private data eventually.

Given that createHome already acts as switch to not only create but
effectively own the home directory, manage permissions in the same
manner to ensure the intended default and cover all primary attributes.

Avoid yet another configuration option to have administrators make a
clear and simple choice between securely managing home directories
and optionally defering management to own code (taking care of custom
location, ownership, mode, extended attributes, etc.).

While here, simplify and thereby fix misleading documentation.
2020-12-16 03:40:29 +01:00
..
config nixos/users-groups: createHome: Ensure HOME permissions, fix description 2020-12-16 03:40:29 +01:00
hardware nixos/acpilight: add to packages 2020-11-12 05:22:18 +03:00
i18n/input-method hime: fix enable hime, remove hime-all package 2020-10-17 10:48:31 +08:00
installer nixos/sd-image: explicit reference to the gawk package 2020-12-12 15:43:09 +00:00
misc Merge pull request #104727 from chkno/fuse-dot-sshfs 2020-12-11 20:32:28 +00:00
profiles nixos/hardened: update blacklisted filesystems 2020-09-27 06:16:58 +00:00
programs Merge pull request #103813 from symphorien/firejail 2020-12-04 09:00:15 +01:00
security Merge pull request #103866 from cole-h/doas 2020-11-30 19:02:55 +01:00
services Merge pull request #82584 from Atemu/dnscrypt-default-config 2020-12-15 19:47:43 +00:00
system Merge pull request #97505 from mayflower/grub-efi-mirroredboot 2020-12-04 18:37:50 +01:00
tasks nixos auto-upgrade: remove flag when flake 2020-11-25 08:34:04 +01:00
testing nixos/tests: only apply qemu parameters if the options are defined 2020-10-25 13:42:01 +01:00
virtualisation Merge master into staging-next 2020-11-27 15:09:19 +01:00
module-list.nix frab: remove package 2020-12-10 22:24:11 +01:00
rename.nix frab: remove package 2020-12-10 22:24:11 +01:00