HomePhorge

(#12363) Use Tempfile to generate temp files
51fa66659b61Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

(#12363) Use Tempfile to generate temp files

Previously, puppet used ENV['TMP'], ENV['TEMP'], /tmp, etc as it's
temp directory search path, using the first one that existed. It then
used constant file names within the temp directory to re-write the
files in ruby's bin directory, and bat wrappers on Windows.

First, it leads to predictable temp file names, which is bad. Second,
when installing puppet via a non-interactive ssh shell, e.g.

ssh <host> ruby install.rb

which is what the acceptance test harness does, the TMP and TEMP
environment variables are usually not defined. So puppet was always
defaulting to /tmp, which doesn't work when installing puppet on
Windows agents during acceptance tests.

This commit just changes the install script to use ruby's Tempfile to
generate secure temp files that works in non-interactive shells.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUb7e1c32a06fc: Merge pull request #425 from daniel-pittman/bug/2.7.x/12269-multiple-cycles…
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU51fa66659b61: (#12363) Use Tempfile to generate temp files (authored by Josh Cooper <josh@puppetlabs.com>).Feb 1 2012, 9:39 PM