Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9150

cwd option in Puppet::Util::Execution.execute should work with different Windows path types

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.0.7
    • None
    • Platform OS
    • Platform OS Kanban
    • Not Needed
    • Needs Assessment

    Description

      The Windows API supports setting a working directory when starting a process. However, Puppet does not currently allow setting this value programatically.

      The win32-process gem can pass cwd supplied through it's argument hash - see code at https://github.com/djberg96/win32-process/blob/win32-process-0.7.5/lib/win32/process.rb#L681

      Puppet currently uses Dir.chdir to set a working directory before creating a process - however, this might not always work properly on Windows. The cwd has File.directory?(dir) used to validate it, which could fail on UNC or other path types (like reparse points - i.e. symlinks) on Windows - meaning that Dir.chdir never gets called as expected.

      The call to Process.create at https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/windows/process.rb#L12 should pass the arguments value through.

      Attachments

        Issue Links

          Activity

            People

              sean.mcdonald Sean McDonald
              enis.inan Enis Inan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support