SASL_AUXPROP(3)
π NAME π
sasl_auxprop β the Cyrus SASL auxiliary property glow-up, aka the page that explains SASL_AUXPROP(3) and honestly? it eats.
β¨ SYNOPSIS β¨
#include <sasl/prop.h>
struct propctx *prop_new(unsigned estimate)
int prop_dup(struct propctx *src_ctx,
struct propctx *dst_ctx)
int prop_request(struct propctx *ctx,
const char **names)
const struct propval *prop_get(struct propctx *ctx)
int prop_getnames(struct propctx *ctx, const char **names,
struct propval *vals)
void prop_clear(struct propctx *ctx, int requests)
void prop_erase(struct propctx *ctx, const char *name)
void prop_dispose(struct propctx **ctx)
int prop_format(struct propctx *ctx, const char *sep, int seplen,
char *outbuf, unsigned outmax, unsigned *outlen)
int prop_set(struct propctx *ctx, const char *name,
const char *value, int vallen)
int prop_setvals(struct propctx *ctx, const char *name,
const char **values)
πΈ DESCRIPTION πΈ
okay so bestie, picture this: SASL auxiliary properties are how you pull properties out of external sources while the authentication process is happening. like, a mechanism might need to go query an LDAP server to get the authentication secret. but the application probably wants other stuff from that same server too β home directory, UID, all of it. and the auxiliary property interface is literally the thing that lets those two cooperate so you only get a single query against the LDAP server (or whatever other property source you're using). one query. iconic behavior. π
property lookups happen directly after user canonicalization occurs. so no cap, all your requests need to be registered with the context before that moment. π
also hi, quick note: you can register requests with the sasl_auxprop_request(3) function too. but most of the functions listed below? they need a property context, and you get one of those by calling sasl_auxprop_getctx(3). π«Ά
π API DESCRIPTION π
prop_new(unsigned estimate)
create a new property context. ngl, it's probably unnecessary for application developers to call this at any point. π
Parameters
estimateβ is the estimate of storage needed in total for requests & responses. a value of0implies the library default.
Returns
a new property context: propctx β¨
prop_dup(struct propctx *src_ctx, struct propctx *dst_ctx)
duplicate a given property context. copy-paste but make it β¨intentionalβ¨.
Parameters
src_ctx(propctx) β property context to copy.dst_ctx(propctx) β destination context to copy into.
Returns
SASL error code.
prop_request(struct propctx *ctx, const char **names)
add properties to the request list of a given context.
Parameters
ctx(propctx) β the property context to add add the request list to.namesβ is theNULL-terminated array of property names, and must persist until the requests are cleared or the context is disposed of with a call toprop_dispose().
β οΈ thatnamesarray has to stick around β it must persist until the requests are cleared or the context gets disposed of withprop_dispose(). don't let it go out of scope, bestie, it's giving use-after-free π
Returns
SASL error code
prop_get(struct propctx *ctx)
fetch out the property values from a context. get you your values, queen. π
Parameters
ctx(propctx) β the property context to fetch from.
Returns
a NULL-terminated array of property values from the given context.
prop_getnames(struct propctx *ctx, const char **names, struct propval *vals)
fill in a (provided) array of property values based on a list of property names. this implies that the vals array is at least as long as the names array. π the values that are filled in by this call persist until next call to prop_request(), prop_clear(), or prop_dispose() on context. and if a name specified here was never requested, then its associated values entry will be set to NULL.
Parameters
ctx(propctx) β the property context to fill in.
Returns
number of matching properties that were found, or a SASL error code.
prop_clear(struct propctx *ctx, int requests)
clear values and (optionally) requests from a property context. spring cleaning but for properties π§ΉπΈ
Parameters
ctx(propctx) β the property context to clear.requestsβ set to1if the requests should be cleared,0otherwise.
prop_erase(struct propctx *ctx, const char *name)
securely erase the value of a property from a context. π₯ not just deleted β securely erased, and yes the distinction matters.
Parameters
ctx(propctx) β the property context to find the property in.nameβ is the name of the property to erase.
prop_dispose(struct propctx **ctx)
disposes of a property context and NULLifys the pointer. it takes the double pointer and leaves it NULL. no dangling anything, we don't do that here. π«Ά
Parameters
ctx(propctx) β the property context to clear.
prop_format(struct propctx *ctx, const char *sep, int seplen, char *outbuf, unsigned outmax, unsigned *outlen)
format the requested property names into a string. this not intended for use by the application (only by auxprop plugins). so if you're an application dev, hands off, this one's for the plugin girlies. π βοΈ
Parameters
ctx(propctx) β the property context to extract values from.sepβ the separator to use for the stringseplenβ (the original page doesn't spell this one out, bestie, but it's sitting right there in the signature π)outbufβ destination string. caller must allocate the buffer of lengthoutmax(includingNULterminator).outlenβ if non-NULL, will contain the length of the resulting string (excludingNULterminator).
Returns
SASL error code.
prop_set(struct propctx *ctx, const char *name, const char *value, int vallen)
adds a property value to the context. this is intended for use by auxprop plugins only.
Parameters
ctx(propctx) β the property context to add a value to.nameβ the name of the property to receive the new value, orNULL, which implies that the value will be added to the same property as the last call to eitherprop_set()orprop_setvals().valueβ the new value (of lengthvallen)vallenβ the length of the string value.
Returns
SASL error code
prop_setvals(struct propctx *ctx, const char *name, const char **values)
adds multiple values to a single property. this is intended for use by auxprop plugins only.
Parameters
ctx(propctx) β the property context to add values to.nameβ the name of the property to receive the new value, orNULL, which implies that the values will be added to the same property as the last call to eitherprop_set()orprop_setvals().valuesβ aNULL-terminated array of values to be added the property.
Returns
SASL error code
π¦ DATA STRUCTURES π¦
type propval
a struct holding a name and its property values. a name can have zero or more values. (zero. so a name can absolutely show up with nothing attached. it's giving "seen but no reply" π)
Param name
const char *. name of this propval. NULL means end of list.
Param values
const char **. list of string values. if property not found, values == NULL. if property found with no values, then *values == NULL
type propctx
a property context.
Param values
list of property values in this context.
Type values
propval *
π RETURN VALUE π
the property functions that return an int return SASL error codes. see sasl_errors(3). and the ones that return pointers? they'll return a valid pointer on success, or NULL on any error. simple as. β¨
β CONFORMING TO β
π SEE ALSO π
sasl(3), sasl_errors(3), sasl_auxprop_request(3), sasl_auxprop_getctx(3)
π AUTHOR π
The Cyrus Team
π COPYRIGHT π
1993-2016, The Cyrus Team
and that's the whole page, bestie, we ate and left no crumbs π this was Cyrus SASL 2.1.28, dated February 18, 2022 β go forth and query your LDAP server exactly once, the way the universe intended. mwah π π
π¦ 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