All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
rlm_pam.c File Reference

Interfaces with the PAM library to allow auth via PAM. More...

#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
#include "config.h"
+ Include dependency graph for rlm_pam.c:

Go to the source code of this file.

Data Structures

struct  rlm_pam_data_t
 
struct  rlm_pam_t
 

Macros

#define COPY_STRING(s)   ((s) ? strdup(s) : NULL)
 

Typedefs

typedef struct rlm_pam_data_t rlm_pam_data_t
 
typedef struct rlm_pam_t rlm_pam_t
 

Functions

static rlm_rcode_t CC_HINT (nonnull)
 
static int do_pam (REQUEST *request, char const *username, char const *passwd, char const *pamauth)
 Check the users password against the standard UNIX password table + PAM. More...
 
static int mod_instantiate (UNUSED CONF_SECTION *conf, void *instance)
 
static int pam_conv (int num_msg, struct pam_message const **msg, struct pam_response **resp, void *appdata_ptr)
 Dialogue between RADIUS and PAM modules. More...
 

Variables

static const CONF_PARSER module_config []
 
module_t rlm_pam
 

Detailed Description

Interfaces with the PAM library to allow auth via PAM.

Id:
44bd3ec1ae93180b7510b4ecd5a42745cd01eb37
Note
This was taken from the hacks that miguel a.l. paraz map@i.nosp@m.phil.nosp@m..net did on radiusd-cistron-1.5.3 and migrated to a separate file. That, in fact, was again based on the original stuff from Jeph Blaize jblai.nosp@m.ze@k.nosp@m.iva.n.nosp@m.et done in May 1997.

Definition in file rlm_pam.c.


Data Structure Documentation

struct rlm_pam_data_t

Definition at line 59 of file rlm_pam.c.

+ Collaboration diagram for rlm_pam_data_t:
Data Fields
bool error True if pam_conv failed.
char const * password Password to provide to PAM when prompted.
REQUEST * request The current request.
char const * username Username to provide to PAM when prompted.
struct rlm_pam_t

Definition at line 50 of file rlm_pam.c.

Data Fields
char const * pam_auth_name

Macro Definition Documentation

#define COPY_STRING (   s)    ((s) ? strdup(s) : NULL)

Typedef Documentation

typedef struct rlm_pam_t rlm_pam_t

Function Documentation

static rlm_rcode_t CC_HINT ( nonnull  )
static

Definition at line 196 of file rlm_pam.c.

+ Here is the call graph for this function:

static int do_pam ( REQUEST request,
char const *  username,
char const *  passwd,
char const *  pamauth 
)
static

Check the users password against the standard UNIX password table + PAM.

Note
For most flexibility, passing a pamauth type to this function allows you to have multiple authentication types (i.e. multiple files associated with radius in /etc/pam.d).
Parameters
requestThe current request.
usernameUser to authenticate.
passwdPassword to authenticate with,
pamauthType of PAM authentication.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 147 of file rlm_pam.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int mod_instantiate ( UNUSED CONF_SECTION conf,
void *  instance 
)
static

Definition at line 66 of file rlm_pam.c.

static int pam_conv ( int  num_msg,
struct pam_message const **  msg,
struct pam_response **  resp,
void *  appdata_ptr 
)
static

Dialogue between RADIUS and PAM modules.

Uses PAM's appdata_ptr so it's thread safe, and doesn't have any nasty static variables hanging around.

Definition at line 80 of file rlm_pam.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const CONF_PARSER module_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("pam_auth", PW_TYPE_STRING, rlm_pam_t, pam_auth_name) },
}
#define CONF_PARSER_TERMINATOR
Definition: conffile.h:289
#define FR_CONF_OFFSET(_n, _t, _s, _f)
Definition: conffile.h:168
String of printable characters.
Definition: radius.h:33

Definition at line 54 of file rlm_pam.c.

module_t rlm_pam
Initial value:
= {
.magic = RLM_MODULE_INIT,
.name = "pam",
.inst_size = sizeof(rlm_pam_t),
.config = module_config,
.instantiate = mod_instantiate,
.methods = {
},
}
static const CONF_PARSER module_config[]
Definition: rlm_pam.c:54
#define RLM_TYPE_THREAD_UNSAFE
Module is not threadsafe.
Definition: modules.h:76
#define RLM_MODULE_INIT
Definition: modules.h:86
static rlm_rcode_t mod_authenticate(void *instance, REQUEST *request) CC_HINT(nonnull)
static int mod_instantiate(UNUSED CONF_SECTION *conf, void *instance)
Definition: rlm_pam.c:66
struct rlm_pam_t rlm_pam_t
0 methods index for authenticate section.
Definition: modules.h:41

Definition at line 245 of file rlm_pam.c.