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
ec576aae
Commit
ec576aae
authored
24 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
SLAPD_SCHEMA_NOT_COMPAT: Use no-op syntax validator
parent
a838ea67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
servers/slapd/modify.c
+3
-0
3 additions, 0 deletions
servers/slapd/modify.c
servers/slapd/schema_init.c
+41
-5
41 additions, 5 deletions
servers/slapd/schema_init.c
with
44 additions
and
5 deletions
servers/slapd/modify.c
+
3
−
0
View file @
ec576aae
...
...
@@ -347,6 +347,9 @@ int slap_modlist2mods(
ad
->
ad_type
->
sat_syntax
->
ssyn_validate
;
if
(
!
validate
)
{
Debug
(
LDAP_DEBUG_TRACE
,
"modlist2mods: no validator for syntax %s
\n
"
,
ad
->
ad_type
->
sat_syntax
->
ssyn_oid
,
0
,
0
);
slap_mods_free
(
mod
);
*
text
=
"no validator for syntax"
;
return
LDAP_INVALID_SYNTAX
;
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/schema_init.c
+
41
−
5
View file @
ec576aae
...
...
@@ -35,7 +35,7 @@ UTF8StringValidate(
int
len
;
unsigned
char
*
u
=
in
->
bv_val
;
for
(
count
=
in
->
bv_len
;
count
>
0
;
count
+
=
len
,
u
+=
len
)
{
for
(
count
=
in
->
bv_len
;
count
>
0
;
count
-
=
len
,
u
+=
len
)
{
/* get the length indicated by the first byte */
len
=
LDAP_UTF8_CHARLEN
(
u
);
...
...
@@ -131,6 +131,42 @@ UTF8StringNormalize(
return
0
;
}
static
int
oidValidate
(
Syntax
*
syntax
,
struct
berval
*
val
)
{
ber_len_t
i
;
if
(
val
->
bv_len
==
0
)
return
0
;
if
(
isdigit
(
val
->
bv_val
[
0
])
)
{
int
dot
=
0
;
for
(
i
=
1
;
i
<
val
->
bv_len
;
i
++
)
{
if
(
val
->
bv_val
[
i
]
==
'.'
)
{
if
(
dot
++
)
return
1
;
}
else
if
(
isdigit
(
val
->
bv_val
[
i
])
)
{
dot
=
0
;
}
else
{
return
1
;
}
}
return
!
dot
?
0
:
1
;
}
else
if
(
isalpha
(
val
->
bv_val
[
0
])
)
{
for
(
i
=
1
;
i
<
val
->
bv_len
;
i
++
)
{
if
(
!
isalpha
(
val
->
bv_val
[
i
]
)
)
{
return
1
;
}
}
return
0
;
}
return
1
;
}
static
int
IA5StringValidate
(
Syntax
*
syntax
,
...
...
@@ -303,7 +339,7 @@ struct syntax_defs_rec syntax_defs[] = {
{
"( 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 'DN' )"
,
0
,
NULL
,
NULL
,
NULL
},
0
,
blobValidate
,
NULL
,
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' )"
,
...
...
@@ -353,13 +389,13 @@ struct syntax_defs_rec syntax_defs[] = {
{
"( 1.3.6.1.4.1.1466.115.121.1.37 DESC 'Object Class Description' )"
,
0
,
NULL
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.38 DESC 'OID' )"
,
0
,
NULL
,
NULL
,
NULL
},
0
,
oidValidate
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.39 DESC 'Other Mailbox' )"
,
0
,
NULL
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.40 DESC 'Octet String' )"
,
0
,
blobValidate
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.41 DESC 'Postal Address' )"
,
0
,
NULL
,
NULL
,
NULL
},
0
,
blobValidate
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.42 DESC 'Protocol Information' )"
,
0
,
NULL
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.43 DESC 'Presentation Address' )"
,
...
...
@@ -370,7 +406,7 @@ struct syntax_defs_rec syntax_defs[] = {
X_BINARY
X_NOT_H_R
")"
,
SLAP_SYNTAX_BINARY
|
SLAP_SYNTAX_BER
,
berValidate
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.50 DESC 'Telephone Number' )"
,
0
,
NULL
,
NULL
,
NULL
},
0
,
blobValidate
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.51 DESC 'Teletex Terminal Identifier' )"
,
0
,
NULL
,
NULL
,
NULL
},
{
"( 1.3.6.1.4.1.1466.115.121.1.52 DESC 'Telex Number' )"
,
...
...
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