summaryrefslogtreecommitdiffstats
path: root/src/kadmin/dbutil/kdb5_create.c
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2014-01-23 11:34:52 -0500
committerGreg Hudson <ghudson@mit.edu>2014-02-20 15:55:49 -0500
commit71d028f1054deb186807e7c8048218b82b478422 (patch)
tree72ab9b66b33ee7696f6662fccc50f2888ceadfbd /src/kadmin/dbutil/kdb5_create.c
parentd1f9aa3737b2b3e62b5c5ed488d6112b7ce8a5ad (diff)
downloadkrb5-71d028f1054deb186807e7c8048218b82b478422.tar.gz
krb5-71d028f1054deb186807e7c8048218b82b478422.tar.xz
krb5-71d028f1054deb186807e7c8048218b82b478422.zip
Lock around more ulog operations
Always lock the ulog when accessing it. We can currently get away with some laxness on iprop slaves because they are mostly synchronous, but hierarchical iprop will allow master and slave operations to take place concurrently, requiring more strict locking. Add new functions ulog_get_last and ulog_set_last, which access the ulog header with locking, and use them in kdb5_util and kpropd. Add locking to ulog_replay and ulog_init_header. ulog_lock and ulog_sync_header are no longer used outside of kdb_log.c after these changes, so make them static functions and remove the ulog_ prefix. Add an unlock_ulog function for clarity.
Diffstat (limited to 'src/kadmin/dbutil/kdb5_create.c')
-rw-r--r--src/kadmin/dbutil/kdb5_create.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/kadmin/dbutil/kdb5_create.c b/src/kadmin/dbutil/kdb5_create.c
index 31b3c6efb0..f6df9923e4 100644
--- a/src/kadmin/dbutil/kdb5_create.c
+++ b/src/kadmin/dbutil/kdb5_create.c
@@ -300,7 +300,12 @@ void kdb5_create(argc, argv)
* We're reinitializing the update log in case one already
* existed, but this should never happen.
*/
- ulog_init_header(util_context);
+ retval = ulog_init_header(util_context);
+ if (retval) {
+ com_err(argv[0], retval, _("while initializing update log"));
+ exit_status++;
+ return;
+ }
/*
* Since we're creating a new db we shouldn't worry about