openpam_borrow_cred3
Temporarily borrow user credentials
Usage
#include <sys/types.h>
#include <security/pam_appl.h>
#include <security/openpam.h>
int
openpam_borrow_cred(pam_handle_t *pamh, const struct passwd *pwd);
Library
library “libpam”
Overview
The openpam_borrow_cred function saves the current credentials and switches to those of the user specified by its pwd argument. The affected credentials are the effective UID, the effective GID, and the group access list. The original credentials can be restored using openpam_restore_cred(3).
Return values
The openpam_borrow_cred function returns one of the following values:
- [PAM_BUF_ERR]
-
Memory buffer error.
- [PAM_PERM_DENIED]
-
Permission denied.
- [PAM_SYSTEM_ERR]
-
System error.
Releases
Unchanged in 106 releases since Mac OS X 10.6.