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
dd687051
Commit
dd687051
authored
Feb 27, 2003
by
Pierangelo Masarati
Browse files
quick fix to allow -DSLAP_NVALUES with -DLDAP_SLAPI
parent
216bcd94
Changes
2
Hide whitespace changes
Inline
Side-by-side
servers/slapd/slapi/slapi_ops.c
View file @
dd687051
...
...
@@ -292,6 +292,9 @@ freeMods( Modifications *ml )
next
=
ml
->
sml_next
;
slapi_ch_free
(
(
void
**
)
&
ml
->
sml_bvalues
);
#ifdef SLAP_NVALUES
slapi_ch_free
(
(
void
**
)
&
ml
->
sml_nvalues
);
#endif
slapi_ch_free
(
(
void
**
)
&
ml
);
}
}
...
...
@@ -356,6 +359,9 @@ LDAPModToEntry(
tmp
.
sml_type
.
bv_val
=
pMod
->
mod_type
;
tmp
.
sml_type
.
bv_len
=
strlen
(
pMod
->
mod_type
);
tmp
.
sml_bvalues
=
bv
;
#ifdef SLAP_NVALUES
tmp
.
sml_nvalues
=
NULL
;
#endif
mod
=
(
Modifications
*
)
ch_malloc
(
sizeof
(
Modifications
)
);
...
...
@@ -364,6 +370,9 @@ LDAPModToEntry(
mod
->
sml_desc
=
NULL
;
mod
->
sml_type
=
tmp
.
sml_type
;
mod
->
sml_bvalues
=
tmp
.
sml_bvalues
;
#ifdef SLAP_NVALUES
mod
->
sml_nvalues
=
tmp
.
sml_nvalues
;
#endif
*
modtail
=
mod
;
modtail
=
&
mod
->
sml_next
;
...
...
@@ -379,6 +388,9 @@ LDAPModToEntry(
tmp
.
sml_type
.
bv_val
=
pMod
->
mod_type
;
tmp
.
sml_type
.
bv_len
=
strlen
(
pMod
->
mod_type
);
tmp
.
sml_bvalues
=
bv
;
#ifdef SLAP_NVALUES
tmp
.
sml_nvalues
=
NULL
;
#endif
mod
=
(
Modifications
*
)
ch_malloc
(
sizeof
(
Modifications
)
);
...
...
@@ -387,6 +399,9 @@ LDAPModToEntry(
mod
->
sml_desc
=
NULL
;
mod
->
sml_type
=
tmp
.
sml_type
;
mod
->
sml_bvalues
=
tmp
.
sml_bvalues
;
#ifdef SLAP_NVALUES
mod
->
sml_nvalues
=
tmp
.
sml_nvalues
;
#endif
*
modtail
=
mod
;
modtail
=
&
mod
->
sml_next
;
...
...
@@ -932,6 +947,9 @@ slapi_modify_internal(
tmp
.
sml_type
.
bv_val
=
pMod
->
mod_type
;
tmp
.
sml_type
.
bv_len
=
strlen
(
pMod
->
mod_type
);
tmp
.
sml_bvalues
=
bv
;
#ifdef SLAP_NVALUES
tmp
.
sml_nvalues
=
NULL
;
#endif
mod
=
(
Modifications
*
)
ch_malloc
(
sizeof
(
Modifications
)
);
...
...
@@ -940,12 +958,18 @@ slapi_modify_internal(
mod
->
sml_desc
=
NULL
;
mod
->
sml_type
=
tmp
.
sml_type
;
mod
->
sml_bvalues
=
tmp
.
sml_bvalues
;
#ifdef SLAP_NVALUES
mod
->
sml_nvalues
=
tmp
.
sml_nvalues
;
#endif
}
else
{
rc
=
values2obj
(
pMod
->
mod_values
,
&
bv
);
if
(
rc
!=
LDAP_SUCCESS
)
goto
cleanup
;
tmp
.
sml_type
.
bv_val
=
pMod
->
mod_type
;
tmp
.
sml_type
.
bv_len
=
strlen
(
pMod
->
mod_type
);
tmp
.
sml_bvalues
=
bv
;
#ifdef SLAP_NVALUES
tmp
.
sml_nvalues
=
NULL
;
#endif
mod
=
(
Modifications
*
)
ch_malloc
(
sizeof
(
Modifications
)
);
...
...
@@ -954,6 +978,9 @@ slapi_modify_internal(
mod
->
sml_desc
=
NULL
;
mod
->
sml_type
=
tmp
.
sml_type
;
mod
->
sml_bvalues
=
tmp
.
sml_bvalues
;
#ifdef SLAP_NVALUES
mod
->
sml_nvalues
=
tmp
.
sml_nvalues
;
#endif
}
*
modtail
=
mod
;
modtail
=
&
mod
->
sml_next
;
...
...
servers/slapd/slapi/slapi_utils.c
View file @
dd687051
...
...
@@ -556,15 +556,20 @@ slapi_entry_add_values( Slapi_Entry *e, const char *type, struct berval **vals )
}
if
(
vals
==
NULL
)
{
/* Apparently vals can be NULL */
/* Apparently vals can be NULL
* FIXME: sm_bvalues = NULL ? */
mod
.
sm_bvalues
=
(
BerVarray
)
ch_malloc
(
sizeof
(
struct
berval
)
);
mod
.
sm_bvalues
->
bv_val
=
NULL
;
}
else
{
rc
=
bvptr2obj
(
vals
,
&
mod
.
sm_bvalues
);
if
(
rc
!=
LDAP_SUCCESS
)
{
return
LDAP_CONSTRAINT_VIOLATION
;
}
}
#ifdef SLAP_NVALUES
mod
.
sm_nvalues
=
NULL
;
#endif
rc
=
modify_add_values
(
e
,
&
mod
,
0
,
&
text
,
textbuf
,
sizeof
(
textbuf
)
);
...
...
@@ -638,6 +643,9 @@ slapi_entry_delete_values( Slapi_Entry *e, const char *type, struct berval **val
if
(
rc
!=
LDAP_SUCCESS
)
{
return
LDAP_CONSTRAINT_VIOLATION
;
}
#if SLAP_NVALUES
mod
.
sm_nvalues
=
NULL
;
#endif
rc
=
modify_delete_values
(
e
,
&
mod
,
0
,
&
text
,
textbuf
,
sizeof
(
textbuf
)
);
...
...
@@ -3144,6 +3152,9 @@ Modifications *slapi_x_ldapmods2modifications (LDAPMod **mods)
}
mod
->
sml_bvalues
[
i
].
bv_val
=
NULL
;
}
#ifdef SLAP_NVALUES
mod
->
sml_nvalues
=
NULL
;
#endif
*
modtail
=
mod
;
modtail
=
&
mod
->
sml_next
;
...
...
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