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