unsigned int in_tkt_ktype_count;
krb5_enctype *tgs_ktypes;
unsigned int tgs_ktype_count;
- /* This used to be a void*, but since we always allocate them
- together (though in different source files), and the types
- are declared in the same header, might as well just combine
- them.
-
- The array[1] is so the existing code treating the field as
- a pointer will still work. For cleanliness, it should
- eventually get changed to a single element instead of an
- array. */
- struct _krb5_os_context os_context[1];
+ struct _krb5_os_context os_context;
char *default_realm;
profile_t profile;
void *db_context;
/*
* lib/krb5/ccache/cc_file.c
*
- * Copyright 1990,1991,1992,1993,1994,2000,2004 Massachusetts Institute of Technology.
+ * Copyright 1990,1991,1992,1993,1994,2000,2004,2007 Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Original stdio support copyright 1995 by Cygnus Support.
static krb5_error_code
krb5_fcc_open_file (krb5_context context, krb5_ccache id, int mode)
{
- krb5_os_context os_ctx = (krb5_os_context)context->os_context;
+ krb5_os_context os_ctx = &context->os_context;
krb5_fcc_data *data = (krb5_fcc_data *)id->data;
krb5_ui_2 fcc_fvno;
krb5_ui_2 fcc_flen;
/*
* lib/krb5/ccache/cccursor.c
*
- * Copyright 2006 by the Massachusetts Institute of Technology.
+ * Copyright 2006, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
krb5_os_context os_ctx = NULL;
*ccache = NULL;
- os_ctx = context->os_context;
+ os_ctx = &context->os_context;
switch (cursor->pos) {
case CCCURSOR_CONTEXT:
/*
* lib/krb5/ccache/ccdefault.c
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
if (!context || context->magic != KV5M_CONTEXT)
return KV5M_CONTEXT;
- os_ctx = context->os_context;
+ os_ctx = &context->os_context;
return krb5_cc_resolve(context, krb5_cc_default_name(context), ccache);
}
/*
* lib/krb5/krb/init_ctx.c
*
- * Copyright 1994,1999,2000, 2002, 2003 by the Massachusetts Institute of Technology.
+ * Copyright 1994,1999,2000, 2002, 2003, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
nctx->ser_ctx_count = 0;
nctx->ser_ctx = NULL;
nctx->prompt_types = NULL;
- nctx->os_context->default_ccname = NULL;
+ nctx->os_context.default_ccname = NULL;
memset(&nctx->preauth_plugins, 0, sizeof(nctx->preauth_plugins));
nctx->preauth_context = NULL;
goto errout;
nctx->tgs_ktype_count = ctx->tgs_ktype_count;
- if (ctx->os_context->default_ccname != NULL) {
- nctx->os_context->default_ccname =
- strdup(ctx->os_context->default_ccname);
- if (nctx->os_context->default_ccname == NULL) {
+ if (ctx->os_context.default_ccname != NULL) {
+ nctx->os_context.default_ccname =
+ strdup(ctx->os_context.default_ccname);
+ if (nctx->os_context.default_ccname == NULL) {
ret = ENOMEM;
goto errout;
}
/*
* lib/krb5/krb/ser_ctx.c
*
- * Copyright 1995 by the Massachusetts Institute of Technology.
+ * Copyright 1995, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
if (context->default_realm)
required += strlen(context->default_realm);
/* Calculate size required by os_context, if appropriate */
- if (context->os_context)
- kret = krb5_size_opaque(kcontext,
- KV5M_OS_CONTEXT,
- (krb5_pointer) context->os_context,
- &required);
+ kret = krb5_size_opaque(kcontext,
+ KV5M_OS_CONTEXT,
+ (krb5_pointer) &context->os_context,
+ &required);
/* Calculate size required by db_context, if appropriate */
if (!kret && context->db_context)
return (kret);
/* Now handle os_context, if appropriate */
- if (context->os_context) {
- kret = krb5_externalize_opaque(kcontext, KV5M_OS_CONTEXT,
- (krb5_pointer) context->os_context,
- &bp, &remain);
- if (kret)
- return (kret);
- }
-
+ kret = krb5_externalize_opaque(kcontext, KV5M_OS_CONTEXT,
+ (krb5_pointer) &context->os_context,
+ &bp, &remain);
+ if (kret)
+ return (kret);
+
/* Now handle database context, if appropriate */
if (context->db_context) {
kret = krb5_externalize_opaque(kcontext, KV5M_DB_CONTEXT,
/* Put the newly allocated data into the krb5_context
structure where we're really keeping it these days. */
if (osp)
- *context->os_context = *osp;
+ context->os_context = *osp;
free(osp);
}
/*
* lib/krb5/os/ccdefname.c
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
if (!err) {
/* free the old ccname and store the new one */
- krb5_os_context os_ctx = context->os_context;
+ krb5_os_context os_ctx = &context->os_context;
if (os_ctx->default_ccname) { free (os_ctx->default_ccname); }
os_ctx->default_ccname = new_ccname;
new_ccname = NULL; /* don't free */
if (!context || context->magic != KV5M_CONTEXT) { err = KV5M_CONTEXT; }
if (!err) {
- os_ctx = context->os_context;
+ os_ctx = &context->os_context;
if (os_ctx->default_ccname == NULL) {
/* Default ccache name has not been set yet */
/*
* lib/krb5/os/init_ctx.c
*
- * Copyright 1994 by the Massachusetts Institute of Technology.
+ * Copyright 1994, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
WSADATA wsaData;
#endif /* _WIN32 */
- os_ctx = ctx->os_context;
+ os_ctx = &ctx->os_context;
os_ctx->magic = KV5M_OS_CONTEXT;
os_ctx->time_offset = 0;
os_ctx->usec_offset = 0;
{
krb5_os_context os_ctx;
- os_ctx = ctx->os_context;
+ os_ctx = &ctx->os_context;
if (os_ctx->default_ccname) {
free(os_ctx->default_ccname);
/*
* lib/krb5/os/timeofday.c
*
- * Copyright 1990 by the Massachusetts Institute of Technology.
+ * Copyright 1990, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
krb5_error_code KRB5_CALLCONV
krb5_timeofday(krb5_context context, register krb5_timestamp *timeret)
{
- krb5_os_context os_ctx = context->os_context;
+ krb5_os_context os_ctx = &context->os_context;
time_t tval;
if (os_ctx->os_flags & KRB5_OS_TOFFSET_TIME) {
/*
* lib/krb5/os/toffset.c
*
- * Copyright 1995 by the Massachusetts Institute of Technology.
+ * Copyright 1995, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
krb5_error_code KRB5_CALLCONV
krb5_set_real_time(krb5_context context, krb5_timestamp seconds, krb5_int32 microseconds)
{
- krb5_os_context os_ctx = context->os_context;
+ krb5_os_context os_ctx = &context->os_context;
krb5_int32 sec, usec;
krb5_error_code retval;
krb5_error_code
krb5_set_debugging_time(krb5_context context, krb5_timestamp seconds, krb5_int32 microseconds)
{
- krb5_os_context os_ctx = context->os_context;
+ krb5_os_context os_ctx = &context->os_context;
os_ctx->time_offset = seconds;
os_ctx->usec_offset = microseconds;
krb5_error_code
krb5_use_natural_time(krb5_context context)
{
- krb5_os_context os_ctx = context->os_context;
+ krb5_os_context os_ctx = &context->os_context;
os_ctx->os_flags &= ~(KRB5_OS_TOFFSET_VALID|KRB5_OS_TOFFSET_TIME);
krb5_error_code KRB5_CALLCONV
krb5_get_time_offsets(krb5_context context, krb5_timestamp *seconds, krb5_int32 *microseconds)
{
- krb5_os_context os_ctx = context->os_context;
+ krb5_os_context os_ctx = &context->os_context;
if (seconds)
*seconds = os_ctx->time_offset;
krb5_error_code
krb5_set_time_offsets(krb5_context context, krb5_timestamp seconds, krb5_int32 microseconds)
{
- krb5_os_context os_ctx = context->os_context;
+ krb5_os_context os_ctx = &context->os_context;
os_ctx->time_offset = seconds;
os_ctx->usec_offset = microseconds;
/*
* lib/krb5/os/ustime.c
*
- * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991,2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
krb5_error_code KRB5_CALLCONV
krb5_us_timeofday(krb5_context context, krb5_timestamp *seconds, krb5_int32 *microseconds)
{
- krb5_os_context os_ctx = context->os_context;
+ krb5_os_context os_ctx = &context->os_context;
krb5_int32 sec, usec;
krb5_error_code retval;