From 9672bd37bf50db1e0989d0b84035c4788422bd31 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Tue, 30 Mar 2021 22:36:14 +0200 Subject: [PATCH 1/2] activation: Do not dereference symlinks in home directory creation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . * gnu/build/activation.scm (copy-account-skeletons): Do not chown the home directory; leave this to 'activate-user-home'. (activate-user-home): Only chown the home directory after the account skeletons have been copied. Co-authored-by: Ludovic Courtès . --- gnu/build/activation.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 6cb6f8819b..43d973d3da 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -107,7 +107,8 @@ Warning: this is currently suspect to a TOCTTOU race!" (directory %skeleton-directory) uid gid) "Copy the account skeletons from DIRECTORY to HOME. When UID is an integer, -make it the owner of all the files created; likewise for GID." +make it the owner of all the files created except the home directory; likewise +for GID." (define (set-owner file) (when (or uid gid) (chown file (or uid -1) (or gid -1)))) @@ -115,7 +116,6 @@ make it the owner of all the files created; likewise for GID." (let ((files (scandir directory (negate dot-or-dot-dot?) string