[oe-commits] Marcin Juszkiewicz : kernel.bbclass: do not use insecure tmpnam() function for generating unique names

GIT User account git at amethyst.openembedded.net
Mon Jan 12 17:52:15 UTC 2009


Module: openembedded.git
Branch: org.openembedded.dev
Commit: e1f4964de0b74991a2c84f639a27ce50d220bc02
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=e1f4964de0b74991a2c84f639a27ce50d220bc02

Author: Marcin Juszkiewicz <hrw at openembedded.org>
Date:   Mon Jan 12 18:33:47 2009 +0100

kernel.bbclass: do not use insecure tmpnam() function for generating unique names

---

 classes/kernel.bbclass |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index e8f2fb6..c864782 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -293,8 +293,9 @@ module_conf_rfcomm = "alias bt-proto-3 rfcomm"
 
 python populate_packages_prepend () {
 	def extract_modinfo(file):
-		import os, re
-		tmpfile = os.tmpnam()
+		import tempfile, os, re
+		tempfile.tempdir = bb.data.getVar("WORKDIR", d, 1)
+		tmpfile = tempfile.mkstemp()[1]
 		cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (bb.data.getVar("PATH", d, 1), bb.data.getVar("HOST_PREFIX", d, 1) or "", file, tmpfile)
 		os.system(cmd)
 		f = open(tmpfile)





More information about the Openembedded-commits mailing list