Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Christopher Ng
OpenLDAP
Commits
9284fbf8
Commit
9284fbf8
authored
20 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
remove lint and cleanup namespace
parent
05463503
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
servers/slapd/saslauthz.c
+23
-17
23 additions, 17 deletions
servers/slapd/saslauthz.c
with
23 additions
and
17 deletions
servers/slapd/saslauthz.c
+
23
−
17
View file @
9284fbf8
...
...
@@ -368,21 +368,27 @@ is_dn: bv.bv_len = uri->bv_len - (bv.bv_val - uri->bv_val);
group_dn
.
bv_val
++
;
group_dn
.
bv_len
=
uri
->
bv_len
-
(
group_dn
.
bv_val
-
uri
->
bv_val
);
fstr
->
bv_len
=
STRLENOF
(
"(&(objectClass=)(="
)
+
group_oc
.
bv_len
+
member_at
.
bv_len
;
rc
=
dnNormalize
(
0
,
NULL
,
NULL
,
&
group_dn
,
nbase
,
op
->
o_tmpmemctx
);
if
(
rc
!=
LDAP_SUCCESS
)
{
*
scope
=
-
1
;
return
rc
;
}
*
scope
=
LDAP_X_SCOPE_GROUP
;
/* FIXME: caller needs to add value of member attribute
* and close brackets twice */
fstr
->
bv_len
=
STRLENOF
(
"(&(objectClass=)(="
/* )) */
)
+
group_oc
.
bv_len
+
member_at
.
bv_len
;
fstr
->
bv_val
=
ch_malloc
(
fstr
->
bv_len
+
1
);
tmp
=
lutil_strncopy
(
fstr
->
bv_val
,
"(&(objectClass="
,
STRLENOF
(
"(&(objectClass="
)
);
tmp
=
lutil_strncopy
(
fstr
->
bv_val
,
"(&(objectClass="
/* )) */
,
STRLENOF
(
"(&(objectClass="
/* )) */
)
);
tmp
=
lutil_strncopy
(
tmp
,
group_oc
.
bv_val
,
group_oc
.
bv_len
);
tmp
=
lutil_strncopy
(
tmp
,
")("
,
STRLENOF
(
")("
)
);
tmp
=
lutil_strncopy
(
tmp
,
/* ( */
")("
/* ) */
,
STRLENOF
(
/* ( */
")("
/* ) */
)
);
tmp
=
lutil_strncopy
(
tmp
,
member_at
.
bv_val
,
member_at
.
bv_len
);
tmp
=
lutil_strncopy
(
tmp
,
"="
,
STRLENOF
(
"="
)
);
rc
=
dnNormalize
(
0
,
NULL
,
NULL
,
&
group_dn
,
nbase
,
op
->
o_tmpmemctx
);
if
(
rc
!=
LDAP_SUCCESS
)
{
*
scope
=
-
1
;
}
else
{
*
scope
=
LDAP_X_SCOPE_GROUP
;
}
return
rc
;
}
...
...
@@ -675,7 +681,7 @@ static void slap_sasl_rx_exp(
LDAP URI to find the matching LDAP entry, using the pattern matching
strings given in the saslregexp config file directive(s) */
static
int
slap_
sasl
_regexp
(
struct
berval
*
in
,
struct
berval
*
out
,
static
int
slap_
authz
_regexp
(
struct
berval
*
in
,
struct
berval
*
out
,
int
flags
,
void
*
ctx
)
{
#ifdef SLAP_AUTH_REWRITE
...
...
@@ -725,9 +731,9 @@ static int slap_sasl_regexp( struct berval *in, struct berval *out,
#ifdef NEW_LOGGING
LDAP_LOG
(
TRANSPORT
,
ENTRY
,
"slap_
sasl
_regexp: converting SASL name %s
\n
"
,
saslname
,
0
,
0
);
"slap_
authz
_regexp: converting SASL name %s
\n
"
,
saslname
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"slap_
sasl
_regexp: converting SASL name %s
\n
"
,
Debug
(
LDAP_DEBUG_TRACE
,
"slap_
authz
_regexp: converting SASL name %s
\n
"
,
saslname
,
0
,
0
);
#endif
...
...
@@ -754,11 +760,11 @@ static int slap_sasl_regexp( struct berval *in, struct berval *out,
#ifdef NEW_LOGGING
LDAP_LOG
(
TRANSPORT
,
ENTRY
,
"slap_
sasl
_regexp: converted SASL name to %s
\n
"
,
"slap_
authz
_regexp: converted SASL name to %s
\n
"
,
BER_BVISEMPTY
(
out
)
?
""
:
out
->
bv_val
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"slap_
sasl
_regexp: converted SASL name to %s
\n
"
,
"slap_
authz
_regexp: converted SASL name to %s
\n
"
,
BER_BVISEMPTY
(
out
)
?
""
:
out
->
bv_val
,
0
,
0
);
#endif
...
...
@@ -950,7 +956,7 @@ exact_match:
* with scope "base", and the filter ensures that <assertDN> is
* member of the group */
tmp
=
ch_realloc
(
op
.
ors_filterstr
.
bv_val
,
op
.
ors_filterstr
.
bv_len
+
assertDN
->
bv_len
+
STRLENOF
(
"))"
)
+
1
);
op
.
ors_filterstr
.
bv_len
+
assertDN
->
bv_len
+
STRLENOF
(
/* (( */
"))"
)
+
1
);
if
(
tmp
==
NULL
)
{
rc
=
LDAP_NO_MEMORY
;
goto
CONCLUDED
;
...
...
@@ -958,7 +964,7 @@ exact_match:
op
.
ors_filterstr
.
bv_val
=
tmp
;
tmp
=
lutil_strcopy
(
&
tmp
[
op
.
ors_filterstr
.
bv_len
],
assertDN
->
bv_val
);
tmp
=
lutil_strcopy
(
tmp
,
"))"
);
tmp
=
lutil_strcopy
(
tmp
,
/* (( */
"))"
);
/* pass opx because str2filter_x may (and does) use o_tmpmfuncs */
op
.
ors_filter
=
str2filter_x
(
opx
,
op
.
ors_filterstr
.
bv_val
);
...
...
@@ -1139,7 +1145,7 @@ void slap_sasl2dn( Operation *opx,
cb
.
sc_private
=
sasldn
;
/* Convert the SASL name into a minimal URI */
if
(
!
slap_
sasl
_regexp
(
saslname
,
&
regout
,
flags
,
opx
->
o_tmpmemctx
)
)
{
if
(
!
slap_
authz
_regexp
(
saslname
,
&
regout
,
flags
,
opx
->
o_tmpmemctx
)
)
{
goto
FINISHED
;
}
...
...
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