Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1631525 - clamav: clamscan --gen-json does not output JSON
Summary: clamav: clamscan --gen-json does not output JSON
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: clamav
Version: 31
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Sergio Basto
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-20 19:26 UTC by Armijn Hemel
Modified: 2019-12-05 05:51 UTC (History)
10 users (show)

Fixed In Version: clamav-0.101.5-1.fc30 clamav-0.101.5-1.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-05 05:13:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
0001-1631525-enable-libjson-Enables-libjson.patch (1.64 KB, patch)
2019-12-04 11:23 UTC, Sergio Basto
no flags Details | Diff

Description Armijn Hemel 2018-09-20 19:26:01 UTC
Description of problem:

clamscan --get-json does not output JSON

Version-Release number of selected component (if applicable):

Version     : 0.100.1
Release     : 4.fc28
Architecture: x86_64


How reproducible:

Always

Steps to Reproduce:
1. install clamav
2. scan an arbitrary file with clamscan --get-json
3.

Actual results:

No JSON output

$ clamscan --gen-json /bin/ls
/bin/ls: OK

----------- SCAN SUMMARY -----------
Known viruses: 6569818
Engine version: 0.100.1
Scanned directories: 0
Scanned files: 1
Infected files: 0
Data scanned: 0.15 MB
Data read: 0.15 MB (ratio 1.00:1)
Time: 12.676 sec (0 m 12 s)


Expected results:

JSON output

Additional info:

I don't know whether or not this is because of some build flag, or an error in the build environment. I tried to compile it myself and then clamav's configure script fails on a test for libjson-c it seems, but I could be wrong here.

Comment 1 Ben Cotton 2019-05-02 20:52:17 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Ben Cotton 2019-08-13 17:03:28 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 3 Ben Cotton 2019-08-13 19:24:41 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 4 Fedora Update System 2019-11-25 02:04:08 UTC
clamav-0.101.5-1.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-1543eae191

Comment 5 Fedora Update System 2019-11-25 02:27:53 UTC
clamav-0.101.5-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-dcbfe89e39

Comment 6 Fedora Update System 2019-11-25 02:38:30 UTC
clamav-0.101.5-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-d6b0a398c2

Comment 7 Fedora Update System 2019-11-25 03:10:12 UTC
clamav-0.101.5-1.el8 has been pushed to the Fedora EPEL 8 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-52445f11c2

Comment 8 Fedora Update System 2019-11-25 04:15:20 UTC
clamav-0.101.5-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-ce438e7857

Comment 9 Fedora Update System 2019-12-01 01:04:01 UTC
clamav-0.101.5-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2019-12-04 01:15:16 UTC
clamav-0.101.5-1.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Jan ONDREJ 2019-12-04 07:07:58 UTC
I still don't see any json data in clamscan output:

[ondrejj@work ~]$ rpm -q clamav
clamav-0.101.5-1.fc31.x86_64
[ondrejj@work ~]$ clamscan --gen-json /bin/ls
/bin/ls: OK

----------- SCAN SUMMARY -----------
Known viruses: 6794126
Engine version: 0.101.5
Scanned directories: 0
Scanned files: 1
Infected files: 0
Data scanned: 0.15 MB
Data read: 0.15 MB (ratio 1.00:1)
Time: 10.705 sec (0 m 10 s)
[ondrejj@work ~]$

Comment 12 Sergio Basto 2019-12-04 11:23:05 UTC
Created attachment 1642024 [details]
0001-1631525-enable-libjson-Enables-libjson.patch

I checked this report and I made the pacth in attachment , but nothing changed. 
libjson is enabled we are missing something ... 

Thank you

Comment 13 Orion Poplawski 2019-12-05 05:13:43 UTC
Well, --gen-json is definitely "enabled", otherwise specifying --gen-json would produce:

!Can't generate json (gen-json). libjson-c dev library was missing or misconfigured when ClamAV was built.

Apparently output is only generate in combination with --debug and for specific files: "some office, pdf, or pe file"

see https://blog.clamav.net/2014/11/intro-to-collection-and-analysis-of.html

For a pdf file I got:

LibClamAV debug: { "Magic": "CLAMJSONv0", "RootFileType": "CL_TYPE_PDF", "FileType": "CL_TYPE_PDF", "FileSize": 64347, "FileMD5": "d7146c1a9cee064ead503f88a44f0b44", "PDFStats": { "PDFVersion": "1.3", "ObjectsWithoutDictionaries": [ 5, 11, 17, 7, 20, 26, 29, 31, 34, 35, 36, 35, 36, 36 ], "IncorrectPagesCount": true, "Producer": "Mac OS X 10.10.1 Quartz PDFContext", "ModificationDate": "D:20141210181337Z00'00'", "CreationDate": "D:20141210181337Z00'00'", "DeflateObjectCount": 6, "PageCount": 1 }, "ContainedObjects": [ { "FileType": "CL_TYPE_TEXT_ASCII", "FileSize": 170948, "FileMD5": "14f2991dfacb79bcdfaec7a76c5221b8" }, { "FileType": "CL_TYPE_TEXT_ASCII", "FileSize": 7079, "FileMD5": "bd3d689960efd7e41c1404afe8b78584" }, { "FileType": "CL_TYPE_BINARY_DATA", "FileSize": 1960, "FileMD5": "0d258bad36b64cebfb9e6826c3ed5037" }, { "FileType": "CL_TYPE_BINARY_DATA", "FileSize": 16392, "FileMD5": "5ceac6c32776184c508bb9ef48b3f7ca" }, { "FileType": "CL_TYPE_TEXT_ASCII", "FileSize": 342, "FileMD5": "021b9e6faf9b389d61e045e1f9194b14" }, { "FileType": "CL_TYPE_BINARY_DATA", "FileSize": 2228, "FileMD5": "cc787337be3ddd46f72bd4768fdb2291" }, { "FileType": "CL_TYPE_BINARY_DATA", "FileSize": 8116, "FileMD5": "1bdaa02cfa95c0dc8bfb75ce1d66bfa0" } ] }

Comment 14 Sergio Basto 2019-12-05 05:51:59 UTC
Lets close with fixed, we added libjson-c-devel to the spec file


Note You need to log in before you can comment on or make changes to this bug.