Replace mktemp with mkstemp since the former is deprecated for security reasons.
authorZac Medico <zmedico@gentoo.org>
Tue, 16 Jan 2007 07:59:41 +0000 (07:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 16 Jan 2007 07:59:41 +0000 (07:59 -0000)
svn path=/main/trunk/; revision=5669

bin/repoman

index a9c05c6c190984c151cb02b0c7cea164a1c0895c..772c0da36e8708933779cf6fb0b1c914079e9b3b 100755 (executable)
@@ -1600,8 +1600,8 @@ else:
                commitmessage+="\n(Portage version: Unknown)"
        if myupdates or myremoved:
                myfiles = myupdates + myremoved
-               commitmessagefile=tempfile.mktemp(".repoman.msg")
-               mymsg=open(commitmessagefile,"w")
+               fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
+               mymsg = os.fdopen(fd, "w")
                mymsg.write(commitmessage)
                mymsg.close()
 
@@ -1752,8 +1752,8 @@ else:
                if "--pretend" in myoptions:
                        print "(/usr/bin/cvs -q commit -F "+commitmessagefile+")"
                else:
-                       commitmessagefile = tempfile.mktemp(".repoman.msg")
-                       mymsg=open(commitmessagefile,"w")
+                       fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
+                       mymsg = os.fdopen(fd, "w")
                        mymsg.write(commitmessage)
                        if signed:
                                mymsg.write("\n (Signed Manifest commit)")