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
b735ca32
Commit
b735ca32
authored
23 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Add some cheats to dnNormalize and dnMatch to workaround
ava normalization issues.
parent
3df5c178
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servers/slapd/dn.c
+5
-4
5 additions, 4 deletions
servers/slapd/dn.c
servers/slapd/entry.c
+14
-14
14 additions, 14 deletions
servers/slapd/entry.c
servers/slapd/tools/slapadd.c
+9
-4
9 additions, 4 deletions
servers/slapd/tools/slapadd.c
with
28 additions
and
22 deletions
servers/slapd/dn.c
+
5
−
4
View file @
b735ca32
...
...
@@ -351,10 +351,12 @@ dnNormalize(
out
=
ber_bvdup
(
val
);
}
/* FIXME: cheat! */
ldap_pvt_str2upper
(
out
->
bv_val
);
Debug
(
LDAP_DEBUG_TRACE
,
"<<< dnNormalize: <%s>
\n
"
,
out
->
bv_val
,
0
,
0
);
*
normalized
=
out
;
return
LDAP_SUCCESS
;
}
...
...
@@ -423,8 +425,7 @@ dnPretty(
/*
* dnMatch routine
*
* note: uses exact string match (strcmp) because it is supposed to work
* on normalized DNs.
* FIXME: strcasecmp should be replaced with schema aware checks
*/
int
dnMatch
(
...
...
@@ -445,7 +446,7 @@ dnMatch(
match
=
value
->
bv_len
-
asserted
->
bv_len
;
if
(
match
==
0
)
{
match
=
strcmp
(
value
->
bv_val
,
asserted
->
bv_val
);
match
=
strc
asec
mp
(
value
->
bv_val
,
asserted
->
bv_val
);
}
#ifdef NEW_LOGGING
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/entry.c
+
14
−
14
View file @
b735ca32
...
...
@@ -65,7 +65,7 @@ str2entry( char *s )
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"str2entry:
\"
%s
\"\n
"
,
s
?
s
:
"NULL"
));
"str2entry:
\"
%s
\"\n
"
,
s
?
s
:
"NULL"
));
#else
Debug
(
LDAP_DEBUG_TRACE
,
"=> str2entry
\n
"
,
s
?
s
:
"NULL"
,
0
,
0
);
...
...
@@ -77,7 +77,7 @@ str2entry( char *s )
if
(
e
==
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"str2entry: entry allocation failed.
\n
"
));
"str2entry: entry allocation failed.
\n
"
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"<= str2entry NULL (entry allocation failed)
\n
"
,
...
...
@@ -156,7 +156,7 @@ str2entry( char *s )
return
NULL
;
}
e
->
e_name
.
bv_val
=
pdn
->
bv_val
!=
NULL
e
->
e_name
.
bv_val
=
(
pdn
->
bv_val
!=
NULL
)
?
pdn
->
bv_val
:
ch_strdup
(
""
);
e
->
e_name
.
bv_len
=
pdn
->
bv_len
;
free
(
pdn
);
...
...
@@ -169,7 +169,7 @@ str2entry( char *s )
if
(
rc
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"str2entry: str2ad(%s):
%s
\n
"
,
type
,
text
));
"str2entry: str2ad(%s): %s
\n
"
,
type
,
text
));
#else
Debug
(
slapMode
&
SLAP_TOOL_MODE
?
LDAP_DEBUG_ANY
:
LDAP_DEBUG_TRACE
,
...
...
@@ -186,7 +186,7 @@ str2entry( char *s )
if
(
rc
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"str2entry: str2undef_ad(%s):
%s
\n
"
,
type
,
text
));
"str2entry: str2undef_ad(%s): %s
\n
"
,
type
,
text
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"<= str2entry: str2undef_ad(%s): %s
\n
"
,
...
...
@@ -219,8 +219,8 @@ str2entry( char *s )
}
else
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_INFO
,
"str2entry: no validator for syntax %s
\n
"
,
ad
->
ad_type
->
sat_syntax
->
ssyn_oid
));
"str2entry: no validator for syntax %s
\n
"
,
ad
->
ad_type
->
sat_syntax
->
ssyn_oid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"str2entry: no validator for syntax %s
\n
"
,
...
...
@@ -235,8 +235,8 @@ str2entry( char *s )
if
(
rc
!=
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"str2entry: invalid value for syntax %s
\n
"
,
ad
->
ad_type
->
sat_syntax
->
ssyn_oid
));
"str2entry: invalid value for syntax %s
\n
"
,
ad
->
ad_type
->
sat_syntax
->
ssyn_oid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"str2entry: invalid value for syntax %s
\n
"
,
...
...
@@ -259,7 +259,7 @@ str2entry( char *s )
if
(
rc
!=
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"str2entry: NULL (attr_merge)
\n
"
));
"str2entry: NULL (attr_merge)
\n
"
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"<= str2entry NULL (attr_merge)
\n
"
,
0
,
0
,
0
);
...
...
@@ -278,8 +278,8 @@ str2entry( char *s )
if
(
e
->
e_dn
==
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_INFO
,
"str2entry: entry %ld has no dn.
\n
"
,
(
long
)
e
->
e_id
));
"str2entry: entry %ld has no dn.
\n
"
,
(
long
)
e
->
e_id
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"str2entry: entry %ld has no dn
\n
"
,
(
long
)
e
->
e_id
,
0
,
0
);
...
...
@@ -296,8 +296,8 @@ str2entry( char *s )
if
(
rc
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_INFO
,
"str2entry: entry %ld has invalid dn: %s
\n
"
,
(
long
)
e
->
e_id
,
e
->
e_dn
));
"str2entry: entry %ld has invalid dn: %s
\n
"
,
(
long
)
e
->
e_id
,
e
->
e_dn
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"str2entry: entry %ld has invalid dn: %s
\n
"
,
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/tools/slapadd.c
+
9
−
4
View file @
b735ca32
...
...
@@ -76,11 +76,16 @@ main( int argc, char **argv )
/* check backend */
if
(
select_backend
(
e
->
e_ndn
,
is_entry_referral
(
e
),
nosubs
)
!=
be
)
{
fprintf
(
stderr
,
"%s:
database (%s) not configured to
"
"hold
dn=
\"
%s
\"
(line=%d)
\n
"
,
progname
,
fprintf
(
stderr
,
"%s:
line %d:
"
"
database (%s) not configured to
hold
\"
%s
\"\n
"
,
progname
,
lineno
,
be
?
be
->
be_suffix
[
0
]
:
"<none>"
,
e
->
e_dn
,
lineno
);
e
->
e_dn
);
fprintf
(
stderr
,
"%s: line %d: "
"database (%s) not configured to hold
\"
%s
\"\n
"
,
progname
,
lineno
,
be
?
be
->
be_nsuffix
[
0
]
->
bv_val
:
"<none>"
,
e
->
e_ndn
);
rc
=
EXIT_FAILURE
;
entry_free
(
e
);
if
(
continuemode
)
continue
;
...
...
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