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.
DB_CURSOR_BULK requires DB 4.8 or later
Fix broken qop.5 man page generation

$base should not include sub directories.  Filter them out.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
require automake 1.11
Better character classes and wording

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
kadm5_log_reinit() needs to obtain its lock before truncating the file.

We can't use O_TRUNC on open because (without O_EXLOCK which is
not portable) we would be modifying the file without an exclusive
lock.  So, we drop the use of O_TRUNC and use ftruncate(2) after
obtaining the lock via flock(2).
krb5_kt_have_content have always really returned a krb5_error_code, pointed out by Gred Hudson
Fix ASN.1 template compiler bug and add test cases more likely to trip on similar (structure size/type) errors

Signed-off-by: Roland C. Dowdeswell <elric@imrryr.org>