radcli_ctx_set_secret(3)

πŸ“¦ version 2.0.1, in arch rolling

πŸ’… radcli_ctx_set_secret β€” the manual, but make it make sense

okay so bestie, welcome to radcli_ctx_set_secret(3) from the radcli Radius client library ✨ this one's short and sweet and honestly kind of iconic once you get what it's doing.


🌸 NAME 🌸

radcli_ctx_set_secret β€” sets the RADIUS shared secret for the authserver and/or acctserver you've already configured πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <radcli/>

int radcli_ctx_set_secret(
    radcli_ctx  *ctx,
    unsigned     target_mask,
    const char  *secret
);

πŸ’– DESCRIPTION πŸ’–

so like. real talk. this is the new-API equivalent of doing that little trick where you shove a secret inside the host:port:secret form of #RADCLI_OPT_AUTHSERVER/#RADCLI_OPT_ACCTSERVER's value β€” except it's its own whole distinct call instead of a delimited string, and it can set both server types' secret at once when they share one (which, ngl, is the usual case) via RADCLI_SECRET_AUTH | RADCLI_SECRET_ACCT. and the best part? you don't have to embed anything in the authserver/acctserver value at all. clean. immaculate. periodt πŸ’…


✨ PARAMETERS ✨

  • ctx β€” a context whose #RADCLI_OPT_AUTHSERVER and/or #RADCLI_OPT_ACCTSERVER (whichever ones your target_mask points at) is already set via radcli_ctx_set_opt_str() or radcli_ctx_read_config() before you make this call 🫢 like, do that part first, okay?
  • target_mask β€” a bitwise OR of one or both radcli_secret_target values. pick your fighter(s) 🌈
  • secret β€” the shared secret itself, as a NUL-terminated string πŸ“

πŸ‘‘ RETURN VALUE πŸ‘‘

0 on success, -1 on failure 😭 and the failure cases are:

  • NULL ctx/secret
  • target_mask empty or carrying an unrecognised bit
  • or the corresponding server not yet configured

πŸ”₯ SEE ALSO πŸ”₯


and that's the whole thing, no cap πŸ’œ this page is brought to you by radcli, dated 2026-10-10 β€” go set some secrets bestie, you've got this 🧚✨

πŸ“¦ where this page comes from