1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>
4 .TH PAM_OPEN_SESSION 3 "1997 Jan 4" "Linux-PAM 0.55" "App. Programmers' Manual"
7 pam_open/close_session \- PAM session management
10 .B #include <security/pam_appl.h>
12 .BI "int pam_open_session(pam_handle_t " *pamh ", int " flags ");"
14 .BI "int pam_close_session(pam_handle_t " *pamh ", int " flags ");"
18 PAM provides management-hooks for the initialization and termination
24 Use this function to signal that an authenticated user session has
25 begun. It should be called only after the user is properly identified
26 and (where necessary) has been granted their credentials with
27 .BR pam_authenticate "(3)"
33 Some types of functions associated with session
34 initialization are logging for the purposes of system-audit and
35 mounting directories (the user's home directory for example). These
36 should not concern the application. It should be noted that the
40 of the application should be of sufficient privilege to perform such
46 Use this function to signal that a user session has
47 terminated. In general this function may not need to be located in the
48 same application as the initialization function,
49 .BR pam_open_session "."
52 Typically, this function will undo the actions of
53 .BR pam_open_session "."
54 That is, log audit information concerning the end of the user session
55 or unmount the user's home directory. Apart from having sufficient
56 privilege the details of the session termination should not concern
57 the calling application. It is good programming practice, however, to
58 cease acting on behalf of the user on returning from this call.
61 A successful return from the session management functions will be
66 The specific error indicating a failure to open or close a session is
67 .BR PAM_SESSION_ERR "."
68 In general other return values may be returned. They should be treated
69 as indicating failure.
72 May be translated to text with
73 .BR pam_strerror "(3). "
76 OSF-RFC 86.0, October 1995.
85 .BR pam_authenticate "(3), "
86 .BR pam_setcred "(3), "
87 .BR pam_get_item "(3), "
88 .BR pam_strerror "(3) "
96 .BR "System administrators" ", "
97 .BR "module developers" ", "
99 .BR "application developers" ". "