setkey_principal_3(): use the new HDB/log protocol
The addition of kadm5_setkey_principal_3(), and the associated kadm5_s_setkey_principal_3() missed the revamp for two-phase commit.
This commit is contained in:
@@ -56,6 +56,13 @@ kadm5_s_setkey_principal_3(void *server_handle,
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
ret = kadm5_log_init(context);
|
||||||
|
if (ret) {
|
||||||
|
if (!context->keep_open)
|
||||||
|
context->db->hdb_close(context->context, context->db);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
ret = context->db->hdb_fetch_kvno(context->context, context->db, princ,
|
ret = context->db->hdb_fetch_kvno(context->context, context->db, princ,
|
||||||
HDB_F_GET_ANY|HDB_F_ADMIN_DATA, 0, &ent);
|
HDB_F_GET_ANY|HDB_F_ADMIN_DATA, 0, &ent);
|
||||||
if (keepold) {
|
if (keepold) {
|
||||||
@@ -108,17 +115,16 @@ kadm5_s_setkey_principal_3(void *server_handle,
|
|||||||
if ((ret = hdb_seal_keys(context->context, context->db,
|
if ((ret = hdb_seal_keys(context->context, context->db,
|
||||||
&ent.entry)) == 0
|
&ent.entry)) == 0
|
||||||
&& (ret = _kadm5_set_modifier(context, &ent.entry)) == 0
|
&& (ret = _kadm5_set_modifier(context, &ent.entry)) == 0
|
||||||
&& (ret = _kadm5_bump_pw_expire(context, &ent.entry)) == 0
|
&& (ret = _kadm5_bump_pw_expire(context, &ent.entry)) == 0)
|
||||||
&& (ret = context->db->hdb_store(context->context, context->db,
|
ret = kadm5_log_modify(context, &ent.entry,
|
||||||
HDB_F_REPLACE, &ent)) == 0)
|
KADM5_ATTRIBUTES | KADM5_PRINCIPAL |
|
||||||
kadm5_log_modify(context, &ent.entry,
|
KADM5_MOD_NAME | KADM5_MOD_TIME |
|
||||||
KADM5_ATTRIBUTES | KADM5_PRINCIPAL |
|
KADM5_KEY_DATA | KADM5_KVNO |
|
||||||
KADM5_MOD_NAME | KADM5_MOD_TIME |
|
KADM5_PW_EXPIRATION | KADM5_TL_DATA);
|
||||||
KADM5_KEY_DATA | KADM5_KVNO |
|
|
||||||
KADM5_PW_EXPIRATION | KADM5_TL_DATA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hdb_free_entry(context->context, &ent);
|
hdb_free_entry(context->context, &ent);
|
||||||
|
(void) kadm5_log_end(context);
|
||||||
if (!context->keep_open)
|
if (!context->keep_open)
|
||||||
context->db->hdb_close(context->context, context->db);
|
context->db->hdb_close(context->context, context->db);
|
||||||
return _kadm5_error_code(ret);
|
return _kadm5_error_code(ret);
|
||||||
|
Reference in New Issue
Block a user