kadmind: Add -A option for async HDB writes

This commit is contained in:
Nicolas Williams
2025-12-08 18:17:14 -06:00
parent 16b4b386f2
commit 5a7ace809e
3 changed files with 10 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ static char *fuzz_keytab_name;
static char *fuzz_service_name;
static char *fuzz_admin_server;
#endif
int async_flag;
static int help_flag;
static int version_flag;
static int debug_flag;
@@ -71,6 +72,7 @@ static struct getargs args[] = {
{ "realm", 'r', arg_string, &realm,
"realm to use", "realm"
},
{ "async", 'A', arg_flag, &async_flag, "do not fsync HDB writes", NULL },
#ifdef HAVE_DLOPEN
{ "check-library", 0, arg_string, &check_library,
"library to load password check function from", "library" },

View File

@@ -37,6 +37,8 @@
#include <gssapi_krb5.h>
#include <gssapi_spnego.h>
extern int async_flag;
#define CHECK(x) \
do { \
int __r; \
@@ -1029,6 +1031,8 @@ process_stream(krb5_context contextp,
0, 0,
&server_handle);
INSIST(ret == 0);
if (async_flag)
realm_params.mask |= KADM5_CONFIG_ASYNC_HDB_WRITES;
}
INSIST(gctx.ctx != GSS_C_NO_CONTEXT);

View File

@@ -34,6 +34,8 @@
#include "kadmin_locl.h"
#include <krb5-private.h>
extern int async_flag;
static kadm5_ret_t check_aliases(kadm5_server_context *,
kadm5_principal_ent_rec *,
kadm5_principal_ent_rec *);
@@ -1111,6 +1113,8 @@ handle_v5(krb5_context contextp,
krb5_free_ticket(contextp, ticket);
return;
}
if (async_flag)
realm_params.mask |= KADM5_CONFIG_ASYNC_HDB_WRITES;
}
initial = ticket->ticket.flags.initial;