|
|
@@ -1108,13 +1108,15 @@ windows_plugin_add(void **theapi, int maxapi)
|
|
|
while (elem && (elem != &winsync_plugin_list)) {
|
|
|
if (precedence < elem->precedence) {
|
|
|
PR_INSERT_BEFORE(wpi, elem);
|
|
|
+ wpi = NULL; /* owned by list now */
|
|
|
break;
|
|
|
}
|
|
|
elem = PR_NEXT_LINK(elem);
|
|
|
}
|
|
|
- if (elem == &winsync_plugin_list) {
|
|
|
+ if (wpi) { /* was not added - precedence too high */
|
|
|
/* just add to end of list */
|
|
|
PR_INSERT_BEFORE(wpi, elem);
|
|
|
+ wpi = NULL; /* owned by list now */
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -1237,8 +1239,10 @@ windows_plugin_cleanup_agmt(Repl_Agmt *ra)
|
|
|
|
|
|
while (list && !PR_CLIST_IS_EMPTY(list)) {
|
|
|
elem = PR_LIST_HEAD(list);
|
|
|
- PR_REMOVE_LINK(elem);
|
|
|
- slapi_ch_free((void **)&elem);
|
|
|
+ if (elem != list) {
|
|
|
+ PR_REMOVE_LINK(elem);
|
|
|
+ slapi_ch_free((void **)&elem);
|
|
|
+ }
|
|
|
}
|
|
|
slapi_ch_free((void **)&list);
|
|
|
windows_private_set_api_cookie(ra, NULL);
|
|
|
@@ -1686,12 +1690,19 @@ test_winsync_pre_ds_search_all_cb(void *cbdata, const char *agmt_dn,
|
|
|
"--> test_winsync_pre_ds_search_all_cb -- orig filter [%s] -- begin\n",
|
|
|
((filter && *filter) ? *filter : "NULL"));
|
|
|
|
|
|
- /* We only want to grab users from the ds side - no groups */
|
|
|
- slapi_ch_free_string(filter);
|
|
|
- /* maybe use ntUniqueId=* - only get users that have already been
|
|
|
- synced with AD already - ntUniqueId and ntUserDomainId are
|
|
|
- indexed for equality only - need to add presence? */
|
|
|
- *filter = slapi_ch_strdup("(&(objectclass=ntuser)(ntUserDomainId=*))");
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
+ if (filter) {
|
|
|
+ /* We only want to grab users from the ds side - no groups */
|
|
|
+ slapi_ch_free_string(filter);
|
|
|
+ /* maybe use ntUniqueId=* - only get users that have already been
|
|
|
+ synced with AD already - ntUniqueId and ntUserDomainId are
|
|
|
+ indexed for equality only - need to add presence? */
|
|
|
+ *filter = slapi_ch_strdup("(&(objectclass=ntuser)(ntUserDomainId=*))");
|
|
|
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
+ "--> test_winsync_pre_ds_search_all_cb -- new filter [%s]\n",
|
|
|
+ *filter ? *filter : "NULL"));
|
|
|
+ }
|
|
|
+#endif
|
|
|
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_pre_ds_search_all_cb -- end\n");
|
|
|
@@ -1786,13 +1797,12 @@ test_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry,
|
|
|
Slapi_Entry *ad_entry, char **new_dn_string,
|
|
|
const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix)
|
|
|
{
|
|
|
- char **rdns = NULL;
|
|
|
-
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_get_new_ds_user_dn_cb -- old dn [%s] -- begin\n",
|
|
|
*new_dn_string);
|
|
|
|
|
|
- rdns = slapi_ldap_explode_dn(*new_dn_string, 0);
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
+ char **rdns = slapi_ldap_explode_dn(*new_dn_string, 0);
|
|
|
if (!rdns || !rdns[0]) {
|
|
|
slapi_ldap_value_free(rdns);
|
|
|
return;
|
|
|
@@ -1801,6 +1811,7 @@ test_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry,
|
|
|
slapi_ch_free_string(new_dn_string);
|
|
|
*new_dn_string = PR_smprintf("%s,%s", rdns[0], slapi_sdn_get_dn(ds_suffix));
|
|
|
slapi_ldap_value_free(rdns);
|
|
|
+#endif
|
|
|
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_get_new_ds_user_dn_cb -- new dn [%s] -- end\n",
|
|
|
@@ -1914,10 +1925,12 @@ test_winsync_post_ad_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slap
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_post_ad_mod_user_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Result of modifying AD entry [%s] was [%d:%s]\n",
|
|
|
slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result));
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_post_ad_mod_user_cb -- end\n");
|
|
|
|
|
|
@@ -1930,10 +1943,12 @@ test_winsync_post_ad_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Sla
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_post_ad_mod_group_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Result of modifying AD entry [%s] was [%d:%s]\n",
|
|
|
slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result));
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_post_ad_mod_group_cb -- end\n");
|
|
|
|
|
|
@@ -1946,10 +1961,12 @@ test_winsync_post_ds_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slap
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_post_ds_mod_user_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Result of modifying DS entry [%s] was [%d:%s]\n",
|
|
|
slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result));
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_post_ds_mod_user_cb -- end\n");
|
|
|
|
|
|
@@ -1962,10 +1979,12 @@ test_winsync_post_ds_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Sla
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_post_ds_mod_group_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Result of modifying DS entry [%s] was [%d:%s]\n",
|
|
|
slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result));
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_post_ds_mod_group_cb -- end\n");
|
|
|
|
|
|
@@ -1978,10 +1997,12 @@ test_winsync_post_ds_add_user_cb(void *cookie, const Slapi_Entry *rawentry, Slap
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_post_ds_add_user_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Result of adding DS entry [%s] was [%d:%s]\n",
|
|
|
slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result));
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_post_ds_add_user_cb -- end\n");
|
|
|
|
|
|
@@ -1994,10 +2015,12 @@ test_winsync_post_ds_add_group_cb(void *cookie, const Slapi_Entry *rawentry, Sla
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_post_ds_add_group_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Result of adding DS entry [%s] was [%d:%s]\n",
|
|
|
slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result));
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_post_ds_add_group_cb -- end\n");
|
|
|
|
|
|
@@ -2010,11 +2033,13 @@ test_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_pre_ad_add_user_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Adding AD entry [%s] from add of DS entry [%s]\n",
|
|
|
slapi_entry_get_dn(ad_entry), slapi_entry_get_dn(ds_entry));
|
|
|
/* make modifications to ad_entry here */
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_pre_ad_add_user_cb -- end\n");
|
|
|
|
|
|
@@ -2027,11 +2052,13 @@ test_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entr
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_pre_ad_add_group_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Adding AD entry [%s] from add of DS entry [%s]\n",
|
|
|
slapi_entry_get_dn(ad_entry), slapi_entry_get_dn(ds_entry));
|
|
|
/* make modifications to ad_entry here */
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_pre_ad_add_group_cb -- end\n");
|
|
|
|
|
|
@@ -2044,10 +2071,12 @@ test_winsync_post_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entr
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_post_ad_add_user_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Result of adding AD entry [%s] was [%d:%s]\n",
|
|
|
slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result));
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_post_ad_add_user_cb -- end\n");
|
|
|
|
|
|
@@ -2060,10 +2089,12 @@ test_winsync_post_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Ent
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_post_ad_add_group_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Result of adding AD entry [%s] was [%d:%s]\n",
|
|
|
slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result));
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_post_ad_add_group_cb -- end\n");
|
|
|
|
|
|
@@ -2076,10 +2107,12 @@ test_winsync_post_ad_mod_user_mods_cb(void *cookie, const Slapi_Entry *rawentry,
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_post_ad_mod_user_mods_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Result of modifying AD entry [%s] was [%d:%s]\n",
|
|
|
slapi_sdn_get_dn(remote_dn), *result, ldap_err2string(*result));
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_post_ad_mod_user_mods_cb -- end\n");
|
|
|
|
|
|
@@ -2092,10 +2125,12 @@ test_winsync_post_ad_mod_group_mods_cb(void *cookie, const Slapi_Entry *rawentry
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"--> test_winsync_post_ad_mod_group_mods_cb -- begin\n");
|
|
|
|
|
|
+#ifdef THIS_IS_JUST_AN_EXAMPLE
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"Result of modifying AD entry [%s] was [%d:%s]\n",
|
|
|
slapi_sdn_get_dn(remote_dn), *result, ldap_err2string(*result));
|
|
|
-
|
|
|
+#endif
|
|
|
+
|
|
|
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
|
|
|
"<-- test_winsync_post_ad_mod_group_mods_cb -- end\n");
|
|
|
|