From fd87bcb8291aff8d390b623a7cc64b925a64f52f Mon Sep 17 00:00:00 2001 From: eshizhan Date: Sun, 19 Nov 2023 02:23:23 +0800 Subject: [PATCH] modify /home to corrent permissions while it may be mounted with wrong permissions --- files/entrypoint | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/entrypoint b/files/entrypoint index 9c3d6e3..6770fe9 100755 --- a/files/entrypoint +++ b/files/entrypoint @@ -55,6 +55,11 @@ if [ ! -f "$userConfFinalPath" ]; then # Check that we have users in config if [ -f "$userConfFinalPath" ] && [ "$(wc -l < "$userConfFinalPath")" -gt 0 ]; then + if [ -n "$(find /home -perm /go=w -o \! -user root -maxdepth 0)" ]; then + log "Modify /home to have the correct permissions, as it may be mounted with the wrong permissions." + chmod go-w /home + chown root /home + fi # Import users from final conf file while IFS= read -r user || [[ -n "$user" ]]; do create-sftp-user "$user"