From 32b1094d28d5fbedcc85a403bc08c8877b396255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 4 Oct 2024 15:33:55 +0200 Subject: [PATCH] fix user/group permission not set correctly in persist No idea how this ever worked, but for me all directories in /persistent never have the write user/group permissions when freshly created. This now also ensures that permissions will change if the configuration changes, which is a nice side effect. --- create-directories.bash | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/create-directories.bash b/create-directories.bash index 5f9a793..279fb2e 100755 --- a/create-directories.bash +++ b/create-directories.bash @@ -48,12 +48,10 @@ fi realSource="$(realpath -m "$sourceBase$target")" if [[ ! -d "$realSource" ]]; then printf "Warning: Source directory '%s' does not exist; it will be created for you with the following permissions: owner: '%s:%s', mode: '%s'.\n" "$realSource" "$user" "$group" "$mode" - mkdir --mode="$mode" "$realSource" - chown "$user:$group" "$realSource" + mkdir "$realSource" fi [[ -d "$target" ]] || mkdir "$target" -# synchronize perms between source and target -chown --reference="$realSource" "$target" -chmod --reference="$realSource" "$target" +chown "$user:$group" "$realSource" "$target" +chmod "$mode" "$realSource" "$target"