---
name: "auth_getoption"
section: "3"
platform: "linux"
package: "courier-authlib-dev"
version: "0.72.4-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/auth_getoption"
---

# auth\_getoption(3)

Search an option string

## NAME

auth\_getoption - Search an option string

## SYNOPSIS

```
#include <courierauth.h>
```

**char \*value=auth\_getoption(const char \****options***, const char \****keyword***);**

## DESCRIPTION

This is a convenience function for parsing account options, as received by the callback function invoked by [**auth\_generic\_meta**(3)](/auth_generic_meta/3.md)\[1\], [**auth\_login\_meta**(3)](/auth_login_meta/3.md)\[2\], [**auth\_getuserinfo\_meta**(3)](/auth_getuserinfo_meta/3.md)\[3\], and [**auth\_passwd**(3)](/auth_passwd/3.md)\[4\].

*options* is the *options* field from authinfo (which can be NULL). As described in [**auth\_generic\_meta**(3)](/auth_generic_meta/3.md)\[1\] (and the others), it is a comma-separated list of “*keyword*=*value*” pairs.

**auth\_getoption** searches *options* for a *keyword*.

## RETURNS

If *options* does not have the *keyword*, **auth\_getoption** returns NULL with *errno* set to ENOENT. Otherwise **auth\_getoption** allocates a buffer for *value*, and returns it. It is the caller's responsibility to [**free**(3)](/free/3.md) the returned buffer.

**auth\_getoption** returns NULL with *errno* set to ENOMEM if it cannot allocate a buffer.

## SEE ALSO

[**authlib**(3)](/authlib/3.md)\[5\], [**auth\_generic\_meta**(3)](/auth_generic_meta/3.md)\[1\], [**auth\_login\_meta**(3)](/auth_login_meta/3.md)\[2\], [**auth\_getuserinfo\_meta**(3)](/auth_getuserinfo_meta/3.md)\[3\].

## NOTES

- 1\.

  [**auth\_generic\_meta**(3)](/auth_generic_meta/3.md)

  http://www.courier-mta.org/authlib/auth\_generic.html

- 2\.

  [**auth\_login\_meta**(3)](/auth_login_meta/3.md)

  http://www.courier-mta.org/authlib/auth\_login.html

- 3\.

  [**auth\_getuserinfo\_meta**(3)](/auth_getuserinfo_meta/3.md)

  http://www.courier-mta.org/authlib/auth\_getuserinfo.html

- 4\.

  [**auth\_passwd**(3)](/auth_passwd/3.md)

  http://www.courier-mta.org/authlib/auth\_passwd.html

- 5\.

  [**authlib**(3)](/authlib/3.md)

  http://www.courier-mta.org/authlib/authlib.html
