Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Normal
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: PUP 4.10.2, PUP 5.0.0
-
Component/s: None
-
Labels:
-
Environment:
Windows 10 Pro 64bit
-
Template:customfield_10700 194815
-
Team:Agent
-
Story Points:1
-
Sprint:Agent 2017-06-14
-
Method Found:Needs Assessment
-
Release Notes:Bug Fix
-
Release Notes Summary:Puppet's interface with the CreateSymbolicLinkW Windows API function previously defined an incorrect return type which could cause unexpected results in the case of an error.
-
QA Risk Assessment:Manual
-
QA Risk Assessment Reason:ruby API issue; should be covered in unit tests
Description
I was investigating why David Schmitt and I were getting different results from `Puppet::FileSystem.symlink` on Windows. His VM was correctly reporting an error and mine was silently failing.
When run as a non-administrator user on my VM, `CreateSymbolicLinkW` would return non-zero (success for this function) when it should have failed. Going through the MSDN docs, I noticed that it returns a 1 byte `BOOLEAN` rather than the 4 byte `BOOL` that it is currently prototyped for with FFI (so I was getting a value with random data in the 3 upper bytes).
Changing the FFI prototype for the function over to returning an `int8` resolved the problem for me (see linked PR).