Skip to content

Commit

Permalink
lib/krb5: restore krb5_context_data field ordering to match 7.x
Browse files Browse the repository at this point in the history
The struct krb5_context_data field can be passed to plugins
which might not be aware of the new structure layout.  To
reduce the risk of data corruption, fields must never be
removed, modified or reordered.  Old unused fields are marked
deprecated and new fields are appended to the end of the structure.

This change moves two fields that were added to master which
are not present in Heimdal 7.x:

fe43be8 added config_include_depth.

5b39bd7 added no_ticket_store.

Change-Id: I28b157e128732324972c99b246a93a828bc077c1
  • Loading branch information
jaltman committed Jun 8, 2018
1 parent 3046fb9 commit 1d4ebc0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/krb5/krb5_locl.h
Expand Up @@ -216,6 +216,16 @@ struct _krb5_get_init_creds_opt_private {

typedef uint32_t krb5_enctype_set;

/*
* Do not remove or reorder the fields of this structure.
* Fields that are no longer used should be marked "deprecated".
* New fields should always be appended to the end of the
* structure.
*
* Although this structure is internal it is shared with
* plugins and such changes will result in data corruption
* if plugins are not built with a matching version.
*/
typedef struct krb5_context_data {
krb5_enctype *etypes;
krb5_enctype *cfg_etypes;
Expand All @@ -231,7 +241,6 @@ typedef struct krb5_context_data {
int32_t kdc_sec_offset;
int32_t kdc_usec_offset;
krb5_config_section *cf;
size_t config_include_depth;
struct et_list *et_list;
struct krb5_log_facility *warn_dest;
struct krb5_log_facility *debug_dest;
Expand All @@ -247,7 +256,6 @@ typedef struct krb5_context_data {
krb5_boolean scan_interfaces; /* `ifconfig -a' */
krb5_boolean srv_lookup; /* do SRV lookups */
krb5_boolean srv_try_txt; /* try TXT records also */
krb5_boolean no_ticket_store; /* Don't store service tickets */
int32_t fcache_vno; /* create cache files w/ this
version */
int num_kt_types; /* # of registered keytab types */
Expand Down Expand Up @@ -276,6 +284,8 @@ typedef struct krb5_context_data {
#endif
unsigned int num_kdc_requests;
krb5_name_canon_rule name_canon_rules;
size_t config_include_depth;
krb5_boolean no_ticket_store; /* Don't store service tickets */
} krb5_context_data;

#ifndef KRB5_USE_PATH_TOKENS
Expand Down

0 comments on commit 1d4ebc0

Please sign in to comment.