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);
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_SUCCESS]
-
Success.
- [PAM_BUF_ERR]
-
Memory buffer error.
- [PAM_PERM_DENIED]
-
Permission denied.
- [PAM_SYSTEM_ERR]
-
System error.
Releases
56 releases since FreeBSD 5.0-RELEASE; the text changed 15 times.