(krb5_ret_creds): Runtime detect the what is the higher bits of the
bitfield git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13483 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -652,7 +652,7 @@ krb5_store_creds(krb5_storage *sp, krb5_creds *creds)
|
|||||||
return ret;
|
return ret;
|
||||||
dummy32 = creds->flags.i;
|
dummy32 = creds->flags.i;
|
||||||
if (0) /* change heimdal major version 0.7 or 0.8 ? */
|
if (0) /* change heimdal major version 0.7 or 0.8 ? */
|
||||||
dummy32 = bitswap32(dummy32);
|
dummy32 = bitswap32(TicketFlags2int(creds->flags.b));
|
||||||
ret = krb5_store_int32(sp, dummy32);
|
ret = krb5_store_int32(sp, dummy32);
|
||||||
if(ret)
|
if(ret)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -690,12 +690,21 @@ krb5_ret_creds(krb5_storage *sp, krb5_creds *creds)
|
|||||||
ret = krb5_ret_int32 (sp, &dummy32);
|
ret = krb5_ret_int32 (sp, &dummy32);
|
||||||
if(ret) goto cleanup;
|
if(ret) goto cleanup;
|
||||||
/*
|
/*
|
||||||
* If the higher hits are set, its either a new ticket flag (and
|
* Runtime detect the what is the higher bits of the bitfield. If
|
||||||
* this code need to be removed), or its a MIT cache (or new
|
* any of the higher bits are set in the input data, its either a
|
||||||
* Heimdal cache), lets change it to our current format.
|
* new ticket flag (and this code need to be removed), or its a
|
||||||
|
* MIT cache (or new Heimdal cache), lets change it to our current
|
||||||
|
* format.
|
||||||
*/
|
*/
|
||||||
if (dummy32 & 0xffff0000)
|
{
|
||||||
dummy32 = bitswap32(dummy32);
|
u_int32_t mask = 0xffff0000;
|
||||||
|
creds->flags.i = 0;
|
||||||
|
creds->flags.b.anonymous = 1;
|
||||||
|
if (creds->flags.i & mask)
|
||||||
|
mask = ~mask;
|
||||||
|
if (dummy32 & mask)
|
||||||
|
dummy32 = bitswap32(dummy32);
|
||||||
|
}
|
||||||
creds->flags.i = dummy32;
|
creds->flags.i = dummy32;
|
||||||
ret = krb5_ret_addrs (sp, &creds->addresses);
|
ret = krb5_ret_addrs (sp, &creds->addresses);
|
||||||
if(ret) goto cleanup;
|
if(ret) goto cleanup;
|
||||||
|
Reference in New Issue
Block a user