Maint: Update docs for schedule type and metaparameter

The wording of these was out of date and somewhat strange.
Maint: Improve/reduce documentation of relationship metaparemeters

These descriptions were too wordy and too inconsistent. I'm imposing a format on
them so they all look alike, and a casual reader can tell how many there are and
how their behaviors differ. I'm also adding links to the more detailed
documentation.
Maint: Standardize docs for refresh behavior in resource types; clarify exec docs

Service/mount/exec already documented that they do the refresh thing, but it
wasn't organized in a predictable way. I'm imposing a convention of a bold
"Refresh" label, a reminder of where events come from, and a description of what
that type does when it gets one.

This commit also adds a lot more detail on how execs respond to refresh, since
it's actually really complicated and not the least bit intuitive. I also reworded
some of the older language near the top of the exec type, while I was in there.
Maint: Clarify docs for stage type and metaparameter

This was pretty disorganized and confusing. Now it's less so!
(PUP-1255) Fix assumed default file mode to 0644

When a file is created with content, the assumed default mode should be 0644,
but this wasn't being explicitly set.  The secure file replacement (in
Puppet::Util.replace_file) was instead defaulting to a file mode of 0600.
The assumed default mode is now explicitly set when calling replace_file.

The code path for file creation without content continues to set a umask of
0022 if no mode is specified on the resource, so new files are implicitly
created with a mode of 0644.
(PUP-1255) Don't use POSIX defaults on Windows

If the POSIX default mode of 0644 is used when creating files on windows the
SYSTEM ACE is lost on files that are not meant to have thier mode managed. This
updates the replace_file method to understand that a nil default mode really
means to use the platform dependent default.
Merge pull request #2203 from kylog/issue/master/pup-1255-incorrect-default-permissions

Issue/master/pup 1255 incorrect default permissions
(PUP-1255) Don't be sensitive to pseudo-inherited ACEs

Previously, the test would fail on Windows 2012, as the access control
entries in the Temp directory's DACL are missing the INHERITED_ACE bit:

    > setacl -on  temp -ot file -actn list  -lst "f:tab;w:d,s,o,g;i:y"
    temp

    Owner: WIN-61G7FSKJ7JI\josh
    Group: WIN-61G7FSKJ7JI\None
    DACL(not_protected):
    NT AUTHORITY\SYSTEM    full   allow container_inherit+object_inherit
    BUILTIN\Administrators full   allow container_inherit+object_inherit
    WIN-61G7FSKJ7JI\josh   full   allow container_inherit+object_inherit

Note how none of the entries granting 'full' access are "inherited".

The test creates two empty temp files (the source is generated in the
call to Puppet::Util.replace_file) each with permissions:

    WIN-61G7FSKJ7JI\josh
    WIN-61G7FSKJ7JI\None
      NT AUTHORITY\SYSTEM:(I)                       0x1f01ff
      BUILTIN\Administrators:(I)                    0x1f01ff
      WIN-61G7FSKJ7JI\josh:(I)                      0x1f01ff

Each ACE is inherited and grants full access as expected. But when the Win32
API `ReplaceFile` is called, it prepends non-inherited ACEs to the destination
file:

    WIN-61G7FSKJ7JI\josh
    WIN-61G7FSKJ7JI\None
      NT AUTHORITY\SYSTEM:                          0x1f01ff
      BUILTIN\Administrators:                       0x1f01ff
      WIN-61G7FSKJ7JI\josh:                         0x1f01ff
      NT AUTHORITY\SYSTEM:(I)                       0x1f01ff
      BUILTIN\Administrators:(I)                    0x1f01ff
      WIN-61G7FSKJ7JI\josh:(I)                      0x1f01ff

While the merging behavior is unexpected, it doesn't alter the effective
security of the file.

This commit marks the directory as protected, which breaks inheritance
at that point. As a result, ReplaceFile behaves as expected.

Also note that if the Temp ACLs are reset recursively:

    icacls Temp /reset /t

Then the merging behavior does not occur and the test passes (without
this commit).

See also pseudo-inherited ACEs:
http://helgeklein.com/setacl/faq/#what-are-pseudo-protected-acls-and-pseudo-inherited-aces-setacl-2-1
(maint) Add temp workaround for travis

