rkhunter Reports Its Own tmp Files As Suspicious When Run From Cron

Bug #1342866 reported by Jared Fernandez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rkhunter (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When run from the default Ubuntu cron file (/etc/cron.daily/rkhunter), if the option 'suspscan' is included, rkhunter reports the tmp file created by its own cron job as suspicious:

Warning: File '/tmp/tmp.Vnv2CeoUes' (score: 230) contains some suspicious content and should be checked.
Warning: Checking for files with suspicious contents [ Warning ]

This is caused by using 'mktmp' in the cron bash script which by default puts temp files in '/tmp'. The solution is to change the line

OUTFILE=`mktemp` || exit 1

to

OUTFILE=`mktemp -p /var/lib/rkhunter/tmp` || exit 1

so that the temp file is put in rkhunter's whitelisted tmp directory.

Revision history for this message
François Marier (fmarier) wrote :
no longer affects: rkhunter
Revision history for this message
Jared Fernandez (jared-fernandez) wrote :

This bug is specific to the Ubuntu/Debian-specific cron file located at /etc/cron.daily/rkhunter

Revision history for this message
Jared Fernandez (jared-fernandez) wrote :

Interestingly, this problem no longer occurs in the latest version (1.4.2-0.4) shipped with 15.04 Vivid. They must have changed the way that tmp files are scanned. Closing as WontFix.

Changed in rkhunter (Ubuntu):
assignee: nobody → Jared Fernandez (jared-fernandez)
assignee: Jared Fernandez (jared-fernandez) → nobody
Revision history for this message
Jared Fernandez (jared-fernandez) wrote :

I'm unable to change the status to WontFix myself. Feel free to close this one out.

Changed in rkhunter (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.