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
Oren Tirosh
OpenLDAP
Commits
fee0f443
Commit
fee0f443
authored
21 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Added ldapdb_starttls keyword
parent
5e9fae34
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/ldapsasl/README
+9
-0
9 additions, 0 deletions
contrib/ldapsasl/README
contrib/ldapsasl/ldapdb.c
+14
-0
14 additions, 0 deletions
contrib/ldapsasl/ldapdb.c
with
23 additions
and
0 deletions
contrib/ldapsasl/README
+
9
−
0
View file @
fee0f443
...
...
@@ -64,3 +64,12 @@ sasl-regexp uidNumber=(.*)\\+gidNumber=(.*),cn=peercred,cn=external,cn=auth
sasl-regexp uid=(.*),cn=external,cn=auth
ldap:///dc=example,dc=com??sub?(uid=$1)
One more update: you can use the ldapdb_starttls keyword to use the
StartTLS extended operation on an LDAP session. This item may be set
to either "try" or "demand", e.g.:
ldapdb_uri: ldap://ldap.example.com
ldapdb_starttls: try
When set to "try" any failure in StartTLS is ignored. When set to "demand"
then any failure aborts the connection.
This diff is collapsed.
Click to expand it.
contrib/ldapsasl/ldapdb.c
+
14
−
0
View file @
fee0f443
...
...
@@ -38,6 +38,7 @@ typedef struct ldapctx {
struct
berval
id
;
/* SASL authcid to bind as */
struct
berval
pw
;
/* password for bind */
struct
berval
mech
;
/* SASL mech */
int
use_tls
;
/* Issue StartTLS request? */
}
ldapctx
;
typedef
struct
gluectx
{
...
...
@@ -145,6 +146,11 @@ static void ldapdb_auxprop_lookup(void *glob_context,
i
=
LDAP_VERSION3
;
ret
=
ldap_set_option
(
ld
,
LDAP_OPT_PROTOCOL_VERSION
,
&
i
);
/* If TLS is set and it fails, continue or bail out as requested */
if
(
ctx
->
use_tls
&&
ldap_start_tls_s
(
ld
,
NULL
,
NULL
)
!=
LDAP_SUCCESS
)
{
if
(
ctx
->
use_tls
>
1
)
goto
done
;
}
ret
=
ldap_sasl_interactive_bind_s
(
ld
,
NULL
,
ctx
->
mech
.
bv_val
,
NULL
,
NULL
,
LDAP_SASL_QUIET
,
ldapdb_interact
,
&
gc
);
if
(
ret
!=
LDAP_SUCCESS
)
goto
done
;
...
...
@@ -210,6 +216,8 @@ static int ldapdb_auxprop_plug_init(const sasl_utils_t *utils,
if
(
max_version
<
SASL_AUXPROP_PLUG_VERSION
)
return
SASL_BADVERS
;
memset
(
&
tmp
,
0
,
sizeof
(
tmp
));
utils
->
getopt
(
utils
->
getopt_context
,
ldapdb
,
"ldapdb_uri"
,
&
tmp
.
uri
,
NULL
);
if
(
!
tmp
.
uri
)
return
SASL_BADPARAM
;
...
...
@@ -222,6 +230,12 @@ static int ldapdb_auxprop_plug_init(const sasl_utils_t *utils,
utils
->
getopt
(
utils
->
getopt_context
,
ldapdb
,
"ldapdb_mech"
,
(
const
char
**
)
&
tmp
.
mech
.
bv_val
,
&
len
);
tmp
.
mech
.
bv_len
=
len
;
utils
->
getopt
(
utils
->
getopt_context
,
ldapdb
,
"ldapdb_starttls"
,
&
s
,
NULL
);
if
(
s
)
{
if
(
!
strcasecmp
(
s
,
"demand"
))
tmp
.
use_tls
=
2
;
else
if
(
!
strcasecmp
(
s
,
"try"
))
tmp
.
use_tls
=
1
;
}
utils
->
getopt
(
utils
->
getopt_context
,
ldapdb
,
"ldapdb_rc"
,
&
s
,
&
len
);
if
(
s
)
{
...
...
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