 11bd59700b
			
		
	
	11bd59700b
	
	
	
		
			
			git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13579 ec53bebd-3082-4978-b11e-865c3cabbd6b
		
			
				
	
	
		
			295 lines
		
	
	
		
			7.3 KiB
		
	
	
	
		
			Groff
		
	
	
	
	
	
			
		
		
	
	
			295 lines
		
	
	
		
			7.3 KiB
		
	
	
	
		
			Groff
		
	
	
	
	
	
| .\" Copyright (c) 2000 - 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$
 | |
| .\"
 | |
| .Dd March 20, 2004
 | |
| .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_free_strings
 | |
| free
 | |
| .Fa strings
 | |
| as returned by
 | |
| .Fn krb5_config_get_strings
 | |
| and
 | |
| .Fn krb5_config_vget_strings .
 | |
| .Pp
 | |
| .Fn krb5_config_file_free
 | |
| free the result of
 | |
| .Fn krb5_config_parse_file
 | |
| and
 | |
| .Fa 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.
 |