Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Robert Dubner
OpenLDAP
Commits
66e0a504
Commit
66e0a504
authored
Sep 10, 2021
by
Robert Dubner
Browse files
Accept and parse search URIs
parent
51fc9426
Changes
1
Hide whitespace changes
Inline
Side-by-side
contrib/slapd-modules/radiusov/radiusov.c
View file @
66e0a504
...
...
@@ -780,7 +780,8 @@ static ConfigTable radiuscfg[] =
"( OLcfgOvAt:"
OVERLAY_OID
".4 NAME 'olcRadiusTest' "
"DESC 'URL for simple searches in the test environment' "
"EQUALITY caseIgnoreMatch "
"SYNTAX OMsDirectoryString )"
,
"SYNTAX OMsDirectoryString "
")"
,
NULL
,
NULL
},
...
...
@@ -792,23 +793,14 @@ static ConfigOCs radiusocs[] =
{
{
"( OLcfgOvOc:"
OVERLAY_OID
".1 "
"NAME 'olcRadius
Log
Config' "
"DESC '
Access log
configuration' "
"NAME 'olcRadius
Ov
Config' "
"DESC '
RADIUS server
configuration' "
"SUP olcOverlayConfig "
"MUST olcRadiusPort "
// "MAY ( olcRadiusLogOps $ olcRadiusLogPurge $ olcRadiusLogSuccess $ "
// "olcRadiusLogOld $ olcRadiusLogOldAttr $ olcRadiusLogBase ) "
"MUST olcRadiusClientUri "
"MAY (olcRadiusPort $ olcRadiusHost $ olcRadiusTest) "
")"
,
Cft_Overlay
,
radiuscfg
},
// {
// "( OLcfgCtOc:" OVERLAY_OID ".1 "
// "NAME 'olcRadiusOvConfig' "
// "DESC 'RADIUS lookup configuration' "
// "SUP olcOverlayConfig "
// ")",
// Cft_Overlay, radiuscfg
// },
{
NULL
,
0
,
NULL
}
};
...
...
@@ -832,61 +824,57 @@ radius_config_driver(ConfigArgs *config_args)
switch
(
config_args
->
type
)
{
case
RADIUS_PORT
:
Debug
(
LDAP_DEBUG_ARGS
,
" radiusport is %d
\n
"
,
config_args
->
values
.
v_int
);
radius_info
->
radius_port_number
=
config_args
->
values
.
v_int
;
if
(
config_args
->
argc
>
1
)
{
Debug
(
LDAP_DEBUG_ARGS
,
" radiusport is %d
\n
"
,
atoi
(
config_args
->
argv
[
1
]));
radius_info
->
radius_port_number
=
atoi
(
config_args
->
argv
[
1
]);
}
break
;
case
RADIUS_HOST
:
Debug
(
LDAP_DEBUG_ARGS
,
" radiushost is %s
\n
"
,
config_args
->
values
.
v_string
);
strncpy
(
radius_info
->
radius_port_host
,
config_args
->
values
.
v_string
,
sizeof
(
radius_info
->
radius_port_host
)
);
radius_info
->
radius_port_host
[
sizeof
(
radius_info
->
radius_port_host
)
-
1
]
=
'\0'
;
if
(
config_args
->
argc
>
1
)
{
Debug
(
LDAP_DEBUG_ARGS
,
" radiushost is %s
\n
"
,
config_args
->
argv
[
1
]);
strncpy
(
radius_info
->
radius_port_host
,
config_args
->
argv
[
1
],
sizeof
(
radius_info
->
radius_port_host
)
);
radius_info
->
radius_port_host
[
sizeof
(
radius_info
->
radius_port_host
)
-
1
]
=
'\0'
;
}
break
;
case
RADIUS_CLIENT_URI
:
{
if
(
config_args
->
values
.
v_string
&&
ldap_url_parse
(
config_args
->
values
.
v_string
,
&
radius_info
->
lud_radius_client
)
)
if
(
config_args
->
argc
>
1
)
{
Debug
(
LDAP_DEBUG_ANY
,
"ldap_url_parse FAILED on %s
\n
"
,
config_args
->
values
.
v_string
);
rc
=
1
;
}
else
{
Debug
(
LDAP_DEBUG_ANY
,
"ldap_url_parse SUCCEEDED on %s
\n
"
,
config_args
->
values
.
v_string
);
if
(
ldap_url_parse
(
config_args
->
argv
[
1
],
&
radius_info
->
lud_radius_client
)
)
{
Debug
(
LDAP_DEBUG_ANY
,
"ldap_url_parse FAILED on %s
\n
"
,
config_args
->
argv
[
1
]);
rc
=
1
;
}
}
}
break
;
case
RADIUS_TEST
:
{
if
(
config_args
->
values
.
v_string
&&
ldap_url_parse
(
config_args
->
values
.
v_string
,
&
radius_info
->
lud_simple_test
)
)
{
Debug
(
LDAP_DEBUG_ANY
,
"ldap_url_parse FAILED on %s
\n
"
,
config_args
->
values
.
v_string
);
rc
=
1
;
}
else
if
(
config_args
->
argc
>
1
)
{
Debug
(
LDAP_DEBUG_ANY
,
"ldap_url_parse SUCCEEDED on %s
\n
"
,
config_args
->
values
.
v_string
);
if
(
ldap_url_parse
(
config_args
->
argv
[
1
],
&
radius_info
->
lud_simple_test
)
)
{
Debug
(
LDAP_DEBUG_ANY
,
"ldap_url_parse FAILED on %s
\n
"
,
config_args
->
argv
[
1
]);
rc
=
1
;
}
}
}
break
;
}
break
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment