summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/krb5_init_context.3
blob: cf9d696985019262f6708a42d44e4b43f23e1a7b (plain)
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
.\" Copyright (c) 2001 - 2004 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\"
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" 3. Neither the name of the Institute nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id: krb5_init_context.3 19980 2007-01-17 18:06:33Z lha $
.\"
.Dd December  8, 2004
.Dt KRB5_CONTEXT 3
.Os HEIMDAL
.Sh NAME
.Nm krb5_add_et_list ,
.Nm krb5_add_extra_addresses ,
.Nm krb5_add_ignore_addresses ,
.Nm krb5_context ,
.Nm krb5_free_config_files ,
.Nm krb5_free_context ,
.Nm krb5_get_default_config_files ,
.Nm krb5_get_dns_canonize_hostname ,
.Nm krb5_get_extra_addresses ,
.Nm krb5_get_fcache_version ,
.Nm krb5_get_ignore_addresses ,
.Nm krb5_get_kdc_sec_offset ,
.Nm krb5_get_max_time_skew ,
.Nm krb5_get_use_admin_kdc
.Nm krb5_init_context ,
.Nm krb5_init_ets ,
.Nm krb5_prepend_config_files ,
.Nm krb5_prepend_config_files_default ,
.Nm krb5_set_config_files ,
.Nm krb5_set_dns_canonize_hostname ,
.Nm krb5_set_extra_addresses ,
.Nm krb5_set_fcache_version ,
.Nm krb5_set_ignore_addresses ,
.Nm krb5_set_max_time_skew ,
.Nm krb5_set_use_admin_kdc ,
.Nd create, modify and delete krb5_context structures
.Sh LIBRARY
Kerberos 5 Library (libkrb5, -lkrb5)
.Sh SYNOPSIS
.In krb5.h
.Pp
.Li "struct krb5_context;"
.Pp
.Ft krb5_error_code
.Fo krb5_init_context
.Fa "krb5_context *context"
.Fc
.Ft void
.Fo krb5_free_context
.Fa "krb5_context context"
.Fc
.Ft void
.Fo krb5_init_ets
.Fa "krb5_context context"
.Fc
.Ft krb5_error_code
.Fo krb5_add_et_list
.Fa "krb5_context context"
.Fa "void (*func)(struct et_list **)"
.Fc
.Ft krb5_error_code
.Fo krb5_add_extra_addresses
.Fa "krb5_context context"
.Fa "krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_set_extra_addresses
.Fa "krb5_context context"
.Fa "const krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_get_extra_addresses
.Fa "krb5_context context"
.Fa "krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_add_ignore_addresses
.Fa "krb5_context context"
.Fa "krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_set_ignore_addresses
.Fa "krb5_context context"
.Fa "const krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_get_ignore_addresses
.Fa "krb5_context context"
.Fa "krb5_addresses *addresses"
.Fc
.Ft krb5_error_code
.Fo krb5_set_fcache_version
.Fa "krb5_context context"
.Fa "int version"
.Fc
.Ft krb5_error_code
.Fo krb5_get_fcache_version
.Fa "krb5_context context"
.Fa "int *version"
.Fc
.Ft void
.Fo krb5_set_dns_canonize_hostname
.Fa "krb5_context context"
.Fa "krb5_boolean flag"
.Fc
.Ft krb5_boolean
.Fo krb5_get_dns_canonize_hostname
.Fa "krb5_context context"
.Fc
.Ft krb5_error_code
.Fo krb5_get_kdc_sec_offset
.Fa "krb5_context context"
.Fa "int32_t *sec"
.Fa "int32_t *usec"
.Fc
.Ft krb5_error_code
.Fo krb5_set_config_files
.Fa "krb5_context context"
.Fa "char **filenames"
.Fc
.Ft krb5_error_code
.Fo krb5_prepend_config_files
.Fa "const char *filelist"
.Fa "char **pq"
.Fa "char ***ret_pp"
.Fc
.Ft krb5_error_code
.Fo krb5_prepend_config_files_default
.Fa "const char *filelist"
.Fa "char ***pfilenames"
.Fc
.Ft krb5_error_code 
.Fo krb5_get_default_config_files
.Fa "char ***pfilenames"
.Fc
.Ft void
.Fo krb5_free_config_files
.Fa "char **filenames"
.Fc
.Ft void
.Fo krb5_set_use_admin_kdc
.Fa "krb5_context context"
.Fa "krb5_boolean flag"
.Fc
.Ft krb5_boolean
.Fo krb5_get_use_admin_kdc
.Fa "krb5_context context"
.Fc
.Ft time_t
.Fo krb5_get_max_time_skew
.Fa "krb5_context context"
.Fc
.Ft krb5_error_code
.Fo krb5_set_max_time_skew
.Fa "krb5_context context"
.Fa "time_t time"
.Fc
.Sh DESCRIPTION
The
.Fn krb5_init_context
function initializes the
.Fa context
structure and reads the configuration file
.Pa /etc/krb5.conf .
.Pp
The structure should be freed by calling
.Fn krb5_free_context
when it is no longer being used.
.Pp
.Fn krb5_init_context
returns 0 to indicate success.
Otherwise an errno code is returned.
Failure means either that something bad happened during initialization
(typically
.Bq ENOMEM )
or that Kerberos should not be used
.Bq ENXIO .
.Pp
.Fn krb5_init_ets
adds all
.Xr com_err 3
libs to
.Fa context .
This is done by
.Fn krb5_init_context .
.Pp
.Fn krb5_add_et_list 
adds a
.Xr com_err 3
error-code handler
.Fa func
to the specified
.Fa context .
The error handler must generated by the the re-rentrant version of the
.Xr compile_et 3
program.
.Fn krb5_add_extra_addresses
add a list of addresses that should be added when requesting tickets.
.Pp
.Fn krb5_add_ignore_addresses
add a list of addresses that should be ignored when requesting tickets.
.Pp
.Fn krb5_get_extra_addresses
get the list of addresses that should be added when requesting tickets.
.Pp
.Fn krb5_get_ignore_addresses
get the list of addresses that should be ignored when requesting tickets.
.Pp
.Fn krb5_set_ignore_addresses
set the list of addresses that should be ignored when requesting tickets.
.Pp
.Fn krb5_set_extra_addresses
set the list of addresses that should be added when requesting tickets.
.Pp
.Fn krb5_set_fcache_version
sets the version of file credentials caches that should be used.
.Pp
.Fn krb5_get_fcache_version
gets the version of file credentials caches that should be used.
.Pp
.Fn krb5_set_dns_canonize_hostname
sets if the context is configured to canonicalize hostnames using DNS.
.Pp
.Fn krb5_get_dns_canonize_hostname
returns if the context is configured to canonicalize hostnames using DNS.
.Pp
.Fn krb5_get_kdc_sec_offset
returns the offset between the localtime and the KDC's time.
.Fa sec
and
.Fa usec
are both optional argument and
.Dv NULL
can be passed in.
.Pp
.Fn krb5_set_config_files
set the list of configuration files to use and re-initialize the
configuration from the files.
.Pp
.Fn krb5_prepend_config_files
parse the 
.Fa filelist
and prepend the result to the already existing list
.Fa pq
The result is returned in
.Fa ret_pp
and should be freed with
.Fn krb5_free_config_files .
.Pp
.Fn krb5_prepend_config_files_default
parse the 
.Fa filelist
and append that to the default
list of configuration files.
.Pp
.Fn krb5_get_default_config_files
get a list of default configuration files.
.Pp
.Fn krb5_free_config_files
free a list of configuration files returned by
.Fn krb5_get_default_config_files ,
.Fn krb5_prepend_config_files_default ,
or
.Fn krb5_prepend_config_files .
.Pp
.Fn krb5_set_use_admin_kdc
sets if all KDC requests should go admin KDC.
.Pp
.Fn krb5_get_use_admin_kdc
gets if all KDC requests should go admin KDC.
.Pp
.Fn krb5_get_max_time_skew
and
.Fn krb5_set_max_time_skew
get and sets the maximum allowed time skew between client and server.
.Sh SEE ALSO
.Xr errno 2 ,
.Xr krb5 3 ,
.Xr krb5_config 3 ,
.Xr krb5_context 3 ,
.Xr kerberos 8
OpenPOWER on IntegriCloud