the
.B \-t
.I keytab_file
-option; otherwise the default name and location will be used. By default a host ticket is requested but any principal may be specified. On a KDC, the special keytab location
+option; otherwise the default name and location will be used. By
+default a host ticket is requested but any principal may be
+specified. On a KDC, the special keytab location
.B KDB:
can be used to indicate that kinit should open the KDC database and
-look up the key directly. This permits an administrator to obtain
+look up the key directly. This permits an administrator to obtain
tickets as any principal that supports password-based authentication.
.TP
\fB-n\fP
com_err(progname, code, "while initializing Kerberos 5 library");
return 0;
}
-errctx = k5->ctx;
+ errctx = k5->ctx;
if (opts->k5_cache_name)
{
code = krb5_cc_resolve(k5->ctx, opts->k5_cache_name, &k5->cc);
code = kinit_kdb_init(&k5->ctx,
krb5_princ_realm(k5->ctx, k5->me)->data);
if (code != 0) {
- com_err(progname, code, "while setting up KDB keytab for realm %s",
+ com_err(progname, code,
+ "while setting up KDB keytab for realm %s",
krb5_princ_realm(k5->ctx, k5->me)->data);
goto cleanup;
}
#include <kdb_kt.h>
#include "extern.h"
-/**Server handle*/
-static void * server_handle;
+/** Server handle */
+static void *server_handle;
/**
- *@internal Initialize KDB for given realm
+ * @internal Initialize KDB for given realm
* @param context pointer to context that will be re-initialized
* @@param realm name of realm to initialize
*/
krb5_error_code
-kinit_kdb_init (krb5_context *pcontext, char *realm)
+kinit_kdb_init(krb5_context *pcontext, char *realm)
{
- kadm5_config_params config;
- krb5_error_code retval = 0;
- if (*pcontext)
- krb5_free_context(*pcontext);
- memset(&config, 0, sizeof config);
- retval = kadm5_init_krb5_context(pcontext);
- if (retval)
+ kadm5_config_params config;
+ krb5_error_code retval = 0;
+
+ if (*pcontext)
+ krb5_free_context(*pcontext);
+ memset(&config, 0, sizeof config);
+ retval = kadm5_init_krb5_context(pcontext);
+ if (retval)
+ return retval;
+ config.mask = KADM5_CONFIG_REALM;
+ config.realm = realm;
+ retval = kadm5_init(*pcontext, "kinit", NULL /*pass*/,
+ "kinit", &config,
+ KADM5_STRUCT_VERSION, KADM5_API_VERSION_3, NULL,
+ &server_handle);
+ if (retval)
+ return retval;
+ retval = krb5_kt_register(*pcontext, &krb5_kt_kdb_ops);
return retval;
- config.mask = KADM5_CONFIG_REALM;
- config.realm = realm;
- retval = kadm5_init(*pcontext, "kinit", NULL /*pass*/,
- "kinit", &config,
- KADM5_STRUCT_VERSION, KADM5_API_VERSION_3, NULL,
- &server_handle);
- if (retval)
- return retval;
- retval = krb5_kt_register(*pcontext, &krb5_kt_kdb_ops);
- return retval;
}