---
name: "pam_get_data"
section: "3"
platform: "linux"
package: "pam"
version: "1.7.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pam_get_data"
---

# pam\_get\_data(3)

get module internal data

## NAME

pam\_get\_data - get module internal data

## SYNOPSIS

```
#include <security/pam_modules.h>
```

**int pam\_get\_data(const pam\_handle\_t \****pamh***, const char \****module\_data\_name***, const void \*\****data***);**

## DESCRIPTION

This function together with the [**pam\_set\_data**(3)](/pam_set_data/3.md) function is useful to manage module-specific data meaningful only to the calling PAM module.

The **pam\_get\_data** function looks up the object associated with the (hopefully) unique string *module\_data\_name* in the PAM context specified by the *pamh* argument. A successful call to **pam\_get\_data** will result in *data* pointing to the object. Note, this data is *not* a copy and should be treated as *constant* by the module.

## RETURN VALUES

PAM\_SUCCESS

Data was successfully retrieved.

PAM\_SYSTEM\_ERR

A NULL pointer was submitted as PAM handle or the function was called by an application.

PAM\_NO\_MODULE\_DATA

No module specific data is present.

## SEE ALSO

[**pam\_end**(3)](/pam_end/3.md), [**pam\_set\_data**(3)](/pam_set_data/3.md), [**pam\_strerror**(3)](/pam_strerror/3.md)
