SASL_LISTMECH(3)

✨ SASL_LISTMECH ✨

okay bestie, gather round πŸ’– this one lives in the Cyrus SASL manual, section 3, and it's genuinely so useful once it clicks. no cap.


🌸 NAME 🌸

sasl_listmech β€” the Cyrus SASL documentation, but make it a group chat explanation πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <sasl/sasl.h>

int sasl_listmech(sasl_conn_t *conn,
                 const char *user,
                 const char *prefix,
                 const char *sep,
                 const char *suffix,
                 const char **result,
                 unsigned *plen,
                 int *pcount);

πŸ’œ DESCRIPTION πŸ’œ

here's the whole signature again, laid out all pretty so your eyes don't have to work for it πŸŽ€

int sasl_listmech(sasl_conn_t *conn,

const char *user,

const char *prefix,

const char *sep,

const char *suffix,

const char **result,

unsigned *plen,

int *pcount);

so like. sasl_listmech hands you back a string that lists the SASL names of all the mechanisms available to the specified user. that's it, that's the whole vibe ✨

usually you'd hand that string off to the client through a capability command or an initial server response. and honestly? client applications need this list β€” how else are they supposed to know which mechanisms the server supports?? it's giving "here's the menu, pick your fave" πŸ“

🧚 Parameters 🧚

  • conn – the SASL context for this connection. your whole situation, basically.
  • user – optional! if you pass one, it restricts the mechanism list to only those available to that user. narrowing the field, we love to see it.
  • prefix – appended to the beginning of the result. the little intro, the "hey bestie".
  • sep – appended between mechanisms. the lil comma moments between everyone.
  • suffix – appended to the end of the result. the mic drop, the outro.
  • result – the NULL terminated result string. and listen β€” it's allocated/freed by the library, not by you. don't touch, don't free, don't be messy πŸ’€
  • plen – length of the result, filled in by the library. may be NULL if you're not about that length life.
  • pcount – number of mechanisms available, filled in by the library. may be NULL too, no pressure.

🌈 EXAMPLE 🌈

sasl_listmech(conn,NULL,"(",",",")",&mechlist,NULL,NULL);

and this bad boy may give the following string as a result:

(ANONYMOUS,KERBEROS_V4,DIGEST‐MD5)

look at those parentheses doing their prefix/suffix job, and those commas holding it down as the sep. iconic behavior, fr fr πŸ‘‘


⭐ RETURN VALUE ⭐

SASL functions should return SASL return codes β€” go peek at sasl.h for the complete list. and SASL_OK indicates success. that's the one you want, bestie. that's the green flag 🫢


πŸ’– SEE ALSO πŸ’–

RFC 4422,:saslman:sasl(3), sasl_server_new(3), sasl_errors(3), sasl_client_new(3)


πŸ‘‘ AUTHOR πŸ‘‘

The Cyrus Team


1993-2016, The Cyrus Team


and that's the whole page, no crumbs left πŸ’… this was Cyrus SASL version 2.1.28, dated February 18, 2022 β€” go forth and list those mechanisms, you absolute main character 🌟