aboutsummaryrefslogtreecommitdiffstats
path: root/kadmin/add-random-users.c
diff options
context:
space:
mode:
Diffstat (limited to 'kadmin/add-random-users.c')
-rw-r--r--kadmin/add-random-users.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/kadmin/add-random-users.c b/kadmin/add-random-users.c
index c3beaf206a6d..b3d6d581d9b3 100644
--- a/kadmin/add-random-users.c
+++ b/kadmin/add-random-users.c
@@ -77,8 +77,7 @@ read_words (const char *filename, char ***ret_w)
}
static void
-add_user (krb5_context context, void *kadm_handle,
- unsigned nwords, char **words)
+add_user (krb5_context ctx, void *hndl, unsigned nwords, char **words)
{
kadm5_principal_ent_rec princ;
char name[64];
@@ -94,14 +93,14 @@ add_user (krb5_context context, void *kadm_handle,
mask = KADM5_PRINCIPAL;
memset(&princ, 0, sizeof(princ));
- ret = krb5_parse_name(context, name, &princ.principal);
+ ret = krb5_parse_name(ctx, name, &princ.principal);
if (ret)
- krb5_err(context, 1, ret, "krb5_parse_name");
+ krb5_err(ctx, 1, ret, "krb5_parse_name");
- ret = kadm5_create_principal (kadm_handle, &princ, mask, name);
+ ret = kadm5_create_principal (hndl, &princ, mask, name);
if (ret)
- krb5_err (context, 1, ret, "kadm5_create_principal");
- kadm5_free_principal_ent(kadm_handle, &princ);
+ krb5_err (ctx, 1, ret, "kadm5_create_principal");
+ kadm5_free_principal_ent(hndl, &princ);
printf ("%s\n", name);
}
@@ -110,37 +109,38 @@ add_users (const char *filename, unsigned n)
{
krb5_error_code ret;
int i;
- void *kadm_handle;
- krb5_context context;
+ void *hndl;
+ krb5_context ctx;
unsigned nwords;
char **words;
- ret = krb5_init_context(&context);
+ ret = krb5_init_context(&ctx);
if (ret)
errx (1, "krb5_init_context failed: %d", ret);
- ret = kadm5_s_init_with_password_ctx(context,
+ ret = kadm5_s_init_with_password_ctx(ctx,
KADM5_ADMIN_SERVICE,
NULL,
KADM5_ADMIN_SERVICE,
NULL, 0, 0,
- &kadm_handle);
+ &hndl);
if(ret)
- krb5_err(context, 1, ret, "kadm5_init_with_password");
+ krb5_err(ctx, 1, ret, "kadm5_init_with_password");
nwords = read_words (filename, &words);
for (i = 0; i < n; ++i)
- add_user (context, kadm_handle, nwords, words);
- kadm5_destroy(kadm_handle);
- krb5_free_context(context);
+ add_user (ctx, hndl, nwords, words);
+ kadm5_destroy(hndl);
+ krb5_free_context(ctx);
+ free(words);
}
static int version_flag = 0;
static int help_flag = 0;
static struct getargs args[] = {
- { "version", 0, arg_flag, &version_flag },
- { "help", 0, arg_flag, &help_flag }
+ { "version", 0, arg_flag, &version_flag, NULL, NULL },
+ { "help", 0, arg_flag, &help_flag, NULL, NULL }
};
static void