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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
* Openvision retains the copyright to derivative works of
* this source code. Do *NOT* create a derivative of this
* source code before consulting with your legal department.
* Do *NOT* integrate *ANY* of this source code into another
* product before consulting with your legal department.
*
* For further information, read the top-level Openvision
* copyright which is contained in the top-level MIT Kerberos
* copyright.
*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
*/
/* ktutil_ct.c - automatically generated from ktutil_ct.ct */
/* Above no longer appears to be true */
#include <libintl.h>
#include <ss/ss.h>
#include "k5-int.h"
/*
* I18n hack. We sill define gettext(s) to be s here. That way the info_strings
* will be extracted to the .po file.
*/
#define gettext(s) s
#ifndef __STDC__
#define const
#endif
static char const * const ssu00001[] = {
"clear_list",
"clear",
(char const *)0
};
extern void ktutil_clear_list __SS_PROTO;
static char const * const ssu00002[] = {
"read_kt",
"rkt",
(char const *)0
};
extern void ktutil_read_v5 __SS_PROTO;
static char const * const ssu00003[] = {
"read_st",
"rst",
(char const *)0
};
extern void ktutil_read_v4 __SS_PROTO;
static char const * const ssu00004[] = {
"write_kt",
"wkt",
(char const *)0
};
extern void ktutil_write_v5 __SS_PROTO;
static char const * const ssu00005[] = {
"write_st",
"wst",
(char const *)0
};
extern void ktutil_write_v4 __SS_PROTO;
static char const * const ssu00006[] = {
"add_entry",
"addent",
(char const *)0
};
extern void ktutil_add_entry __SS_PROTO;
static char const * const ssu00007[] = {
"delete_entry",
"delent",
(char const *)0
};
extern void ktutil_delete_entry __SS_PROTO;
static char const * const ssu00008[] = {
"list",
"l",
(char const *)0
};
extern void ktutil_list __SS_PROTO;
static char const * const ssu00009[] = {
"list_requests",
"lr",
"?",
(char const *)0
};
extern void ss_list_requests __SS_PROTO;
static char const * const ssu00010[] = {
"quit",
"exit",
"q",
(char const *)0
};
extern void ss_quit __SS_PROTO;
static ss_request_entry ssu00011[] = {
{ ssu00001,
ktutil_clear_list,
gettext("Clear the current keylist."),
0 },
{ ssu00002,
ktutil_read_v5,
gettext("Read a krb5 keytab into the current keylist."),
0 },
{ ssu00003,
ktutil_read_v4,
gettext("Read a krb4 srvtab into the current keylist."),
0 },
{ ssu00004,
ktutil_write_v5,
gettext("Write the current keylist to a krb5 keytab."),
0 },
{ ssu00005,
ktutil_write_v4,
gettext("Write the current keylist to a krb4 srvtab."),
0 },
{ ssu00006,
ktutil_add_entry,
gettext("Add an entry to the current keylist."),
0 },
{ ssu00007,
ktutil_delete_entry,
gettext("Delete an entry from the current keylist."),
0 },
{ ssu00008,
ktutil_list,
gettext("List the current keylist."),
0 },
{ ssu00009,
ss_list_requests,
gettext("List available requests."),
0 },
{ ssu00010,
ss_quit,
gettext("Exit program."),
0 },
{ 0, 0, 0, 0 }
};
ss_request_table ktutil_cmds = { 2, ssu00011 };
#undef gettext
/*
* This routine is responsible for localizing all the displayable
* messages in the table. This was necessary since ktutil will be
* invoking library calls that need to be able to display the messages
* in the correct text domain (which only ktutil knows).
*
* This function assumes that the US version of the messages are
* pre-loaded in the table and will be used should gettext not be
* successful. This routine does NOT free the replaced strings as
* its expected they may be in the heap (as above) and not malloc'ed.
* If the caller malloc'ed the strings, they should retain pointers
* and free them if not matching the contents of the table.
*/
krb5_error_code
ktutil_initialize_cmds_table(ss_request_table *ktutil_cmds)
{
char *localized_text;
ss_request_entry *ss_cmd;
krb5_error_code retval = 0;
if (ktutil_cmds) {
for (ss_cmd = ktutil_cmds->requests;
ss_cmd->info_string && *(ss_cmd->info_string) != '\0';
++ss_cmd) {
localized_text = gettext(ss_cmd->info_string);
if ((strcmp(localized_text, ss_cmd->info_string))
!= 0) {
ss_cmd->info_string = strdup(localized_text);
}
}
}
else
retval = EINVAL;
return (retval);
}
|