diff --git a/assets/runtime/functions b/assets/runtime/functions index 0c5f2eb9..a513f5be 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -803,8 +803,8 @@ initialize_datadir() { if [ ${REDMINE_DATA_DIR} = ${dir} ]; then mkdir -p ${dir} fi - chmod -R u+rw,go+r ${dir} - chown -R ${REDMINE_USER}: ${dir} + find ${dir} \! -perm -u=wr,go=r -print0 | xargs -0 -r chmod u+rw,go+r + find ${dir} \! -user ${REDMINE_USER} -print0 | xargs -0 -r chown ${REDMINE_USER}: done }