add change-defaults
authorLove Hörnquist Åstrand <lha@kth.se>
Wed, 25 Mar 2009 15:35:31 +0000 (15:35 +0000)
committerLove Hörnquist Åstrand <lha@kth.se>
Wed, 25 Mar 2009 15:35:31 +0000 (15:35 +0000)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24934 ec53bebd-3082-4978-b11e-865c3cabbd6b

kuser/kinit.c

index 06d4a52b2ba6d504e3c220f35ec843b40fbd0dab..8c646ea5526913c2f3fa385b6e096b312c7b5210 100644 (file)
@@ -62,6 +62,7 @@ char *renew_life      = NULL;
 char *server_str       = NULL;
 char *cred_cache       = NULL;
 char *start_str                = NULL;
+static int switch_cache_flags = 1;
 struct getarg_strings etype_str;
 int use_keytab         = 0;
 char *keytab_str       = NULL;
@@ -187,6 +188,9 @@ static struct getargs args[] = {
       NP_("NTLM domain", ""), "domain" },
 #endif
 
+    { "change-default",  0,  arg_negative_flag, &switch_cache_flags,
+      NP_("switch the default cache to the new credentials cache", "") },
+
     { "ok-as-delegate",        0,  arg_flag, &ok_as_delegate_flag,
       NP_("honor ok-as-delegate on tickets", "") },
 
@@ -642,6 +646,9 @@ get_new_tickets(krb5_context context,
     if (ret)
        krb5_err (context, 1, ret, "krb5_cc_move");
 
+    if (switch_cache_flags)
+       krb5_cc_switch(context, ccache);
+
 #ifndef NO_NTLM
     if (ntlm_domain && ntlmkey.data)
        store_ntlmkey(context, ccache, ntlm_domain, &ntlmkey);