Rubygems broke travis builds on ruby 1.8.7:

https://github.com/travis-ci/travis-ci/issues/1793
https://github.com/rubygems/rubygems/pull/763

This patch is a temporary workaround until rubygems is
updated.
Merge remote-tracking branch 'joshcooper/issue/stable/pup-1255-windows-2012' into stable
(PUP-724,#21922) Autoload compares only integer secs

Although the ultimate reasons have not been tracked down, there have
been occasions where the Puppet::Util::Autoload.changed? method will
erroneously report that a file has changed based on an mtime having
seemed to change nsecs, despite no evidence of this being seen in the
file system.

The previous implementation was comparing mtime (Ruby Time instances)
and the nsecs seem to be volatile under unknown conditions. When it does
break, this was manifesting as a failure to autoload
puppet/util/instrumentation/listeners/log.rb (the instrumentation code
is relying on Puppet::Util::Autoload for initial loading but does not
expect its listeners to be reloaded, and they are not written in such a
way as to be reloadable...) (see PUP-724 and its associated tickets for
details).

The work around is to instead just compare integer secs.
(PUP-1144) Make future parser accept $_private

This removes validation of QualifiedName (they must be validated
differently depending on where they appear). Variables were bit
by this too restrictive validation rule.
(PUP-1144) Fix up failing tests (pending new/better validation)

Two tests that expected validation to fail did not get triggered
because the too strict validation was removed. It needs to be replaced
with a different better validation. Such validation should be added
in 3.5 (too much work for 3.4) - instead, just accepting potentially
faulty names (they still have to lex correctly).
(packaging) Update PUPPETVERSION to 3.4.2
(PUP-1211) Force registry value encoding to match code page

Ruby uses ANSI versions of Win32 APIs to read values from the registry. The
encoding of these strings depends on the active code page. However, ruby
incorrectly sets the string encoding to US-ASCII.[1]

As a result, if you try to perform a regex match on the string, and the string
contains the registered trademark symbol, 0xAE, then ruby will raise an error
saying 'Invalid byte sequence in US-ASCII'

This commit forces the encoding of REG_SZ, REG_EXPAND_SZ, and REG_MULTI_SZ to
the encoding for the active code page. So if the active code page is 1252, the
ruby encoding will be `Encoding::CP1252`.

See https://bugs.ruby-lang.org/issues/8943
Merge pull request #2229 from joshcooper/issue/stable/PUP-1211-registry-encoding

(PUP-1211) Force registry value encoding to match code page
Merge pull request #2156 from nfagerlund/docs_metaparams_schedule

Docs: Schedule, stage, and other metaparams
(PUP-736) Remove description from RPM/DPKG

Encoding mis-match causes package prefetching to fail with
'invalid byte sequence in US-ASCII'. The guidelines for the
Debian Project [1] and the Fedora Project [2] specify that
metadata files should be UTF-8 encoded, but it is not
enforced.

Since we are not able to force encoding "UTF-8" to work around
this we have decided to back out the description from package
formats for now while working on a longer term solution for
encoding.

Without this fix the package formats fail if there is a package
with UTF-8 encoding in the description.

[1]: http://www.debian.org/doc/debian-policy/ch-controlfields.html
[2]: http://fedoraproject.org/wiki/Packaging:Guidelines#Encoding

Paired with Josh Partlow <joshua.partlow@puppetlabs.com>
(PUP-736) Do not test for package not found

And log unmatched lines at debug level. The executors for dpkg and rpm
will raise an error if the command line returns a non-zero status, which
it does for package not found errors.  This bypasses parsing and is
interpretted as package absent result.  Therefore there is no need to
attempt to parse 'package not found' and we can avoid any issues with
changing or translated messages.

If there are unrecognizable lines of output returned from a successful
execution, log them at debug level.  Logging at a warning level has the
potential to produce too much noise.

Dpkg#query is no longer multi-line output and no longer requires
filtering through a pipe.
Merge pull request #2233 from jpartlow/issue/stable/pup-736-remove-rpm-dpkg-description-fetching

Issue/stable/pup 736 remove rpm dpkg description fetching