hdb: decorate HDB_entry with context member

Decorate HDB_entry with context and move free_entry callback into HDB structure
itself. Requires updating hdb_free_entry() signature to include HDB parameter.
A follow-up commit will consolidate hdb_entry_ex (which has a single hdb_entry
member) into hdb_entry.
This commit is contained in:
Luke Howard
2022-01-07 12:15:55 +11:00
parent 923067e099
commit c5551775e2
40 changed files with 150 additions and 137 deletions

View File

@@ -194,7 +194,7 @@ kadm5_s_create_principal_with_key(void *server_handle,
if (!context->keep_open) {
ret = context->db->hdb_open(context->context, context->db, O_RDWR, 0);
if (ret) {
hdb_free_entry(context->context, &ent);
hdb_free_entry(context->context, context->db, &ent);
return ret;
}
}
@@ -227,7 +227,7 @@ kadm5_s_create_principal_with_key(void *server_handle,
if (ret == 0 && ret2 != 0)
ret = ret2;
}
hdb_free_entry(context->context, &ent);
hdb_free_entry(context->context, context->db, &ent);
return _kadm5_error_code(ret);
}
@@ -315,7 +315,7 @@ kadm5_s_create_principal(void *server_handle,
if (!context->keep_open) {
ret = context->db->hdb_open(context->context, context->db, O_RDWR, 0);
if (ret) {
hdb_free_entry(context->context, &ent);
hdb_free_entry(context->context, context->db, &ent);
return ret;
}
}
@@ -351,7 +351,7 @@ kadm5_s_create_principal(void *server_handle,
if (ret == 0 && ret2 != 0)
ret = ret2;
}
hdb_free_entry(context->context, &ent);
hdb_free_entry(context->context, context->db, &ent);
return _kadm5_error_code(ret);
}