When the caller passes in a version different than the one the ccache
was opened with, cc_set_principal should return CC_ERR_CRED_VERSION
because "cred_vers is used as a double check".
ticket: new
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20263
dc483132-0cff-0310-8789-
dd5450dbe970
{
cc_result err = ccNoError;
cc_uint32 version;
+ cc_uint32 compat_version;
if (!in_context ) { err = cci_check_error (ccErrBadParam); }
if (!io_ccache ) { err = cci_check_error (ccErrBadParam); }
err = cci_remap_version (in_version, &version);
}
+ if (!err) {
+ err = cci_ccache_get_compat_version (io_ccache, &compat_version);
+ }
+
+ if (!err && version != compat_version) {
+ err = cci_check_error (ccErrBadCredentialsVersion);
+ }
+
if (!err) {
err = ccapi_ccache_set_principal (io_ccache, version, in_principal);
}