KRB5_APPDEFAULT(3)

πŸ’– KRB5_APPDEFAULT πŸ’–

okay bestie, welcome to krb5_appdefault from the Kerberos 5 Library β€” it's a manual page, it's a whole vibe, and by the end of this you're gonna know exactly how to pull application configuration values out of thin air (well, out of a config file). let's go πŸ¦‹


✨ NAME ✨

krb5_appdefault_boolean, krb5_appdefault_string, krb5_appdefault_time β€” the trio that gets your application configuration value, no cap πŸ’…


πŸ“š LIBRARY πŸ“š

Kerberos 5 Library (libkrb5, -lkrb5)


πŸŽ€ SYNOPSIS πŸŽ€

#include <krb5.h>

void
krb5_appdefault_boolean(krb5_context context, const char *appname,
    krb5_realm realm, const char *option, krb5_boolean def_val,
    krb5_boolean *ret_val);

void
krb5_appdefault_string(krb5_context context, const char *appname,
    krb5_realm realm, const char *option, const char *def_val,
    char **ret_val);

void
krb5_appdefault_time(krb5_context context, const char *appname,
    krb5_realm realm, const char *option, time_t def_val,
    time_t *ret_val);

🌸 DESCRIPTION 🌸

so here's the tea β˜• β€” these functions go get application defaults from the appdefaults section of the krb5.conf(5) configuration file. and the way it's set up, these defaults can be specified per application, and/or per realm. very flexible, very demure, very mindful 🫢

when you ask for a value, it gets looked for in krb5.conf(5) in order of descending importance. like, most specific wins, and it trickles all the way down. the hierarchy is giving:

[appdefaults]
        appname = {
                realm = {
                        option = value
                }
        }
        appname = {
                option = value
        }
        realm = {
                option = value
        }
        option = value

okay so quick glossary because i love you:

  • appname is the name of the application.
  • realm is the realm name. and if the realm is omitted it will not be used for resolving values β€” so don't expect it to magically show up, bestie πŸ™ˆ
  • def_val is the value to return if no value is found in krb5.conf(5). it's your fallback, your safety net, your ride-or-die πŸ’–
fr fr, that's the whole thing. look up the option, walk the ladder from most specific to least, and if nothing matches, hand back def_val and keep it moving.

πŸ‘€ SEE ALSO πŸ‘€


and that's the page, periodt πŸ’… this was HEIMDAL, dated July 25, 2000 β€” yes she's an elder icon and she still ate πŸ‘‘ go read krb5.conf(5) next, ily, bye πŸŽ€βœ¨

πŸ“¦ where this page comes from