1.\" $NetBSD: openpam_borrow_cred.3,v 1.7 2017/05/06 19:50:09 christos Exp $ 2.\" 3.\" Generated from openpam_borrow_cred.c by gendoc.pl 4.\" $OpenPAM: openpam_borrow_cred.c 938 2017-04-30 21:34:42Z des $ 5.Dd April 30, 2017 6.Dt OPENPAM_BORROW_CRED 3 7.Os 8.Sh NAME 9.Nm openpam_borrow_cred 10.Nd temporarily borrow user credentials 11.Sh SYNOPSIS 12.In sys/types.h 13.In security/pam_appl.h 14.In security/openpam.h 15.Ft "int" 16.Fn openpam_borrow_cred "pam_handle_t *pamh" "const struct passwd *pwd" 17.Sh DESCRIPTION 18The 19.Fn openpam_borrow_cred 20function saves the current credentials and 21switches to those of the user specified by its 22.Fa pwd 23argument. 24The affected credentials are the effective UID, the effective GID, and 25the group access list. 26The original credentials can be restored using 27.Xr openpam_restore_cred 3 . 28.Sh RETURN VALUES 29The 30.Fn openpam_borrow_cred 31function returns one of the following values: 32.Bl -tag -width 18n 33.It Bq Er PAM_SUCCESS 34Success. 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 Mt des@des.no . 67