diff options
Diffstat (limited to 'lib/chef/win32/file.rb')
-rw-r--r-- | lib/chef/win32/file.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/win32/file.rb b/lib/chef/win32/file.rb index 55fc2461e8..7a019781d7 100644 --- a/lib/chef/win32/file.rb +++ b/lib/chef/win32/file.rb @@ -23,6 +23,7 @@ require_relative "api/security" require_relative "error" require_relative "unicode" require_relative "version" +require "chef-utils" unless defined?(ChefUtils::CANARY) class Chef module ReservedNames::Win32 @@ -62,7 +63,7 @@ class Chef # TODO do a check for CreateSymbolicLinkW and # raise NotImplemented exception on older Windows flags = ::File.directory?(old_name) ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0 - flags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE if Chef::ReservedNames::Win32::Version.new.win_10_creators_or_higher? + flags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE if ChefUtils.windows_nt_version >= "10.0.15063" # Windows 10 Creators Update or later old_name = encode_path(old_name) new_name = encode_path(new_name) unless CreateSymbolicLinkW(new_name, old_name, flags) |