puppetlabs/puppet — pull request #190 by joshcooper (2011-10-31 23:09:56+00:00)
Title: Ticket/2.7.x/10269 build break

Previously, some of the file integration tests were failing to cleanup
non-executable directories when using a world-writable TMPDIR.

The issue is that if the parent directory is world-writable, then
FileUtils.rm_r performs additional steps to ensure it is not
vulnerable to a TOCTTOU attack, such as ensuring the parent directory
is sticky and that the directory-to-be-deleted is readable.

This was not noticed earlier, because on Mac and Windows, TMPDIR
defaults to a user-specific directory, which is not
world-writable. But the Jenkins nodes are using /tmp, so it caused
these failures.

This commit changes the tests to explicitly make the directories
read/write/executable for the current user, so that they can be
cleaned up.