1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00
nixpkgs/nixos/modules/config
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
..
fonts fontdir: add ttc to font regex 2020-10-26 10:45:22 +08:00
gtk
krb5 nixos/krb5: add list to example configuration 2020-08-25 17:18:56 +02:00
xdg
appstream.nix nixos/modules: remove trailing whitespace 2020-08-07 14:45:39 +01:00
console.nix
debug-info.nix
gnu.nix
i18n.nix nixos i18n.supportedLocales: increase systemPackages priority 2020-06-11 10:22:20 +02:00
iproute2.nix
ldap.nix Merge pull request #98731 from mayflower/ldap-nss-optional 2020-12-12 10:53:39 +01:00
locale.nix
malloc.nix nixos/malloc: fix Scudo 2020-11-17 09:11:31 -05:00
networking.nix nixos/networking: Add the FQDN and hostname to /etc/hosts 2020-05-25 14:06:25 +02:00
no-x-libs.nix nixos/no-x-libs: add networkmanager-sstp 2020-10-21 00:04:02 +02:00
nsswitch.nix nixos/nsswitch: improve error message 2020-05-11 16:14:51 +02:00
power-management.nix nixos/power-management: always run systemctl of the currently running systemd 2020-05-21 10:28:29 +02:00
pulseaudio.nix Merge pull request #103225 from gebner/hsphfpd 2020-11-11 19:56:35 +01:00
qt5.nix
resolvconf.nix nixos/resolvconf: always run systemctl of the currently running systemd 2020-05-21 10:29:22 +02:00
shells-environment.nix
swap.nix utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
sysctl.nix
system-environment.nix
system-path.nix utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
terminfo.nix
unix-odbc-drivers.nix
update-users-groups.pl nixos/users-groups: createHome: Ensure HOME permissions, fix description 2020-12-16 03:40:29 +01:00
users-groups.nix nixos/users-groups: createHome: Ensure HOME permissions, fix description 2020-12-16 03:40:29 +01:00
vte.nix
zram.nix nixos/zram: add zramSwap.memoryMax option 2020-11-25 13:43:38 +00:00