Commit Graph

27266 Commits

Author SHA1 Message Date
Roland C. Dowdeswell
5459558dea Move #undef ENABLE_PTHREAD_SUPPORT lower in appl/gssmask/common.h
This wasn't having the intended effect because after we #include
config.h and #undef ENABLE_PTHREAD_SUPPORT we then #include other
headers that also #include config.h.  I've moved this lower so that
it has the effect that appears to be intended but the correct answer
may be to make it work but this will require #including pthread.h
as the build fails with -Werror when pthread functions are called.
2012-06-07 16:57:51 +01:00
Roland C. Dowdeswell
539ba5fb87 Fix issue where master HDB can be locked while waiting for network I/O.
We should not hold locks on the master's database while waiting
for network I/O which may take a terribly long time to complete as
this will block out all writers and could therefore be slightly
problematic.  ipropd-master was holding a shared lock on the database
while sending a complete propation to slaves which are out of sync
with the log file.  We fix this by writing what we intend to send
in record format into a file hdb_db_dir()/ipropd.dumpfile while
holding a shared lock on the database and then we send the contents
of the file after releasing the lock.  We also save and re-use the file
that we generated during future complete propagation events as long
as the log is long enough to get us back to the state previously
dumped.
2012-06-06 22:29:03 +01:00
Viktor Dukhovni
5e081aa4a6 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>
2012-06-05 22:05:35 +01:00
Love Hörnquist Åstrand
0fad20a7ce krb5_kt_have_content have always really returned a krb5_error_code, pointed out by Gred Hudson 2012-06-04 10:47:12 +02:00
Roland C. Dowdeswell
f9f78a2cbf 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).
2012-05-31 17:30:29 +01:00
Harald Barth
8546c0c7b8 Better character classes and wording
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2012-05-30 19:43:30 +02:00
Love Hornquist Astrand
5479ac2192 require automake 1.11 2012-05-30 16:36:18 +02:00
Eray Aslan
06130cf7bf 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>
2012-05-30 16:36:18 +02:00
Viktor Dukhovni
1614c49354 DB_CURSOR_BULK requires DB 4.8 or later 2012-05-29 18:56:44 +01:00
Viktor Dukhovni
1b3f1b57b4 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.
2012-05-28 16:13:14 +01:00
Roland C. Dowdeswell
65ffba10cc Fix memory leak in krb5_ret_data() on error/eof. 2012-05-28 15:10:09 +01:00
Roland C. Dowdeswell
df42274d96 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.
2012-05-28 13:14:55 +01:00
Roland C. Dowdeswell
8dc7c43a8b ipropd_slave.c: init data to zero or we free a random ptr. 2012-05-28 12:43:29 +01:00
Roland C. Dowdeswell
2a27d50fa1 Formatting: unnecessary lines and trailing whitespace. 2012-05-22 23:08:18 +01:00
Viktor Dukhovni
e41ff9c0f5 Open cursor for bulk retrieval 2012-05-22 22:33:25 +01:00
Roland C. Dowdeswell
7af81533ef Don't clobber errno during error cleanup in krb5_storage_from_fd(). 2012-05-22 11:07:19 +01:00
Roland C. Dowdeswell
2656659fc2 Fix a typo in a comment. 2012-05-21 17:12:16 +01:00
Roland C. Dowdeswell
ac18aa10dc Eliminate unused variable warning. 2012-05-21 13:33:42 +01:00
Nicolas Williams
a3947acb38 Fix segfault in MIT dump entry parsing code 2012-05-19 21:57:53 -05:00
Roland C. Dowdeswell
21b7863935 kadm5_s_get_principals() is a read only operation, so open the HDB in r/o mode. 2012-05-18 17:13:30 +01:00
Roland C. Dowdeswell
fde1d8cb72 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.
2012-05-18 13:03:23 +01:00
Roland C. Dowdeswell
1f63d6e4dc 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.
2012-05-18 12:39:08 +01:00
Marco Molteni
8cdcd53a5a 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>
2012-05-09 08:15:51 +02:00
Marco Molteni
894008ab82 Add doxygen and source comments to some functions of the krb5 API
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2012-05-09 08:15:42 +02:00
Nicolas Williams
0cee6d1d70 Update KDB in tests/kdc so check-hdb-mitdb passes 2012-05-03 14:24:19 -05:00
Nicolas Williams
022d16f913 Update kadmin.8 2012-05-03 14:24:18 -05:00
Nicolas Williams
54fdd62c2b Update MIT<->Heimdal migration documentation 2012-05-03 14:24:18 -05:00
Nicolas Williams
57f1545a46 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().
2012-05-03 14:24:18 -05:00
Viktor Dukhovni
6c4764fbc7 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
2012-05-03 15:03:07 +01:00
Marco Molteni
e242c40746 Verify the existence of the keytab for tcp_server, gssapi_server
appl/test/tcp_server and gssapi_server try to open the keytab file only when processing a connection.

