Cache TGS-REPs too

Changes in r25660 inadvertently failed to insert TGS-REPs into the
lookaside cache.  Call finish_dispatch_cache() at the end of
dispatch() to handle this case.

ticket: 7388 (new)
target_version: 1.10.4
tags: pullup
Add support for loading interposer modules

Extend the syntax of the gss mech config file to allow a module type
delimited by triangle brackets.  If the module type is "interposer",
flag the mechanism entry as being an interposer mechanism.  A module
marked as an interposer is loaded immediately (so it can interpose a
built-in mechanism) and produces a list of OIDs to interpose.
Interposer mechanisms are not exposed to applications.

[ghudson@mit.edu: Stylistic changes, commit squashing, commit
message]
Add primitives for using interposed mechanisms

Add gssint_select_mechanism() to determine what mechanism to use for a
caller-specified OID, gssint_get_public_oid() to determine what
mechanism to expose to the caller, and gssint_make_public_oid_set to
translate an array of mech OIDs into a set of public OIDs.  In
gssint_get_mechanism(), match interposed OIDs as well as real ones.

[ghudson@mit.edu: Stylistic changes, commit squashing, commit message]
Use interposer mechanisms in mechglue functions

Wherever a GSSAPI mechglue function accepts a mech OID from the
caller, use gssint_select_mech_type() to choose the mechanism to use.
Wherever a mechglue function outputs a mech OID to the caller, use
gssint_get_public_oid() or gssint_make_public_oid_set() to expose the
public mech OID.

[ghudson@mit.edu: Stylistic changes, commit squashing, commit message]
Add SPI calls to import objects by mech oid

An interposer mech needs to be able to handle multiple mechanisms.
When importing a mech token for a name, cred, or context, the
interposer mech needs to know the mech type of the token being
imported.  To make this work, add SPI calls which accept a mech type
argument.

[ghudson@mit.edu: Stylistic changes, commit squashing, commit message]
GENC should always export composite names

RFC 6680 requires that gss_export_name_composite begin the output
token with 04 02.  So we must produce a composite token even if the
name has no authdata, and be able to consume a composite token with no
authdata attributes.

[ghudson@mit.edu: expanded commit message]

ticket: 7400 (new)
Add Python scripts to check for C style issues

util/cstyle-file.py checks a file for C style issues and displays
line-by-line output.  It is not terribly sophisticated, and can
probably be improved upon (e.g. by doing an emacs batch-reindent of
the file and checking for differences in indentation).

util/cstyle.py produces diffs using git, runs the file checker on each
modified C source file in each diff, and displays the output lines
attribute to the diff.
Improve kpropd behavior in iprop mode

 - Make kpropd in iprop mode fork a child to listen for kprops from the
   master.  The child writes progress and outcome reports to the parent
   for each kprop.  This fixes a race between asking for a full resync
   and setting up a listener socket for it.

 - Add runonce (-t) for kpropd do_standalone() too.

 - Add a new iprop parameter: iprop_resync_timeout.  kpropd will keep
   asking for incremental updates while waiting for a full resync to
   finish, and will re-request a full resync if kadmind continues to
   indicate that one is needed after this timeout passes since the
   previous full resync was requested.

 - Allow polling intervals less than 10 seconds.

[ghudson@mit.edu: split out debug output changes; note polling interval
change in commit message]

ticket: 7373
Improve kpropd debug and syslog output

Add additional debug output and syslogs.  Remove "kpropd:" from
syslogs.  Always call openlog().  Clean up C style of a few messages.

[ghudson@mit.edu: split and combine commits; commit message]
Use a single global dump for iprop full syncs

Use a global dump (the default dump file) for full syncs for iprop.
When a slave asks for a fullsync we kprop the existing global dump to it
if that is good enough, else we dump the DB and send the new global
dump.

Before this change kadmind would run kdb5_util dump -i... each time a
slave asked for a full dump.  This was done in a sub-process,
thankfully, but it was still a waste of time and storage (e.g., if one
has a huge KDB).

Also, long dump times might cause a slave to give up (the timeout for
this is now configurable).  But since iprop dumps bear a serial number
and timestamp and since slaves will resync from that point forward, it
doesn't matter if the dump we send a slave is fresh as long as it is
fresh enough (i.e., that its sno and timestamp are in the ulog).

Also:

 - Rename dumps into place instead of unlink, create, write (but we
   still keep the dump ok files as lock files and as a method of
   signaling to kprop that the dump is complete).

ticket: 7371
Cleanup dump_db()
Fix kdb5_util dump race

ticket: 7377
ipropd_svc.c DPRINT improvements

Make DPRINT a varargs macro and add some new debug prints.
Add -p, -F, -K options to kadmind

New options:

    -p path-to-kdb5_util
    -K path-to-kprop
    -F dump-file

These are needed for testing without first having to install.

ticket: 7372
Correct docs re: kpropd usage w/ iprop

ticket: 7379
Deprecate kpropd -S option

ticket: 7376
kdb5_util load needs iprop safety net

ticket: 7370
Sync iprop header in kdb5_util dump

[ghudson@mit.edu: split out from previous commit]
Fix policy refcount corruption race in dump

ticket: 7384
Add -R option to kproplog to force full resyncs

ticket: 7375