diff options
author | Stef Walter <stef@memberwebs.com> | 2009-07-28 23:01:13 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2009-07-28 23:01:13 +0000 |
commit | 3283d3ea13b72ff25ecf67972916ef82b83ab791 (patch) | |
tree | aeffff713cc920af0ec9b1cebf75851b80d5e169 /plugin | |
parent | beeb7e0f5229625cdbf0558d59eaa09acaaab5d2 (diff) |
Basic build working
git-svn-id: http://internal-svn-server/svn/network/slapi-suffix@1509 96c7dce7-e4ff-0310-afa0-05b99c2e9643
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/plugin.c | 49 | ||||
-rw-r--r-- | plugin/plugin.h | 4 |
2 files changed, 8 insertions, 45 deletions
diff --git a/plugin/plugin.c b/plugin/plugin.c index 76a493d..63158a3 100644 --- a/plugin/plugin.c +++ b/plugin/plugin.c @@ -148,47 +148,12 @@ lowercase (char *data) * OPERATIONS */ -static char* -dn_build_normalize (const char *dn, const char *rdn) -{ - char *result; - Slapi_DN *sdn; - Slapi_DN *parent; - Slapi_RDN *srdn; - - /* Get the parent of the dn */ - sdn = slapi_sdn_new_dn_byval (dn); - return_val_if_fail (sdn, NULL); - parent = slapi_sdn_new (); - slapi_sdn_get_parent (sdn, parent); - - /* Add the rdn to the parent */ - srdn = slapi_rdn_new_dn (rdn); - return_val_if_fail (srdn, NULL); - slapi_sdn_add_rdn (parent, srdn); - - /* Get the result out */ - result = (char*)slapi_sdn_get_dn (parent); - return_val_if_fail (result, NULL); - - /* Normalize the result */ - result = slapi_ch_strdup (result); - slapi_dn_normalize_case (result); - - slapi_sdn_free (&sdn); - slapi_rdn_free (&srdn); - slapi_sdn_free (&parent); - - trace (result); - return result; -} - static int pre_modify (Slapi_PBlock *pb) { LDAPMod **mods; char *dn; - int rc, code; + int rc; return_val_if_fail (pb, -1); @@ -202,7 +167,7 @@ pre_modify (Slapi_PBlock *pb) return_val_if_fail (rc >= 0 && mods, -1); /* Send off to components */ - rc = serial_pre_modify (dn, mods); + rc = suffix_pre_modify (dn, mods); slapi_ch_free_string (&dn); return rc; @@ -229,7 +194,7 @@ pre_add (Slapi_PBlock *pb) slapi_dn_normalize_case (dn); /* Send off to components */ - rc = serial_post_add (dn); + rc = suffix_pre_add (dn); slapi_ch_free_string (&dn); return rc; @@ -308,15 +273,13 @@ plugin_init (Slapi_PBlock *pb) } /* Setup the entry add/mobify functions */ - if (slapi_pblock_set (pb, SLAPI_PLUGIN_PRE_ADD_FN, (void*)post_add) != 0 || - slapi_pblock_set (pb, SLAPI_PLUGIN_PRE_MODIFY_FN, (void*)post_modify) != 0) { + if (slapi_pblock_set (pb, SLAPI_PLUGIN_PRE_ADD_FN, (void*)pre_add) != 0 || + slapi_pblock_set (pb, SLAPI_PLUGIN_PRE_MODIFY_FN, (void*)pre_modify) != 0) { log_plugin ("error registering plugin hooks"); return -1; } -#ifdef _DEBUG - log_trace ("%s initialized", PLUGIN_NAME); -#endif + trace (PLUGIN_NAME " initialized"); return 0; } diff --git a/plugin/plugin.h b/plugin/plugin.h index cdd15ad..6ca89cf 100644 --- a/plugin/plugin.h +++ b/plugin/plugin.h @@ -86,7 +86,7 @@ void lowercase (char *data); int suffix_init (void); void suffix_destroy (void); int suffix_config (const char *name, const char *value); -void suffix_pre_add (const char *dn); -void suffix_pre_modify (const char *dn, LDAPMod **mods); +int suffix_pre_add (const char *dn); +int suffix_pre_modify (const char *dn, LDAPMod **mods); #endif /*PLUGIN_H_*/ |