summaryrefslogtreecommitdiffstats
path: root/src/back-shr.c
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2012-01-10 19:20:51 -0500
committerNalin Dahyabhai <nalin@redhat.com>2012-01-10 19:20:51 -0500
commit04aaf87f7629cc74d86632a20e4b751ec4ea5641 (patch)
treeea75a1ffd5987320688dbc27e061f2aa96792174 /src/back-shr.c
parent98a8e863f8600dcb0a861ade6e57e0dccacd2408 (diff)
downloadslapi-nis-04aaf87f7629cc74d86632a20e4b751ec4ea5641.tar.gz
slapi-nis-04aaf87f7629cc74d86632a20e4b751ec4ea5641.tar.xz
slapi-nis-04aaf87f7629cc74d86632a20e4b751ec4ea5641.zip
- be more careful when logging the names of callback entries
Diffstat (limited to 'src/back-shr.c')
-rw-r--r--src/back-shr.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/back-shr.c b/src/back-shr.c
index e75a26b..b34797d 100644
--- a/src/back-shr.c
+++ b/src/back-shr.c
@@ -1462,6 +1462,7 @@ static int
backend_shr_add_cb(Slapi_PBlock *pb)
{
struct backend_add_entry_cbdata cbdata;
+ char *dn;
/* If we somehow recursed here from ourselves, just bail. */
if (wrap_get_call_level() > 0) {
@@ -1475,10 +1476,10 @@ backend_shr_add_cb(Slapi_PBlock *pb)
return 0;
}
slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &cbdata.e);
- cbdata.ndn = slapi_entry_get_ndn(cbdata.e);
+ slapi_pblock_get(pb, SLAPI_ADD_TARGET, &dn);
cbdata.pb = pb;
slapi_log_error(SLAPI_LOG_PLUGIN, cbdata.state->plugin_desc->spd_id,
- "added \"%s\"\n", cbdata.ndn);
+ "added \"%s\"\n", dn);
/* Check for NULL entries, indicative of a failure elsewhere (?). */
if (cbdata.e == NULL) {
@@ -1490,6 +1491,7 @@ backend_shr_add_cb(Slapi_PBlock *pb)
return 0;
}
}
+ cbdata.ndn = slapi_entry_get_ndn(cbdata.e);
/* Add map entries which corresponded to this directory server
* entry. */
@@ -1604,6 +1606,7 @@ static int
backend_shr_modify_cb(Slapi_PBlock *pb)
{
Slapi_DN *sdn;
+ char *dn;
struct backend_shr_modify_entry_cbdata cbdata;
/* If we somehow recursed here from ourselves, just bail. */
@@ -1617,14 +1620,14 @@ backend_shr_modify_cb(Slapi_PBlock *pb)
/* The plugin was not actually started. */
return 0;
}
+ slapi_pblock_get(pb, SLAPI_MODIFY_TARGET, &dn);
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);
- cbdata.ndn = slapi_entry_get_ndn(cbdata.e_pre);
cbdata.pb = pb;
cbdata.modlist = NULL;
slapi_log_error(SLAPI_LOG_PLUGIN, cbdata.state->plugin_desc->spd_id,
- "modified \"%s\"\n", cbdata.ndn);
+ "modified \"%s\"\n", dn);
/* Check for NULL entries, indicative of a failure elsewhere (?). */
if (cbdata.e_pre == NULL) {
slapi_log_error(SLAPI_LOG_PLUGIN,
@@ -1638,6 +1641,7 @@ backend_shr_modify_cb(Slapi_PBlock *pb)
"post-modify entry is NULL\n");
return 0;
}
+ cbdata.ndn = slapi_entry_get_ndn(cbdata.e_pre);
cbdata.modlist = backend_shr_mods_as_string(cbdata.mods);
/* Modify map entries which corresponded to this directory server
* entry. */
@@ -1843,6 +1847,7 @@ static int
backend_shr_delete_cb(Slapi_PBlock *pb)
{
struct backend_shr_delete_entry_cbdata cbdata;
+ char *dn;
/* If we somehow recursed here from ourselves, just bail. */
if (wrap_get_call_level() > 0) {
@@ -1856,10 +1861,10 @@ backend_shr_delete_cb(Slapi_PBlock *pb)
return 0;
}
slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &cbdata.e);
- cbdata.ndn = slapi_entry_get_ndn(cbdata.e);
+ slapi_pblock_get(pb, SLAPI_DELETE_TARGET, &dn);
cbdata.pb = pb;
slapi_log_error(SLAPI_LOG_PLUGIN, cbdata.state->plugin_desc->spd_id,
- "deleted \"%s\"\n", cbdata.ndn);
+ "deleted \"%s\"\n", dn);
/* Check for NULL entries, indicative of a failure elsewhere (?). */
if (cbdata.e == NULL) {
slapi_log_error(SLAPI_LOG_PLUGIN,
@@ -1867,6 +1872,7 @@ backend_shr_delete_cb(Slapi_PBlock *pb)
"deleted entry is NULL\n");
return 0;
}
+ cbdata.ndn = slapi_entry_get_ndn(cbdata.e);
/* Remove map entries which corresponded to this directory server
* entry. */
wrap_inc_call_level();