KRB5_TIMEOFDAY(3)
π KRB5_TIMEOFDAY π
okay bestie, so this is a page from the Library Functions Manual β section 3 of the Kerberos 5 docs, and it's literally all about how Kerberos handles time β°β¨ (which, iykyk, is the whole entire plot of Kerberos, because if your clock is wrong nothing works, no cap).
πΈ NAME πΈ
krb5_timeofday, krb5_set_real_time, krb5_us_timeofday, krb5_format_time, krb5_string_to_deltat β the Kerberos 5 time handling functions π
π LIBRARY π
Kerberos 5 Library β link it with libkrb5, -lkrb5 π«Ά
β¨ SYNOPSIS β¨
#include <krb5.h>
krb5_timestamp;
krb5_deltat;
krb5_error_code
krb5_set_real_time(krb5_context context, krb5_timestamp sec,
int32_t usec);
krb5_error_code
krb5_timeofday(krb5_context context, krb5_timestamp *timeret);
krb5_error_code
krb5_us_timeofday(krb5_context context, krb5_timestamp *sec,
int32_t *usec);
krb5_error_code
krb5_format_time(krb5_context context, time_t t, char *s, size_t len,
krb5_boolean include_time);
krb5_error_code
krb5_string_to_deltat(const char *string, krb5_deltat *deltat);
π DESCRIPTION π
the vibe: time sync is the moment π°οΈ
krb5_set_real_time sets the absolute time that the caller knows the KDC has. the way that this works is β once you've told it, the Kerberos library can figure out the relative difference between the KDC's time and your local system's time, and it stores that difference right there in the context. and with that info? the library can adjust all the time stamps in Kerberos packages. slay. π
krb5_timeofday() returns the current time β but adjusted with that time difference between the local host and the KDC, bestie. it's giving trust issues with your own clock. and krb5_us_timeofday() does the exact same thing but also hands you the microseconds π¦
krb5_format_time formats the time t into the string s of length len. and if include_time is set, the time is set include_time. π yeah, that's genuinely what the original says, so that's what you get β no notes.
krb5_string_to_deltat parses a delta time string into deltat. periodt. β¨
π₯ SEE ALSO π₯
ngl if any of this is confusing it's because time itself is confusing and that's not on you π«Ά
and that's the whole page, bestie!! πβ¨ππ¦πΈ
this was written by HEIMDAL and it's dated September 16, 2006 β yes it's older than most of the group chat but it still ate, and this is the KRB5_TIMEOFDAY(3) page signing off π
π
π¦ 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, 2003, 2006 Kungliga Tekniska HΓΆgskolan
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms