(maint) Remove trailing whitespace, retab puppet.init

This removes trailing whitespace from ext/debian/puppet.init and also retabs it
to use 4 space tabs instead of the mix of hard and soft tabs that were present
previously.
(#17447) Stop puppet before returning in debian init script

Without the retry flag, the stop call in the debian init script isn't
guaranteed to stop the puppet agent or master. This commit adds a 2 step
timeout to the init scripts. A TERM signal is sent first, and after 10 seconds
if the process is still running a KILL signal is sent. The unneccessary sleep
call is also removed from the restart case. This affects both agent and
master init scripts.
(#17445) Update logrotate for debian

Previously logrotate would run the postrotate script n times where n was equal
to the number of logs matching the pattern. This could cause puppet to
misbehave if it received several HUP or USR2 signals at once as noted in the
ticket. This commit adds a sharedscripts line to the logrotate rule, which
tells logrotate to only run the postrotate script once, for all matching log
files found.
Update lib/puppet/version.rb for 2.7.20-rc1
Merge branch '2.7.x' into 3.0.x

Conflicts:
	lib/puppet/version.rb
(maint) Document Puppet::Parser::Functions.newfunction

Without this patch we have no YARD inline documentation for the
`Puppet::Parser::Functions.newfunction` class method.  This is a problem
because this is a very important user facing method that provides an API
that must remain stable across semantic versions.

This patch addresses the problem by documenting all of the options,
parameters, and user facing behaviors of the `newfunction` method.  In
addition, references to docs.puppetlabs.com, the stdlib module (which
heavily relies on this API), and the builtin template() function are
provided.

This patch also clearly documents the semantics of the new `:arity`
optional parameter.
Merge branch 'fix/master/document_parser_newfunction'

* fix/master/document_parser_newfunction:
  (maint) Document Puppet::Parser::Functions.newfunction
[12833] Refactor directoryservice user provider

Previously, the OS X directoryservice user provider could not handle
10.8 users due to version 10.8 of OS X implementing PBKDF2-style
password hashing/stretching. The user provider also struggled with
setting 10.7-style passwords in a single run due to the way that
passwords are stored in OS X versions 10.7 and higher.

The `dscl` binary is in charge of changing user attributes, and CAN be
used to set a user's password, but it must be provided with a plaintext
password. We have discovered no way to use `dscl` or `dsimport` and pass
it a password hash that will be set for a user. Because of this fault,
the user's plist located in /var/db/dslocal/nodes/Default/users must be
directly modified. Because the `dscl` command maintains its own caching
system, changes made using the dscl command will not be immediately written
to disk. Conversely, DIRECT CHANGES to the user's plist file will NOT be
recognized by the dscl command unless you flush its cache. Flushing the
dscl cache is an asynchronous action, however, so you must sleep long
enough for dscl to read-from/write-to disk.

With the mechanism for reading/writing passwords cleaned up, the problem
remains that 10.8 uses PBKDF2 passwords that rely on a `salt` and `iterations`
value. These three values (the hash, the salt, and the iterations value)
together form a unique key that comprise the user's password. Because
the salt and iterations values must be specified, the user type had to
be modified to allow these values to be passed in a user resource
declaration. This change does not break clients on versions of OS X
older than 10.8.

With these two faults in mind, the decision was made to completely
re-write the directoryservice user provide so that it shed its reliance
on the lib/puppet/provider/nameservice/directoryservice plugin and was
completely independent. This commit refactors the directoryservice user
provider according to the aforementioned deficiencies and implements
tests for the new user provider.
Merge branch 'fix/3.0.x/glarizza_12833_user_refactor' into 3.0.x

* fix/3.0.x/glarizza_12833_user_refactor:
  [12833] Refactor directoryservice user provider
Merge branch '3.0.x'

* 3.0.x:
  [12833] Refactor directoryservice user provider
  Update lib/puppet/version.rb for 2.7.20-rc1
Merge pull request #1260 from haus/ticket/3.0.x/17447_fixup_init_script

Ticket/3.0.x/17447 fixup init script
[12833] Refactor directoryservice user provider

Previously, the OS X directoryservice user provider could not handle
10.8 users due to version 10.8 of OS X implementing PBKDF2-style
password hashing/stretching. The user provider also struggled with
setting 10.7-style passwords in a single run due to the way that
passwords are stored in OS X versions 10.7 and higher.

The `dscl` binary is in charge of changing user attributes, and CAN be
used to set a user's password, but it must be provided with a plaintext
password. We have discovered no way to use `dscl` or `dsimport` and pass
it a password hash that will be set for a user. Because of this fault,
the user's plist located in /var/db/dslocal/nodes/Default/users must be
directly modified. Because the `dscl` command maintains its own caching
system, changes made using the dscl command will not be immediately written
to disk. Conversely, DIRECT CHANGES to the user's plist file will NOT be
recognized by the dscl command unless you flush its cache. Flushing the
dscl cache is an asynchronous action, however, so you must sleep long
enough for dscl to read-from/write-to disk.

With the mechanism for reading/writing passwords cleaned up, the problem
remains that 10.8 uses PBKDF2 passwords that rely on a `salt` and `iterations`
value. These three values (the hash, the salt, and the iterations value)
together form a unique key that comprise the user's password. Because
the salt and iterations values must be specified, the user type had to
be modified to allow these values to be passed in a user resource
declaration. This change does not break clients on versions of OS X
older than 10.8.

With these two faults in mind, the decision was made to completely
re-write the directoryservice user provide so that it shed its reliance
on the lib/puppet/provider/nameservice/directoryservice plugin and was
completely independent. This commit refactors the directoryservice user
provider according to the aforementioned deficiencies and implements
tests for the new user provider.
Merge branch '3.0.x'

* 3.0.x:
  [12833] Refactor directoryservice user provider
  (#17447) Stop puppet before returning in debian init script
  (maint) Remove trailing whitespace, retab puppet.init
(#17294) Remove empty puppet/provider/interface/base file

Without this patch there is a zero byte file located in the Puppet
library directory structure.  This is a problem because empty files are
considered errors when producing RPM packages.  I could not find any
reason this file exists, or any instances of this file being loaded.
Removing the file does not cause any apparent spec test failures.

This patch fixes the problem by removing the file from the tree.
Merge branch 'fix/3.0.x/17294_remove_empty_file' into 3.0.x

* fix/3.0.x/17294_remove_empty_file:
  (#17294) Remove empty puppet/provider/interface/base file
Merge branch '3.0.x'

* 3.0.x:
  (#17294) Remove empty puppet/provider/interface/base file
Merge pull request #1262 from haus/ticket/3.0.x/17445_fixup_logrotate_rules

(#17445) Update logrotate for debian
Merge branch '3.0.x'

* (#17445) Update logrotate for debian
(#17492) Fix --run_mode=foo global option parsing

Without this patch applied Puppet behaves as expected when given
`--run_mode user`, but not when given `--run_mode=user`.  This is a
problem because The Foreman passes arguments to Puppet as a single
argument in the argument vector and this exceptional behavior is a
blocker for The Foreman supporting Puppet 3.

This patch fixes the problem by removing the --run_mode argument from
the argument vector after the option_parser is done processing.  This
prevents subsequent option parsing from trying to process the option and
failing to do so.

Original commit message:

parse_global_options now supports --run_mode=foo style arguments as well
space-separated arguments.

Reviewed-by: Jeff McCune <jeff@puppetlabs.com>
Merge branch 'domcleal-tickets/3.0.x/17492-runmode' into 3.0.x

* domcleal-tickets/3.0.x/17492-runmode:
  (#17492) Fix --run_mode=foo global option parsing