doesn't return results for all files when a directory is provided

Create issue
Issue #3 resolved
Brandon Murphy created an issue
>>> import pyclamd
>>> cd = pyclamd.ClamdAgnostic()
>>> cd.ping()
True
>>> cd.scan_file('/tmp/eicar')
{'/tmp/eicar': ('FOUND', 'Eicar-Test-Signature')}
>>> cd.scan_file('/tmp/eicar2')
{'/tmp/eicar2': ('FOUND', 'Eicar-Test-Signature')}
>>> cd.scan_file('/tmp/')
{'/tmp/eicar': ('FOUND', 'Eicar-Test-Signature')}

expected output

>>> import pyclamd
>>> cd = pyclamd.ClamdAgnostic()
>>> cd.ping()
True
>>> cd.scan_file('/tmp/eicar')
{'/tmp/eicar': ('FOUND', 'Eicar-Test-Signature')}
>>> cd.scan_file('/tmp/eicar2')
{'/tmp/eicar2': ('FOUND', 'Eicar-Test-Signature')}
>>> cd.scan_file('/tmp/')
{'/tmp/eicar': ('FOUND', 'Eicar-Test-Signature')}
{'/tmp/eicar2': ('FOUND', 'Eicar-Test-Signature')}

Comments (3)

  1. Brandon Murphy reporter

    example output of clamdscan

    $ clamdscan  --allmatch /tmp/
    /tmp/eicar: Eicar-Test-Signature FOUND
    /tmp/eicar: Clamav.Test.File-7 FOUND
    /tmp/eicar: Eicar-Test-Signature FOUND
    /tmp/eicar: Win.Test.EICAR_NDB-1 FOUND
    /tmp/eicar: Eicar-Test-Signature FOUND
    /tmp/eicar: Eicar-Test-Signature FOUND
    /tmp/eicar2: Eicar-Test-Signature FOUND
    /tmp/eicar2: Clamav.Test.File-7 FOUND
    /tmp/eicar2: Eicar-Test-Signature FOUND
    /tmp/eicar2: Win.Test.EICAR_NDB-1 FOUND
    /tmp/eicar2: Eicar-Test-Signature FOUND
    /tmp/eicar2: Eicar-Test-Signature FOUND
    
    ----------- SCAN SUMMARY -----------
    Infected files: 2
    Time: 0.010 sec (0 m 0 s)
    
  2. Brandon Murphy reporter

    looks like multiscan_file works correctly - given the use of MULTISCAN (and therefor clamd's multiple threads) for this function this is probably the preferred way to scan a directory anyway.

    >>> import pyclamd
    >>> cd = pyclamd.ClamdAgnostic()
    >>> cd.multiscan_file('/tmp/')
    {'/tmp/eicar2': ('FOUND', 'Eicar-Test-Signature'), '/tmp/eicar': ('FOUND', 'Eicar-Test-Signature')}
    

    I'll close this issue

  3. Log in to comment