Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
09cbbb92
Commit
09cbbb92
authored
Aug 27, 2007
by
Pierangelo Masarati
Browse files
need to copy the Entry to safely manipulate it
parent
5fb99e0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/slapadd.c
View file @
09cbbb92
...
...
@@ -344,7 +344,8 @@ slapadd( int argc, char **argv )
}
else
{
ctxcsn_e
=
be
->
be_entry_get
(
be
,
ctxcsn_id
);
if
(
ctxcsn_e
!=
NULL
)
{
attr
=
attr_find
(
ctxcsn_e
->
e_attrs
,
slap_schema
.
si_ad_contextCSN
);
Entry
*
e
=
entry_dup
(
ctxcsn_e
);
attr
=
attr_find
(
e
->
e_attrs
,
slap_schema
.
si_ad_contextCSN
);
if
(
attr
)
{
int
i
;
...
...
@@ -384,33 +385,31 @@ slapadd( int argc, char **argv )
}
}
#if 0
if ( attr->a_nvals && attr->a_nvals != attr->a_vals ) {
ber_bvarray_free( attr->a_nvals );
if
(
attr
->
a_nvals
!=
attr
->
a_vals
)
{
ber_bvarray_free
(
attr
->
a_vals
);
}
attr
->
a_nvals
=
NULL
;
ber_bvarray_free
(
attr
->
a_vals
);
#endif
attr
->
a_vals
=
NULL
;
attr
->
a_nvals
=
NULL
;
}
for
(
sid
=
0
;
sid
<=
SLAP_SYNC_SID_MAX
;
sid
++
)
{
if
(
maxcsn
[
sid
].
bv_len
)
{
attr_merge_one
(
ctxcsn_
e
,
slap_schema
.
si_ad_contextCSN
,
attr_merge_one
(
e
,
slap_schema
.
si_ad_contextCSN
,
&
maxcsn
[
sid
],
NULL
);
}
}
ctxcsn_id
=
be
->
be_entry_modify
(
be
,
ctxcsn_
e
,
&
bvtext
);
ctxcsn_id
=
be
->
be_entry_modify
(
be
,
e
,
&
bvtext
);
if
(
ctxcsn_id
==
NOID
)
{
fprintf
(
stderr
,
"%s: could not modify ctxcsn
\n
"
,
progname
);
rc
=
EXIT_FAILURE
;
}
else
if
(
verbose
)
{
fprintf
(
stderr
,
"modified:
\"
%s
\"
(%08lx)
\n
"
,
ctxcsn_
e
->
e_dn
,
(
long
)
ctxcsn_id
);
e
->
e_dn
,
(
long
)
ctxcsn_id
);
}
entry_free
(
e
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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