Hi there,

On Wed, 14 Jul 2021, Michael Wang wrote:

I discovered that the "=" sign in freshclam option is mandatory. For
example:

freshclam --datadir=c:\temp\database (with =)
and
freshclam --datadir c:\temp\database (without =)

are different. In the latter, the option "--datadir c:\temp\database" is
ignored as if it were not specified.

On the other hand, the "=" in clamscan option is optional, i.e.

clamscan --log=c:\tmp\my.log
and
clamscan --log c:\tmp\my.log

are equivalent.

I would like to get a confirmation that this is true, and secondly to get
an opinion if this is a bug, as far as I know, the = in option should be
optional.

If an option takes an argument, and it has long and short forms (for
example -l and --log) then it's more or less a Unix custom for the
short form of the option to require that there is no following '=',
and for the long form to require one.  As you say, the clamscan and
freshclam 'man' pages show that, but it seems that the conformance of
the executables to the custom is patchy.

I've confirmed that clamscan on Linux behaves in the same way you have
described for Windows.  Because of the changes currently taking place
in the main and daily databases I haven't run freshclam to test it (in
any case I very rarely run freshclam manually) but I'd be surprised if
it didn't also behave in the same way.  Most of the code is common (in
.../shared/optparser.c) to both operating systems.  Thesedays, rather
than re-invent that particular wheel I'd use a library, but I guess at
the time this was written (getting on for twenty years ago) the author
had his reasons.

I think you've found two faults, not one.  Unless the man page says
that it will ignore a malformed option, freshclam should not do that;
it should issue an error message and quit with no other action.  And
the '=' should be required, not optional, in the option's long form.
I'd recommend reporting the faults via the ClamAV Bugzilla, if they
have not already been reported.

Full marks for studying the man pages carefully and checking that the
binaries behave as described.

--

73,
Ged.

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml

Reply via email to