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

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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 6.0.7
    • Component/s: None
    • Template:
      PUP Bug Template
    • Team:
      Platform OS
    • Sprint:
      Platform OS Kanban
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      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

              jsd-sla-details-panel

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: