[PATCH] Samba VirusFilter (version 11)

jim jim.brown at rsmas.miami.edu
Tue Jan 2 03:49:45 UTC 2018


On 1/1/2018 2:45 PM, Trever L. Adams wrote:
> On 12/28/2017 08:41 AM, jim via samba-technical wrote:
>> Status of functions returning virusfilter_result should be checked
>> against correct constants (not true or false).
>> A few more nits.
>>
>> Tests for type virusfilter_result should be against correct constants
>> - not against true.
>> Or, it should be assigned to a bool variable like virusfilter_io_readl.
>>
>> result != true should be result != VIRUSFILTER_RESULT_OK (many places)
> Thank you so much for your feed back. I am sorry for the delayed
> response. I missed this email last week. Your feedback made me realize
> that the consistency I once hoped for (using the virusfilter_result)
> everywhere was not a good idea. I have tried to 'simplify' the return
> types in addition to making the changes you suggested. If bool is
> enough, I am now using bool. If it needs an int, use that, if it needs
> the full virusfilter_result, use that.
>
> As I keep missing things, I am attaching the incremental patch.
> Hopefully, this will help find the last nits, coding style violations
> and any bugs (which this process has helped me uncover and fix) remaining.
>
> Thank you to all who have been so helpful.

Trever

These incremental changes address all of my concerns.

Jim

Could 'result' be renamed 'ok' to match the other usage patterns (i.e. 
enhance readability)?

On 1/1/2018 2:45 PM, Trever L. Adams wrote:
> @@ -677,13 +676,13 @@ bool virusfilter_io_writefl_readl(
>   		result = virusfilter_io_vwritefl(io_h, fmt, ap);
>   		va_end(ap);
>   
> -		if (result != true) {
> +		if (!result) {
>   			return result;
>   		}
>   	}
>   
>   	result = virusfilter_io_readl(talloc_tos(), io_h, read_line);
> -	if (result != true) {
> +	if (!result) {




More information about the samba-technical mailing list