krb5_error(3)

πŸ“¦
version 7.8.0 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, epel 10, epel 9, fedora 43, fedora 44
krb5_error(3) πŸ’– straight outta the Heimdal Kerberos 5 library ✨

πŸŽ€ NAME πŸŽ€

krb5_error β€” the Heimdal Kerberos 5 error reporting functions πŸ’… like, the whole squad of them. she reports errors. that's the vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

✨ Functions ✨

okay bestie, here's the full lineup, no skips, no cuts πŸ’–

  • krb5_get_error_string β€” grabs you a char *. Deprecated, bestie, I'm so serious β€” the note literally says Use krb5_get_error_message instead. do not be out here using the old one. πŸ™ˆ
KRB5_LIB_FUNCTION char *KRB5_LIB_CALL krb5_get_error_string
    (krb5_context context) KRB5_DEPRECATED_FUNCTION('Use
    krb5_get_error_message instead')
  • krb5_eai_to_heim_errno β€” takes an int eai_errno and an int system_error, hands you back a krb5_error_code. two ints in, one error code out. balanced. πŸŽ€
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_eai_to_heim_errno
    (int eai_errno, int system_error)
  • krb5_h_errno_to_heim_errno β€” one int eai_errno goes in, a krb5_error_code comes out. (yes the param is named eai_errno, no I did not mistype it, that's literally what the page says, slay πŸ’…)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
    krb5_h_errno_to_heim_errno (int eai_errno)
  • krb5_clear_error_message β€” returns void, takes the krb5_context. the little eraser of the group 🧽✨
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_clear_error_message
    (krb5_context context)
  • krb5_set_error_message β€” void, takes context, a krb5_error_code ret, and a const char *fmt,.... she's a variadic girlie, __printf__-style formatting and all. πŸ’–
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_error_message
    (krb5_context context, krb5_error_code ret, const char *fmt,...)
    __attribute__((__format__(__printf__
  • krb5_vset_error_message β€” same energy as the one above but the ... is now a va_list args. the v stands for very demure, very mindful, very va_list. 😌
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_vset_error_message
    (krb5_context context, krb5_error_code ret, const char *fmt, va_list
    args) __attribute__((__format__(__printf__
  • krb5_prepend_error_message β€” void, takes context, ret, and the variadic fmt,.... she's the "put it at the FRONT" sister of krb5_set_error_message. πŸ‘‘
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_prepend_error_message
    (krb5_context context, krb5_error_code ret, const char *fmt,...)
    __attribute__((__format__(__printf__
  • krb5_vprepend_error_message β€” the va_list args version of the prepend girlie. twin flame behaviour. 🫢
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_vprepend_error_message
    (krb5_context context, krb5_error_code ret, const char *fmt, va_list
    args) __attribute__((__format__(__printf__
  • krb5_get_error_message β€” takes context and a krb5_error_code code, gives you back a const char *. this is the non-deprecated icon the other one told you to use. main character energy fr fr ✨
KRB5_LIB_FUNCTION const char *KRB5_LIB_CALL krb5_get_error_message
    (krb5_context context, krb5_error_code code)
  • krb5_free_error_message β€” void, takes context and the const char *msg. you got a message, now let it go. closure is healthy. πŸ¦‹
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_free_error_message
    (krb5_context context, const char *msg)
  • krb5_vwarn β€” returns a krb5_error_code, takes context, code, fmt, and va_list ap, all __printf__ formatted. warning but make it variadic-args style. 🌈
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_vwarn (krb5_context
    context, krb5_error_code code, const char *fmt, va_list ap)
    __attribute__((__format__(__printf__
  • krb5_warn β€” krb5_error_code back, takes context, code, and the variadic fmt,.... and yes, the declaration in the source is doubled up β€” KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL appears twice, that's not me glitching, that's the page. iconic in a cursed way πŸ’€
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL KRB5_LIB_FUNCTION
    krb5_error_code KRB5_LIB_CALL krb5_warn (krb5_context context,
    krb5_error_code code, const char *fmt,...)
    __attribute__((__format__(__printf__
  • krb5_vwarnx β€” krb5_error_code, takes context, fmt, and va_list ap. notice: no code param. she's the x-variant. the x is silent but powerful. πŸ’…
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_vwarnx
    (krb5_context context, const char *fmt, va_list ap)
    __attribute__((__format__(__printf__
  • krb5_warnx β€” krb5_error_code, context + variadic fmt,.... and yes bestie, doubled macros again. two of them. living their truth. πŸ™ˆ
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL KRB5_LIB_FUNCTION
    krb5_error_code KRB5_LIB_CALL krb5_warnx (krb5_context context,
    const char *fmt,...) __attribute__((__format__(__printf__
  • krb5_verr β€” krb5_error_code, takes context, int eval, code, fmt, and va_list ap. and she's marked __noreturn__. she does NOT come back. periodt. 😀
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_verr (krb5_context
    context, int eval, krb5_error_code code, const char *fmt, va_list
    ap) __attribute__((__noreturn__
  • krb5_err β€” krb5_error_code, context, int eval, code, variadic fmt,.... also __noreturn__. she's leaving and she's not texting back. πŸ”₯
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_err (krb5_context
    context, int eval, krb5_error_code code, const char *fmt,...)
    __attribute__((__noreturn__
  • krb5_verrx β€” krb5_error_code, context, int eval, fmt, va_list ap. no code param, x-variant, __noreturn__. mysterious, dramatic, gone. πŸŒ™
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_verrx (krb5_context
    context, int eval, const char *fmt, va_list ap)
    __attribute__((__noreturn__
  • krb5_errx β€” krb5_error_code, context, int eval, variadic fmt,..., __noreturn__. the last of the __noreturn__ quadruplets. we stan a consistent queen. πŸ‘‘
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_errx (krb5_context
    context, int eval, const char *fmt,...) __attribute__((__noreturn__
  • krb5_vabort β€” krb5_error_code, context, code, fmt, va_list ap, __noreturn__. yes, abort. she is NOT asking for permission. 😭
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_vabort
    (krb5_context context, krb5_error_code code, const char *fmt,
    va_list ap) __attribute__((__noreturn__
  • krb5_abort β€” krb5_error_code, context, code, variadic fmt,..., __noreturn__. same energy, ... instead of va_list. 🌸
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_abort (krb5_context
    context, krb5_error_code code, const char *fmt,...)
    __attribute__((__noreturn__
  • krb5_abortx β€” krb5_error_code, context, variadic fmt,..., __noreturn__. no code param. she aborts bare. πŸ’€
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_abortx
    (krb5_context context, const char *fmt,...)
    __attribute__((__noreturn__
  • krb5_set_warn_dest β€” krb5_error_code, takes context and a krb5_log_facility *fac. pointer girlie. ✨
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_warn_dest
    (krb5_context context, krb5_log_facility *fac)
  • krb5_get_warn_dest β€” hands you back a krb5_log_facility *, takes just the context. and the star hugs the return type here: krb5_log_facility *KRB5_LIB_CALL. respect the formatting, bestie. πŸ’œ
KRB5_LIB_FUNCTION krb5_log_facility *KRB5_LIB_CALL krb5_get_warn_dest
    (krb5_context context)

πŸ”₯ Detailed Description πŸ”₯

okay so this is where the actual tea gets spilled… and it's coming up in part 2, so hold on, we're not done here πŸ“

✨ Function Documentation ✨

πŸ’€ krb5_abort

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_abort (krb5_context context, krb5_error_code code, const char * fmt,  ...)

Okay so bestie, this one is dramatic. It logs a warning to the log (which defaults to stderr), includes the error from the last failure, and then aborts. Like, it's not even sorry. πŸ’€

Parameters:

  • context β€” a Kerberos 5 context, obviously.
  • code β€” the error code of the last error.
  • fmt β€” the message to print.
  • ... β€” arguments for the format string.

πŸ’₯ krb5_abortx

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_abortx (krb5_context context, const char * fmt,  ...)

Same energy as krb5_abort but it doesn't include the last error. It just logs a warning (default stderr) and then aborts. No cap. πŸ’…

Parameters:

  • context β€” a Kerberos 5 context.
  • fmt β€” printf format string of message to print.
  • ... β€” arguments for the format string.

🧹 krb5_clear_error_message

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_clear_error_message (krb5_context context)

Clears the error message from the Kerberos 5 context. Like a little reset button for your error string. ✨

Parameters:

  • context β€” the Kerberos 5 context to clear.

πŸ”„ krb5_eai_to_heim_errno

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_eai_to_heim_errno (int eai_errno, int system_error)

Converts the getaddrinfo() error code to a Kerberos et error code. So you can translate that networking drama into Kerberos language. 🌐

Parameters:

  • eai_errno β€” contains the error code from getaddrinfo().
  • system_error β€” should have the value of errno after the failed getaddrinfo().

Returns:

  • Kerberos error code representing the EAI errors.

πŸšͺ krb5_err

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_err (krb5_context context, int eval, krb5_error_code code, const char * fmt,  ...)

Logs a warning to the log (default stderr), includes the error from the last failure, and then exits. It's giving "I'm done here". πŸšͺπŸ’¨

Parameters:

  • context β€” a Kerberos 5 context.
  • eval β€” the exit code to exit with.
  • code β€” error code of the last error.
  • fmt β€” message to print.

πŸšͺ krb5_errx

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_errx (krb5_context context, int eval, const char * fmt,  ...)

Like krb5_err but without the last error. Logs a warning (default stderr) and then exits. Simple. πŸ’…

Parameters:

  • context β€” a Kerberos 5 context.
  • eval β€” the exit code to exit with.
  • fmt β€” message to print.

πŸ—‘οΈ krb5_free_error_message

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_free_error_message (krb5_context context, const char * msg)

Frees the error message returned by krb5_get_error_message(). Don't forget to free your strings, bestie, or it's a leak. πŸ’§

Parameters:

  • context β€” Kerberos context.
  • msg β€” error message to free, returned by krb5_get_error_message().

πŸ’¬ krb5_get_error_message

KRB5_LIB_FUNCTION const char* KRB5_LIB_CALL krb5_get_error_message (krb5_context context, krb5_error_code code)

Returns the error message for code in context. On memory allocation error, the function returns NULL. So you might get a cute string or a big fat NULL. 😭

Parameters:

  • context β€” Kerberos 5 context.
  • code β€” error code related to the error.

Returns:

  • an error string, needs to be freed with krb5_free_error_message(). The functions return NULL on error.

πŸ’¬ krb5_get_error_string

KRB5_LIB_FUNCTION char* KRB5_LIB_CALL krb5_get_error_string (krb5_context context)

Returns the error message in context. On error or no error string, the function returns NULL. So if there's no tea, you get NULL. πŸ«–

Parameters:

  • context β€” Kerberos 5 context.

Returns:

  • an error string, needs to be freed with krb5_free_error_message(). The functions return NULL on error.

πŸ“ krb5_get_warn_dest

KRB5_LIB_FUNCTION krb5_log_facility* KRB5_LIB_CALL krb5_get_warn_dest (krb5_context context)

Gets the default logging facility. Like, where do the warnings go? Now you know. πŸ“

Parameters:

  • context β€” a Kerberos 5 context.

πŸ”„ krb5_h_errno_to_heim_errno

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_h_errno_to_heim_errno (int eai_errno)

Converts the gethostname() error code (h_error) to a Kerberos et error code. Another translator, because we love interoperability. 🌐

Parameters:

  • eai_errno β€” contains the error code from gethostname().

Returns:

  • Kerberos error code representing the gethostname errors.

πŸ“ krb5_prepend_error_message

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_prepend_error_message (krb5_context context, krb5_error_code ret, const char * fmt,  ...)

Prepends the context's full error string for a specific error code. The error that is stored should be internationalized. If context is NULL, no error string is stored. So it's like adding a little prefix to your error saga. πŸ“

Parameters:

  • context β€” Kerberos 5 context.
  • ret β€” the error code.
  • fmt β€” error string for the error code.
  • ... β€” printf(3) style parameters.

πŸ“ krb5_set_error_message

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_error_message (krb5_context context, krb5_error_code ret, const char * fmt,  ...)

Sets the context's full error string for a specific error code. The error that is stored should be internationalized. If context is NULL, no error string is stored. So you're replacing the error message entirely. Iconic. ✨

Parameters:

  • context β€” Kerberos 5 context.
  • ret β€” the error code.
  • fmt β€” error string for the error code.
  • ... β€” printf(3) style parameters.

πŸ“ krb5_set_warn_dest

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_set_warn_dest (krb5_context context, krb5_log_facility * fac)

Sets the default logging facility. So you can redirect where the warnings go. Slay. πŸ’…

Parameters:

  • context β€” a Kerberos 5 context.
  • fac β€” facility to use for logging.

πŸ’€ krb5_vabort

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_vabort (krb5_context context, krb5_error_code code, const char * fmt, va_list ap)

Like krb5_abort but takes a va_list. Logs a warning (default stderr), includes the error from the last failure, and then aborts. Still dramatic. πŸ’€

Parameters:

  • context β€” a Kerberos 5 context.
  • code β€” error code of the last error.
  • fmt β€” message to print.
  • ap β€” arguments.

πŸšͺ krb5_verr

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_verr (krb5_context context, int eval, krb5_error_code code, const char * fmt, va_list ap)

Like krb5_err but with a va_list. Logs a warning (default stderr), includes the last error, and then exits. πŸšͺ

Parameters:

  • context β€” a Kerberos 5 context.
  • eval β€” the exit code to exit with.
  • code β€” error code of the last error.
  • fmt β€” message to print.
  • ap β€” arguments.

πŸšͺ krb5_verrx

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_verrx (krb5_context context, int eval, const char * fmt, va_list ap)

Like krb5_errx but with a va_list. Logs a warning (default stderr) and then exits. No last error included. πŸ’…

Parameters:

  • context β€” a Kerberos 5 context.
  • eval β€” the exit code to exit with.
  • fmt β€” message to print.
  • ap β€” arguments.

πŸ“ krb5_vprepend_error_message

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_vprepend_error_message (krb5_context context, krb5_error_code ret, const char * fmt, va_list args)

Prepends the context's full error string for a specific error code. If context is NULL, no error string is stored. This is the va_list version. πŸ“

Parameters:

  • context β€” Kerberos 5 context.
  • ret β€” the error code.
  • fmt β€” error string for the error code.
  • args β€” printf(3) style parameters.

πŸ“ krb5_vset_error_message

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_vset_error_message (krb5_context context, krb5_error_code ret, const char * fmt, va_list args)

Sets the context's full error string for a specific error code. If context is NULL, no error string is stored. This is the va_list version. ✨

Parameters:

  • context β€” Kerberos 5 context.
  • ret β€” the error code.
  • fmt β€” error string for the error code.
  • args β€” printf(3) style parameters.

⚠️ krb5_vwarn

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_vwarn (krb5_context context, krb5_error_code code, const char * fmt, va_list ap)

Logs a warning to the log (default stderr), includes the error from the last failure. This is the va_list version. ⚠️

Parameters:

  • context β€” a Kerberos 5 context.
  • code β€” error code of the last error.
  • fmt β€” message to print.
  • ap β€” arguments.

⚠️ krb5_vwarnx

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_vwarnx (krb5_context context, const char * fmt, va_list ap)

Logs a warning to the log (default stderr). No last error included. This is the va_list version. πŸ’…

Parameters:

  • context β€” a Kerberos 5 context.
  • fmt β€” message to print.
  • ap β€” arguments.

⚠️ krb5_warn

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_warn (krb5_context context, krb5_error_code code, const char * fmt,  ...)

Logs a warning to the log (default stderr), includes the error from the last failure. Yes, the signature has that duplicated macro thing going on, but that's exactly how it is. πŸ‘‘

Parameters:

  • context β€” a Kerberos 5 context.
  • code β€” error code of the last error.
  • fmt β€” message to print.

⚠️ krb5_warnx

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_warnx (krb5_context context, const char * fmt,  ...)

Logs a warning to the log (default stderr). No last error included. Again, that duplicated macro in the signature is not a typo, it's just how Doxygen rolled. πŸ’…

Parameters:

  • context β€” a Kerberos 5 context.
  • fmt β€” message to print.

πŸ‘‘ Author

Generated automatically by Doxygen for Heimdal Kerberos 5 library from the source code.


And that's the tea, bestie! This page is from the Heimdal Kerberos 5 library, version 7.8.0, dated Tue Nov 15 2022. Stay slaying, and may your error messages always be clear. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from