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
openldap
OpenLDAP
Commits
3aabc4ed
Commit
3aabc4ed
authored
Apr 14, 2003
by
Howard Chu
Browse files
doPlugins return code fix
parent
755f7854
Changes
8
Hide whitespace changes
Inline
Side-by-side
servers/slapd/add.c
View file @
3aabc4ed
...
...
@@ -523,7 +523,7 @@ static int doPreAddPluginFNs( Operation *op )
int
rc
;
rc
=
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_PRE_ADD_FN
,
op
->
o_pb
);
if
(
rc
!=
0
)
{
if
(
rc
<
0
)
{
/*
* A preoperation plugin failure will abort the
* entire operation.
...
...
@@ -549,7 +549,7 @@ static void doPostAddPluginFNs( Operation *op )
int
rc
;
rc
=
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_ADD_FN
,
op
->
o_pb
);
if
(
rc
!=
0
)
{
if
(
rc
<
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
OPERATION
,
INFO
,
"do_add: add postoperation plugin failed
\n
"
,
0
,
0
,
0
);
...
...
servers/slapd/backend.c
View file @
3aabc4ed
...
...
@@ -694,7 +694,7 @@ backend_unbind( Operation *op, SlapReply *rs )
slapi_pblock_set
(
pb
,
SLAPI_BACKEND
,
(
void
*
)
&
backends
[
i
]
);
rc
=
doPluginFNs
(
&
backends
[
i
],
SLAPI_PLUGIN_PRE_UNBIND_FN
,
(
Slapi_PBlock
*
)
pb
);
if
(
rc
!=
0
)
{
if
(
rc
<
0
)
{
/*
* A preoperation plugin failure will abort the
* entire operation.
...
...
@@ -717,7 +717,7 @@ backend_unbind( Operation *op, SlapReply *rs )
#if defined( LDAP_SLAPI )
if
(
doPluginFNs
(
&
backends
[
i
],
SLAPI_PLUGIN_POST_UNBIND_FN
,
(
Slapi_PBlock
*
)
pb
)
!=
0
)
{
(
Slapi_PBlock
*
)
pb
)
<
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
OPERATION
,
INFO
,
"do_unbind: Unbind postoperation plugins "
"failed
\n
"
,
0
,
0
,
0
);
...
...
servers/slapd/bind.c
View file @
3aabc4ed
...
...
@@ -528,7 +528,7 @@ do_bind(
slapi_pblock_set
(
pb
,
SLAPI_MANAGEDSAIT
,
(
void
*
)(
0
)
);
rs
->
sr_err
=
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_PRE_BIND_FN
,
pb
);
if
(
rs
->
sr_err
!=
SLAPI_BIND_SUCCESS
)
{
if
(
rs
->
sr_err
<
0
)
{
/*
* Binding is a special case for SLAPI plugins. It is
* possible for a bind plugin to be successful *and*
...
...
@@ -641,7 +641,7 @@ do_bind(
}
#if defined( LDAP_SLAPI )
if
(
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_BIND_FN
,
pb
)
!=
0
)
{
if
(
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_BIND_FN
,
pb
)
<
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
OPERATION
,
INFO
,
"do_bind: Bind postoperation plugins failed
\n
"
,
0
,
0
,
0
);
...
...
servers/slapd/compare.c
View file @
3aabc4ed
...
...
@@ -260,7 +260,7 @@ do_compare(
slapi_pblock_set
(
pb
,
SLAPI_COMPARE_VALUE
,
(
void
*
)
&
value
);
rs
->
sr_err
=
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_PRE_COMPARE_FN
,
pb
);
if
(
rs
->
sr_err
!=
0
)
{
if
(
rs
->
sr_err
<
0
)
{
/*
* A preoperation plugin failure will abort the
* entire operation.
...
...
@@ -287,7 +287,7 @@ do_compare(
}
#if defined( LDAP_SLAPI )
if
(
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_COMPARE_FN
,
pb
)
!=
0
)
{
if
(
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_COMPARE_FN
,
pb
)
<
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
OPERATION
,
INFO
,
"do_compare: compare postoperation plugins "
"failed
\n
"
,
0
,
0
,
0
);
...
...
servers/slapd/modify.c
View file @
3aabc4ed
...
...
@@ -327,7 +327,7 @@ do_modify(
slapi_pblock_set
(
pb
,
SLAPI_MODIFY_MODS
,
(
void
*
)
modv
);
rs
->
sr_err
=
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_PRE_MODIFY_FN
,
pb
);
if
(
rs
->
sr_err
!=
0
)
{
if
(
rs
->
sr_err
<
0
)
{
/*
* A preoperation plugin failure will abort the
* entire operation.
...
...
@@ -355,8 +355,9 @@ do_modify(
* Calling slapi_x_modifications2ldapmods() destroyed modlist so
* we don't need to free it.
*/
slapi_pblock_get
(
pb
,
SLAPI_MODIFY_MODS
,
(
void
**
)
&
modv
);
modlist
=
slapi_x_ldapmods2modifications
(
modv
);
if
(
rs
->
sr_err
==
0
)
{
slapi_pblock_get
(
pb
,
SLAPI_MODIFY_MODS
,
(
void
**
)
&
modv
);
modlist
=
slapi_x_ldapmods2modifications
(
modv
);
/*
* NB: it is valid for the plugin to return no modifications
...
...
@@ -366,10 +367,11 @@ do_modify(
* then slapi_x_ldapmods2modifications() above will return
* NULL).
*/
if
(
modlist
==
NULL
)
{
rs
->
sr_err
=
LDAP_SUCCESS
;
send_ldap_result
(
op
,
rs
);
goto
cleanup
;
if
(
modlist
==
NULL
)
{
rs
->
sr_err
=
LDAP_SUCCESS
;
send_ldap_result
(
op
,
rs
);
goto
cleanup
;
}
}
#endif
/* defined( LDAP_SLAPI ) */
...
...
@@ -447,7 +449,7 @@ do_modify(
}
#if defined( LDAP_SLAPI )
if
(
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_MODIFY_FN
,
pb
)
!=
0
)
{
if
(
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_MODIFY_FN
,
pb
)
<
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
OPERATION
,
INFO
,
"do_modify: modify postoperation plugins "
"failed
\n
"
,
0
,
0
,
0
);
...
...
servers/slapd/modrdn.c
View file @
3aabc4ed
...
...
@@ -319,7 +319,7 @@ do_modrdn(
slapi_pblock_set
(
pb
,
SLAPI_MANAGEDSAIT
,
(
void
*
)
manageDSAit
);
rs
->
sr_err
=
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_PRE_MODRDN_FN
,
pb
);
if
(
rs
->
sr_err
!=
0
)
{
if
(
rs
->
sr_err
<
0
)
{
/*
* A preoperation plugin failure will abort the
* entire operation.
...
...
@@ -378,7 +378,7 @@ do_modrdn(
}
#if defined( LDAP_SLAPI )
if
(
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_MODRDN_FN
,
pb
)
!=
0
)
{
if
(
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_MODRDN_FN
,
pb
)
<
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
OPERATION
,
INFO
,
"do_modrdn: modrdn postoperation plugins "
"failed
\n
"
,
0
,
0
,
0
);
...
...
servers/slapd/search.c
View file @
3aabc4ed
...
...
@@ -448,7 +448,7 @@ static int doPreSearchPluginFNs( Operation *op )
int
rc
;
rc
=
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_PRE_SEARCH_FN
,
op
->
o_pb
);
if
(
rc
!=
0
)
{
if
(
rc
<
0
)
{
/*
* A preoperation plugin failure will abort the
* entire operation.
...
...
@@ -494,7 +494,7 @@ static int doSearchRewriteFNs( Operation *op )
static
void
doPostSearchPluginFNs
(
Operation
*
op
)
{
if
(
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_SEARCH_FN
,
op
->
o_pb
)
!=
0
)
{
if
(
doPluginFNs
(
op
->
o_bd
,
SLAPI_PLUGIN_POST_SEARCH_FN
,
op
->
o_pb
)
<
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
OPERATION
,
INFO
,
"doPostSearchPluginFNs: search postoperation plugins "
"failed
\n
"
,
0
,
0
,
0
);
...
...
servers/slapd/slapi/plugin.c
View file @
3aabc4ed
...
...
@@ -637,6 +637,8 @@ doPluginFNs(
* failure (confirmed with SLAPI specification).
*/
if
(
!
SLAPI_PLUGIN_IS_POST_FN
(
funcType
)
&&
rc
!=
0
)
{
/* make sure errors are negative */
if
(
rc
>
0
)
rc
=
0
-
rc
;
break
;
}
}
...
...
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