pam_get_item 3 Linux-PAM Manual
pam_get_item getting PAM informations

    #include <security/pam_modules.h>

int `pam_get_item` const pam_handle_t *pamh int item_type const void **item

## DESCRIPTION

The `pam_get_item` function allows applications and PAM service modules to access and retrieve PAM informations of item_type. Upon successful return, item contains a pointer to the value of the corresponding item. Note, this is a pointer to the actual data and should not be free()'ed or over-written! The following values are supported for item_type:

The following additional items are specific to Linux-PAM and should not be used in portable applications:

If a service module wishes to obtain the name of the user, it should not use this function, but instead perform a call to pam_get_user 3 .

Only a service module is privileged to read the authentication tokens, PAM_AUTHTOK and PAM_OLDAUTHTOK.

## RETURN VALUES

PAM_BAD_ITEM

  The application attempted to set an undefined or inaccessible item.

PAM_BUF_ERR

  Memory buffer error.

PAM_PERM_DENIED

  The value of item was NULL.

PAM_SUCCESS

  Data was successful updated.

PAM_SYSTEM_ERR

  The pam_handle_t passed as first argument was invalid.

## SEE ALSO

pam_set_item 3 , pam_strerror 3