Skip to content

Commit

Permalink
Place retry file in the user's home dir instead of /var/lib/tmp
Browse files Browse the repository at this point in the history
Addresses CVE-2013-4260: predictable filename used for failed results
in world writable directory.
  • Loading branch information
jimi-c committed Aug 21, 2013
1 parent b33ca49 commit d5948d5
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/ansible/playbook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,7 @@ def generate_retry_inventory(self, replay_hosts):
basedir = self.inventory.basedir()
filename = "%s.retry" % os.path.basename(self.filename)
filename = filename.replace(".yml","")

if not os.path.exists('/var/tmp/ansible'):
try:
os.makedirs('/var/tmp/ansible')
except:
pass
filename = os.path.join('/var/tmp/ansible', filename)
filename = os.path.join(os.path.expandvars('$HOME/'), filename)

try:
fd = open(filename, 'w')
Expand Down

0 comments on commit d5948d5

Please sign in to comment.