24 Commits

Author SHA1 Message Date
73e2f335c2 lib/hdb: entry2mit_string_int free unparsed name on error
if append_string() fails do not leak the unparsed name.

Change-Id: I29d909c35e0e5d7282577ce37ec283efc33edbbf
2022-01-16 22:19:39 -05:00
f341fa7721 prevent unintended sign extension errors
When an unsigned char is shifted << 24 bits its type will be
promoted to signed 32-bits.   If the value is then assigned to
an unsigned 64-bit value sign extension will occur.

Prevent the unwanted sign extension by explicitly casting the
value to unsigned long before shifting.

Change-Id: Iabeac0f17dc3229a2dc89abe71960a8ffbf523f8
2022-01-16 00:23:05 -05:00
0e8c4ccc6e hdb: eliminate hdb_entry_ex
Remove hdb_entry_ex and revert to the original design of hdb_entry (except with
an additional context member in hdb_entry which is managed by the free_entry
method in HDB).
2022-01-15 18:54:57 +11:00
2a27d50fa1 Formatting: unnecessary lines and trailing whitespace. 2012-05-22 23:08:18 +01:00
ac18aa10dc Eliminate unused variable warning. 2012-05-21 13:33:42 +01:00
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
31974aa24c More s/int/size_t/ for iterators. Also fixed a stupid bug. 2011-07-22 16:07:06 -05:00
fca53990e4 Initial commit for second approach for multiple kvno. NOT TESTED! 2011-07-22 16:04:51 -05:00
6850d6a65f avoid uninit variable and unreachable code warnings
most of these warnings are not problems because of ample
use of abort() calls.  However, the large number of warnings
makes it difficult to identify real problems.  Initialize
the variables to shut up the compilers.

Change-Id: I8477c11b17c7b6a7d9074c721fdd2d7303b186a8
2011-05-17 12:02:16 -04:00
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
5a9dd54e95 drop RCSID
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25319 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-07-05 05:09:16 +00:00
cdc2b37670 switch to krb5_clear_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23913 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-14 02:56:07 +00:00
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
7fcd266fdd use krb5_set_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23316 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-23 04:32:32 +00:00
0c2369acd0 Wrap hdb_entry with hdb_entry_ex, patch originally from Andrew Bartlet
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16378 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-12-12 12:40:12 +00:00
6a53664484 Print extensions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15879 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-11 13:18:09 +00:00
4fa94362ee fix for storage change
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11021 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-05-24 15:23:43 +00:00
c7562eda65 add some more error strings
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10338 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-07-13 06:30:42 +00:00
3e49adeb61 use krb5_storage to make it more dynamic
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10155 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-06-21 13:43:25 +00:00
c4395a890d reduce number of memory allocations
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9504 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-01-26 15:08:36 +00:00
16e7c33cbf (event2string): handle events without principal. From Luke Howard
<lukeh@PADL.COM>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7673 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-12-26 13:50:22 +00:00
d3f5d79294 strc{py,at}_truncate -> strlc{py,at}
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6985 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-09-16 21:39:11 +00:00
bc9f1f3010 move printable version of entry from kadmin
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6092 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-05-03 16:55:03 +00:00