opscode/chef — pull request #926 by sersut (2013-07-29 15:25:22+00:00)
Title: CHEF-4419: Absolute file paths with no drive letter for file resources on Windows fails chef-client run

This PR fixes CHEF-4419 (https://tickets.opscode.com/browse/CHEF-4419) for 11.6 branches.

Some background:

We have an old bug in chef where passing paths starting with "/" to some windows APIs fail either with PATH_NOT_FOUND or ACCESS_DENIED without any users hitting it.

File Provider Refactoring in 11.6.0 made one of the code paths which hits this bug a frequent code path. Specifically this code path is the path where chef checks if the files it sees are symlink or not in order to ensure that files pointed by symlinks do not get overridden.

This PR fixes CHEF-4419 for this common case.

In the long term we are planning to fix the overall issue by mapping all the paths that start with "/" to SYSTEMDRIVE because:

1-) Windows maps the paths starting with "/" to the current working directory which can change from system to system and how chef is run. Therefore using paths that start with "/" is a bad practice on windows.
2-) Most if not all of the time, users are intending to point to SYSTEMDRIVE on windows when they use a path that starts with "/".
3-) Having this by default in chef will ensure that everyone doesn't implement a different workaround in cookbooks.

However since this functionality is a change in behavior, it is not in the scope of 11.6 branches.

NOTE: This PR shouldn't be merged into master for which a different fix is in the works.

End of transmission :)