Commit Graph

35 Commits

Author SHA1 Message Date
Viktor Dukhovni
0ae6147483 Fix kadm5 error cleanup 2016-11-11 01:38:41 -05:00
Viktor Dukhovni
579393c8b9 Optionally prune old keys when setting new keys.
When new keys are added (typically via kadm5_setkey_principal_3),
truncate the key history to remove old keys, that is keys older than
the newest key which was in effect prior longer ago than the principal's
maximum ticket lifetime.  This feature is controlled via the "[kadmin]"
section's "prune-key-history" boolean parameter, which defaults to false.

Currently this happens only when kadm5_setkey_principal_3()
is called directly on the server, the client API simulates
kadm5_setkey_principal_3() via a get, update, modify sequence that does
not prune the key history.  The plan is to add a new kadm5 protocol RPC
and convert clients to call that instead.

In setkey_principal_3 seal keys after entry key update

Also, for now, don't check the return value of kadm5_log_modify() in
the new kadm5_s_setkey_principal_3().  This has to be addressed more
globally.

Censor stale keys in kadm5_s_get_principal
2016-02-26 15:43:12 -05:00
Nicolas Williams
b6e4d25d0d coverity 1164086 2015-04-18 23:19:24 -05:00
Roland C. Dowdeswell
92b243a638 We must unlock before close. 2012-03-07 11:17:26 +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
a7717ae4f9 Use heim_assert() instead of assert() 2011-07-24 11:10:37 -05:00
Nicolas Williams
dfc7ec92fa Make kadm5_lock() and unlock work, and add kadmin commands for them.
The libkadm5 functions hdb_open() and close around all HDB ops.  This
meant the previous implementation of kadm5_lock() and unlock would
always result in a core dump.  Now we hdb_open() for write in
kadm5_lock() and hdb_close() in kadm5_unlock(), with all kadm5_s_*()
functions now not opening nor closing the HDB when the server context
keep_open flag is set.

Also, there's now kadmin(8) lock and unlock commands.  These are there
primarily as a way to test the kadm5_lock()/unlock() operations, but
MIT's kadmin.local also has lock/unlock commands, and these can be
useful for scripting (though they require much care).
2011-07-22 21:07:48 -05:00
Nicolas Williams
58d72035f1 Added kadm5_lock() and unlock. 2011-07-22 16:04:52 -05:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Asanka Herath
d84119813e No AF_UNIX on Windows and no SIGPIPE and SIGXCPU 2009-11-24 10:12:44 -08:00
Love Hörnquist Åstrand
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
Love Hörnquist Åstrand
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
Love Hörnquist Åstrand
284d45bbbc use hdb_db_dir() and hdb_default_db()
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22211 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-07 19:27:27 +00:00
Love Hörnquist Åstrand
0382061b7b add configuration for signal file and acl file, let user select hostname, catch signals and print why we are quiting, make nop cause one new version, not two
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21756 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-31 22:15:08 +00:00
Love Hörnquist Åstrand
eece94d418 (find_db_spec): match realm-less as the default realm.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21462 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-10 14:21:57 +00:00
Love Hörnquist Åstrand
e43725130d Use hdb_get_dbinfo to pick up configuration.
ctx->config.realm can be NULL, check for that, from Bjorn S.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21413 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-05 12:38:34 +00:00
Love Hörnquist Åstrand
ad3f3d8f3c (set_field): try another way to calculate the path to the
database/logfile/signal-socket


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16321 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-11-30 12:39:19 +00:00
Love Hörnquist Åstrand
4d5498534c const poison
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15482 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-06-17 05:13:26 +00:00
Assar Westerlund
0cf44e300e (find_db_spec): const-correctness in parameters to krb5_config_get_next
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11231 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-08-26 13:28:36 +00:00
Johan Danielsson
dd63466491 x
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10489 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-08-13 14:42:13 +00:00
Assar Westerlund
77e48c950b (set_field): free variable if it's already set
(find_db_spec): malloc space for all strings


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8212 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-05-12 15:22:33 +00:00
Assar Westerlund
6fadf041d3 (set_funcs): add chpass_principal_with_key
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8061 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-03-23 23:03:38 +00:00
Assar Westerlund
5bc23ce9ae (_kadm5_s_init_context): handle params == NULL
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7742 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-01-06 21:40:08 +00:00
Johan Danielsson
c5b916ca6f remove advertising clause
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7464 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-12-02 17:05:13 +00:00
Assar Westerlund
ede36759f6 (find_db_spec): ugly cast work-around.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7418 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-11-20 20:50:33 +00:00
Assar Westerlund
491256422e (_kadm5_s_init_context): call krb5_add_et_list so that we aren't
dependent on the layout of krb5_context_data


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7390 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-11-14 16:32:56 +00:00
Johan Danielsson
57a21c9121 (_kadm5_s_init_context): get dbname, acl_file, and stash_file from the
config parameters, try to figure out these if they're not provided


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7326 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-11-09 17:52:30 +00:00
Assar Westerlund
dc8d030a39 remove semicolon
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4491 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-03-01 02:46:41 +00:00
Johan Danielsson
630157db65 initialize_*_error_table -> initialize_*_error_table_r
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4417 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-02-16 16:36:46 +00:00
Johan Danielsson
c9fdac7141 undo last change
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4144 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-12-06 08:04:19 +00:00
Johan Danielsson
a1f7459397 Use re-entrant error-table.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4128 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-12-05 04:25:31 +00:00
Johan Danielsson
c83d62954a _kadm5_s_get_db()
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4027 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-16 10:52:28 +00:00
Johan Danielsson
7d293dc9fb Use function pointer trampoline for easier dual use (without radiation-hardening capability).
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3948 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-11 21:21:47 +00:00
Johan Danielsson
b6669a62d9 Include context.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3724 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-11-01 00:40:21 +00:00
Johan Danielsson
68d77a285f Beginning of a kadm5-library
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3662 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-10-25 06:19:27 +00:00