aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>2009-12-02 16:16:26 +0000
committerSam Hartman <hartmans@mit.edu>2009-12-02 16:16:26 +0000
commit41abf184df9320840e08e6e8fe5ee412acf539d6 (patch)
tree0534c360fe9cdba9f98c8e57469a6910bf5eb290
parentdb34c2ba2fdb4d96fbdfbcf47b076a294345a5fd (diff)
downloadkrb5-41abf184df9320840e08e6e8fe5ee412acf539d6.zip
krb5-41abf184df9320840e08e6e8fe5ee412acf539d6.tar.gz
krb5-41abf184df9320840e08e6e8fe5ee412acf539d6.tar.bz2
Use krb5_get_init_creds_opt_set_out_ccache to set the output ccache for kinit.
Support this function in krb5_get_init_creds git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast-negotiate@23414 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/clients/kinit/kinit.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/clients/kinit/kinit.c b/src/clients/kinit/kinit.c
index 96bb9cd..95e70ed 100644
--- a/src/clients/kinit/kinit.c
+++ b/src/clients/kinit/kinit.c
@@ -629,6 +629,9 @@ k5_kinit(opts, k5)
goto cleanup;
}
}
+ code = krb5_get_init_creds_opt_set_out_ccache(k5->ctx, options, k5->cc);
+ if (code)
+ goto cleanup;
switch (opts->action) {
case INIT_PW:
@@ -678,20 +681,21 @@ k5_kinit(opts, k5)
goto cleanup;
}
- code = krb5_cc_initialize(k5->ctx, k5->cc,
- opts->canonicalize ? my_creds.client : k5->me);
- if (code) {
- com_err(progname, code, "when initializing cache %s",
- opts->k5_cache_name?opts->k5_cache_name:"");
- goto cleanup;
- }
+ if ((opts->action != INIT_PW) && (opts->action != INIT_KT)) {
+ code = krb5_cc_initialize(k5->ctx, k5->cc,
+ opts->canonicalize ? my_creds.client : k5->me);
+ if (code) {
+ com_err(progname, code, "when initializing cache %s",
+ opts->k5_cache_name?opts->k5_cache_name:"");
+ goto cleanup;
+ }
- code = krb5_cc_store_cred(k5->ctx, k5->cc, &my_creds);
- if (code) {
- com_err(progname, code, "while storing credentials");
- goto cleanup;
+ code = krb5_cc_store_cred(k5->ctx, k5->cc, &my_creds);
+ if (code) {
+ com_err(progname, code, "while storing credentials");
+ goto cleanup;
+ }
}
-
notix = 0;
cleanup: