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
Dragoș Haiduc
OpenLDAP
Commits
a7b55f4f
Commit
a7b55f4f
authored
20 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
assert administrative identity instead of the required one if doing auth check in non-caching mode
parent
32d9856f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servers/slapd/back-ldap/bind.c
+19
-10
19 additions, 10 deletions
servers/slapd/back-ldap/bind.c
tests/data/slapd-ldapgluepeople.conf
+1
-0
1 addition, 0 deletions
tests/data/slapd-ldapgluepeople.conf
tests/scripts/test029-ldapglue
+27
-27
27 additions, 27 deletions
tests/scripts/test029-ldapglue
with
47 additions
and
37 deletions
servers/slapd/back-ldap/bind.c
+
19
−
10
View file @
a7b55f4f
...
...
@@ -143,7 +143,7 @@ ldap_back_conn_cmp(
int
rc
;
/* If local DNs don't match, it is definitely not a match */
if
(
(
rc
=
ber_bvcmp
(
&
lc1
->
local_dn
,
&
lc2
->
local_dn
))
)
if
(
(
rc
=
ber_bvcmp
(
&
lc1
->
local_dn
,
&
lc2
->
local_dn
)
)
)
return
rc
;
/* For shared sessions, conn is NULL. Only explicitly
...
...
@@ -226,17 +226,16 @@ ldap_back_freeconn( Operation *op, struct ldapconn *lc )
struct
ldapconn
*
ldap_back_getconn
(
Operation
*
op
,
SlapReply
*
rs
)
{
struct
ldapinfo
*
li
=
(
struct
ldapinfo
*
)
op
->
o_bd
->
be_private
;
struct
ldapconn
*
lc
,
lc_curr
;
LDAP
*
ld
;
int
is_priv
=
0
;
struct
ldapinfo
*
li
=
(
struct
ldapinfo
*
)
op
->
o_bd
->
be_private
;
struct
ldapconn
*
lc
,
lc_curr
;
LDAP
*
ld
;
int
is_priv
=
0
;
/* Searches for a ldapconn in the avl tree */
/* Explicit binds must not be shared */
if
(
op
->
o_tag
==
LDAP_REQ_BIND
||
(
op
->
o_conn
&&
(
op
->
o_bd
==
op
->
o_conn
->
c_authz_backend
)))
{
||
(
op
->
o_conn
&&
op
->
o_bd
==
op
->
o_conn
->
c_authz_backend
)
)
{
lc_curr
.
conn
=
op
->
o_conn
;
}
else
{
...
...
@@ -463,7 +462,9 @@ ldap_back_dobind( struct ldapconn *lc, Operation *op, SlapReply *rs )
int
freeauthz
=
0
;
/* if SASL supports native authz, prepare for it */
if
(
li
->
idassert_flags
&
LDAP_BACK_AUTH_NATIVE_AUTHZ
)
{
if
(
(
!
op
->
o_do_not_cache
||
!
op
->
o_is_auth_check
)
&&
(
li
->
idassert_flags
&
LDAP_BACK_AUTH_NATIVE_AUTHZ
)
)
{
switch
(
li
->
idassert_mode
)
{
case
LDAP_BACK_IDASSERT_OTHERID
:
case
LDAP_BACK_IDASSERT_OTHERDN
:
...
...
@@ -753,7 +754,8 @@ ldap_back_proxy_authz_ctrl(
{
struct
ldapinfo
*
li
=
(
struct
ldapinfo
*
)
op
->
o_bd
->
be_private
;
LDAPControl
**
ctrls
=
NULL
;
int
i
=
0
;
int
i
=
0
,
mode
;
struct
berval
assertedID
;
*
pctrls
=
NULL
;
...
...
@@ -845,7 +847,14 @@ ldap_back_proxy_authz_ctrl(
rs
->
sr_text
=
"proxyAuthz not allowed within namingContext"
;
}
switch
(
li
->
idassert_mode
)
{
if
(
op
->
o_do_not_cache
&&
op
->
o_is_auth_check
)
{
mode
=
LDAP_BACK_IDASSERT_NOASSERT
;
}
else
{
mode
=
li
->
idassert_mode
;
}
switch
(
mode
)
{
case
LDAP_BACK_IDASSERT_LEGACY
:
case
LDAP_BACK_IDASSERT_SELF
:
/* original behavior:
...
...
This diff is collapsed.
Click to expand it.
tests/data/slapd-ldapgluepeople.conf
+
1
−
0
View file @
a7b55f4f
...
...
@@ -41,6 +41,7 @@ authz-regexp "^uid=([^,]+),.*" "uid=$1,ou=People,dc=example,dc=com"
#
access
to
attr
=
userpassword
by
dn
.
exact
=
"uid=proxy,ou=People,dc=example,dc=com"
read
by
self
=
wx
by
anonymous
=
x
...
...
This diff is collapsed.
Click to expand it.
tests/scripts/test029-ldapglue
+
27
−
27
View file @
a7b55f4f
...
...
@@ -185,33 +185,33 @@ if test $? != 0 ; then
fi
# FIXME: this cannot work as is, because SASL bind cannot be proxied!
#
if test $USE_SASL != "no" ; then
#
ID="bjorn"
#
BASE="dc=example,dc=com"
#
echo "Testing ldapsearch as $ID for \"$BASE\" with SASL bind and identity assertion..."
#
$LDAPSASLSEARCH -h $LOCALHOST -p $PORT1 -b "$BASE" \
#
-Q -U "$ID" -w bjorn -Y $MECH > $SEARCHOUT 2>&1
#
#
RC=$?
#
if test $RC != 0 ; then
#
echo "ldapsearch failed ($RC)!"
#
test $KILLSERVERS != no && kill -HUP $KILLPIDS
#
exit $RC
#
fi
#
#
echo "Filtering ldapsearch results..."
#
. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
#
echo "Filtering original ldif used to create database..."
#
. $LDIFFILTER < $LDAPGLUEOUT > $LDIFFLT
#
echo "Comparing filter output..."
#
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
#
#
if test $? != 0 ; then
#
echo "comparison failed - glued search with SASL bind and identity assertion didn't succeed"
#
test $KILLSERVERS != no && kill -HUP $KILLPIDS
#
exit 1
#
fi
#
fi
if
test
$USE_SASL
!=
"no"
;
then
ID
=
"bjorn"
BASE
=
"dc=example,dc=com"
echo
"Testing ldapsearch as
$ID
for
\"
$BASE
\"
with SASL bind and identity assertion..."
$LDAPSASLSEARCH
-h
$LOCALHOST
-p
$PORT1
-b
"
$BASE
"
\
-Q
-U
"
$ID
"
-w
bjorn
-Y
$MECH
>
$SEARCHOUT
2>&1
RC
=
$?
if
test
$RC
!=
0
;
then
echo
"ldapsearch failed (
$RC
)!"
test
$KILLSERVERS
!=
no
&&
kill
-HUP
$KILLPIDS
exit
$RC
fi
echo
"Filtering ldapsearch results..."
.
$LDIFFILTER
<
$SEARCHOUT
>
$SEARCHFLT
echo
"Filtering original ldif used to create database..."
.
$LDIFFILTER
<
$LDAPGLUEOUT
>
$LDIFFLT
echo
"Comparing filter output..."
$CMP
$SEARCHFLT
$LDIFFLT
>
$CMPOUT
if
test
$?
!=
0
;
then
echo
"comparison failed - glued search with SASL bind and identity assertion didn't succeed"
test
$KILLSERVERS
!=
no
&&
kill
-HUP
$KILLPIDS
exit
1
fi
fi
test
$KILLSERVERS
!=
no
&&
kill
-HUP
$KILLPIDS
...
...
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