ensure awstats links are owned by root

Version 1.51

Bugfix
Finished

Because apache will refuse to follow a link if the link owners does not match the destination owner, DA will now confirm the ownership of the link. By default, the links are all created by root, so this isn't an issue. But upon restore, because tar runs as the User, the link would likely be chowned to the User, thus the link doesn't match. New internal directadmin.conf variable: ensure_root_awstats_links=1 enabled by default. Set to 0 if you do not wish for DA to check this. It will check: icon lang lib plugins docs but will not check the index.html, which should be reset nightly already. If the value is not chowned to root, DA will not change the ownership, but full delete the old link, and re-create a new one pointing to the default path. So if you're using some custom path, you'll likely want to disable this feature. We fully delete it because we cannot trust any link value that the User could have set. Note that the script: /usr/local/directadmin/scripts/awstats_process.sh already had a variable: ENSURE_ROOT_LINKS=0 which is disabled by default. It does roughly the same thing, but it's checks are not as strict as DA's so if you do need to use ENSURE_ROOT_LINKS=1, run it once, then disable it. It's better to rely on ensure_root_awstats_links=1

Interested to try DirectAdmin? Get a 30-day Free Trial!