0
0
Fork 0
mirror of https://github.com/atmoz/sftp.git synced 2024-11-17 12:51:33 -05:00

modify /home to corrent permissions while it may be mounted with wrong permissions

This commit is contained in:
eshizhan 2023-11-19 02:23:23 +08:00 committed by GitHub
parent eacf693131
commit fd87bcb829
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,6 +55,11 @@ if [ ! -f "$userConfFinalPath" ]; then
# Check that we have users in config # Check that we have users in config
if [ -f "$userConfFinalPath" ] && [ "$(wc -l < "$userConfFinalPath")" -gt 0 ]; then 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 # Import users from final conf file
while IFS= read -r user || [[ -n "$user" ]]; do while IFS= read -r user || [[ -n "$user" ]]; do
create-sftp-user "$user" create-sftp-user "$user"