AUTH_GETOPTION(3)

✨ AUTH_GETOPTION(3) ✨

okay bestie, welcome to section 3 of the manual (iykyk, that's the library-functions girlies) πŸ’… this one's called auth_getoption and she's a lil cutie from the authlib cinematic universe. buckle uppp πŸŽ€


🌸 NAME 🌸

auth_getoption β€” search an option string, bestie. that's it. that's the whole job. πŸ”


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <courierauth.h>

char *value=auth_getoption(const char *options, const char *keyword);

like. look at her. two args, one return, no notes. πŸ’–


✨ DESCRIPTION ✨

so basically, this is your lil convenience function for parsing account options β€” the ones that show up in the callback function that gets invoked by auth_generic_meta(3), auth_login_meta(3), auth_getuserinfo_meta(3), and auth_passwd(3). she's the friend who reads the group chat for you and tells you what's actually going on. 🫢

  • options β€” this is the options field from authinfo, and yes, she can be NULL. no shame in that. as described over in auth_generic_meta(3) (and the others too, they all say the same thing), it's a comma-separated list of <italic>keyword=value</italic> pairs. commas are the vibe separators. periodt.
  • keyword β€” the keyword you're hunting for.

auth_getoption searches options for a keyword. that's the whole plot. she looks. she finds (or doesn't). iconic behaviour honestly. πŸ‘‘


πŸ’œ RETURNS πŸ’œ

okay here's the tea, and it's important so listen:

  • if options does not have the keyword, auth_getoption returns NULL and sets errno to ENOENT. she's not being dramatic, that's just the API. 😭
  • otherwise, auth_getoption allocates a buffer for value and returns it. and guess what β€” it is the caller's responsibility to free(3) the returned buffer. no cap. you took the buffer home, you feed it. if you leak it, that's on you bestie πŸ’€
  • auth_getoption returns NULL with errno set to ENOMEM if it cannot allocate a buffer. the malloc said no and honestly? relatable. πŸ₯²

🌈 SEE ALSO 🌈


πŸ“ NOTES πŸ“

  1. auth_generic_meta(3) β€” https://www.courier-mta.org/authlib/auth_generic.html
  2. auth_login_meta(3) β€” https://www.courier-mta.org/authlib/auth_login.html
  3. auth_getuserinfo_meta(3) β€” https://www.courier-mta.org/authlib/auth_getuserinfo.html
  4. auth_passwd(3) β€” https://www.courier-mta.org/authlib/auth_passwd.html
  5. authlib(3) β€” https://www.courier-mta.org/authlib/authlib.html

and that's the whole page, bestie! this absolute banger of a manpage was written by S. Varshavchik. and dated 01/11/2026 β€” yes we're serving you the freshest vintage πŸ’– go forth and parse those option strings, you're doing amazing sweetie πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from