Commit 09c86134 authored by Robert Dubner's avatar Robert Dubner
Browse files

Sneaking up on 'overlay radiusov' parameter parsing

parent d4a89cec
/* radiusov.c - radius-ldap overlay for slapd */
/* radiusov.c - radius-ldap overlay for slapd */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
......@@ -37,6 +38,8 @@
#undef oq_search
#define OVERLAY_OID "1031"
ldap_pvt_thread_mutex_t libradius_mutex;
// This is used during debugging. It can be used to suppress processing of
......@@ -297,26 +300,26 @@ radiusov_get_password_from_uid( void *ctx,
/*
* Parse the search request. It looks like this:
*
* SearchRequest := [APPLICATION 3] SEQUENCE {
* baseObject DistinguishedName,
* scope ENUMERATED {
* baseObject (0),
* singleLevel (1),
* wholeSubtree (2),
* SearchRequest := [APPLICATION 3] SEQUENCE {
* baseObject DistinguishedName,
* scope ENUMERATED {
* baseObject (0),
* singleLevel (1),
* wholeSubtree (2),
* subordinate (3) -- OpenLDAP extension
* },
* derefAliases ENUMERATED {
* neverDerefaliases (0),
* derefInSearching (1),
* derefFindingBaseObj (2),
* alwaysDerefAliases (3)
* },
* sizelimit INTEGER (0 .. 65535),
* timelimit INTEGER (0 .. 65535),
* attrsOnly BOOLEAN,
* filter Filter,
* attributes SEQUENCE OF AttributeType
* }
* },
* derefAliases ENUMERATED {
* neverDerefaliases (0),
* derefInSearching (1),
* derefFindingBaseObj (2),
* alwaysDerefAliases (3)
* },
* sizelimit INTEGER (0 .. 65535),
* timelimit INTEGER (0 .. 65535),
* attrsOnly BOOLEAN,
* filter Filter,
* attributes SEQUENCE OF AttributeType
* }
*/
BerElement *ber = ber_alloc_t(LBER_USE_DER);
......@@ -342,7 +345,7 @@ radiusov_get_password_from_uid( void *ctx,
// In this implementation, we don't need to specify attributes. The
// query automatically returns the entire record, with all the attributes,
// from the database. We sort the out in radiusov_password_callback
// from the database. We sort that out in radiusov_password_callback
ber_printf(ber, "{s}", "");
ber_printf(ber,"}");
......@@ -691,24 +694,75 @@ radiusov_create_udp_port(BackendDB *be, ConfigReply *cr, int port_number)
ni->ni_conn = connection_client_setup( udp_socket, radiusov_acceptconn, ni );
}
static ConfigDriver radius_config_driver;
enum
{
RADIUS_PORT = 1,
};
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-braces"
static ConfigTable radiuscfg[] =
{
{
"radiusport",
"RADIUS service port",
2, 2, 0,
ARG_DN|ARG_QUOTE|ARG_MAGIC|RADIUS_PORT,
radius_config_driver,
"( OLcfgOvAt:" OVERLAY_OID ".1 NAME 'olcRadiusPort' "
"DESC 'Port number of RADIUS service' "
"EQUALITY distinguishedNameMatch "
"SUP distinguishedName SINGLE-VALUE )",
NULL, NULL
},
{ NULL, NULL, 0,0,0, ARG_IGNORED }
};
#pragma GCC diagnostic pop
static ConfigOCs radiusocs[] =
{
{
"( OLcfgCtOc:3.1 "
"NAME 'olcRadiusOvConfig' "
"DESC 'RADIUS lookup configuration' "
{ "( OLcfgOvOc:" OVERLAY_OID ".1 "
"NAME 'olcRadiusLogConfig' "
"DESC 'Access log configuration' "
"SUP olcOverlayConfig "
")",
Cft_Overlay, radiuscfg
},
"MUST olcRadiusPort "
// "MAY ( olcRadiusLogOps $ olcRadiusLogPurge $ olcRadiusLogSuccess $ "
// "olcRadiusLogOld $ olcRadiusLogOldAttr $ olcRadiusLogBase ) "
")",
Cft_Overlay, radiuscfg },
// {
// "( OLcfgCtOc:" OVERLAY_OID ".1 "
// "NAME 'olcRadiusOvConfig' "
// "DESC 'RADIUS lookup configuration' "
// "SUP olcOverlayConfig "
// ")",
// Cft_Overlay, radiuscfg
// },
{ NULL, 0, NULL }
};
static int
radius_config_driver(ConfigArgs *config_args)
{
Debug( LDAP_DEBUG_ANY,
"%s(): config_args->op is 0x%X; config_args->type is 0x%X\n",
__func__,
(int)config_args->op,
(int)config_args->type);
// slap_overinst *on = (slap_overinst *)config_args->bi;
// struct log_info *li = on->on_bi.bi_private;
int rc = 0;
// slap_mask_t tmask = 0;
// char agebuf[2*STRLENOF("ddddd+hh:mm:ss ")];
// struct berval agebv, cyclebv;
return rc;
}
static int
radiusov_db_init( BackendDB *be,
ConfigReply *cr )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment