1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
/*
* lib/krb4/err_txt.c
*
* Copyright 1988, 2002 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
#include "krb.h"
#include "krb4int.h"
/*
* This is gross. We want krb_err_txt to match the contents of the
* com_err error table, but the text is static in krb_err.c. We can't
* alias it by making a pointer to it, either, so we have to suck in
* another copy of it that is named differently. Also, to avoid
* multiple registrations of the error table, we want to override
* initialize_krb_error_table() in case someone decides to call it.
*/
#undef initialize_krb_error_table
#define initialize_krb_error_table krb4int_init_krb_err_tbl
void krb4int_init_krb_err_tbl(void);
#include "krb_err.c"
#undef initialize_krb_error_table
#include "krb_err_txt.c"
void initialize_krb_error_table(void);
static int inited = 0;
void
krb4int_et_init(void)
{
if (inited)
return;
add_error_table(&et_krb_error_table);
inited = 1;\
}
void
initialize_krb_error_table(void)
{
krb4int_et_init();
}
void
krb4int_et_fini(void)
{
if (inited)
remove_error_table(&et_krb_error_table);
}
const char * KRB5_CALLCONV
krb_get_err_text(code)
int code;
{
krb4int_et_init();
/*
* Shift krb error code into com_err number space.
*/
if (code >= 0 && code < MAX_KRB_ERRORS)
return error_message(ERROR_TABLE_BASE_krb + code);
else
return "Invalid Kerberos error code";
}
|