---
name: "pam_get_item"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pam_get_item"
---

# pam\_get\_item(3)

get PAM information

## NAME

**pam\_get\_item** – get PAM information

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<security/pam\_appl.h\>**

*int*\

**pam\_get\_item**(*const pam\_handle\_t \*pamh*, *int item\_type*, *const void \*\*item*);

## DESCRIPTION

The **pam\_get\_item**() function stores a pointer to the item specified by the *item\_type* argument in the location pointed to by the *item* argument. The item is retrieved from the PAM context specified by the *pamh* argument. If **pam\_get\_item**() fails, the *item* argument is untouched.

The following item types are recognized:

- PAM\_SERVICE

  The name of the requesting service.

- PAM\_USER

  The name of the user the application is trying to authenticate.

- PAM\_TTY

  The name of the current terminal.

- PAM\_RHOST

  The name of the applicant's host.

- PAM\_CONV

  A *struct* *pam\_conv* describing the current conversation function.

- PAM\_AUTHTOK

  The current authentication token.

- PAM\_OLDAUTHTOK

  The expired authentication token.

- PAM\_RUSER

  The name of the applicant.

- PAM\_USER\_PROMPT

  The prompt to use when asking the applicant for a user name to authenticate as.

- PAM\_AUTHTOK\_PROMPT

  The prompt to use when asking the applicant for an authentication token.

- PAM\_OLDAUTHTOK\_PROMPT

  The prompt to use when asking the applicant for an expired authentication token prior to changing it.

- PAM\_HOST

  The name of the host the application runs on.

See [pam\_start(3)](/pam_start/3.md) for a description of *struct* *pam\_conv*.

## RETURN VALUES

The **pam\_get\_item**() function returns one of the following values:

- \[PAM\_SUCCESS\]

  Success.

- \[PAM\_BAD\_ITEM\]

  Unrecognized or restricted item.

## SEE ALSO

[pam(3)](/pam/3.md), [pam\_set\_item(3)](/pam_set_item/3.md), [pam\_start(3)](/pam_start/3.md), [pam\_strerror(3)](/pam_strerror/3.md)

## STANDARDS

*X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules*, June 1997.

## AUTHORS

The **pam\_get\_item**() function and this manual page were developed for the FreeBSD Project by ThinkSec AS and Network Associates Laboratories, the Security Research Division of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (“CBOSS”), as part of the DARPA CHATS research program.

The OpenPAM library is maintained by Dag-Erling Smørgrav ⟨*des@des.dev*⟩.
