Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
James Lowden
OpenLDAP
Commits
bf144a4e
Commit
bf144a4e
authored
17 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
apply fixes in ITS#4951 (tested)
parent
77208446
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/slapd-modules/passwd/radius.c
+29
-1
29 additions, 1 deletion
contrib/slapd-modules/passwd/radius.c
with
29 additions
and
1 deletion
contrib/slapd-modules/passwd/radius.c
+
29
−
1
View file @
bf144a4e
...
...
@@ -17,6 +17,7 @@
#include
<lber.h>
#include
<lber_pvt.h>
/* BER_BVC definition */
#include
"lutil.h"
#include
<ldap_pvt_thread.h>
#include
<ac/string.h>
#include
<ac/unistd.h>
...
...
@@ -25,6 +26,7 @@
static
LUTIL_PASSWD_CHK_FUNC
chk_radius
;
static
const
struct
berval
scheme
=
BER_BVC
(
"{RADIUS}"
);
static
char
*
config_filename
;
static
ldap_pvt_thread_mutex_t
libradius_mutex
;
static
int
chk_radius
(
...
...
@@ -58,8 +60,11 @@ chk_radius(
return
LUTIL_PASSWD_ERR
;
/* passwd must behave like a string */
}
ldap_pvt_thread_mutex_lock
(
&
libradius_mutex
);
h
=
rad_auth_open
();
if
(
h
==
NULL
)
{
ldap_pvt_thread_mutex_unlock
(
&
libradius_mutex
);
return
LUTIL_PASSWD_ERR
;
}
...
...
@@ -79,16 +84,37 @@ chk_radius(
goto
done
;
}
if
(
rad_send_request
(
h
)
==
RAD_ACCESS_ACCEPT
)
{
switch
(
rad_send_request
(
h
)
)
{
case
RAD_ACCESS_ACCEPT
:
rc
=
LUTIL_PASSWD_OK
;
break
;
case
RAD_ACCESS_REJECT
:
rc
=
LUTIL_PASSWD_ERR
;
break
;
case
RAD_ACCESS_CHALLENGE
:
rc
=
LUTIL_PASSWD_ERR
;
break
;
case
-
1
:
/* no valid response is received */
break
;
}
done:
;
rad_close
(
h
);
ldap_pvt_thread_mutex_unlock
(
&
libradius_mutex
);
return
rc
;
}
int
term_module
()
{
return
ldap_pvt_thread_mutex_destroy
(
&
libradius_mutex
);
}
int
init_module
(
int
argc
,
char
*
argv
[]
)
{
...
...
@@ -109,5 +135,7 @@ init_module( int argc, char *argv[] )
}
}
ldap_pvt_thread_mutex_init
(
&
libradius_mutex
);
return
lutil_passwd_add
(
(
struct
berval
*
)
&
scheme
,
chk_radius
,
NULL
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment