Fix incorrect usage message in ktutil del

Usage: remove [-h] [--principal=principal] [-p principal] [--kvno=enctype]
   [-V enctype] [--enctype=enctype] [-e enctype] [--help]
-p principal, --principal=principal principal to remove
-V enctype, --kvno=enctype          key version to remove
-e enctype, --enctype=enctype       enctype to remove
Add support for writing to KDB and dumping HDB to MIT KDB dump format

    Before this change Heimdal could read KDBs.  Now it can write to
    them too.

    Heimdal can now also dump HDBs (including KDBs) in MIT format, which
    can then be imported with kdb5_util load.

    This is intended to help in migrations from MIT to Heimdal by
    allowing migrations from Heimdal to MIT so that it is possible
    to rollback from Heimdal to MIT should there be any issues.  The
    idea is to allow a) running Heimdal kdc/kadmind with a KDB, or
    b) running Heimdal with an HDB converted from a KDB and then
    rollback by dumping the HDB and loading a KDB.

    Note that not all TL data types are supported, only two: last
    password change and modify-by.  This is the minimum necessary.
    PKINIT users may need to add support for KRB5_TL_USER_CERTIFICATE,
    and for databases with K/M history we may need to add KRB5_TL_MKVNO
    support.

    Support for additional TL data types can be added in
    lib/hdb/hdb-mitdb.c:_hdb_mdb_value2entry() and
    lib/hdb/print.c:entry2mit_string_int().
Update MIT<->Heimdal migration documentation
Update kadmin.8
Update KDB in tests/kdc so check-hdb-mitdb passes
Add doxygen and source comments to some functions of the krb5 API

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
Add comments to tcp_server.c, to make it easier for a newcomer to understand the krb5 API usage.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
Fix locking issues in DB1 HDB backend.

Multiple concurrent writers would cause the HDB to become corrupted
as the locking was not sufficient to prevent these sorts of issues
from occurring.  We have changed the locking to obtain the appropriate
kind of lock on database open and to hold that lock until the
database closes.  We need to do this as Berkeley DB 1.85 will cache
information from the database in memory and if if this information
is updated without our knowledge then our later writes will corrupt
the database.  We speculate that there would be issues with a single
writer and reader but did not reproduce them.
Fix locking issues in DB3 HDB backend.

Multiple concurrent writers would cause the HDB to become corrupted
as the locking was not sufficient to prevent these sorts of issues
from occurring.  We fix this in a similar way to the prior DB1 patch.
kadm5_s_get_principals() is a read only operation, so open the HDB in r/o mode.
Fix segfault in MIT dump entry parsing code
Eliminate unused variable warning.
Fix a typo in a comment.
Don't clobber errno during error cleanup in krb5_storage_from_fd().
Open cursor for bulk retrieval
Formatting: unnecessary lines and trailing whitespace.
ipropd_slave.c: init data to zero or we free a random ptr.
Add krb5_storage_fsync().

We add a function to cause krb5_storage's to be sync'd to their backing
store.  For memory backed storages, this is a NOP.  For files, it calls
fsync on the file descriptor.
Fix memory leak in krb5_ret_data() on error/eof.
Don't forget to sleep in 3DES del_enctype test.

On NetBSD /bin/sh with vfork() is noticeably faster than /bin/bash,
and in particular the reader manages to read the the database before
slave replication completes.