mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #1352 from ericgaspar/set-right-for-log-path
helpers/logrotate: Enforce decent permissions on log file if app user exists
This commit is contained in:
commit
66ded07672
1 changed files with 6 additions and 0 deletions
|
@ -96,6 +96,12 @@ $logfile {
|
||||||
EOF
|
EOF
|
||||||
mkdir --parents $(dirname "$logfile") # Create the log directory, if not exist
|
mkdir --parents $(dirname "$logfile") # Create the log directory, if not exist
|
||||||
cat ${app}-logrotate | $customtee /etc/logrotate.d/$app > /dev/null # Append this config to the existing config file, or replace the whole config file (depending on $customtee)
|
cat ${app}-logrotate | $customtee /etc/logrotate.d/$app > /dev/null # Append this config to the existing config file, or replace the whole config file (depending on $customtee)
|
||||||
|
|
||||||
|
if ynh_user_exists --username="$app"; then
|
||||||
|
chown $app:$app "$logfile"
|
||||||
|
chmod o-rwx "$logfile"
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove the app's logrotate config.
|
# Remove the app's logrotate config.
|
||||||
|
|
Loading…
Add table
Reference in a new issue