krb5: do not store TGTs if GC_NO_STORE
krb5_get_credentials_with_flags() and krb5_get_creds() do not store obtained TGTs if the KRB5_GC_NO_STORE flag is set. Change-Id: Ie999ec4e985463ff60e9d499c3e870880033dfa7
This commit is contained in:

committed by
Jeffrey Altman

parent
b84bdf213d
commit
8a5d50a328
@@ -1271,7 +1271,8 @@ next_rule:
|
|||||||
tgts = NULL;
|
tgts = NULL;
|
||||||
ret = _krb5_get_cred_kdc_any(context, flags, ccache,
|
ret = _krb5_get_cred_kdc_any(context, flags, ccache,
|
||||||
try_creds, NULL, NULL, out_creds, &tgts);
|
try_creds, NULL, NULL, out_creds, &tgts);
|
||||||
for(i = 0; tgts && tgts[i]; i++) {
|
for (i = 0; tgts && tgts[i]; i++) {
|
||||||
|
if ((options & KRB5_GC_NO_STORE) == 0)
|
||||||
krb5_cc_store_cred(context, ccache, tgts[i]);
|
krb5_cc_store_cred(context, ccache, tgts[i]);
|
||||||
krb5_free_creds(context, tgts[i]);
|
krb5_free_creds(context, tgts[i]);
|
||||||
}
|
}
|
||||||
@@ -1507,7 +1508,8 @@ next_rule:
|
|||||||
try_creds, opt ? opt->self : 0,
|
try_creds, opt ? opt->self : 0,
|
||||||
opt ? opt->ticket : 0, out_creds,
|
opt ? opt->ticket : 0, out_creds,
|
||||||
&tgts);
|
&tgts);
|
||||||
for(i = 0; tgts && tgts[i]; i++) {
|
for (i = 0; tgts && tgts[i]; i++) {
|
||||||
|
if ((options & KRB5_GC_NO_STORE) == 0)
|
||||||
krb5_cc_store_cred(context, ccache, tgts[i]);
|
krb5_cc_store_cred(context, ccache, tgts[i]);
|
||||||
krb5_free_creds(context, tgts[i]);
|
krb5_free_creds(context, tgts[i]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user