[PATCH] Samba VirusFilter (version 12)

Trever L. Adams trever at middleearth.sapphiresunday.org
Mon Jan 29 15:19:41 UTC 2018

On 01/23/2018 04:59 PM, ronnie sahlberg wrote:
> You could even modify the query data you return for the file to set
> the offline bit
> as another visual cue to the user that "the file is there but there is
> something wrong with it and you can't read it".


Thank you for the idea.

Jeremy and Ralph, attached is a first stab at this. There is a warning.
In one place in the module there is a smb_fname = fsp_name that is set
to be const. For this reason, I have made the function to mark things as
offline have the smb_fname parameter const. Unfortunately,

../source3/modules/vfs_virusfilter.c: In function ‘infected_mark_offline’:
../source3/include/vfs_macros.h:398:50: warning: passing argument 2 of
‘smb_vfs_call_get_dos_attributes’ discards ‘const’ qualifier from
pointer target type [-Wdiscarded-qualifiers]
  smb_vfs_call_get_dos_attributes((handle)->next, (smb_fname), (attributes))

As the two of you know Samba's internals much better than I, would you
mind advising me on the correct way to go about fixing the warning and
doing a preliminary review. Also, I do not know if this would be best to
be default behavior. I have it currently defaulted to true.

Alternatively, this could work more like vfs_offline and simply modify
the return for the get dos attributes and fget dos attributes to be
offline if the file is infected in the cache. i.e. no permanent
attribute on disk, but would only work so long as files are in the scan
results cache.

Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-capability-to-mark-infected-files-offline-to-vfs.patch
Type: text/x-patch
Size: 3695 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180129/2cb6a958/0001-Add-capability-to-mark-infected-files-offline-to-vfs.bin>
-------------- 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/20180129/2cb6a958/signature.sig>

More information about the samba-technical mailing list