Skip to content

Commit

Permalink
Merge 5d6cbb3 into b2d1450
Browse files Browse the repository at this point in the history
  • Loading branch information
sanfrancrisko authored Jun 9, 2021
2 parents b2d1450 + 5d6cbb3 commit 690fde9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion lib/pdk/cli/exec/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@ def initialize(*argv)
@argv = argv

@process = ChildProcess.build(*@argv)
@process.leader = true
# https://github.com/puppetlabs/pdk/issues/1083:
# When @process.leader is set, childprocess will set the CREATE_BREAKAWAY_FROM_JOB
# and JOB_OBJECT_LIMIT_BREAKAWAY_OK flags in the Win32 API calls. This will cause
# issues on systems > Windows 7 / Server 2008, if the JOB_OBJECT_LIMIT_BREAKAWAY_OK
# flag is set and the Task Scheduler is trying to kick off a job, it can sometimes
# result in ACCESS_DENIED being returned by the Win32 API, depending on the permission
# levels / user account this user.
# The resolution for pdk/issues/1083 is to ensure @process.leader is not set.
# This will potentially cause issues on older Windows systems, in which case we may
# need to revisit and conditionally set this param depending on what OS we're on
# @process.leader = true

@stdout = Tempfile.new('stdout', mode: TEMPFILE_MODE).tap { |io| io.sync = true }
@stderr = Tempfile.new('stderr', mode: TEMPFILE_MODE).tap { |io| io.sync = true }
Expand Down
4 changes: 2 additions & 2 deletions pdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 2.4.0' # rubocop:disable Gemspec/RequiredRubyVersion

spec.add_runtime_dependency 'bundler', '>= 1.15.0', '< 3.0.0'
spec.add_runtime_dependency 'childprocess', '~> 0.7.1'
spec.add_runtime_dependency 'childprocess', '~> 4.0.0'
spec.add_runtime_dependency 'cri', '~> 2.10'
spec.add_runtime_dependency 'diff-lcs', '1.3'
spec.add_runtime_dependency 'ffi', '>= 1.9.25', '< 2.0.0'
spec.add_runtime_dependency 'gettext-setup', '~> 0.24'
spec.add_runtime_dependency 'hitimes', '1.3.0'
spec.add_runtime_dependency 'hitimes', '2.0.0'
spec.add_runtime_dependency 'json-schema', '2.8.0'
spec.add_runtime_dependency 'json_pure', '~> 2.1.0'
spec.add_runtime_dependency 'minitar', '~> 0.6'
Expand Down

0 comments on commit 690fde9

Please sign in to comment.