1 #pragma ident "%Z%%M% %I% %E% SMI"
5 krb5_error_code KRB5_CALLCONV
6 krb5_cc_copy_creds(krb5_context context
, krb5_ccache incc
, krb5_ccache outcc
)
10 krb5_cc_cursor cur
= 0;
13 flags
= 0; /* turns off OPENCLOSE mode */
14 if ((code
= krb5_cc_set_flags(context
, incc
, flags
)))
16 /* the code for this will open the file for reading only, which
17 is not what I had in mind. So I won't turn off OPENCLOSE
18 for the output ccache */
20 if ((code
= krb5_cc_set_flags(context
, outcc
, flags
)))
24 if ((code
= krb5_cc_start_seq_get(context
, incc
, &cur
)))
27 while (!(code
= krb5_cc_next_cred(context
, incc
, &cur
, &creds
))) {
28 code
= krb5_cc_store_cred(context
, outcc
, &creds
);
29 krb5_free_cred_contents(context
, &creds
);
34 if (code
!= KRB5_CC_END
)
37 code
= krb5_cc_end_seq_get(context
, incc
, &cur
);
45 flags
= KRB5_TC_OPENCLOSE
;
47 /* If set then we are in an error pathway */
49 krb5_cc_end_seq_get(context
, incc
, &cur
);
52 krb5_cc_set_flags(context
, incc
, flags
);
54 code
= krb5_cc_set_flags(context
, incc
, flags
);
58 krb5_cc_set_flags(context
, outcc
, flags
);
60 code
= krb5_cc_set_flags(context
, outcc
, flags
);