Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

Session Management


Defines

#define PAM_SM_SESSION
#define MACS_PW_TMPFILE   "/etc/npasswd"
#define MACS_PW_ADD   1
#define MACS_PW_DEL   2

Functions

passwd * _pam_macs_mkpwent (_pam_macs_config *c)
int _macs_putpwent (struct passwd *pwent, FILE *file)
 Write a passwd struct to a FILE.

int _pam_macs_mungepasswd (_pam_macs_config *c, int action)
 Modify /etc/passwd.

PAM_EXTERN int pam_sm_open_session (pam_handle_t *pamh, int flags, int argc, const char **argv)
 Set up a session.

PAM_EXTERN int pam_sm_close_session (pam_handle_t *pamh, int flags, int argc, const char **argv)
 Tear down a session.


Detailed Description

The Session Management group of functions, as described in The Linux-PAM Module Writers' Guide

This function inherits information from the Authentication Management group; therefore, it should only be configured to run in addition to the authentication routines.

Usage in the PAM configuration file:

 pam_macs_sess [p [d]] [v|q] 
Where


Define Documentation

#define PAM_SM_SESSION
 

This tells the pam headers that we're an auth piece.

#define MACS_PW_TMPFILE   "/etc/npasswd"
 

The name of the temporary passwd file.

#define MACS_PW_ADD   1
 

Tells _pam_macs_mungepasswd to add the give pwent to /etc/passwd

#define MACS_PW_DEL   2
 

Tells _pam_macs_mungepasswd to remove the give pwent from /etc/passwd


Function Documentation

struct passwd* _pam_macs_mkpwent _pam_macs_config   c
 

Initializes and returns a passwd entry.

int _macs_putpwent struct passwd *    pwent,
FILE *    file
 

Write a passwd struct to a FILE.

Parameters:
pwent A pointer to the passwd struct to write
pwfile The open file to write to
Returns:
0 on failure, 1 on success

int _pam_macs_mungepasswd _pam_macs_config   c,
int    action
 

Modify /etc/passwd.

Parameters:
pwent The struct passwd to work with
action Whether to add or remove the pwent. One of MACS_PW_ADD or MACS_PW_DEL
Returns:
0 on failure, 1 on success

PAM_EXTERN int pam_sm_open_session pam_handle_t *    pamh,
int    flags,
int    argc,
const char **    argv
 

Set up a session.

If there's no such user, and if we're not configured not to, we add an entry to /etc/passwd. You might also like to look at the mkhomedir module.

This is a PAM entry point. It is called by libpam.

PAM_EXTERN int pam_sm_close_session pam_handle_t *    pamh,
int    flags,
int    argc,
const char **    argv
 

Tear down a session.

If we're not configured not to, we delete an entry from /etc/passwd.

This is a PAM entry point. It is called by libpam.


Generated on Mon Jul 14 14:27:02 2003 for MACS Client PAM Module by doxygen1.3-rc3