Re: tmp issues: trap before making safe tmp and no change directory

From: Brian Hatch (security-discuss_at_ifokr.org)
Date: 10/28/03


Date: Tue, 28 Oct 2003 13:52:34 -0800
To: security-discuss@linuxsecurity.com



> Would it be possible to write a small compiled program
> that could do the "atomically create unique
> file/directory and return it's name" program?

Yes, it's called 'mktemp'

        TMPFILE=`mktemp -t example.XXXXXXXXXX` || exit 1
        echo "blah blah blah" >> $TMPFILE

--
Brian Hatch                  "Zathras listens, he does,
   Systems and                yes. Zathras listens and
   Security Engineer          does what he's told."
http://www.ifokr.org/bri/
Every message PGP signed

------------------------------------------------------------------------
     To unsubscribe email security-discuss-request@linuxsecurity.com
         with "unsubscribe" in the subject of the message.