From 1eda083efe0b1c9f8db5c559651dbab9ae09faa2 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Tue, 22 Jul 1997 00:29:16 +0000 Subject: [PATCH] * error_message.c (error_message): Mask error code with ERRCODE_MASK to handle case where 32bit ints are zero filled in the gssapi layer. * error_table.h: Define ERRCODE_MAX, the maximum allowed error code (32bits). I am taking the draconian outlook that the com_err library was always intending to define the error as a 32 bit value. I taken this approach instead of making the errcode_t machine specific as the com_er generated header files would then need be machine specific as well. (error codes are declared as say -4353L explicitly). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10122 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/et/ChangeLog | 9 +++++++++ src/util/et/error_message.c | 4 ++-- src/util/et/error_table.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog index e886e3a88..f6bdc7d66 100644 --- a/src/util/et/ChangeLog +++ b/src/util/et/ChangeLog @@ -1,3 +1,12 @@ +Mon Jul 21 12:00:24 1997 Ezra Peisach + + * error_message.c (error_message): Mask error code with + ERRCODE_MASK to handle case where 32bit ints are zero + filed in the gssapi layer. + + * error_table.h: Define ERRCODE_MAX, the maximum allowed error + code (32bits). + Tue Mar 18 15:07:40 1997 Theodore Ts'o * com_err.h: Add 'extern "C"' for C++ compatibility; also check for diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c index 81e5088c1..691df289e 100644 --- a/src/util/et/error_message.c +++ b/src/util/et/error_message.c @@ -61,7 +61,7 @@ KRB5_DLLIMP const char FAR * KRB5_CALLCONV error_message(code) l_offset = (unsigned long)code & ((1<table->base == table_num) { + if ((et->table->base & ERRCODE_MAX) == table_num) { /* This is the right table */ if (et->table->n_msgs <= offset) break; diff --git a/src/util/et/error_table.h b/src/util/et/error_table.h index a3cc229ac..053a52174 100644 --- a/src/util/et/error_table.h +++ b/src/util/et/error_table.h @@ -22,6 +22,7 @@ extern struct et_list * _et_list; #define ERRCODE_RANGE 8 /* # of bits to shift table number */ #define BITS_PER_CHAR 6 /* # bits to shift per character in name */ +#define ERRCODE_MAX 0xFFFFFFFF /* Mask for maximum error table */ extern const char FAR *error_table_name ET_P((unsigned long)); extern const char FAR *error_table_name_r ET_P((unsigned long, char FAR *)); -- 2.26.2