(packaging) Update PUPPETVERSION to 3.2.0
Merge branch 'release_3.2.0' into stable
(#20726) Add user managehome acceptance tests

There were no acceptance tests covering the behavior of user providers
when managing home directories.

This commit adds two acceptance tests, one for testing when the home
directory is managed, and one test when the home directory is no longer
being managed.

Paired-with: Josh Cooper <josh@puppetlabs.com>
Revert "Merge branch 'pull-1512'"

This reverts commit 9c22753eee23db85fb9a3774d25b26a468db8d7e, reversing
changes made to cb9927f49fd1512720177ad77395a1586f86cbd1.

This commit is being reverted because #20726 revealed a bug with the new
managehome home behavior of useradd.
(#20726) Include password for useradd managehome tests on windows

The new acceptence tests for managing the home directory fails on
Windows because windows requires a sufficiently complex password to be
specified when creating the home directory.

With that said, managing the home directory is broken on windows with
ruby 1.9 (#20768). This marks the test as pending when not running ruby
1.8.

Paired-with: Josh Cooper <josh@puppetlabs.com>
(#20726) Manage home has issues on Solaris

On Solaris, executing `usermod -d dir username` where dir is the user's
home directory as reported by `puppet resource user username` will fail
with the error:

    UX: useradd: ERROR: Path must not start with '/home/'

It appears the new directory must be of the form
'/export/home/username'. Since this issue is unrelated to #20726, I'm
marking this test as pending on Solaris.
(Maint) Give each test a meaningful name

The tests being put all together did not provide any explanation about
what was interesting about each situation. This obscures other
interesting cases that may not be covered and also provides little to no
specification to later developers who may need to know what the cases
being handled are.
Merge branch 'ticket/stable/20726-usermod-command-arguments-out-of-order' into stable

* ticket/stable/20726-usermod-command-arguments-out-of-order:
  (#20726) Manage home has issues on Solaris
  (#20726) Include password for useradd managehome tests on windows
  Revert "Merge branch 'pull-1512'"
  (#20726) Add user managehome acceptance tests
(#20742) Handle DNs that cannot be parsed

When no DN is sent in a RACK setup (passenger behind apache), the DN
that the master sees for unauthenticated requests ends up being the
string "(null)". The openssl name parsing functions do not handle data
that doesn't look like a DN in a useful manner. If the string to be
parsed as a DN does not contain an equals sign ("="), then it will fail
with an error like:

  TypeError: can't convert nil into String
  # ./lib/puppet/util/ssl.rb:26:in `call'
  # ./lib/puppet/util/ssl.rb:26:in `block in subject_from_dn'
  # ./lib/puppet/util/ssl.rb:24:in `each'
  # ./lib/puppet/util/ssl.rb:24:in `subject_from_dn'

This same code also would fail with a OpenSSL::X509::NameError if the
parsed DN contained an unknown part (RDN), e.g. "no=yes".

This commit fixes the malformed DN by checking that the DN contains at
least an equals sign before trying to parse. It also then handles all
OpenSSL::X509::NameError problems.
(#20742) Only use certifcate info if there is a CN

Because of the changes to puppet/util/ssl for this issue, the DN
was now always able to be parsed into something. This uncovered that the
logic around deciding on the node name and authentication status for the
request was incorrectly based off of simply the existance of a DN in the
headers. This caused a DN that was missing a CN to have an unknown node
for a request, which could be marked as authenticated if the verify
header was "SUCCESS".

This patch fixes it by basing the decision of using the SSL headers on
the existance of the CN instead of the DN. Now a CN must be present
(e.g. a valid DN) for the verify header to be used. When no CN is
present, then it is treated the same as no DN being present, which
causes a reverse DNS lookup to be done for the node name.
Merge remote-tracking branch 'zaphod42/issue/stable/20742-no-handling-of-bad-dn-in-rack' into stable

* zaphod42/issue/stable/20742-no-handling-of-bad-dn-in-rack:
  (#20742) Only use certifcate info if there is a CN
  (#20742) Handle DNs that cannot be parsed
  (Maint) Give each test a meaningful name
Merge branch 'stable'

* stable:
  (#20742) Only use certifcate info if there is a CN
  (#20742) Handle DNs that cannot be parsed
  (Maint) Give each test a meaningful name
  (#20726) Manage home has issues on Solaris
  (#20726) Include password for useradd managehome tests on windows
  Revert "Merge branch 'pull-1512'"
  (#20726) Add user managehome acceptance tests
  (packaging) Update PUPPETVERSION to 3.2.0