From 52887692d1cda9f3a1808c123d25c1d83ac50207 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 4 Oct 2016 16:55:21 -0400 Subject: [PATCH] Fix home directory autocreation permission If the home directory is a subdirectory of a directory not already in image, use 755 as permission for the new directory. This means a parent directory will not be unreadable by the user. --- src/lib/mount/home/home.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/mount/home/home.c b/src/lib/mount/home/home.c index 73bc9b2e8e..04987a7773 100644 --- a/src/lib/mount/home/home.c +++ b/src/lib/mount/home/home.c @@ -134,7 +134,7 @@ int singularity_mount_home(void) { singularity_message(DEBUG, "Trying to create home dir within container\n"); if ( singularity_rootfs_overlay_enabled() > 0 ) { singularity_priv_escalate(); - if ( s_mkpath(joinpath(container_dir, homedir), 0750) == 0 ) { + if ( s_mkpath(joinpath(container_dir, homedir), 0755) == 0 ) { singularity_priv_drop(); singularity_message(DEBUG, "Created home directory within the container: %s\n", homedir); homedir_base = strdup(homedir);