Interfaces with the PAM library to allow auth via PAM.
More...
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include "config.h"
Go to the source code of this file.
Interfaces with the PAM library to allow auth via PAM.
- Id
- 9686d20a9d38e616f127d4abdf342911220b08ea
- 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.
- Copyright
- 2000,2006 The FreeRADIUS server project
-
1997 Jeph Blaize (jblai.nosp@m.ze@k.nosp@m.iva.n.nosp@m.et)
-
1999 miguel a.l. paraz (map@i.nosp@m.phil.nosp@m..net)
Definition in file rlm_pam.c.
◆ rlm_pam_data_t
Definition at line 54 of file rlm_pam.c.
Data Fields |
bool |
error |
True if pam_conv failed. |
char const * |
password |
Password to provide to PAM when prompted. |
request_t * |
request |
The current request. |
char const * |
username |
Username to provide to PAM when prompted. |
◆ rlm_pam_t
Definition at line 50 of file rlm_pam.c.
Data Fields |
char const * |
pam_auth_name |
|
◆ COPY_STRING
#define COPY_STRING |
( |
|
s | ) |
((s) ? talloc_strdup(reply, s) : NULL) |
◆ do_pam()
static int do_pam |
( |
request_t * |
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
-
request | The current request. |
username | User to authenticate. |
passwd | Password to authenticate with, |
pamauth | Type of PAM authentication. |
- Returns
- 0 on success.
- -1 on failure.
Definition at line 165 of file rlm_pam.c.
◆ mod_authenticate()
◆ mod_instantiate()
◆ pam_conv()
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 102 of file rlm_pam.c.
◆ attr_pam_auth
◆ attr_user_name
◆ attr_user_password
◆ dict_freeradius
◆ dict_radius
◆ module_config
Initial value:= {
}
#define CONF_PARSER_TERMINATOR
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition at line 61 of file rlm_pam.c.
◆ rlm_pam
Initial value:= {
.common = {
.name = "pam",
},
.method_group = {
}
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
static const conf_parser_t config[]
static unlang_action_t mod_authenticate(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static const conf_parser_t module_config[]
static int mod_instantiate(module_inst_ctx_t const *mctx)
static int instantiate(module_inst_ctx_t const *mctx)
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
@ MODULE_TYPE_THREAD_UNSAFE
Module is not threadsafe.
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Named methods exported by a module.
Definition at line 271 of file rlm_pam.c.
◆ rlm_pam_dict
Initial value:= {
{ NULL }
}
static fr_dict_t const * dict_freeradius
static fr_dict_t const * dict_radius
Definition at line 70 of file rlm_pam.c.
◆ rlm_pam_dict_attr
Initial value:= {
{ NULL }
}
@ FR_TYPE_STRING
String of printable characters.
static fr_dict_attr_t const * attr_user_password
static fr_dict_attr_t const * attr_pam_auth
static fr_dict_attr_t const * attr_user_name
Definition at line 81 of file rlm_pam.c.