NAME
pamopen/closesession - PAM session management
SYNOPSIS
##iinncclluuddee <
iinntt ppaammooppeennsseessssiioonn((ppaammhhaannddlleett *pamh,, iinntt flags));; iinntt ppaammcclloosseesseessssiioonn((ppaammhhaannddlleett *pamh,, iinntt flags));;> DESCRIPTION
PAM provides management-hooks for the initialization and termination of
a session. ppaammooppeennsseessssiioonn Use this function to signal that an authenticated user session has begun. It should be called only after the user is properlyidentified and (where necessary) has been granted their creden-
tials with ppaammaauutthheennttiiccaattee(3) and ppaammsseettccrreedd(3) respectively. Some types of functions associated with session initializationare logging for the purposes of system-audit and mounting direc-
tories (the user's home directory for example). These should not concern the application. It should be noted that the effective uid, ggeetteeuuiidd(2), of the application should be of sufficient privilege to perform such tasks. ppaammcclloosseesseessssiioonn Use this function to signal that a user session has terminated. In general this function may not need to be located in the same application as the initialization function, ppaammooppeennsseessssiioonn.Typically, this function will undo the actions of ppaammooppeennsseess-
ssiioonn. That is, log audit information concerning the end of the user session or unmount the user's home directory. Apart fromhaving sufficient privilege the details of the session termina-
tion should not concern the calling application. It is good pro-
gramming practice, however, to cease acting on behalf of the user on returning from this call. RREETTUURRNN VVAALLUUEEA successful return from the session management functions will be indi-
cated with PPAAMMSSUUCCCCEESSSS. The specific error indicating a failure to open or close a session is PPAAMMSSEESSSSIIOONNEERRRR. In general other return values may be returned. They should be treated as indicating failure. EERRRROORRSS May be translated to text with ppaammssttrreerrrroorr(3). CCOONNFFOORRMMIINNGG TTOOOSF-RFC 86.0, October 1995.
BUGS
none known.SEE ALSO
ppaammssttaarrtt(3), ppaammaauutthheennttiiccaattee(3), ppaammsseettccrreedd(3), ppaammggeettiitteemm(3), ppaammssttrreerrrroorr(3) and ppaamm(3).Also, see the three LLiinnuuxx-PPAAMM Guides, for SSyysstteemm aaddmmiinniissttrraattoorrss, mmoodduullee
ddeevveellooppeerrss, and aapppplliiccaattiioonn ddeevveellooppeerrss.Linux-PAM 0.55 1997 Jan 4 PAMOPENSESSION(3)