KRB5_CONFIG_GET(3)

NAME
krb5_config_file_free, krb5_config_free_strings, krb5_config_get, krb5_config_get_bool, krb5_config_get_bool_default, krb5_config_get_int, krb5_config_get_int_default, krb5_config_get_list, krb5_config_get_next, krb5_config_get_string, krb5_config_get_string_default, krb5_config_get_strings, krb5_config_get_time, krb5_config_get_time_default, krb5_config_parse_file, krb5_config_parse_file_multi, krb5_config_vget, krb5_config_vget_bool, krb5_config_vget_bool_default, krb5_config_vget_int, krb5_config_vget_int_default, krb5_config_vget_list, krb5_config_vget_next, krb5_config_vget_string, krb5_config_vget_string_default, krb5_config_vget_strings, krb5_config_vget_time, krb5_config_vget_time_default - get configuration value

LIBRARY
Kerberos 5 Library (libkrb5, -lkrb5)

SYNOPSIS
#include <krb5/krb5.h>
krb5_error_code
krb5_config_file_free(krb5_context context, krb5_config_section *s);
void
krb5_config_free_strings(char **strings);
const void *
krb5_config_get(krb5_context context, const krb5_config_section *c, int type, ...);
krb5_boolean
krb5_config_get_bool(krb5_context context, krb5_config_section *c, ...);
krb5_boolean
krb5_config_get_bool_default(krb5_context context, krb5_config_section *c, krb5_boolean def_value, ...);
int
krb5_config_get_int(krb5_context context, krb5_config_section *c, ...);
int
krb5_config_get_int_default(krb5_context context, krb5_config_section *c, int def_value, ...);
const char*
krb5_config_get_string(krb5_context context, krb5_config_section *c, ...);
const char*
krb5_config_get_string_default(krb5_context context, krb5_config_section *c, const char *def_value, ...);
char**
krb5_config_get_strings(krb5_context context, const krb5_config_section *c, ...);
int
krb5_config_get_time(krb5_context context, krb5_config_section *c, ...);
int
krb5_config_get_time_default(krb5_context context, krb5_config_section *c, int def_value, ...);
krb5_error_code
krb5_config_parse_file(krb5_context context, const char *fname, krb5_config_section **res);
krb5_error_code
krb5_config_parse_file_multi(krb5_context context, const char *fname, krb5_config_section **res);
const void *
krb5_config_vget(krb5_context context, const krb5_config_section *c, int type, va_list args);
krb5_boolean
krb5_config_vget_bool(krb5_context context, const krb5_config_section *c, va_list args);
krb5_boolean
krb5_config_vget_bool_default(krb5_context context, const krb5_config_section *c, krb5_boolean def_value, va_list args);
int
krb5_config_vget_int(krb5_context context, const krb5_config_section *c, va_list args);
int
krb5_config_vget_int_default(krb5_context context, const krb5_config_section *c, int def_value, va_list args);
const krb5_config_binding *
krb5_config_vget_list(krb5_context context, const krb5_config_section *c, va_list args);
const void *
krb5_config_vget_next(krb5_context context, const krb5_config_section *c, const krb5_config_binding **pointer, int type, va_list args);
const char *
krb5_config_vget_string(krb5_context context, const krb5_config_section *c, va_list args);
const char *
krb5_config_vget_string_default(krb5_context context, const krb5_config_section *c, const char *def_value, va_list args);
char **
krb5_config_vget_strings(krb5_context context, const krb5_config_section *c, va_list args);
int
krb5_config_vget_time(krb5_context context, const krb5_config_section *c, va_list args);
int
krb5_config_vget_time_default(krb5_context context, const krb5_config_section *c, int def_value, va_list args);

DESCRIPTION
These functions get values from the krb5.conf(5) configuration file, or another configuration database specified by the c parameter.

The variable arguments should be a list of strings naming each subsection to look for. For example:

    krb5_config_get_bool_default(context, NULL, FALSE,
         "libdefaults", "log_utc", NULL);

gets the boolean value for the log_utc option, defaulting to FALSE.

krb5_config_get_bool_default() will convert the option value to a boolean value, where ‘yes’, ‘true’, and any non-zero number means TRUE, and any other value FALSE.

krb5_config_get_int_default() will convert the value to an integer.

krb5_config_get_time_default() will convert the value to a period of time (not a time stamp) in seconds, so the string ‘2 weeks’ will be converted to 1209600 (2 * 7 * 24 * 60 * 60).

krb5_config_get_string() returns a const char * to a string in the configuration database. The string not be valid after reload of the configuration database so a caller should make a local copy if its need to keep the database.

krb5_config_free_strings() free strings as returned by krb5_config_get_strings() and krb5_config_vget_strings(). If the argument strings is a NULL pointer, no action occurs.

krb5_config_file_free() free the result of krb5_config_parse_file() and krb5_config_parse_file_multi().

SEE ALSO
krb5_appdefault(3), krb5_init_context(3), krb5.conf(5)

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.