Commit Graph

855 Commits

Author SHA1 Message Date
Love Hörnquist Åstrand
4d39bae8bb use noinst_HEADERS for hdb-private.h 2014-02-16 09:15:53 -08:00
Love Hörnquist Åstrand
f2e69c9c62 make hdb plugin test pass 2014-02-14 19:36:36 -08:00
Jeffrey Clark
cc1faff15f Simple hdb plugin test
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2014-01-31 08:49:55 +01:00
Jeffrey Clark
c1c7da7f79 Fix compiling hdb ldap as a module
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2014-01-31 08:49:51 +01:00
Love Hörnquist Åstrand
d8d0e659ce make sure h is set at when we find a match, from [GITHUB #54] 2014-01-31 08:45:29 +01:00
Nicolas Williams
2c16b0da30 Be verbose about MIT dump entry parsing failures 2013-11-20 01:07:54 -06:00
Nicolas Williams
e9d21aeffc Fix bug in loading MIT dumps 2013-11-20 01:07:54 -06:00
Love Hornquist Astrand
10f3c8b56e add possible to set rules on what enctypes to use based on glob matching on principal 2013-10-18 10:01:55 +02:00
Love Hornquist Astrand
1d84562886 add HDBGET: that only supports get, iteration doesnt really make sense for the HDB keytab except when dumping 2013-10-15 12:40:39 +02:00
Jeffrey Altman
50381859a0 hdb: fix parsing of mkey db string
The use of the wrong value for the length of ":mkey=" was identified
by Brian May and reported via github:

  https://github.com/heimdal/heimdal/issues/40

Change-Id: I0aed86a5bb0359b7a266369076fde5e62f23b5fe
2013-10-13 19:59:48 -04:00
Jeffrey Altman
3c3e2ad5e6 Windows: ktutil.exe requires libkadmsrv and libhdb
Include libkadmsrv.dll and libhdb.dll in the assembly which are
required for ktutil.exe to load.

Change-Id: Ic72d51e72daac71683a7f7000fe084197ee3c94a
2013-09-13 22:17:43 -04:00
Nicolas Williams
ccb148eedb lib/hdb/db3.c:DB_open() needs to DB_close() more
Without this the KDC can trip the assert in DB_open().
2013-09-12 12:14:39 -05:00
Nicolas Williams
075a0d32ee Add UPN support to sqlite HDB backend 2013-08-06 20:54:23 -05:00
Love Hornquist Astrand
82d71b063b support db6 too, based on patch from Lars Wendler <wendler@fasihi.net> 2013-07-18 14:58:54 +02:00
Nicolas Williams
a53f3a49e2 Fix unused variable warnings 2013-06-02 15:52:41 -05:00
Landon Fuller
6fb9bc86b7 Add a configuration option to enable LDAP Start TLS.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2013-04-24 16:21:15 -07:00
Landon Fuller
96e9025675 Add support for specifying bind DN and password.
This uses a seperate hdb-ldap-secret-file configuration value, which
specifies an external file that may be used to supply the LDAP bind dn
and password. This allows that specific file to be configured with more
restrictive permissions than the global krb5.conf.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2013-04-24 16:21:15 -07:00
Landon Fuller
8cb8a8932e Remove unnecessary strdup() (and resulting leak)
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2013-04-24 16:21:15 -07:00
Landon Fuller
e58308e2a6 Add support for specifying an LDAP URL.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2013-04-24 16:21:14 -07:00
Love Hornquist Astrand
9b6cae5408 remove unused code that I meant to drop 2013-03-05 20:06:15 -08:00
Nicolas Williams
d9764a5399 Make lib/hdb/hdb.c build (but hdb plugins broken) 2013-03-05 21:47:21 -06:00
Love Hornquist Astrand
3cba540a5f fix prototypes 2013-03-04 10:24:35 -08:00
Love Hornquist Astrand
1eb4e2516e unify hdb_so_method and hdb_method 2013-03-04 10:18:16 -08:00
Tollef Fog Heen
4787ea76a9 Update hdb's use of the plugin interface
The various _krb5_plugin_* functions are gone, replace this with the new world order.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2013-03-04 10:00:41 -08:00
Arvid Requate
3cf3708950 honour krb5PasswordEnd also if sambaPwdLastSet
Commit 9f696b11c2 changed the
behaviour of key expiry for principals that have an sambaPwdLastSet
attribute in LDAP. The change was twofold:

* if "password_lifetime" is not set in kdc.conf a default lifetime
  of 1 year is enforced

* krb5PasswordEnd is not honoured.

This patch causes pw_end to be modified only if sambaPwdLastSet
*and* "password_lifetime" is defined in kdc.conf.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2013-03-04 09:47:46 -08:00
Howard Chu
9f95207933 Add support for OpenLDAP libmdb 2012-10-07 16:47:45 -07:00
Love Hornquist Astrand
216bfa564d rename mdb to mitdb 2012-10-06 15:38:56 -07:00
Love Hornquist Astrand
d9aa1ff496 use configuration for db-dir 2012-10-01 09:50:46 -07:00
Roland C. Dowdeswell
be5afdbf7f Make concurrent builds work.
To stop the errors when building concurrently, we make a number of
changes:

        1.  stop including generated files in *_SOURCES,

        2.  make *-protos.h and *-private.h depend on the *_SOURCES,

        3.  make all objects depend on *-{protos,private}.h,

        4.  in a few places change dir/header.h to $(srcdir)/dir/header.h,

This appears to work for me with make -j16 on a 4-way box.
2012-08-08 00:04:04 +01:00
Roland C. Dowdeswell
7de08cd5d0 hdb.h uses FILE * and so should #include <stdio.h>. 2012-06-27 01:58:19 +01:00
Jeffrey Altman
aed7a3b948 Windows: missing exports on Windows
synchronize the export lists on Windows and UNIX.
When new functions are exported on UNIX or Windows,
the "test" build target on Windows will verify if
the export lists are in sync.

Change-Id: I9df3607983b03ee8dc6fa7cd22f85b07a6cee784
2012-06-12 18:48:37 -04:00
Jeffrey Altman
b8e7f977f8 Windows: link libhdb against heimbase
heim_abort and heim_assert are not exported from heimdal.dll.
must link against heimbase to use them.

Change-Id: I57a29b90360f9036723c114f03a95684a4802529
2012-06-12 18:48:33 -04:00
Viktor Dukhovni
1614c49354 DB_CURSOR_BULK requires DB 4.8 or later 2012-05-29 18:56:44 +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
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
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
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
Roland C. Dowdeswell
0c0a4ff071 Add require-pwchange flag to HDB and honour it if present in mit-db:.
Also remove +requires_pwchange on passwd changes.
2012-03-06 11:39:20 +00:00
Love Hörnquist Åstrand
65987846fd make bind principal a common function 2012-02-28 00:03:20 -08:00
Roland C. Dowdeswell
0da84c0c3a Add require-pwchange flag to HDB and honour it if present in mit-db:. 2012-02-27 10:19:54 +00:00
Roland C. Dowdeswell
800a4e5c94 We're free(3)ing the wrong ptr, here. 2012-02-24 18:56:29 +00:00
Roland C. Dowdeswell
e8779d5d4a Add -Wshadow and deal with the warnings. 2012-02-21 11:17:55 +00:00
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00
Nicolas Williams
19d378f44d Add 64-bit integer support to ASN.1 compiler
ASN.1 INTEGERs will now compile to C int64_t or uint64_t, depending
    on whether the constraint ranges include numbers that cannot be
    represented in 32-bit ints and whether they include negative
    numbers.

    Template backend support included.  check-template is now built with
    --template, so we know we're testing it.

    Tests included.
2011-12-12 20:01:20 -06:00
Nicolas Williams
417dff03ba Fix trailing whitespace 2011-11-29 14:50:44 -06:00
Roland C. Dowdeswell
af011f57fc Provide server side kadm5_chpass_principal_3() with ks_tuple implementation.
We enable kadm5_chpass_principal_3() in the server side of the
library.  The client kadm5 library calls will still return the
error KAMD5_KS_TUPLE_NO_SUPP.

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2011-11-29 14:47:37 -06:00