[PATCH] Samba VirusFilter (version 12)

Trever L. Adams trever at middleearth.sapphiresunday.org
Wed Jan 3 01:45:34 UTC 2018


On 01/02/2018 11:03 AM, jim via samba-technical wrote:
> Trever
>
> A few more comments.
>
> Jim
>
> In quarantine_create_dir 'ret' is bool. Test should be 'if (ret)'
Correct. Thank you for the catch.
>
> On 1/2/2018 12:34 PM, Trever L. Adams via samba-technical wrote:
>> +        ret = quarantine_directory_exist(handle, new_dir);
>> +        if (ret != 0)
>
> There are places where you have early returns and call
> 'unbecome_root()' in both cases.
> Move 'unbecome_root()' before early exit if test (where possible).
There was another one of the cases below. All three have been corrected.
Thank you.
>
> On 1/2/2018 12:34 PM, Trever L. Adams via samba-technical wrote:
>> +        int_ok = virusfilter_vfs_next_move(handle, smb_fname,
>> +                           q_smb_fname);
>> +        if (int_ok == -1)
>> +        {
>> +            unbecome_root();
>> +            DBG_ERR("Rename failed: %s/%s: Rename failed: %s\n",
>> +                cwd_fname, fname,
>> +                strerror(errno));
>> +            return VIRUSFILTER_ACTION_DO_NOTHING;
>> +        }
>> +        unbecome_root();
>
> On 1/2/2018 12:34 PM, Trever L. Adams via samba-technical wrote:
>> +        int_ok = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
>> +        if (int_ok == -1) {
>> +            unbecome_root();
>> +            DBG_ERR("Delete failed: %s/%s: Unlink failed: %s\n",
>> +                cwd_fname, fname,
>> +                strerror(errno));
>> +            return VIRUSFILTER_ACTION_DO_NOTHING;
>> +        }
>> +        unbecome_root();
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 886 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180102/44e75f6d/signature.sig>


More information about the samba-technical mailing list