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