summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-03-06 12:11:43 -0800
committerGitHub <noreply@github.com>2020-03-06 12:11:43 -0800
commitc10d9ac2c6897a4579f94ccd079492e4ce3fc2a4 (patch)
tree4fae0671a1474a8a99663de0b65642e8b9199222 /lib
parentf2aacc890c732ca481dbbe890d9a035b37c4dafb (diff)
parent7c6ef6bff121a22a9346c8559196e5661551df32 (diff)
downloadchef-c10d9ac2c6897a4579f94ccd079492e4ce3fc2a4.tar.gz
Merge pull request #9455 from chef/link_check
link resource: Remove checks for symoblic link support on Windows
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/link.rb21
-rw-r--r--lib/chef/win32/file.rb12
2 files changed, 2 insertions, 31 deletions
diff --git a/lib/chef/resource/link.rb b/lib/chef/resource/link.rb
index 134f02fde9..7758e27433 100644
--- a/lib/chef/resource/link.rb
+++ b/lib/chef/resource/link.rb
@@ -43,11 +43,6 @@ class Chef
default_action :create
allowed_actions :create, :delete
- def initialize(name, run_context = nil)
- verify_links_supported!
- super
- end
-
property :target_file, String,
description: "An optional property to set the target file if it differs from the resource block's name.",
name_property: true, identity: true
@@ -72,22 +67,6 @@ class Chef
def path
target_file
end
-
- private
-
- # On certain versions of windows links are not supported. Make
- # sure we are not on such a platform.
- def verify_links_supported!
- if ChefUtils.windows?
- require_relative "../win32/file"
- begin
- Chef::ReservedNames::Win32::File.verify_links_supported!
- rescue Chef::Exceptions::Win32APIFunctionNotImplemented => e
- Chef::Log.fatal("Link resource is not supported on this version of Windows")
- raise e
- end
- end
- end
end
end
end
diff --git a/lib/chef/win32/file.rb b/lib/chef/win32/file.rb
index 4fac3fe797..ccbff43f01 100644
--- a/lib/chef/win32/file.rb
+++ b/lib/chef/win32/file.rb
@@ -1,7 +1,7 @@
#
# Author:: Seth Chisamore (<schisamo@chef.io>)
-# Author:: Mark Mzyk (<mmzyk@ospcode.com>)
-# Copyright:: Copyright 2011-2016, Chef Software Inc.
+# Author:: Mark Mzyk (<mmzyk@chef.io>)
+# Copyright:: Copyright 2011-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -166,14 +166,6 @@ class Chef
VersionInfo.new(file_name)
end
- def self.verify_links_supported!
- CreateSymbolicLinkW(nil)
- rescue Chef::Exceptions::Win32APIFunctionNotImplemented => e
- raise e
- rescue Exception
- # things are ok.
- end
-
def self.file_access_check(path, desired_access)
security_descriptor = Chef::ReservedNames::Win32::Security.get_file_security(path)
token_rights = Chef::ReservedNames::Win32::Security::TOKEN_IMPERSONATE |