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
Jaak Ristioja
OpenLDAP
Commits
e31e4237
Commit
e31e4237
authored
24 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
SLAPD_SCHEMA_NOT_COMPAT: cheap DN match
parent
30c43c30
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/schema_init.c
+73
-4
73 additions, 4 deletions
servers/slapd/schema_init.c
with
73 additions
and
4 deletions
servers/slapd/schema_init.c
+
73
−
4
View file @
e31e4237
...
...
@@ -16,6 +16,76 @@
#include
"slap.h"
#include
"ldap_pvt.h"
static
int
dnValidate
(
Syntax
*
syntax
,
struct
berval
*
in
)
{
int
rc
;
char
*
dn
;
if
(
in
->
bv_len
==
0
)
return
LDAP_SUCCESS
;
dn
=
ch_strdup
(
in
->
bv_val
);
rc
=
dn_validate
(
dn
)
==
NULL
?
LDAP_INVALID_SYNTAX
:
LDAP_SUCCESS
;
ch_free
(
dn
);
return
rc
;
}
static
int
dnNormalize
(
Syntax
*
syntax
,
struct
berval
*
val
,
struct
berval
**
normalized
)
{
struct
berval
*
out
=
ber_bvdup
(
val
);
if
(
out
->
bv_len
!=
0
)
{
char
*
dn
;
#ifdef USE_DN_NORMALIZE
dn
=
dn_normalize
(
out
->
bv_val
);
#else
dn
=
dn_validate
(
out
->
bv_val
);
#endif
if
(
dn
==
NULL
)
{
ber_bvfree
(
out
);
return
LDAP_INVALID_SYNTAX
;
}
out
->
bv_val
=
dn
;
out
->
bv_len
=
strlen
(
dn
);
}
*
normalized
=
out
;
return
LDAP_SUCCESS
;
}
static
int
dnMatch
(
int
*
match
,
unsigned
use
,
Syntax
*
syntax
,
MatchingRule
*
mr
,
struct
berval
*
value
,
void
*
assertedValue
)
{
struct
berval
*
asserted
=
(
struct
berval
*
)
assertedValue
;
ber_slen_t
diff
;
diff
=
value
->
bv_len
-
asserted
->
bv_len
;
if
(
diff
)
return
diff
;
#ifdef USE_DN_NORMALIZE
return
strcmp
(
value
->
bv_val
,
asserted
->
bv_val
);
#else
return
strcasecmp
(
value
->
bv_val
,
asserted
->
bv_val
);
#endif
}
static
int
inValidate
(
Syntax
*
syntax
,
...
...
@@ -631,8 +701,8 @@ struct syntax_defs_rec syntax_defs[] = {
SLAP_SYNTAX_BINARY
|
SLAP_SYNTAX_BER
,
berValidate
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.11 DESC 'Country String' )"
,
0
,
NULL
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.12 DESC 'D
N
' )"
,
0
,
blob
Validate
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.12 DESC 'D
istinguished Name
' )"
,
0
,
dn
Validate
,
dnNormalize
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.13 DESC 'Data Quality' )"
,
0
,
NULL
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.14 DESC 'Delivery Method' )"
,
...
...
@@ -779,7 +849,6 @@ struct mrule_defs_rec {
/* unimplemented matching functions */
#define objectIdentifierMatch NULL
#define distinguishedNameMatch NULL
#define numericStringMatch NULL
#define numericStringSubstringsMatch NULL
#define caseIgnoreListMatch NULL
...
...
@@ -806,7 +875,7 @@ struct mrule_defs_rec mrule_defs[] = {
{
"( 2.5.13.1 NAME 'distinguishedNameMatch' "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )"
,
SLAP_MR_EQUALITY
|
SLAP_MR_EXT
,
NULL
,
NULL
,
d
istinguishedName
Match
,
NULL
,
NULL
},
NULL
,
NULL
,
d
n
Match
,
NULL
,
NULL
},
{
"( 2.5.13.2 NAME 'caseIgnoreMatch' "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )"
,
...
...
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