Bug 164494

Summary: /usr/share/clamav/freshclam-sleep broken: `hostid` doesn't work on 64 bits
Product: [Fedora] Fedora Reporter: James Wilkinson <james>
Component: clamavAssignee: Enrico Scholz <rh-bugzilla>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: extras-qa
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-07-28 12:13:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description James Wilkinson 2005-07-28 11:30:22 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716

Description of problem:
The new clamav-update package puts a new clamav-update file in /etc/cron.d. This calls /usr/share/clamav/freshclam-sleep, a bash shellscript.

/usr/share/clamav/freshclam-sleep uses `hostid` to get a random time to sleep. On an AMD64 box:

[james@kendrick ~]$ hostid
ffffffffa8c0fa00
[james@kendrick ~]$ echo $[ 0x`hostid`]
-1463748096

Not surprisingly, sleep doesn't like sleeping for negative seconds. Even if the number was positive, that's still an awfully long time to sleep.

Maybe line 26 of /usr/share/clamav/freshclam-sleep could be changed to use $RANDOM?

Thanks.


Version-Release number of selected component (if applicable):
clamav-0.86.2-2.fc4

How reproducible:
Always

Steps to Reproduce:
[root@kendrick cron.d]# /usr/share/clamav/freshclam-sleep
sleep: invalid option -- 2
Try `sleep --help' for more information.

Additional info:

Comment 1 Enrico Scholz 2005-07-28 12:13:26 UTC
thx; should be solved in CVS

http://cvs.fedora.redhat.com/viewcvs/devel/clamav/freshclam-sleep?root=extras&r1=1.1&r2=1.2