Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 317429 Details for
Bug 457846
The Windows Sync API should have plug-in points
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
diffs - part2
cvsdiffs (text/plain), 11.90 KB, created by
Rich Megginson
on 2008-09-23 01:56:14 UTC
(
hide
)
Description:
diffs - part2
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2008-09-23 01:56:14 UTC
Size:
11.90 KB
patch
obsolete
>Index: ldapserver/ldap/servers/plugins/replication/windows_private.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_private.c,v >retrieving revision 1.20 >diff -u -8 -r1.20 windows_private.c >--- ldapserver/ldap/servers/plugins/replication/windows_private.c 27 Aug 2008 21:46:56 -0000 1.20 >+++ ldapserver/ldap/servers/plugins/replication/windows_private.c 23 Sep 2008 01:55:13 -0000 >@@ -1136,50 +1136,54 @@ > (*thefunc)(windows_private_get_api_cookie(ra), rawentry, ad_entry, > new_dn_string, ds_suffix, ad_suffix); > > return; > } > > void > winsync_plugin_call_pre_ad_mod_user_mods_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry, >- const Slapi_DN *local_dn, LDAPMod * const *origmods, >+ const Slapi_DN *local_dn, >+ const Slapi_Entry *ds_entry, >+ LDAPMod * const *origmods, > Slapi_DN *remote_dn, LDAPMod ***modstosend) > { > winsync_pre_ad_mod_mods_cb thefunc = > (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_USER_MODS_CB]) ? > (winsync_pre_ad_mod_mods_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_USER_MODS_CB] : > NULL; > > if (!thefunc) { > return; > } > > (*thefunc)(windows_private_get_api_cookie(ra), rawentry, local_dn, >- origmods, remote_dn, modstosend); >+ ds_entry, origmods, remote_dn, modstosend); > > return; > } > > void > winsync_plugin_call_pre_ad_mod_group_mods_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry, >- const Slapi_DN *local_dn, LDAPMod * const *origmods, >+ const Slapi_DN *local_dn, >+ const Slapi_Entry *ds_entry, >+ LDAPMod * const *origmods, > Slapi_DN *remote_dn, LDAPMod ***modstosend) > { > winsync_pre_ad_mod_mods_cb thefunc = > (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_GROUP_MODS_CB]) ? > (winsync_pre_ad_mod_mods_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_GROUP_MODS_CB] : > NULL; > > if (!thefunc) { > return; > } > > (*thefunc)(windows_private_get_api_cookie(ra), rawentry, local_dn, >- origmods, remote_dn, modstosend); >+ ds_entry, origmods, remote_dn, modstosend); > > return; > } > > int > winsync_plugin_call_can_add_entry_to_ad_cb(const Repl_Agmt *ra, const Slapi_Entry *local_entry, > const Slapi_DN *remote_dn) > { >Index: ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v >retrieving revision 1.40 >diff -u -8 -r1.40 windows_protocol_util.c >--- ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c 27 Aug 2008 21:46:56 -0000 1.40 >+++ ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c 23 Sep 2008 01:55:14 -0000 >@@ -805,19 +805,34 @@ > return pw_return; > } > > static int > send_accountcontrol_modify(Slapi_DN *sdn, Private_Repl_Protocol *prp) > { > ConnResult mod_return = 0; > Slapi_Mods smods = {0}; >+ Slapi_Entry *remote_entry = NULL; >+ int retval; >+ unsigned long acctval = 0; >+ char acctvalstr[32]; >+ >+ /* have to first retrieve the existing entry - userAccountControl is >+ a bit array, and we must preserve the existing values if any */ >+ /* Get the remote entry */ >+ retval = windows_get_remote_entry(prp, sdn, &remote_entry); >+ if (0 == retval && remote_entry) { >+ acctval = slapi_entry_attr_get_ulong(remote_entry, "userAccountControl"); >+ } >+ slapi_entry_free(remote_entry); >+ acctval |= 0x0200; /* normal account == 512 */ > > slapi_mods_init (&smods, 0); >- slapi_mods_add_string(&smods, LDAP_MOD_REPLACE, "userAccountControl", "512"); >+ PR_snprintf(acctvalstr, sizeof(acctvalstr), "%lu", acctval); >+ slapi_mods_add_string(&smods, LDAP_MOD_REPLACE, "userAccountControl", acctvalstr); > > mod_return = windows_conn_send_modify(prp->conn, slapi_sdn_get_dn(sdn), slapi_mods_get_ldapmods_byref(&smods), NULL, NULL ); > > slapi_mods_done(&smods); > return mod_return; > } > > static int >@@ -1204,23 +1219,25 @@ > { > LDAPMod **mapped_mods = NULL; > > windows_map_mods_for_replay(prp,op->p.p_modify.modify_mods, &mapped_mods, is_user, &password); > if (is_user) { > winsync_plugin_call_pre_ad_mod_user_mods_cb(prp->agmt, > windows_private_get_raw_entry(prp->agmt), > local_dn, >+ local_entry, > op->p.p_modify.modify_mods, > remote_dn, > &mapped_mods); > } else if (is_group) { > winsync_plugin_call_pre_ad_mod_group_mods_cb(prp->agmt, > windows_private_get_raw_entry(prp->agmt), > local_dn, >+ local_entry, > op->p.p_modify.modify_mods, > remote_dn, > &mapped_mods); > } > > /* It's possible that the mapping process results in an empty mod list, in which case we don't bother with the replay */ > if ( mapped_mods == NULL || *(mapped_mods)== NULL ) > { >Index: ldapserver/ldap/servers/plugins/replication/windowsrepl.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windowsrepl.h,v >retrieving revision 1.16 >diff -u -8 -r1.16 windowsrepl.h >--- ldapserver/ldap/servers/plugins/replication/windowsrepl.h 27 Aug 2008 21:46:56 -0000 1.16 >+++ ldapserver/ldap/servers/plugins/replication/windowsrepl.h 23 Sep 2008 01:55:14 -0000 >@@ -144,18 +144,18 @@ > void winsync_plugin_call_pre_ds_add_user_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry); > void winsync_plugin_call_pre_ds_add_group_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry); > > void winsync_plugin_call_get_new_ds_user_dn_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, > char **new_dn_string, const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix); > void winsync_plugin_call_get_new_ds_group_dn_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, > char **new_dn_string, const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix); > >-void winsync_plugin_call_pre_ad_mod_user_mods_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend); >-void winsync_plugin_call_pre_ad_mod_group_mods_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend); >+void winsync_plugin_call_pre_ad_mod_user_mods_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend); >+void winsync_plugin_call_pre_ad_mod_group_mods_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend); > > int winsync_plugin_call_can_add_entry_to_ad_cb(const Repl_Agmt *ra, const Slapi_Entry *local_entry, const Slapi_DN *remote_dn); > void winsync_plugin_call_begin_update_cb(const Repl_Agmt *ra, const Slapi_DN *ds_subtree, > const Slapi_DN *ad_subtree, int is_total); > void winsync_plugin_call_end_update_cb(const Repl_Agmt *ra, const Slapi_DN *ds_subtree, > const Slapi_DN *ad_subtree, int is_total); > void winsync_plugin_call_destroy_agmt_cb(const Repl_Agmt *ra, > const Slapi_DN *ds_subtree, >@@ -205,9 +205,8 @@ > ++windows_conn_get_search_result > windows_dirsync_inc_run > > > windows_inc_protocol > ++send_updates > ++++windows_replay_update > */ >-/* #define WINSYNC_TEST 1 */ /* fake ad is really just a regular ds */ >Index: ldapserver/ldap/servers/plugins/replication/winsync-plugin.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/winsync-plugin.h,v >retrieving revision 1.2 >diff -u -8 -r1.2 winsync-plugin.h >--- ldapserver/ldap/servers/plugins/replication/winsync-plugin.h 27 Aug 2008 21:46:56 -0000 1.2 >+++ ldapserver/ldap/servers/plugins/replication/winsync-plugin.h 23 Sep 2008 01:55:14 -0000 >@@ -134,26 +134,27 @@ > const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix); > #define WINSYNC_PLUGIN_GET_NEW_DS_USER_DN_CB 12 > #define WINSYNC_PLUGIN_GET_NEW_DS_GROUP_DN_CB 13 > /* > * These callbacks are called when a mod operation is going to be replayed > * to AD. This case is different than the pre add or pre mod callbacks > * above because in this context, we may only have the list of modifications > * and the DN to which the mods were applied. >- * rawentry - the raw AD entry, read directly from AD - may be NULL >+ * rawentry - the raw AD entry, read directly from AD - may be NULL > * local_dn - the original local DN used in the modification >+ * ds_entry - the current DS entry that has the operation nsUniqueID > * origmods - the original mod list > * remote_dn - this is the DN which will be used with the remote modify operation > * to AD - the winsync code may have already attempted to calculate its value > * modstosend - this is the list of modifications which will be sent - the winsync > * code will already have done its default mapping to these values > * > */ >-typedef void (*winsync_pre_ad_mod_mods_cb)(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend); >+typedef void (*winsync_pre_ad_mod_mods_cb)(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend); > #define WINSYNC_PLUGIN_PRE_AD_MOD_USER_MODS_CB 14 > #define WINSYNC_PLUGIN_PRE_AD_MOD_GROUP_MODS_CB 15 > > /* > * Callbacks used to determine if an entry should be added to the > * AD side if it does not already exist. > * local_entry - the candidate entry to test > * remote_DN - the candidate remote entry to add >@@ -398,30 +399,32 @@ > slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, > "<-- test_winsync_get_new_ds_group_dn_cb -- end\n"); > > return; > } > > static void > test_winsync_pre_ad_mod_user_mods_cb(void *cbdata, const Slapi_Entry *rawentry, >+ const Slapi_Entry *ds_entry, > const Slapi_DN *local_dn, LDAPMod * const *origmods, > Slapi_DN *remote_dn, LDAPMod ***modstosend) > { > slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, > "--> test_winsync_pre_ad_mod_user_mods_cb -- begin\n"); > > slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, > "<-- test_winsync_pre_ad_mod_user_mods_cb -- end\n"); > > return; > } > > static void > test_winsync_pre_ad_mod_group_mods_cb(void *cbdata, const Slapi_Entry *rawentry, >+ const Slapi_Entry *ds_entry, > const Slapi_DN *local_dn, LDAPMod * const *origmods, > Slapi_DN *remote_dn, LDAPMod ***modstosend) > { > slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, > "--> test_winsync_pre_ad_mod_group_mods_cb -- begin\n"); > > slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name, > "<-- test_winsync_pre_ad_mod_group_mods_cb -- end\n");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 457846
:
313410
|
313411
|
313466
|
313487
|
315142
|
315153
|
316473
| 317429 |
317534
|
317540
|
317614
|
317626
|
317628