Copy owner/group in replace_file

If the file doesn't exist, this will still use the current user/group as
the uid/gid of the file.
Document uid/gid-related methods in Puppet::Util
Remove unnecessary fallbacks in change_{user,group}

These methods were attempting to call change_privilege, and rescuing
NotImplementedError, to use our own implementation of similar behavior.
As it turns out, the only system on which change_privilege is not
implemented is Windows, which these methods already don't support. So
there's no reason to have a fallback that would only ever fail or not be
reached.
Disable replace_file on Windows

Our current approach of setting owner/mode in the Puppet way risks
losing any extra permissions beyond owner/group/everyone, which is
significant enough that it is better to simply not support this
operation until we have a better solution. replace_file isn't used in
any code which actually runs on Windows at the moment, so this is
a benign change.
Disable specs that use replace_file on Windows

The k5login and solaris user_role specs use replace_file, which currently
doesn't work on Windows.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #508 from pmorch/doc-for-apply-noop

Add documentation for puppet apply --noop
Merge pull request #241 from GregSutcliffe/pacman_aur_support

Extend Pacman provider for Archlinux to use Yaourt
Extra debug logging during plugin loading

As a new-ish puppet user, it is incredibly easy to screw up your
module path (e.g., by adding a directory that directly contains
module/plugin contents to the module path, rather than adding the
*parent* directory.  This basically means that there would be a
'lib' directory directly in your module path.)

This commit just adds a few debug messages that may give a user
hints about what could be wrong with their module path when
we are able to detect these sorts of situations.
Updating CHANGELOG and lib/puppet.rb for 2.7.11
Merge pull request #452 from daniel-pittman/bug/2.7.x/8435-openbsd-package-provider-broken-with-remote-packages

Bug/2.7.x/8435 openbsd package provider broken with remote packages
Updating CHANGELOG and lib/puppet.rb for 2.6.14
Fix spec ordering failure on environment

The module_requirements method was sorting the requirements, but only as
it went along, not for the entire list of requirements that got put in
the data structure.  This caused intermittent test failures since
sometimes the results would come out in a different order than the
specs asserted.

This moves the sort to happen *after* the data is all in.
Merge pull request #517 from mmrobins/maint/2.7.x/fix_enviornment_sort_spec_failure

Maint/2.7.x/fix enviornment sort spec failure
Symbolic file mode test fixes when no mode change happens.

The acceptance test for symbolic file modes didn't handle a case when the
initial and target file mode were identical correctly; it expected a message
about a change, which was never delivered.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
(#12412) Mark symbolic file modes test as pending on Windows

Previously, the test used hard-coded tmp file locations, and then
passed the posix style paths to puppet apply, which doesn't work on
Windows agents.

This commit refactors the test to use `Host#tmpfile` and Host#tmpdir`
methods, which requires using `agents.each do |agent|` style test.

Also, there are problems executing `chmod 0000 path` via Cygwin as the
resulting file always has at least 0400 permission. For now, I'm
marking the entire test as pending on Windows and will come back to
it.
Updating CHANGELOG and lib/puppet.rb for 2.7.11
(#7316) Initial acceptance tests

This is an acceptance test for #7316 and #6753.  It creates an application
and a face on the master, runs the agent, verifies that the pluginsync
brought down the correct files, and then attempts to run the app/face.

If the app/face run successfully then we've illustrated that the pluginsync
worked and that the app/face are available on the node, and also that the
face can be run without having a stub placeholder file in the application
directory (#6753).

These currently fail, which is why they are in the "pending" directory.
(#12564) Stub CHILDSTATUS in all test cases, not just failure cases.

On my machine, $CHILDSTATUS is always "success", so I didn't notice the
failure to stub out the first couple of tests correctly.  Now, with them
stubbed, it is no longer possible that a previous test can leave global state
dangling that will break their assumptions.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
(#11740) Wait on the handle from the PROCESS_INFORMATION structure

Previously, the `Puppet::Util.execute` method was using `waitpid2` to
wait for the child process to exit and retrieve its exit status. On
Windows, this method (as implemented by the win32-process gem) opens a
handle to the process with the given pid, and then calls
`WaitForSingleObject` and `GetExitCodeProcess` on the process
handle. However, the pid-to-handle lookup will raise an exception if
the child process has exited. As a result there was a race condition
whereby puppet could sometimes fail to retrieve the exit status of
child processes.

The normal way of getting the exit code for a child process on Windows
is to use the child process handle contained in the
`PROCESS_INFORMATION` structure returned by `CreateProcess`. This
works regardless of whether the child process is currently executing
or not.

This commit reworks the `Puppet::Util.execute_windows` method to wait
on the child process handle contained in the process information
structure. This requires that we pass the `:close_handles => false`
option to the win32-process gem so that it doesn't close the handles.

This commit also re-enables tests that were previously being skipped
due to this bug.
Merge pull request #519 from daniel-pittman/bug/2.7.x/12564-insufficient-stubbing-of-childstatus

Bug/2.7.x/12564 insufficient stubbing of childstatus