Skip to content

(#12363) Use Tempfile#438

Merged
slippycheeze merged 1 commit intopuppetlabs:2.7.xfrom
joshcooper:ticket/2.7.x/12363-use-tempfile
Feb 1, 2012
Merged

(#12363) Use Tempfile#438
slippycheeze merged 1 commit intopuppetlabs:2.7.xfrom
joshcooper:ticket/2.7.x/12363-use-tempfile

Conversation

@joshcooper
Copy link
Contributor

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.

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.
slippycheeze added a commit that referenced this pull request Feb 1, 2012
@slippycheeze slippycheeze merged commit bd45d79 into puppetlabs:2.7.x Feb 1, 2012
melissa pushed a commit to melissa/puppet that referenced this pull request Mar 30, 2018
(PCP-452) Add option to configure Association timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants