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