SASL_CANON_USER_T(3)
β¨ NAME β¨
sasl_canon_user_t β bestie, this is the Cyrus SASL doc for the user canonicalization callback π (it's a page in the Cyrus SASL manual, section 3, so you know it's a library function, iykyk)
π SYNOPSIS π
#include <sasl/sasl.h>
int sasl_canon_user_t(sasl_conn_t *conn, void *context, const char *user, unsigned ulen,
unsigned flags, const char *user_realm, char *out_user,
unsigned out_umax, unsigned *out_ulen)
π¦ DESCRIPTION π¦
Okay so, here's the signature again, laid out all pretty, because the original does it this way and we are not skipping anything, periodt:
int sasl_canon_user_t(sasl_conn_t *conn,
void *context,
const char *user,
unsigned ulen,
unsigned flags,
const char *user_realm,
char *out_user,
unsigned out_umax,
unsigned *out_ulen)
So like. sasl_canon_user_t is the callback for an application-supplied user canonicalization function. That's the whole vibe. π
And because it's that kind of callback, it's subject to the exact same requirements that all user canonicalization functions are subject to:
- It must copy the result into the output buffers β no shortcuts, no "I'll get to it later", fr fr.
- BUT, plot twist: the output buffers and the input buffers may be the same. π So your function has to survive being handed the same memory on both sides. Be brave.
πΈ Parameters πΈ
contextβ context from the callback recorduserβ un-canonicalized usernameulenβ length ofuserflagsβ EitherSASL_CU_AUTHID(indicating the authentication ID is being canonicalized) orSASL_CU_AUTHZID(indicating the authorization ID is to be canonicalized) or a bitwise OR of the the two.user_realmβ Realm of authentication.out_userβ The output buffer for the canonicalized usernameout_umaxβ Maximum length forout_userout_ulenβ Actual length ofout_user
Not me pointing out that the flags line really does say "of the the two" β that's literally what's written, and I am nothing if not faithful to the source. π
π« Returns π«
SASL_OK indicates success. That's the slay outcome. β¨
For a full list of SASL error codes, go check out sasl_errors(3) β it's giving very "read the fine print, bestie."
π CONFORMING TO π
π₯ SEE ALSO π₯
π AUTHOR π
The Cyrus Team
π«Ά COPYRIGHT π«Ά
1993-2016, The Cyrus Team
And that's the whole page, no crumbs left, bestie! π This one's from Cyrus SASL version 2.1.28, dated February 18, 2022 β so when you cite it, you cite it correctly, okay? Main character energy only. Byeee πβ¨
π¦ where this page comes from
- alpine 3.22: cyrus-sasl-doc 2.1.28-r8 Β· BSD-3-Clause-Attribution AND BSD-4-Clause
- alpine 3.23: cyrus-sasl-doc 2.1.28-r9 Β· BSD-3-Clause-Attribution AND BSD-4-Clause
- alpine 3.24: cyrus-sasl-doc 2.1.28-r9 Β· BSD-3-Clause-Attribution AND BSD-4-Clause
- centos-stream 10: cyrus-sasl-devel 2.1.28-27.el10 Β· BSD-Attribution-HPND-disclaimer
- fedora 43: cyrus-sasl-devel 2.1.28-33.fc43 Β· BSD-Attribution-HPND-disclaimer
- fedora 43: cyrus-sasl-devel 2.1.28-33.fc43 Β· BSD-Attribution-HPND-disclaimer
- fedora 44: cyrus-sasl-devel 2.1.28-35.fc44 Β· BSD-Attribution-HPND-disclaimer
- fedora 44: cyrus-sasl-devel 2.1.28-35.fc44 Β· BSD-Attribution-HPND-disclaimer
- opensuse-leap 16.0: cyrus-sasl-bdb-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-bdb-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-bdb-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-bdb-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms