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