On 2009-02-28 22:14, Jose-Marcio Martins da Cruz wrote:
> Török Edwin wrote:
>   
>> On 2009-02-28 12:18, Jose-Marcio Martins da Cruz wrote:
>>     
>>> I see. Removing a '\n' when it's just before the '\0' may not be better 
>>> but doesn't harm. I'm wrong ?
>>>   
>>>       
>> As I said, that is a problem if the filename ends with \n, if I remove
>> the \n it will no longer find the file.
>>     
>
> ...
>
>   
>> Use nCOMMANDS, those work with both old, and new clamd.
>>     
>
> It could be interesting to have a command which answers correctly, with 
> a hint about the version or options available, no matter how it ends : 
> with a '\n' or a '\0'. It could be VERSION, or PING (if you add some 
> data after PONG), or a new command. This way, the clamd client could 
> adapt itself to clamd behaviour, instead of guessing or using an 
> obsolete command.
>   

Thanks for the suggestion. I've opened an enhancement bug:
https://wwws.clamav.net/bugzilla/show_bug.cgi?id=1437


> Either way, nCOMMANDS still remain interesting when using a telnet 
> client for, e.g., debug purposes.

Yes, that is one of the reasons why I say that nCOMMANDs aren't likely
to go away anytime soon.

If you want your app to support both <0.95 and >=0.95, the easiest now
is to use nCOMMANDS.
Since you are writing a milter, you control the filenames, its easy to
make sure they don't contain \n
(if they did, it wouldn't have worked until now anyway).

if you want to use the new features, such as IDSESSION and INSTREAM, you
can send these commands to clamd,
and if it replies UNKNOWN COMMAND, you can fallback to something else.
For example:
nIDSESSION\nnVERSION\nnEND\n

Will reply UNKNOWN COMMAND for old clamd, and will reply with the
VERSION for new clamd.


Best regards,
--Edwin
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to