]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - crypto/heimdal/lib/krb5/krb5_config.3
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / crypto / heimdal / lib / krb5 / krb5_config.3
1 .\" Copyright (c) 2000 - 2007 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\"
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\"
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"
33 .\" $Id: krb5_config.3 21905 2007-08-10 10:16:45Z lha $
34 .\"
35 .Dd August 10, 2007
36 .Dt KRB5_CONFIG_GET 3
37 .Os HEIMDAL
38 .Sh NAME
39 .Nm krb5_config_file_free ,
40 .Nm krb5_config_free_strings ,
41 .Nm krb5_config_get ,
42 .Nm krb5_config_get_bool ,
43 .Nm krb5_config_get_bool_default ,
44 .Nm krb5_config_get_int ,
45 .Nm krb5_config_get_int_default ,
46 .Nm krb5_config_get_list ,
47 .Nm krb5_config_get_next ,
48 .Nm krb5_config_get_string ,
49 .Nm krb5_config_get_string_default ,
50 .Nm krb5_config_get_strings ,
51 .Nm krb5_config_get_time ,
52 .Nm krb5_config_get_time_default ,
53 .Nm krb5_config_parse_file ,
54 .Nm krb5_config_parse_file_multi ,
55 .Nm krb5_config_vget ,
56 .Nm krb5_config_vget_bool ,
57 .Nm krb5_config_vget_bool_default ,
58 .Nm krb5_config_vget_int ,
59 .Nm krb5_config_vget_int_default ,
60 .Nm krb5_config_vget_list ,
61 .Nm krb5_config_vget_next ,
62 .Nm krb5_config_vget_string ,
63 .Nm krb5_config_vget_string_default ,
64 .Nm krb5_config_vget_strings ,
65 .Nm krb5_config_vget_time ,
66 .Nm krb5_config_vget_time_default
67 .Nd get configuration value
68 .Sh LIBRARY
69 Kerberos 5 Library (libkrb5, -lkrb5)
70 .Sh SYNOPSIS
71 .In krb5.h
72 .Ft krb5_error_code
73 .Fo krb5_config_file_free
74 .Fa "krb5_context context"
75 .Fa "krb5_config_section *s"
76 .Fc
77 .Ft void
78 .Fo krb5_config_free_strings
79 .Fa "char **strings"
80 .Fc
81 .Ft "const void *"
82 .Fo krb5_config_get
83 .Fa "krb5_context context"
84 .Fa "const krb5_config_section *c"
85 .Fa "int type"
86 .Fa "..."
87 .Fc
88 .Ft krb5_boolean
89 .Fo krb5_config_get_bool
90 .Fa "krb5_context context"
91 .Fa "krb5_config_section *c"
92 .Fa "..."
93 .Fc
94 .Ft krb5_boolean
95 .Fo krb5_config_get_bool_default
96 .Fa "krb5_context context"
97 .Fa "krb5_config_section *c"
98 .Fa "krb5_boolean def_value"
99 .Fa "..."
100 .Fc
101 .Ft int
102 .Fo krb5_config_get_int
103 .Fa "krb5_context context"
104 .Fa "krb5_config_section *c"
105 .Fa "..."
106 .Fc
107 .Ft int
108 .Fo krb5_config_get_int_default
109 .Fa "krb5_context context"
110 .Fa "krb5_config_section *c"
111 .Fa "int def_value"
112 .Fa "..."
113 .Fc
114 .Ft const char*
115 .Fo krb5_config_get_string
116 .Fa "krb5_context context"
117 .Fa "krb5_config_section *c"
118 .Fa "..."
119 .Fc
120 .Ft const char*
121 .Fo krb5_config_get_string_default
122 .Fa "krb5_context context"
123 .Fa "krb5_config_section *c"
124 .Fa "const char *def_value"
125 .Fa "..."
126 .Fc
127 .Ft "char**"
128 .Fo krb5_config_get_strings
129 .Fa "krb5_context context"
130 .Fa "const krb5_config_section *c"
131 .Fa "..."
132 .Fc
133 .Ft int
134 .Fo krb5_config_get_time
135 .Fa "krb5_context context"
136 .Fa "krb5_config_section *c"
137 .Fa "..."
138 .Fc
139 .Ft int
140 .Fo krb5_config_get_time_default
141 .Fa "krb5_context context"
142 .Fa "krb5_config_section *c"
143 .Fa "int def_value"
144 .Fa "..."
145 .Fc
146 .Ft krb5_error_code
147 .Fo krb5_config_parse_file
148 .Fa "krb5_context context"
149 .Fa "const char *fname"
150 .Fa "krb5_config_section **res"
151 .Fc
152 .Ft krb5_error_code
153 .Fo krb5_config_parse_file_multi
154 .Fa "krb5_context context"
155 .Fa "const char *fname"
156 .Fa "krb5_config_section **res"
157 .Fc
158 .Ft "const void *"
159 .Fo krb5_config_vget
160 .Fa "krb5_context context"
161 .Fa "const krb5_config_section *c"
162 .Fa "int type"
163 .Fa "va_list args"
164 .Fc
165 .Ft krb5_boolean
166 .Fo krb5_config_vget_bool
167 .Fa "krb5_context context"
168 .Fa "const krb5_config_section *c"
169 .Fa "va_list args"
170 .Fc
171 .Ft krb5_boolean
172 .Fo krb5_config_vget_bool_default
173 .Fa "krb5_context context"
174 .Fa "const krb5_config_section *c"
175 .Fa "krb5_boolean def_value"
176 .Fa "va_list args"
177 .Fc
178 .Ft int
179 .Fo krb5_config_vget_int
180 .Fa "krb5_context context"
181 .Fa "const krb5_config_section *c"
182 .Fa "va_list args"
183 .Fc
184 .Ft int
185 .Fo krb5_config_vget_int_default
186 .Fa "krb5_context context"
187 .Fa "const krb5_config_section *c"
188 .Fa "int def_value"
189 .Fa "va_list args"
190 .Fc
191 .Ft "const krb5_config_binding *"
192 .Fo krb5_config_vget_list
193 .Fa "krb5_context context"
194 .Fa "const krb5_config_section *c"
195 .Fa "va_list args"
196 .Fc
197 .Ft "const void *"
198 .Fo krb5_config_vget_next
199 .Fa "krb5_context context"
200 .Fa "const krb5_config_section *c"
201 .Fa "const krb5_config_binding **pointer"
202 .Fa "int type"
203 .Fa "va_list args"
204 .Fc
205 .Ft "const char *"
206 .Fo krb5_config_vget_string
207 .Fa "krb5_context context"
208 .Fa "const krb5_config_section *c"
209 .Fa "va_list args"
210 .Fc
211 .Ft "const char *"
212 .Fo krb5_config_vget_string_default
213 .Fa "krb5_context context"
214 .Fa "const krb5_config_section *c"
215 .Fa "const char *def_value"
216 .Fa "va_list args"
217 .Fc
218 .Ft char **
219 .Fo krb5_config_vget_strings
220 .Fa "krb5_context context"
221 .Fa "const krb5_config_section *c"
222 .Fa "va_list args"
223 .Fc
224 .Ft int
225 .Fo krb5_config_vget_time
226 .Fa "krb5_context context"
227 .Fa "const krb5_config_section *c"
228 .Fa "va_list args"
229 .Fc
230 .Ft int
231 .Fo krb5_config_vget_time_default
232 .Fa "krb5_context context"
233 .Fa "const krb5_config_section *c"
234 .Fa "int def_value"
235 .Fa "va_list args"
236 .Fc
237 .Sh DESCRIPTION
238 These functions get values from the
239 .Xr krb5.conf 5
240 configuration file, or another configuration database specified by the
241 .Fa c
242 parameter.
243 .Pp
244 The variable arguments should be a list of strings naming each
245 subsection to look for. For example:
246 .Bd -literal -offset indent
247 krb5_config_get_bool_default(context, NULL, FALSE, 
248      "libdefaults", "log_utc", NULL);
249 .Ed
250 .Pp
251 gets the boolean value for the
252 .Dv log_utc
253 option, defaulting to
254 .Dv FALSE .
255 .Pp
256 .Fn krb5_config_get_bool_default
257 will convert the option value to a boolean value, where
258 .Sq yes ,
259 .Sq true ,
260 and any non-zero number means
261 .Dv TRUE ,
262 and any other value
263 .Dv FALSE .
264 .Pp
265 .Fn krb5_config_get_int_default
266 will convert the value to an integer.
267 .Pp
268 .Fn krb5_config_get_time_default
269 will convert the value to a period of time (not a time stamp) in
270 seconds, so the string
271 .Sq 2 weeks
272 will be converted to
273 1209600 (2 * 7 * 24 * 60 * 60).
274 .Pp
275 .Fn krb5_config_get_string
276 returns a
277 .Ft "const char *"
278 to a string in the configuration database.  The string not be valid
279 after reload of the configuration database
280 .\" or a call to .Fn krb5_config_set_string ,
281 so a caller should make a local copy if its need to keep the database.
282 .Pp
283 .Fn krb5_config_free_strings
284 free
285 .Fa strings
286 as returned by
287 .Fn krb5_config_get_strings
288 and
289 .Fn krb5_config_vget_strings .
290 If the argument
291 .Fa strings
292 is a 
293 .Dv NULL
294 pointer, no action occurs.
295 .Pp
296 .Fn krb5_config_file_free
297 free the result of
298 .Fn krb5_config_parse_file
299 and
300 .Fn krb5_config_parse_file_multi .
301 .Sh SEE ALSO
302 .Xr krb5_appdefault 3 ,
303 .Xr krb5_init_context 3 ,
304 .Xr krb5.conf 5
305 .Sh BUGS
306 For the default functions, other than for the string case, there's no
307 way to tell whether there was a value specified or not.