pam_set_item

Name

pam_set_item -- (re)set the value of an item.

Synopsis

#include <security/pam_appl.h>

int pam_set_item(pam_handle_t * pamh, int item_type, const void * item);

Description

pam_set_item() (re)sets the value of one of the following item_types:

PAM_SERVICE 

service name

PAM_USER 

user name

PAM_TTY 

terminal name

The value for a device file should include the /dev/ prefix. The value for graphical, X-based, applications should be the $DISPLAY variable.

PAM_RHOST 

remote host name

PAM_CONV 

conversation structure

PAM_RUSER 

remote user name

PAM_USER_PROMPT 

string to be used when prompting for a user's name

The default value for this string is Please enter username: .

For all item_types other than PAM_CONV, item is a pointer to a NULL-terminated character string. In the case of PAM_CONV, item points to an initialized pam_conv structure.

Return Value

PAM_SUCCESS 

Success.

PAM_PERM_DENIED 

An attempt was made to replace the conversation structure with a NULL value.

PAM_BUF_ERR 

Function ran out of memory making a copy of the item.

PAM_BAD_ITEM 

Application attempted to set an undefined item.

Note: Errors may be translated to text with pam_strerror().