1.\" Generated from openpam_borrow_cred.c by gendoc.pl 2.\" $Id: openpam_borrow_cred.c 649 2013-03-05 17:58:33Z des $ 3.Dd February 19, 2017 4.Dt OPENPAM_BORROW_CRED 3 5.Os 6.Sh NAME 7.Nm openpam_borrow_cred 8.Nd temporarily borrow user credentials 9.Sh SYNOPSIS 10.In sys/types.h 11.In security/pam_appl.h 12.In security/openpam.h 13.Ft "int" 14.Fn openpam_borrow_cred "pam_handle_t *pamh" "const struct passwd *pwd" 15.Sh DESCRIPTION 16The 17.Fn openpam_borrow_cred 18function saves the current credentials and 19switches to those of the user specified by its 20.Fa pwd 21argument. 22The affected credentials are the effective UID, the effective GID, and 23the group access list. 24The original credentials can be restored using 25.Xr openpam_restore_cred 3 . 26.Pp 27.Sh RETURN VALUES 28The 29.Fn openpam_borrow_cred 30function returns one of the following values: 31.Bl -tag -width 18n 32.It Bq Er PAM_BUF_ERR 33Memory buffer error. 34.It Bq Er PAM_PERM_DENIED 35Permission denied. 36.It Bq Er PAM_SYSTEM_ERR 37System error. 38.El 39.Sh SEE ALSO 40.Xr setegid 2 , 41.Xr seteuid 2 , 42.Xr setgroups 2 , 43.Xr openpam_restore_cred 3 , 44.Xr pam 3 , 45.Xr pam_strerror 3 46.Sh STANDARDS 47The 48.Fn openpam_borrow_cred 49function is an OpenPAM extension. 50.Sh AUTHORS 51The 52.Fn openpam_borrow_cred 53function and this manual page were 54developed for the 55.Fx 56Project by ThinkSec AS and Network Associates Laboratories, the 57Security Research Division of Network Associates, Inc.\& under 58DARPA/SPAWAR contract N66001-01-C-8035 59.Pq Dq CBOSS , 60as part of the DARPA CHATS research program. 61.Pp 62The OpenPAM library is maintained by 63.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no . 64