Commit dcf8bf9a authored by Robert Dubner's avatar Robert Dubner
Browse files

Creeping toward using URIs as overlay parameters

parent d93edb2d
Pipeline #3460 passed with stage
in 44 minutes and 44 seconds
......@@ -102,7 +102,7 @@ ber_lower(BerValue *bv)
}
static int
radiusov_name2dn_cb(Operation *op, SlapReply *rs)
radiusov_name2dn_callback(Operation *op, SlapReply *rs)
{
Debug(LDAP_DEBUG_TRACE,"=> %s(): rs->sr_type is %d\n",__func__, rs->sr_type);
if ( rs->sr_type == REP_SEARCH )
......@@ -119,7 +119,7 @@ static int
radiusov_get_dn_from_uid( RADIUS_INFO *radius_info,
search_descriptor *sd,
char *pszUsername,
struct berval *dn)
struct berval *dn_retval)
{
Debug(LDAP_DEBUG_TRACE,"=> %s(). UID is %s\n",__func__, pszUsername);
......@@ -147,10 +147,10 @@ radiusov_get_dn_from_uid( RADIUS_INFO *radius_info,
filter.bv_len = sprintf(filter.bv_val,
sd->search_filter_template,
pszUsername);
dn->bv_len = 0;
dn->bv_val = ((void *)0);
cb.sc_private = dn;
cb.sc_response = radiusov_name2dn_cb;
dn_retval->bv_len = 0;
dn_retval->bv_val = ((void *)0);
cb.sc_private = dn_retval;
cb.sc_response = radiusov_name2dn_callback;
op->o_tag = LDAP_REQ_SEARCH;
......@@ -169,7 +169,7 @@ radiusov_get_dn_from_uid( RADIUS_INFO *radius_info,
rc = op->o_bd->bd_info->bi_op_search( op, &rs );
filter_free_x( op, op->o_request.oq_search.rs_filter, 1 );
if( rc == 0 && dn->bv_val == NULL )
if( rc == 0 && dn_retval->bv_val == NULL )
{
rc = 1 ;
}
......@@ -298,7 +298,6 @@ radiusov_get_password_from_uid( RADIUS_INFO *radius_info,
connection_fake_init( &conn, &opbuf, thrctx );
op=&opbuf.ob_op;
conn.c_ssf = conn.c_transport_ssf = local_ssf;
op->o_bd = radius_info->radius_db;
/*
......@@ -859,6 +858,9 @@ radiusov_db_open(BackendDB *be, ConfigReply *cr)
{
Debug( LDAP_DEBUG_TRACE, "=> %s()\n", __func__);
slap_overinst *radiusov = (slap_overinst *)be->bd_info;
RADIUS_INFO *radius_info = radiusov->on_bi.bi_private;
int port_number = -1;
// Assume all of the search_descriptors reference the same
......@@ -878,9 +880,25 @@ radiusov_db_open(BackendDB *be, ConfigReply *cr)
if ( slapMode & SLAP_SERVER_MODE )
{
char achUri[] = "ldap:///configuration=server1,cn=radservercfg,dc=renbud,dc=com?ipa,port?one?";
LDAPURLDesc *lud;
ldap_url_parse( achUri, &lud);
search_descriptor *sd = &search_descriptors[0];
char achPassword[256];
int rc = radiusov_get_password_from_uid( radius_info,
sd,
"abe1",
achPassword);
radiusov_create_udp_port( be,
cr,
port_number);
ldap_free_urldesc( lud );
}
return 0;
......
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