Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
c96f12ee
Commit
c96f12ee
authored
May 24, 2000
by
Kurt Zeilenga
Browse files
SLAPD_SCHEMA_NOT_COMPAT: Fix memory stomping
parent
433d9388
Changes
3
Hide whitespace changes
Inline
Side-by-side
servers/slapd/backend.c
View file @
c96f12ee
...
...
@@ -657,7 +657,7 @@ Attribute *backend_operational(
{
Attribute
*
a
=
ch_malloc
(
sizeof
(
Attribute
)
);
#ifdef SLAPD_SCHEMA_NOT_COMPAT
a
->
a_desc
=
slap_schema
.
si_ad_subschemaSubentry
;
a
->
a_desc
=
ad_dup
(
slap_schema
.
si_ad_subschemaSubentry
)
;
#else
a
->
a_type
=
ch_strdup
(
"subschemasubentry"
);
a
->
a_syntax
=
SYNTAX_DN
|
SYNTAX_CIS
;
...
...
@@ -665,9 +665,7 @@ Attribute *backend_operational(
/* Should be backend specific */
a
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
*
)
);
a
->
a_vals
[
0
]
=
ch_malloc
(
sizeof
(
struct
berval
)
);
a
->
a_vals
[
0
]
->
bv_val
=
ch_strdup
(
SLAPD_SCHEMA_DN
);
a
->
a_vals
[
0
]
->
bv_len
=
sizeof
(
SLAPD_SCHEMA_DN
)
-
1
;
a
->
a_vals
[
0
]
=
ber_bvstrdup
(
SLAPD_SCHEMA_DN
);
a
->
a_vals
[
1
]
=
NULL
;
a
->
a_next
=
NULL
;
...
...
servers/slapd/modify.c
View file @
c96f12ee
...
...
@@ -433,7 +433,7 @@ int slap_mods_opattrs(
if
(
op
->
o_tag
==
LDAP_REQ_ADD
)
{
mod
=
(
Modifications
*
)
ch_calloc
(
1
,
sizeof
(
Modifications
)
);
mod
->
sml_op
=
mop
;
mod
->
sml_desc
=
slap_schema
.
si_ad_creatorsName
;
mod
->
sml_desc
=
ad_dup
(
slap_schema
.
si_ad_creatorsName
)
;
mod
->
sml_bvalues
=
(
struct
berval
**
)
malloc
(
2
*
sizeof
(
struct
berval
*
)
);
mod
->
sml_bvalues
[
0
]
=
ber_bvdup
(
&
name
);
mod
->
sml_bvalues
[
1
]
=
NULL
;
...
...
@@ -443,7 +443,7 @@ int slap_mods_opattrs(
mod
=
(
Modifications
*
)
ch_calloc
(
1
,
sizeof
(
Modifications
)
);
mod
->
sml_op
=
mop
;
mod
->
sml_desc
=
slap_schema
.
si_ad_createTimestamp
;
mod
->
sml_desc
=
ad_dup
(
slap_schema
.
si_ad_createTimestamp
)
;
mod
->
sml_bvalues
=
(
struct
berval
**
)
malloc
(
2
*
sizeof
(
struct
berval
*
)
);
mod
->
sml_bvalues
[
0
]
=
ber_bvdup
(
&
timestamp
);
mod
->
sml_bvalues
[
1
]
=
NULL
;
...
...
servers/slapd/result.c
View file @
c96f12ee
...
...
@@ -129,12 +129,12 @@ struct berval **get_entry_referrals(
unsigned
i
,
j
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
AttributeDescription
*
ref
=
slap_schema
.
si_ad_ref
;
AttributeDescription
*
ad_
ref
=
slap_schema
.
si_ad_ref
;
#else
static
const
char
*
ref
=
"ref"
;
static
const
char
*
ad_
ref
=
"ref"
;
#endif
attr
=
attr_find
(
e
->
e_attrs
,
ref
);
attr
=
attr_find
(
e
->
e_attrs
,
ad_
ref
);
if
(
attr
==
NULL
)
return
NULL
;
...
...
@@ -629,15 +629,15 @@ send_search_entry(
int
opattrs
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
AttributeDescription
*
entry
=
slap_schema
.
si_ad_entry
;
AttributeDescription
*
ad_
entry
=
slap_schema
.
si_ad_entry
;
#else
static
const
char
*
entry
=
"entry"
;
static
const
char
*
ad_
entry
=
"entry"
;
#endif
Debug
(
LDAP_DEBUG_TRACE
,
"=> send_search_entry:
\"
%s
\"\n
"
,
e
->
e_dn
,
0
,
0
);
if
(
!
access_allowed
(
be
,
conn
,
op
,
e
,
entry
,
NULL
,
ACL_READ
)
)
ad_
entry
,
NULL
,
ACL_READ
)
)
{
Debug
(
LDAP_DEBUG_ACL
,
"acl: access to entry not allowed
\n
"
,
0
,
0
,
0
);
...
...
@@ -901,17 +901,17 @@ send_search_reference(
int
bytes
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
AttributeDescription
*
ref
=
slap_schema
.
si_ad_ref
;
AttributeDescription
*
entry
=
slap_schema
.
si_ad_entry
;
AttributeDescription
*
ad_
ref
=
slap_schema
.
si_ad_ref
;
AttributeDescription
*
ad_
entry
=
slap_schema
.
si_ad_entry
;
#else
static
const
char
*
ref
=
"ref"
;
static
const
char
*
entry
=
"entry"
;
static
const
char
*
ad_
ref
=
"ref"
;
static
const
char
*
ad_
entry
=
"entry"
;
#endif
Debug
(
LDAP_DEBUG_TRACE
,
"=> send_search_reference (%s)
\n
"
,
e
->
e_dn
,
0
,
0
);
if
(
!
access_allowed
(
be
,
conn
,
op
,
e
,
entry
,
NULL
,
ACL_READ
)
)
ad_
entry
,
NULL
,
ACL_READ
)
)
{
Debug
(
LDAP_DEBUG_ACL
,
"send_search_reference: access to entry not allowed
\n
"
,
...
...
@@ -920,7 +920,7 @@ send_search_reference(
}
if
(
!
access_allowed
(
be
,
conn
,
op
,
e
,
ref
,
NULL
,
ACL_READ
)
)
ad_
ref
,
NULL
,
ACL_READ
)
)
{
Debug
(
LDAP_DEBUG_ACL
,
"send_search_reference: access to reference not allowed
\n
"
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment