SASL_SERVER_USERDB_SETPASS_T(3)

πŸ’… NAME πŸ’…

sasl_server_userdb_setpass_t β€” Cyrus SASL documentation, bestie edition 🫢

okay so welcome to the Cyrus SASL cinematic universe, section 3 of the manual pages, and today's main character is sasl_server_userdb_setpass_t. yes she's a callback. yes she's iconic. let's get into it ✨


🌸 SYNOPSIS 🌸

#include <sasl/sasl.h>

int sasl_server_userdb_setpass_t(sasl_conn_t *conn,
                                 void *context,
                                 const char *user,
                                 const char *pass,
                                 unsigned passlen,
                                 struct propctx *propctx,
                                 unsigned flags)

πŸŽ€ DESCRIPTION πŸŽ€

int sasl_server_userdb_setpass_t(sasl_conn_t *conn,

void *context,

const char *user,

const char *pass,

unsigned passlen,

struct propctx *propctx,

unsigned flags)

so basically? sasl_server_userdb_setpass_t is the callback that stores or changes a plaintext password in the user database of whoever supplied the callback. like she's the one actually writing the new password down. no cap πŸ’–

the parameters (aka the squad) 🌈

  • conn β€” the SASL connection, obviously. she's always there.
  • context β€” the context that came from the callback record. it's giving "carried over from last time."
  • user β€” NUL terminated user name, and it's in user@realm syntax. don't forget the realm bestie, the realm matters πŸ¦‹
  • pass β€” the password to check, and lowkey important: it may not be NUL terminated. so like. do not assume. 🫠
  • passlen β€” the length of the password. this is why pass doesn't need to be NUL terminated. they go together, periodt.
  • propctx β€” Auxilliary Properties, and heads up: they are not stored. just passing through πŸ’…
  • flags β€” these are literally the same flags that get passed to sasl_setpass(3), and they're documented over on that man page. so if you're confused about flags, that's a you-and-sasl_setpass(3) conversation πŸ’€

⭐ RETURN VALUE ⭐

SASL callback functions should return SASL return codes. the full list lives in sasl.h, go look, it's right there πŸŽ€

SASL_OK means success. that's the slay. that's the win. πŸ‘‘

any other return code means there's an error, and bestie, those should be handled. do not ignore them. that's not the vibe. πŸ™ˆ


πŸ”₯ SEE ALSO πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

The Cyrus Team. legends only, fr fr πŸ’œ


1993-2016, The Cyrus Team


and that's the whole page!! thanks for coming to my TED talk, this was Cyrus SASL manual page 2.1.28, dated February 18, 2022 β€” mwah, go handle your return codes, ily, bye πŸ§šβœ¨πŸ“