Maint: Remove unused variable in user spec

If rspec already gives us the described class why not using it.
Maint: Add a real provider class to user spec

Add a real provider class we can use in the tests.
Maint: Use real objects in user spec

Remove all references to the mock resource object
Maint: Remove unused mock objects in user spec

Also remove the modification of the PATH environment variable because we
will always have our :simple provider which does rely on any commands in
/sbin.
(#1076) Show warning if an empty group is specified

If the user passes an empty group to the user type, puppet will execute
an invalid `usermod` command.

e.g. if groups of user 'foo' is currently 'bar' and we do

    user { 'foo':
      groups     => '',
      membership => minimum # this is the default
    }

puppet will build a should value of ',bar' (old group + the new group '') and
will pass '-G ,bar' to the usermod command (which will then fail).

To really specifiy 'no group' the group property does allow an empty
array so we should fail if we find an empty string as a group.
(#13204) Workaround duplicate Augeas save events

Bug #264 in Augeas causes duplicate save events to be returned when editing
under /boot in newfile mode.  Because we loop around these events, diffing and
unlinking the files, this causes an ENOENT error when we process the same event
twice.

This commit checks that the file we intend to operate on exists.
(#7285) Add spec for Augeas initialisation and file loading

Simple initialisaton tests with combinations of lens include paths, explicit
file/lens loading against a few example files.
Quote strings containing hex numbers when generating ZAML

When generating ZAML, we prefer to write bare strings when possible. To
that end, we have rules about which sorts of strings are not safe to
write bare. One of those rules is strings containing numbers (for if we
wrote those bare, they would be revived as numbers). However, ZAML
wasn't properly considering hex digits when identifying a string
containing a number, resulting in those strings being written unquoted,
and revived incorrectly as numbers.

That is, YAML.load(ZAML.dump("0xffff")) would return 65535, when it ought
to be "0xffff".
(#12466) unset X-Forwarded-For header

Without this patch the handling of
X-Forwarded-For headers is insecure in a
default apache conf supplied with puppet.
This patch ensures X-Forwarded-For headers
are dropped.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(#12101) Add shared context for specs to imitate windows or posix

Add "windows" and "posix" shared contexts to rspec. If you give :as_platform
=> :posix or :as_platform => :windows as argument to a describe block, it will
automatically stub the relevant facts and path behavior to imitate windows or
posix.
(#12101) Make Puppet::Util::absolute_path? usable in autoloader

This makes Puppet::Util::absolute_path? check File::ALT_SEPARATOR to determine
path behavior of the local system instead of Puppet.features, which required
having an Autoload instance already. File::ALT_SEPARATOR is only defined on
systems with Windows path behavior, and the Ruby standard library uses this
frequently to distinguish systems.
Monkey patch FileUtils.mv in Ruby 1.8.5

The FileUtils.mv method in Ruby 1.8.5 can't mv directories across
devices.  File.rename causes "Invalid cross-device link" errors, which
is rescued, but in Ruby 1.8.5 it tries to recover with a copy and
unlink, but the unlink causes the error "Is a directory".  In newer
Rubies remove_entry is used, so the implementation in this patch is
what's used in Ruby 1.8.7 and Ruby 1.9

This was an issue in installing modules using `puppet module install`
since the module is extracted to a temporary directory and then moved to
the modulepath.
(#13367) Patch SemVer to permit ranges including pre-release components.
Make core changes needed for the puppet module tool

This includes changes to portions of the Puppet code base that have some
use by other parts of Puppet than the module tool, but are necessary for
the module tool work.
(#13397) fix gem provider ensure=>latest bug

As of 2.7.12, if you had "ensure=>latest" for any gem package
resource, puppet would not correctly detect that the gem
was already installed and would attempt to install it on
every run.  (This was because the "latest" method on the
gem provider was always returning an array, when it should
always be returning a single value.)
Add Module Tool

This rather large commit includes all the work needed to get the `puppet
module` face in Puppet with all it's actions.  I tried to break this up
into smaller commits, but it was difficult to do so and keep the
individual commits in a state that had passing specs since many changes
in shared module_tool code affected multiple actions.  This code was
developed in an integration branch over a few montsh and is now being
merged back into Puppet core in the same state that shipped with Puppet
Enterprise 2.5.

The work here was done by Pieter van de Bruggen <pieter@puppetlabs.com>,
Kelsey Hightower <kelsey@puppetlabs.com> and myself.
Merge pull request #613 from puppetlabs/geordi

Add Module Tool
Removed text/marshal support

Removing text/marshal support in order to close the security
vulnerability described in Bug #13552.
Fix for bucket_path security vulnerability

This is a fix for Bugs #13553, #13418, #13511. The bucket_path parameter
allowed control over where the filebucket will try to read and write to.
The only place available to stop this parameter is in the resolution
from a URI to an indirectory terminus. The bucket_path is used
internally for local filebuckets and so cannot be removed completely
without a larger change to the design.

Conflicts:

	lib/puppet/network/http/api/v1.rb
	spec/unit/network/http/api/v1_spec.rb

Conflicts resolved by modifying the patch to fit the use of
Puppet::Indirector::Request in the code.
(#3581) Stop forking around: Add fork helper method

Without this patch we are forking all over the place. All this forking
around is problematic when it comes to things like ActiveRecord and
database connections. It turns out that forking has a nasty side effect
of aggressively closing database connections and spewing errors all over
the place.

This patch introduces a new `Puppet::Util#safe_posix_fork` method that
does forking the right way (closing file descriptors, and resetting
stdin, stdout, and stderr). Tagmail, Puppet kick, and
`Puppet::Util#execute_posix` have been updated to make use of this new
functionality.

In the future, `Puppet::Util#safe_posix_fork` should be used in-place of
direct calls to `Kernel#fork`.

This patch includes related spec tests.