Fixes: #1155
It might seem a bit messy but the gist of the PR is that.
We introduce fc_upsert_logg_file method, which attempts to create the directories & log file as required.
We move the drop_privileges case/branch later during the execution. If we do this before we fc_upsert_logg_file our log file, then we can't use root privileges even if freshclam is started as root.
In order to chown the directories (and file, overkill?) we introduce the field dbOwner in the fc_config structure.
Seems this has been handled in documentation as a step of the setup.
Fixes: #1155 It might seem a bit messy but the gist of the PR is that.
fc_upsert_logg_file
method, which attempts to create the directories & log file as required.drop_privileges
case/branch later during the execution. If we do this before wefc_upsert_logg_file
our log file, then we can't useroot
privileges even iffreshclam
is started asroot
.chown
the directories (and file, overkill?) we introduce the fielddbOwner
in thefc_config
structure.Seems this has been handled in documentation as a step of the setup.