diff options
author | Nalin Dahyabhai <nalin@redhat.com> | 2013-04-04 16:30:21 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin@redhat.com> | 2013-04-04 16:30:21 -0400 |
commit | b8ced4715b2fcc3921504b43b85268aa7b09c2f5 (patch) | |
tree | 56f9b1e8052402e9689ee46f86cf84c256c643c0 /src/back-shr.c | |
parent | 4f13ba5eb7712a831de2e3e3bb1b398a8d30387f (diff) | |
download | slapi-nis-b8ced4715b2fcc3921504b43b85268aa7b09c2f5.tar.gz slapi-nis-b8ced4715b2fcc3921504b43b85268aa7b09c2f5.tar.xz slapi-nis-b8ced4715b2fcc3921504b43b85268aa7b09c2f5.zip |
check SLAPI_PLUGIN_OPRETURN values
Check for SLAPI_PLUGIN_OPRETURN values before we do anything, in case
there's an error from the backend operation, where the server calls the
postop plugins anyway.
Diffstat (limited to 'src/back-shr.c')
-rw-r--r-- | src/back-shr.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/back-shr.c b/src/back-shr.c index e238a19..7d9de85 100644 --- a/src/back-shr.c +++ b/src/back-shr.c @@ -1540,6 +1540,7 @@ backend_shr_add_cb(Slapi_PBlock *pb) struct backend_add_entry_cbdata cbdata; struct backend_set_config_entry_add_cbdata set_cbdata; char *dn; + int rc; /* If we somehow recursed here from ourselves, just bail. */ if (wrap_get_call_level() > 0) { @@ -1554,6 +1555,12 @@ backend_shr_add_cb(Slapi_PBlock *pb) } slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &cbdata.e); slapi_pblock_get(pb, SLAPI_ADD_TARGET, &dn); + slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &rc); + if (rc != 0) { + /* The requested add operation failed, but after the ACL + * check?. */ + return 0; + } cbdata.pb = pb; slapi_log_error(SLAPI_LOG_PLUGIN, cbdata.state->plugin_desc->spd_id, "added \"%s\"\n", dn); @@ -1936,6 +1943,7 @@ backend_shr_modify_cb(Slapi_PBlock *pb) char *dn, *log_modlist; struct backend_shr_modify_entry_cbdata cbdata; struct backend_set_config_entry_add_cbdata set_cbdata; + int rc; /* If we somehow recursed here from ourselves, just bail. */ if (wrap_get_call_level() > 0) { @@ -1952,6 +1960,12 @@ backend_shr_modify_cb(Slapi_PBlock *pb) slapi_pblock_get(pb, SLAPI_MODIFY_MODS, &cbdata.mods); slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &cbdata.e_pre); slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &cbdata.e_post); + slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &rc); + if (rc != 0) { + /* The requested add operation failed, but after the ACL + * check?. */ + return 0; + } cbdata.pb = pb; cbdata.modlist = NULL; slapi_log_error(SLAPI_LOG_PLUGIN, cbdata.state->plugin_desc->spd_id, @@ -2254,6 +2268,7 @@ backend_shr_delete_cb(Slapi_PBlock *pb) { struct backend_shr_delete_entry_cbdata cbdata; char *dn; + int rc; /* If we somehow recursed here from ourselves, just bail. */ if (wrap_get_call_level() > 0) { @@ -2268,6 +2283,12 @@ backend_shr_delete_cb(Slapi_PBlock *pb) } slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &cbdata.e); slapi_pblock_get(pb, SLAPI_DELETE_TARGET, &dn); + slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &rc); + if (rc != 0) { + /* The requested modify operation failed, but after the ACL + * check?. */ + return 0; + } cbdata.pb = pb; slapi_log_error(SLAPI_LOG_PLUGIN, cbdata.state->plugin_desc->spd_id, "deleted \"%s\"\n", dn); |