Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / libpam / doc / man / pam_open_session.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" $Id: pam_open_session.3,v 1.2 1997/02/15 18:49:02 morgan Exp $
3 .\" $FreeBSD: src/contrib/libpam/doc/man/pam_open_session.3,v 1.2.6.2 2001/06/11 15:28:11 markm Exp $
4 .\" Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>
5 .TH PAM_OPEN_SESSION 3 "1997 Jan 4" "PAM 0.55" "App. Programmers' Manual"
6 .SH NAME
7
8 pam_open/close_session \- PAM session management
9
10 .SH SYNOPSIS
11 .B #include <security/pam_appl.h>
12 .sp
13 .BI "int pam_open_session(pam_handle_t " *pamh ", int  " flags ");"
14 .sp
15 .BI "int pam_close_session(pam_handle_t " *pamh ", int  " flags ");"
16 .sp 2
17 .SH DESCRIPTION
18
19 PAM provides management-hooks for the initialization and termination
20 of a session. 
21
22 .TP
23 .B pam_open_session
24 .br
25 Use this function to signal that an authenticated user session has
26 begun. It should be called only after the user is properly identified
27 and (where necessary) has been granted their credentials with
28 .BR pam_authenticate "(3)"
29 and
30 .BR pam_setcred "(3)"
31 respectively.
32
33 .br
34 Some types of functions associated with session
35 initialization are logging for the purposes of system-audit and
36 mounting directories (the user's home directory for example). These
37 should not concern the application. It should be noted that the
38 .I effective
39 uid,
40 .BR geteuid "(2),"
41 of the application should be of sufficient privilege to perform such
42 tasks.
43
44 .TP
45 .B pam_close_session
46 .br
47 Use this function to signal that a user session has
48 terminated. In general this function may not need to be located in the
49 same application as the initialization function,
50 .BR pam_open_session "."
51
52 .br
53 Typically, this function will undo the actions of
54 .BR pam_open_session "."
55 That is, log audit information concerning the end of the user session
56 or unmount the user's home directory. Apart from having sufficient
57 privilege the details of the session termination should not concern
58 the calling application. It is good programming practice, however, to
59 cease acting on behalf of the user on returning from this call.
60
61 .SH RETURN VALUE
62 A successful return from the session management functions will be
63 indicated with
64 .BR PAM_SUCCESS "."
65
66 .br
67 The specific error indicating a failure to open or close a session is
68 .BR PAM_SESSION_ERR "."
69 In general other return values may be returned. They should be treated
70 as indicating failure.
71
72 .SH ERRORS
73 May be translated to text with
74 .BR pam_strerror "(3). "
75
76 .SH "CONFORMING TO"
77 OSF-RFC 86.0, October 1995.
78
79 .SH BUGS
80 .sp 2
81 none known.
82
83 .SH "SEE ALSO"
84
85 .BR pam_start "(3), "
86 .BR pam_authenticate "(3), "
87 .BR pam_setcred "(3), "
88 .BR pam_get_item "(3), "
89 .BR pam_strerror "(3) "
90 and
91 .BR pam "(3)."
92
93 .br
94 Also, see the three
95 .BR Linux-PAM
96 Guides, for
97 .BR "System administrators" ", "
98 .BR "module developers" ", "
99 and
100 .BR "application developers" ". "