HomePhorge

(#10269) Make directories executable so they can be cleaned up
674068ad5406Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

(#10269) Make directories executable so they can be cleaned up

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.

Details

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU674068ad5406: (#10269) Make directories executable so they can be cleaned up (authored by Josh Cooper <josh@puppetlabs.com>).Oct 31 2011, 11:25 PM