[PATCH] Samba VirusFilter (version 12)
jim
jim.brown at rsmas.miami.edu
Tue Jan 2 18:03:46 UTC 2018
Trever
A few more comments.
Jim
In quarantine_create_dir 'ret' is bool. Test should be 'if (ret)'
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).
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();
More information about the samba-technical
mailing list