aboutsummaryrefslogtreecommitdiff
path: root/scripts/install-multi-user.sh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-09 18:01:21 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-09 23:34:48 +0200
commit5a303093dcae1e5ce9212616ef18f2ca51020b0d (patch)
tree091df92662ac2fdfe8c5ce4b9eb1f75bc81b5675 /scripts/install-multi-user.sh
parent4331eeb13d241dfe2d2e6a01c53915c556cac94f (diff)
Remove world-writability from per-user directories
'nix-daemon' now creates subdirectories for users when they first connect. Fixes #509 (CVE-2019-17365). Should also fix #3127.
Diffstat (limited to 'scripts/install-multi-user.sh')
-rw-r--r--scripts/install-multi-user.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/install-multi-user.sh b/scripts/install-multi-user.sh
index fd0f54184..258469a0b 100644
--- a/scripts/install-multi-user.sh
+++ b/scripts/install-multi-user.sh
@@ -437,16 +437,15 @@ create_build_users() {
}
create_directories() {
+ # FIXME: remove all of this because it duplicates LocalStore::LocalStore().
+
_sudo "to make the basic directory structure of Nix (part 1)" \
- mkdir -pv -m 0755 /nix /nix/var /nix/var/log /nix/var/log/nix /nix/var/log/nix/drvs /nix/var/nix{,/db,/gcroots,/profiles,/temproots,/userpool}
+ mkdir -pv -m 0755 /nix /nix/var /nix/var/log /nix/var/log/nix /nix/var/log/nix/drvs /nix/var/nix{,/db,/gcroots,/profiles,/temproots,/userpool} /nix/var/nix/{gcroots,profiles}/per-user
_sudo "to make the basic directory structure of Nix (part 2)" \
- mkdir -pv -m 1777 /nix/var/nix/{gcroots,profiles}/per-user
-
- _sudo "to make the basic directory structure of Nix (part 3)" \
mkdir -pv -m 1775 /nix/store
- _sudo "to make the basic directory structure of Nix (part 4)" \
+ _sudo "to make the basic directory structure of Nix (part 3)" \
chgrp "$NIX_BUILD_GROUP_NAME" /nix/store
_sudo "to set up the root user's profile (part 1)" \