Skip to content

Commit

Permalink
Security fix - temp file created in unsecure way
Browse files Browse the repository at this point in the history
  • Loading branch information
Clement Lefebvre committed Mar 17, 2010
1 parent 9355a4f commit 3019939
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions usr/lib/linuxmint/mintUpdate/mintUpdate.py
Expand Up @@ -1402,15 +1402,17 @@ def setVisibleColumn(checkmenuitem, column, configName):

# prepare the log
pid = os.getpid()
logdir = "/tmp/mintUpdate"
logdir = "/tmp/mintUpdate/"
if os.getuid() == 0 :

mode = "root"
else:
mode = "user"
os.system("mkdir -p " + logdir)
logFile = logdir + "/" + parentPid + "_" + str(pid) + ".log"
log = open(logFile, "w")
#logFile = logdir + "/" + parentPid + "_" + str(pid) + ".log"
#log = open(logFile, "w")
log = tempfile.NamedTemporaryFile(prefix = logdir, delete=False)
logFile = log.name

log.writelines("++ Launching mintUpdate in " + mode + " mode\n")
log.flush()
Expand Down

0 comments on commit 3019939

Please sign in to comment.