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"
9 pam_open/close_session \- PAM session management
12 .B #include <security/pam_appl.h>
14 .BI "int pam_open_session(pam_handle_t " *pamh ", int " flags ");"
16 .BI "int pam_close_session(pam_handle_t " *pamh ", int " flags ");"
20 PAM provides management-hooks for the initialization and termination
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)"
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
42 of the application should be of sufficient privilege to perform such
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 "."
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.
63 A successful return from the session management functions will be
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.
74 May be translated to text with
75 .BR pam_strerror "(3). "
78 OSF-RFC 86.0, October 1995.
87 .BR pam_authenticate "(3), "
88 .BR pam_setcred "(3), "
89 .BR pam_get_item "(3), "
90 .BR pam_strerror "(3) "
98 .BR "System administrators" ", "
99 .BR "module developers" ", "
101 .BR "application developers" ". "