KRB5_CONTEXT(3)
π KRB5_CONTEXT(3) β bestie edition π
okay so this is the KRB5_CONTEXT(3) page, it lives in the Library Functions Manual, and it's literally the whole β¨loreβ¨ of how you make, poke at, and delete krb5_context structures. come sit with me π«Ά
πΈ NAME πΈ
krb5_add_et_list, krb5_add_extra_addresses, krb5_add_ignore_addresses, krb5_context, krb5_free_config_files, krb5_free_context, krb5_get_default_config_files, krb5_get_dns_canonize_hostname, krb5_get_extra_addresses, krb5_get_fcache_version, krb5_get_ignore_addresses, krb5_get_kdc_sec_offset, krb5_get_max_time_skew, krb5_get_use_admin_kdc krb5_init_context, krb5_init_ets, krb5_prepend_config_files, krb5_prepend_config_files_default, krb5_set_config_files, krb5_set_dns_canonize_hostname, krb5_set_extra_addresses, krb5_set_fcache_version, krb5_set_ignore_addresses, krb5_set_max_time_skew, krb5_set_use_admin_kdc
β and what do they all do? create, modify and delete krb5_context structures. that's the whole vibe π
π LIBRARY π
Kerberos 5 Library (libkrb5, -lkrb5)
β¨ SYNOPSIS β¨
#include <krb5.h>
struct krb5_context;
krb5_error_code
krb5_init_context(krb5_context *context);
void
krb5_free_context(krb5_context context);
void
krb5_init_ets(krb5_context context);
krb5_error_code
krb5_add_et_list(krb5_context context, void (*func)(struct et_list **));
krb5_error_code
krb5_add_extra_addresses(krb5_context context,
krb5_addresses *addresses);
krb5_error_code
krb5_set_extra_addresses(krb5_context context,
const krb5_addresses *addresses);
krb5_error_code
krb5_get_extra_addresses(krb5_context context,
krb5_addresses *addresses);
krb5_error_code
krb5_add_ignore_addresses(krb5_context context,
krb5_addresses *addresses);
krb5_error_code
krb5_set_ignore_addresses(krb5_context context,
const krb5_addresses *addresses);
krb5_error_code
krb5_get_ignore_addresses(krb5_context context,
krb5_addresses *addresses);
krb5_error_code
krb5_set_fcache_version(krb5_context context, int version);
krb5_error_code
krb5_get_fcache_version(krb5_context context, int *version);
void
krb5_set_dns_canonize_hostname(krb5_context context, krb5_boolean flag);
krb5_boolean
krb5_get_dns_canonize_hostname(krb5_context context);
krb5_error_code
krb5_get_kdc_sec_offset(krb5_context context, int32_t *sec,
int32_t *usec);
krb5_error_code
krb5_set_config_files(krb5_context context, char **filenames);
krb5_error_code
krb5_prepend_config_files(const char *filelist, char **pq,
char ***ret_pp);
krb5_error_code
krb5_prepend_config_files_default(const char *filelist,
char ***pfilenames);
krb5_error_code
krb5_get_default_config_files(char ***pfilenames);
void
krb5_free_config_files(char **filenames);
void
krb5_set_use_admin_kdc(krb5_context context, krb5_boolean flag);
krb5_boolean
krb5_get_use_admin_kdc(krb5_context context);
time_t
krb5_get_max_time_skew(krb5_context context);
krb5_error_code
krb5_set_max_time_skew(krb5_context context, time_t time);
π DESCRIPTION π
okay so the main character here is krb5_init_context(). it initializes the context structure and reads the configuration file /etc/krb5.conf. that's it, that's the job π
and bestie, when you're done with it, you have to free that structure by calling krb5_free_context(). no leaving it lying around, that's not the vibe π
krb5_init_context() returns 0 to indicate success. otherwise an errno code comes back at you π. a failure means either that something bad happened during initialization (typically [ENOMEM]) or that Kerberos should not be used [ENXIO].
krb5_init_ets() adds all com_err(3) libs to context. this is done by krb5_init_context(). so like, it already happened, but ok go off π
krb5_add_et_list() adds a com_err(3) error-code handler func to the specified context. and listen, the error handler must be generated by the re-entrant version of the compile_et(1) program. no shortcuts, iykyk.
krb5_add_extra_addresses() add a list of addresses that should be added when requesting tickets.
krb5_add_ignore_addresses() add a list of addresses that should be ignored when requesting tickets.
krb5_get_extra_addresses() get the list of addresses that should be added when requesting tickets.
krb5_get_ignore_addresses() get the list of addresses that should be ignored when requesting tickets.
krb5_set_ignore_addresses() set the list of addresses that should be ignored when requesting tickets.
krb5_set_extra_addresses() set the list of addresses that should be added when requesting tickets.
krb5_set_fcache_version() sets the version of file credentials caches that should be used. π¦
krb5_get_fcache_version() gets the version of file credentials caches that should be used.
krb5_set_dns_canonize_hostname() sets if the context is configured to canonicalize hostnames using DNS. π
krb5_get_dns_canonize_hostname() returns if the context is configured to canonicalize hostnames using DNS.
krb5_get_kdc_sec_offset() returns the offset between the localtime and the KDC's time. and here's the cute part: sec and usec are both optional arguments and NULL can be passed in. lowkey flexible π
krb5_set_config_files() set the list of configuration files to use and re-initialize the configuration from the files.
krb5_prepend_config_files() parse the filelist and prepend the result to the already existing list pq. the result is returned in ret_pp and should be freed with krb5_free_config_files(). don't forget or it's giving memory leak π
krb5_prepend_config_files_default() parse the filelist and append that to the default list of configuration files.
krb5_get_default_config_files() get a list of default configuration files.
krb5_free_config_files() free a list of configuration files returned by krb5_get_default_config_files(), krb5_prepend_config_files_default(), or krb5_prepend_config_files(). it's the cleanup bestie, she does all three π§
krb5_set_use_admin_kdc() sets if all KDC requests should go admin KDC.
krb5_get_use_admin_kdc() gets if all KDC requests should go admin KDC.
krb5_get_max_time_skew() and krb5_set_max_time_skew() get and sets the maximum allowed time skew between client and server. β°
π¦ SEE ALSO π¦
errno(2), krb5(3), krb5_config(3), krb5_context(3), kerberos(8)
and that's the whole page bestie, you ate it π β¨
this one came from HEIMDAL and it's dated December 8, 2004 β vintage, iconic, no cap ππ
π¦ where this page comes from
- alpine 3.22: heimdal-doc 7.8.0-r4 Β· BSD-3-Clause
- alpine 3.23: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- alpine 3.24: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- debian bookworm: heimdal-dev 7.8.git20221117.28daf24+dfsg-2 Β· BSD-3-Clause
- debian trixie: heimdal-dev 7.8.git20221117.28daf24+dfsg-9+deb13u1 Β· BSD-3-Clause
- epel 10: heimdal-devel 7.8.0-26.el10_2 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- epel 9: heimdal-devel 7.8.0-5.el9 Β· BSD and MIT
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- nixpkgs unstable: heimdal 7.8.0-unstable-2024-09-10
- ubuntu jammy: heimdal-dev 7.7.0+dfsg-3ubuntu1 Β· BSD-3-Clause
- ubuntu noble: heimdal-dev 7.8.git20221117.28daf24+dfsg-5ubuntu3 Β· BSD-3-Clause
- ubuntu questing: heimdal-dev 7.8.git20221117.28daf24+dfsg-9ubuntu1
- ubuntu resolute: heimdal-dev 7.8.git20221117.28daf24+dfsg-11ubuntu1 Β· BSD-3-Clause
- ubuntu stonking: heimdal-dev 7.8.git20240113.1b4565a+dfsg-2ubuntu1 Β· BSD-3-Clause
- Copyright (c) 2001 - 2004 Kungliga Tekniska HΓΆgskolan
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms