clamav-safebrowsing
clamav-safebrowsing copied to clipboard
clamsbsync automatically adds timestamp to outputfile, clamsbwrite creates output file in current directory (not outputdir)
I suggest to mention in the documentation that the sync script using the build option adds a timestamp to the output file. Thus running the script in e.g. a cron job with outputdir set to the clamav db folder does not replace the old signature file but adds a new signature file causing clamav to be overwhelmed with signatures after some time.
On the other hand the write script outputs in the current directory - not the output dir as defined in the configuration file.
The second issue can be fixed with a few changes in the last few lines of clamsbwrite.py:
db_host, db_user, db_pw, db_name, outputdir = [
config.get(key) for key in ["db_host", "db_user", "db_pw", "db_name", "outputdir"]
]
g = GDBWriter(db_host, db_user, db_pw, db_name)
outpath = os.path.join(outputdir, "safebrowsing.gdb")
g.writegdb(outpath)
One issue remains unresolved for me due to lack on python skills:
/usr/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:2693: SAWarning: relationship 'SBPrefix.hashes' will copy column sbclient_v4_prefixes.reflist_id to column sbclient_v4_hashes.reflist_id, which conflicts with relationship(s): 'SBList.hashes' (copies sbclient_v4_lists.id to sbclient_v4_hashes.reflist_id). Consider applying viewonly=True to read-only relationships, or provide a primaryjoin condition marking writable columns with the foreign() annotation. for (pr, fr_) in other_props)
For the first issue. I think you are not meant to run the write script seperatly. It gets called from the sync script and then for me it does write to the output dir defined in the config.
For the second issue. I am seeing the same warning from SQLAlchemy.