pam_set_item Subroutine

Purpose

Sets the value of an item for this PAM session.

Library

PAM Library (libpam.a)

Syntax

#include <security/pam_appl.h>

int pam_set_item (PAMHandle, ItemType, Item)
pam_handle_t *PAMHandle;
int ItemType;
void **Item;

Description

The pam_set_item subroutine allows for the setting and updating of a set of known PAM items. The item value is stored within the PAM handle, PAMHandle. If a previous value exists for the item type, ItemType, then the old value is overwritten with the new value, Item.

Parameters

Item Description
PAMhandle The PAM handle representing the current user authentication session. This handle is obtained by a call to pam_start().
ItemType The type of item that is being requested. The following values are valid item types:
  • PAM_SERVICE
    • The service name requesting this PAM session.
  • PAM_USER
    • The user name of the user being authenticated.
  • PAM_AUTHTOK
    • The user's current authentication token. Interpreted as the new authentication token by password modules.
  • PAM_OLDAUTHOK
    • The user's old authentication token. Interpreted as the current authentication token by password modules.
  • PAM_TTY
    • The terminal name.
  • PAM_RHOST
    • The name of the remote host.
  • PAM_RUSER
    • The name of the remote user.
  • PAM_CONV
    • The pam_conv structure for conversing with the user.
  • PAM_USER_PROMPT
    • The default prompt for the user (used by pam_get_user()).
For security, PAM_AUTHTOK and PAM_OLDAUTHTOK are only available to PAM modules.
Item The value that the ItemType is set to.

Return Values

Upon successful completion, pam_set_item returns PAM_SUCCESS. If the routine fails, either PAM_SYSTEM_ERR or PAM_BUF_ERR is returned, depending on what the actual error was.

Error Codes

Item Description
PAM_SYSTEM_ERR A system error occurred.
PAM_BUF_ERR A memory error occurred.
PAM_SYMBOL_ERR Symbol not found.