Skip to content

Commit fd87bcb

Browse files
authored
modify /home to corrent permissions while it may be mounted with wrong permissions
1 parent eacf693 commit fd87bcb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

files/entrypoint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ if [ ! -f "$userConfFinalPath" ]; then
5555

5656
# Check that we have users in config
5757
if [ -f "$userConfFinalPath" ] && [ "$(wc -l < "$userConfFinalPath")" -gt 0 ]; then
58+
if [ -n "$(find /home -perm /go=w -o \! -user root -maxdepth 0)" ]; then
59+
log "Modify /home to have the correct permissions, as it may be mounted with the wrong permissions."
60+
chmod go-w /home
61+
chown root /home
62+
fi
5863
# Import users from final conf file
5964
while IFS= read -r user || [[ -n "$user" ]]; do
6065
create-sftp-user "$user"

0 commit comments

Comments
 (0)