#25 remove hardcoded temporary file for debugging

rkhunter (35)
Jan Iven

patch pulled from the Fedora/EPEL SRPM, attribution:
* Wed Sep 03 2008 Kevin Fenzi <kevin@tummy.com> - 1.3.2-5
- Patch debug tmp file issue - bug #460628

"--debug" uses a hardcoded temporary file name, this could lead to race (between rkhunter removing and re-creating it), the patch changes that to use mktemp.

Impact is probably minor.


  • Jan Iven

    Jan Iven - 2008-12-10
  • unSpawn

    unSpawn - 2008-12-10
    • labels: --> rkhunter
    • assigned_to: nobody --> unspawn
    • status: open --> closed
  • unSpawn

    unSpawn - 2008-12-10

    Thanks. That patch was already in CVS.

  • John Horne

    John Horne - 2008-12-12

    Okay, there are problems with this.

    First, the --debug option is not a general user option, which is why it is not mentioned that much at all. It should only be used when requested by a developer, and in those instances we really want to be sure that the info we are getting is what we asked for. As such, telling the user exactly what file to send us avoids any confusion ("Oh I sent you the first file I saw, I didn't realise there was more than one, I didn't look at the date/time" etc etc). Once we have the file, the user can then delete that same exact file. Telling the user that there will be a file in /tmp, but they will have to look for it, we don't know what name it will be, and ensure that they send us the right one is more prone to error.

    Secondly, the option is rarely used, and as such I'm not really going to worry about any race-condition. If a problem occurs then the user runs the command again.

    Thirdly, the mktemp command is not generic, and as such it will fail on some systems. For this reason alone the patch will have to come out of CVS.


  • John Horne

    John Horne - 2008-12-29
    • status: closed --> closed-accepted
  • John Horne

    John Horne - 2008-12-29

    (Now) fixed in CVS.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks