Also fix permissions on homedir
This commit is contained in:
parent
06341fa303
commit
c30debad59
|
@ -356,15 +356,30 @@ fix_directory_permissions() { # {{{
|
|||
## Setting new permissions fail by default
|
||||
return_fix_directory_permissions="1"
|
||||
|
||||
## Change owner {{{
|
||||
if chown --silent "${local_username}:${local_user_groupname}" -- "${local_directory}" 2> /dev/null; then
|
||||
debug_message "fix_directory_permissions − \
|
||||
Successfully fix permissions for ${RED}${local_directory}${COLOR_DEBUG} (user: ${local_username})."
|
||||
## }}}
|
||||
## Remove group and others permissions {{{
|
||||
## Cause users might share the same group…
|
||||
if chmod --silent g-rwx,o-rwx -- "${local_directory}" 2> /dev/null; then
|
||||
debug_message "fix_directory_permissions − \
|
||||
Successfully remove permissions for group and other on ${RED}${local_directory}${COLOR_DEBUG}."
|
||||
return_fix_directory_permissions="0"
|
||||
## }}}
|
||||
## If something went wrong with chmod or chown {{{
|
||||
else
|
||||
debug_message "fix_directory_permissions − \
|
||||
Error in 'chmod' command for ${RED}${local_directory}${COLOR_DEBUG} directory (user: ${local_username})."
|
||||
return_fix_directory_permissions="1"
|
||||
fi
|
||||
else
|
||||
debug_message "fix_directory_permissions − \
|
||||
Error in 'chown' command for ${RED}${local_directory}${COLOR_DEBUG} directory (user: ${local_username})."
|
||||
return_fix_directory_permissions="1"
|
||||
fi
|
||||
## }}}
|
||||
|
||||
return "${return_fix_directory_permissions}"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue