summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/krb5_config.3
blob: 9c302ae2f3a3121a041516a1473036f9caf962a0 (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
.\" Copyright (c) 2000 - 2007 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_config.3 21905 2007-08-10 10:16:45Z lha $
.\"
.Dd August 10, 2007
.Dt KRB5_CONFIG_GET 3
.Os HEIMDAL
.Sh NAME
.Nm krb5_config_file_free ,
.Nm krb5_config_free_strings ,
.Nm krb5_config_get ,
.Nm krb5_config_get_bool ,
.Nm krb5_config_get_bool_default ,
.Nm krb5_config_get_int ,
.Nm krb5_config_get_int_default ,
.Nm krb5_config_get_list ,
.Nm krb5_config_get_next ,
.Nm krb5_config_get_string ,
.Nm krb5_config_get_string_default ,
.Nm krb5_config_get_strings ,
.Nm krb5_config_get_time ,
.Nm krb5_config_get_time_default ,
.Nm krb5_config_parse_file ,
.Nm krb5_config_parse_file_multi ,
.Nm krb5_config_vget ,
.Nm krb5_config_vget_bool ,
.Nm krb5_config_vget_bool_default ,
.Nm krb5_config_vget_int ,
.Nm krb5_config_vget_int_default ,
.Nm krb5_config_vget_list ,
.Nm krb5_config_vget_next ,
.Nm krb5_config_vget_string ,
.Nm krb5_config_vget_string_default ,
.Nm krb5_config_vget_strings ,
.Nm krb5_config_vget_time ,
.Nm krb5_config_vget_time_default
.Nd get configuration value
.Sh LIBRARY
Kerberos 5 Library (libkrb5, -lkrb5)
.Sh SYNOPSIS
.In krb5.h
.Ft krb5_error_code
.Fo krb5_config_file_free
.Fa "krb5_context context"
.Fa "krb5_config_section *s"
.Fc
.Ft void
.Fo krb5_config_free_strings
.Fa "char **strings"
.Fc
.Ft "const void *"
.Fo krb5_config_get
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "int type"
.Fa "..."
.Fc
.Ft krb5_boolean
.Fo krb5_config_get_bool
.Fa "krb5_context context"
.Fa "krb5_config_section *c"
.Fa "..."
.Fc
.Ft krb5_boolean
.Fo krb5_config_get_bool_default
.Fa "krb5_context context"
.Fa "krb5_config_section *c"
.Fa "krb5_boolean def_value"
.Fa "..."
.Fc
.Ft int
.Fo krb5_config_get_int
.Fa "krb5_context context"
.Fa "krb5_config_section *c"
.Fa "..."
.Fc
.Ft int
.Fo krb5_config_get_int_default
.Fa "krb5_context context"
.Fa "krb5_config_section *c"
.Fa "int def_value"
.Fa "..."
.Fc
.Ft const char*
.Fo krb5_config_get_string
.Fa "krb5_context context"
.Fa "krb5_config_section *c"
.Fa "..."
.Fc
.Ft const char*
.Fo krb5_config_get_string_default
.Fa "krb5_context context"
.Fa "krb5_config_section *c"
.Fa "const char *def_value"
.Fa "..."
.Fc
.Ft "char**"
.Fo krb5_config_get_strings
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "..."
.Fc
.Ft int
.Fo krb5_config_get_time
.Fa "krb5_context context"
.Fa "krb5_config_section *c"
.Fa "..."
.Fc
.Ft int
.Fo krb5_config_get_time_default
.Fa "krb5_context context"
.Fa "krb5_config_section *c"
.Fa "int def_value"
.Fa "..."
.Fc
.Ft krb5_error_code
.Fo krb5_config_parse_file
.Fa "krb5_context context"
.Fa "const char *fname"
.Fa "krb5_config_section **res"
.Fc
.Ft krb5_error_code
.Fo krb5_config_parse_file_multi
.Fa "krb5_context context"
.Fa "const char *fname"
.Fa "krb5_config_section **res"
.Fc
.Ft "const void *"
.Fo krb5_config_vget
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "int type"
.Fa "va_list args"
.Fc
.Ft krb5_boolean
.Fo krb5_config_vget_bool
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "va_list args"
.Fc
.Ft krb5_boolean
.Fo krb5_config_vget_bool_default
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "krb5_boolean def_value"
.Fa "va_list args"
.Fc
.Ft int
.Fo krb5_config_vget_int
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "va_list args"
.Fc
.Ft int
.Fo krb5_config_vget_int_default
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "int def_value"
.Fa "va_list args"
.Fc
.Ft "const krb5_config_binding *"
.Fo krb5_config_vget_list
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "va_list args"
.Fc
.Ft "const void *"
.Fo krb5_config_vget_next
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "const krb5_config_binding **pointer"
.Fa "int type"
.Fa "va_list args"
.Fc
.Ft "const char *"
.Fo krb5_config_vget_string
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "va_list args"
.Fc
.Ft "const char *"
.Fo krb5_config_vget_string_default
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "const char *def_value"
.Fa "va_list args"
.Fc
.Ft char **
.Fo krb5_config_vget_strings
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "va_list args"
.Fc
.Ft int
.Fo krb5_config_vget_time
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "va_list args"
.Fc
.Ft int
.Fo krb5_config_vget_time_default
.Fa "krb5_context context"
.Fa "const krb5_config_section *c"
.Fa "int def_value"
.Fa "va_list args"
.Fc
.Sh DESCRIPTION
These functions get values from the
.Xr krb5.conf 5
configuration file, or another configuration database specified by the
.Fa c
parameter.
.Pp
The variable arguments should be a list of strings naming each
subsection to look for. For example:
.Bd -literal -offset indent
krb5_config_get_bool_default(context, NULL, FALSE, 
     "libdefaults", "log_utc", NULL);
.Ed
.Pp
gets the boolean value for the
.Dv log_utc
option, defaulting to
.Dv FALSE .
.Pp
.Fn krb5_config_get_bool_default
will convert the option value to a boolean value, where
.Sq yes ,
.Sq true ,
and any non-zero number means
.Dv TRUE ,
and any other value
.Dv FALSE .
.Pp
.Fn krb5_config_get_int_default
will convert the value to an integer.
.Pp
.Fn krb5_config_get_time_default
will convert the value to a period of time (not a time stamp) in
seconds, so the string
.Sq 2 weeks
will be converted to
1209600 (2 * 7 * 24 * 60 * 60).
.Pp
.Fn krb5_config_get_string
returns a
.Ft "const char *"
to a string in the configuration database.  The string not be valid
after reload of the configuration database
.\" or a call to .Fn krb5_config_set_string ,
so a caller should make a local copy if its need to keep the database.
.Pp
.Fn krb5_config_free_strings
free
.Fa strings
as returned by
.Fn krb5_config_get_strings
and
.Fn krb5_config_vget_strings .
If the argument
.Fa strings
is a 
.Dv NULL
pointer, no action occurs.
.Pp
.Fn krb5_config_file_free
free the result of
.Fn krb5_config_parse_file
and
.Fn krb5_config_parse_file_multi .
.Sh SEE ALSO
.Xr krb5_appdefault 3 ,
.Xr krb5_init_context 3 ,
.Xr krb5.conf 5
.Sh BUGS
For the default functions, other than for the string case, there's no
way to tell whether there was a value specified or not.
OpenPOWER on IntegriCloud