This patch verifies the existence of the keytab file on program startup, so that troubleshooting is easier. In addition it adds some comments.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2012-05-01 23:01:19 +02:00
Love Hornquist Astrand
dd267e8fc3 heimbase can't depend on roken.h since its not built at this time
if we need to have this dependency heimbase needs to be moved into lib/s
2012-05-01 22:48:57 +02:00
Roland C. Dowdeswell
2c5ec44d39 Look for auth_to_local in the default realm's realm section...
...rather than the authenticated principal's realm section.  We do
this both to maintain compatibility with MIT and because it makes
more sense.  We should likely also fix the auth_to_local_names as
cursory inspection reveals that it has the same incompatibility.
2012-04-19 23:43:12 +01:00
Tony Acero
e2b6a449ce Windows: Visual Studio 10 support for installers
Change-Id: I845986247abf607694d2438afaffa6ea7d6fd5c4
2012-04-11 15:18:52 -04:00
Jeffrey Altman
9be792055c generated files must #include config if supported
The source files generated by compile_et and asn1-compile must
begin with:

  #ifdef HAVE_CONFIG_H
  #include <config.h>
  #endif

This permits conditional includes based on HAVE_STDINT_H and
HAVE_UNISTD_H to work.

Change-Id: Iefe25317ac3cb1970793748b8318174bcd7a087f
2012-04-10 17:17:33 -04:00
Jeffrey Altman
8e2762f907 Fix Windows build of mcache.c
Commit c04aa9e082 specified the
mutex type, pthread_mutex_t, directly instead of using the
abstraction, HEIMDAL_MUTEX.

Change-Id: Iedfc46163140cf23014d357cc8ccc9f0e6224327
2012-04-10 15:41:23 -04:00
Love Hörnquist Åstrand
c04aa9e082 more mutex locking from Jaudeep Padhye 2012-04-05 23:10:33 -07:00
Samuel Thibault
fbf44ea51d Fix compilation of kafs on Hurd.
kafs now defines two ioctls, define the GNU _IOT constants.

This was originally submitted to the Debian Heimdal package:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=483281

Signed-Off-By: Jelmer Vernooij <jelmer@debian.org>

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2012-04-05 22:55:01 -07:00
Samuel Thibault
0ef0446645 Properly activate the pthread support on GNU/Hurd.
Originally submitted as a patch to the Debian Heimdal package:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=483281

Signed-Off-By: Jelmer Vernooij <jelmer@debian.org>

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2012-04-05 22:55:01 -07:00
Russ Allbery
39460d0045 Remove duplicate __gss_krb5_mechanism_oid_desc definition
__gss_krb5_mechanism_oid_desc is now defined in gssapi/gssapi_oid.h,
so remove the definition in gssapi/gssapi_krb5.h in favor of including
that header.

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2012-04-05 22:55:01 -07:00
Love Hörnquist Åstrand
ec152cdf1a drain pool for each request 2012-04-05 22:55:01 -07:00
Love Hörnquist Åstrand
497eb5a4a4 add description 2012-04-05 22:55:01 -07:00
Roland C. Dowdeswell
67d9094665 Allow hxtool to process multiple --pk-init-principal args. 2012-04-05 20:20:19 +01:00
Viktor Dukhovni
eee3333b76 Handle multiple SANs correctly in KDC pkinit certs
Signed-off-by: Roland C. Dowdeswell <elric@imrryr.org>
2012-04-05 20:20:00 +01:00
Simon Wilkinson
10133ece1a hcrypto: Use correct size for memset in md2
md2.c was doing memset(m, 0, sizeof(m)), and so was only clearing
the first 4 bytes of the passed md2 structure in MD2_Final. Fix
this to clear the entire structure, as expected.
2012-03-31 19:06:59 -04:00
Jelmer Vernooij
15696d9b90 telnet.1: Avoid undefined macro 'B'.
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2012-03-18 11:25:55 -07:00
Nicolas Williams
839ab87c10 Regression test iprop of key rollover and del_enctype 2012-03-15 18:57:35 -05:00
Nicolas Williams
ef9012aef5 Fix ipropd-slave assert when doing del_enctype
Change a paranoid heim_assert into something better.  Update block
    comment.

    Next commit: add a test for del_enctype and iprop.
2012-03-15 18:57:32 -05:00
Nicolas Williams
ca6a22276e Test that we copy forwardable/renewable flags from TGT in TGS-REQ 2012-03-14 23:58:40 -05:00
Nicolas Williams
3f86831c6c Fix earlier fix for not passing forwardable and friends in TGS-REQs 2012-03-14 23:45:31 -05:00
Jeffrey Altman
48d255561e Windows: install heimtools not heimtool
Change-Id: Ie439dd6d2819d7a7088be19f7ecd49863df7ac79
2012-03-13 23:57:00 -04:00