summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/replication/windows_connection.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug 634561 - Server crushes when using Windows Sync AgreementRich Megginson2010-09-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=634561 Resolves: bug 634561 Bug Description: Server crushes when using Windows Sync Agreement Reviewed by: ??? Branch: master Fix Description: The regular replication protocol and the windows sync protocol have two completely different struct repl_connection. They are almost the same, almost identical fields, but they are different. When additional fields were added to the struct repl_connection, not at the end of the structure, and identical changes were not made to the struct repl_connection in windows_connection.c, the structures got out of sync. The authors tried to anticipate this condition by providing windows_ versions of all of the conn_ functions. We were not using the windows_ versions of these functions in all places in the winsync code. The fix is to use the windows_ versions of these functions throughout the winsync code, and to make the struct repl_connection the same size up through the char *plain field. If additional fields are added to either structure at the end, this problem should not occur in the future. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no (cherry picked from commit 4bd78323d0bb1299a19e0ed1feebc79ff997c92f)
* Bug 630094 - (cov#15452) Remove NULL checking for op_stringNathan Kinder2010-09-091-26/+27
| | | | | | | | | | | There is no chance for op_string to be NULL if "rc == LDAP_SUCCESS" since op_string is set for all operation types in the switch statement, which is the only place that rc can be set to something other that the value of -1 that it is initialized to. We can just skip the NULL checking for op_string in the calls to slapi_log_error(). I also fixed the indentation to help me read the code easier.
* Bug 630096 - (cov#11778) check return value of ldap_parse_resultNathan Kinder2010-09-081-2/+15
| | | | | | | | | We were not checking the return value of ldap_parse_result in the windows_check_user_password() function. The old code was a bit unclear about setting rc when we encountered errors from ldap_result(). It also was calling ldap_parse_result() even if ldap_result() encountered an error. I fixed this code to be a bit more straightforward.
* Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues ↵Endi S. Dewata2010-08-231-0/+7
| | | | | | | | | 11940 - 12166 https://bugzilla.redhat.com/show_bug.cgi?id=611790 Resolves: bug 611790 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166 Fix description: Catch possible NULL pointer in windows_search_entry_ext().
* Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093Endi S. Dewata2010-08-191-15/+12
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=617630 Resolves: bug 617630 Bug description: fix coverify Defect Type: Resource leaks issues CID 12052 description: Fixed resource leaks in windows_conn_connect().
* Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053Endi S. Dewata2010-08-191-0/+1
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=619122 Resolves: bug 619122 Bug description: fix coverify Defect Type: Resource leaks issues CID 12027. description: The windows_conn_new() has been modified to release rpc when an error occurs.
* 610281 - fix coverity Defect Type: Control flow issuesNoriko Hosoi2010-07-231-1/+1
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=610281 11813 DEADCODE Triaged Unassigned Bug Minor Fix Required send_dirsync_search() ds/ldap/servers/plugins/replication/windows_connection.c Comment: op_string points to a static string: 731 op_string = "search"; We don't need to check op_string in slapi_log_error.
* Bug 611850 - fix coverity Defect Type: Error handling issuesRich Megginson2010-07-061-2/+18
| | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=611850 Resolves: bug 611850 Bug Description: fix coverity Defect Type: Error handling issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Check the error return from the functions. In some cases, I was able to figure out that the calling function should perform additional error handling (return early, goto error label), but in general the code just logs an appropriate error message and continues. I was able to get rid of some more libacl code. I removed an unused variable from modify.c Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Bug 610177 - fix coverity Defect Type: Uninitialized variables issuesRich Megginson2010-07-061-2/+2
| | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=610177 Resolves: bug 610177 Bug Description: fix coverity Defect Type: Uninitialized variables issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Initialize variables to 0, NULL, or an appropriate error code. Got rid of the unused lexer code. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* several spelling errors389-ds-base-1.2.6.a1Rich Megginson2010-01-251-2/+2
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=558518 Resolves: bug 558518 Bug Description: several spelling errors Reviewed by: ??? Branch: HEAD Fix Description: Fix several spelling errors in error messages and man pages. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Allow modrdn to move subtree and rename non-leaf nodeNoriko Hosoi2010-01-221-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | This patch includes - replacing the entrydn index with the entryrdn index - replacing a full DN in each entry in the DB with an RDN - extending Slapi_Entry, entry2str, and str2entry to absorb the changes made on the entry - adding DN/RDN helper functions - adding DN cache - adding a utility and a migration script to convert the DN format database to the RDN format - extending a database dump utility dbscan to support the entryrdn - slapi_dn_syntax_check by nkinder@redhat.com is added to check the dn before modify operations - big fix for 171338 - Enhancement: winsync modrdn not synced In addition to the above, compile warnings and memory leaks found in testing the new feature are fixed. For more details, see the feature design document at: http://directory.fedoraproject.org/wiki/Subtree_Rename and bugzilla at: https://bugzilla.redhat.com/show_bug.cgi?id=171338
* Password replication from 389DS to AD failsRich Megginson2010-01-041-1/+1
| | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=537956 Resolves: bug 537956 Bug Description: Password replication from 389DS to AD2008(64bit) fails, all other replication continues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Broken during adding support for openldap API. I added the function slapi_ldap_bind which returns the result code. The old function being used by the winsync code expected the function to return the msgid, which is now returned as one of the function arguments instead. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* OpenLDAP supportcleanupRich Megginson2009-07-071-14/+23
| | | | | | | | | | These changes allow the server to be built with OpenLDAP (2.4.17+). A brief summary of the changes: * #defines not provided by OpenLDAP were copied into slapi-plugin.h and protected with #ifndef blocks * where it made sense, I created slapi wrapper functions for things like URL and LDIF processing to abstract way the differences in the APIs * I created a new file utf8.c which contains the UTF8 functions from MozLDAP - this is only compiled when using OpenLDAP * I tried to clean up the code - use the _ext versions of LDAP functions everywhere since the older versions should be considered deprecated * I removed some unused code NOTE that this should still be considered a work in progress since it depends on functionality not yet present in a released version of OpenLDAP, for NSS crypto and for the LDIF public API.
* Resolves: bug 454030Rich Megginson2008-12-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Bug Description: Need to address 64-bit compiler warnings - again Reviewed by: nhosoi (Thanks!) Fix Description: This patch cleans up most of the other remaining compiler warnings. I compiled the directory server code with these flags on RHEL5 x86_64: -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic I also enabled argument/format match checking for most of the commonly used varadic functions. Most of the problems I found fell into these categories: 1) Too many or not enough arguments e.g. most everything that uses or did use LDAPDebug had extra 0,0 arguments. If they had been switched to use slapi_log_error, I removed the extra arguments - for those places still using LDAPDebug, I introduced more macros to handle the number of arguments, since C macros cannot be varadic. 2) When using NSPR formatting functions, we have to use %llu or %lld for 64-bit values, even on 64-bit systems. However, for regular system formatting functions, we have to use %ld or %lu. I introduced two new macros NSPRIu64 and NSPRI64 to handle cases where we are passing explicit 64-bit values to NSPR formatting functions, so that we can use the regular PRIu64 and PRI64 macros for regular system formatting functions. I also made sure we used NSPRI* only with NSPR functions, and used PRI* only with system functions. 3) use %lu for size_t and %ld for time_t I did find a few "real" errors, places that the code was doing something definitely not right: https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/acl/aclinit.c_sec4 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/acl/acllas.c_sec17 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/http/http_impl.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/memberof/memberof.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/pam_passthru/pam_ptimpl.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/cl5_api.c_sec5 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/cl5_clcache.c_sec2 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/replutil.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/libglobs.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/back-ldbm/dbverify.c_sec2 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/back-ldbm/ldif2ldbm.c_sec3 This is why it's important to use this compiler checking, and why it's important to fix compiler warnings, if for no other reason than the sheer noise from so many warnings can mask real errors. Platforms tested: RHEL5 Flag Day: no Doc impact: no
* Resolves: bug 469261Rich Megginson2008-12-021-16/+11
| | | | | | | | | | | | | Bug Description: Support server-to-server SASL - console chaining, server cleanup Reviewed by: nkinder (Thanks!) Fix Description: There are two sets of diffs here. The first set adds tls, gssapi, and digest to the chaining database (aka database link) panels in the console. I had to add support for revert to some of the code to make the Reset button work without having to retrieve the values from the server each time. We already store the original values locally in the _origModel - I added code to allow the use of that in the Reset button. The second set of diffs is for the server. 1) I had to add support for "SIMPLE" for bindMechanism - this translates to LDAP_SASL_SIMPLE for the actual mechanism. This value is NULL, so I had to add handling for NULL values in the cb config code (slapi_ch_* work fine with NULL values). 2) Added some more debugging/tracing code 3) The server to server SSL code would only work if the server were configured to be an SSL server. But for the server to be an SSL client, it only needs NSS initialized and to have the CA cert. It also needs to configured some of the SSL settings and install the correct policy. I changed the server code to do this. Platforms tested: RHEL5 Flag Day: no Doc impact: Yes
* Resolves: bug 469261Rich Megginson2008-11-101-117/+65
| | | | | | | | | | Bug Description: Support server-to-server SASL - part 4 - pta, winsync Reviewed by: nhosoi (Thanks!) Fix Description: Allow pass through auth (PTA) to use starttls. PTA uses the old style argv config params, so I just added an optional starttls (0, 1) to the end of the list, since there is currently no way to encode the startTLS extop in the LDAP URL. NOTE: adding support for true pass through auth for sasl or external cert auth will require a lot of work - not sure it's worth it - anyone other than console users can use chaining backend instead. For windows sync, I just ported the same slapi_ldap_init/slapi_ldap_bind changes made to regular replication to the windows specific code. The Windows code still needs the do_simple_bind function to check the windows password, but it is not used for server to server bind anymore. NOTE: Windows does support startTLS, but I did not test the SASL mechanisms with Windows. Platforms tested: Fedora 9 Flag Day: no Doc impact: yes
* Resolves: bug 457846Rich Megginson2008-08-271-6/+6
| | | | | | | | | | | | | Bug Description: The Windows Sync API should have plug-in points Reviewed by: nkinder (Thanks!) Fix Description: Some additional changes to the api 1) added plugin points for begin update, end update, and agreement destruction 2) added debugging code to allow a regular DS to stand in for AD 3) fixed a couple of minor memory leaks 4) added the rest of the SLAPI DSE code to the public API to allow plugins to do dynamic configuration using the SLAPI public API Platforms tested: RHEL5 Flag Day: no Doc impact: yes - plugin guide
* Resolves: bug 457846Rich Megginson2008-08-051-42/+90
| | | | | | | | | | | | | | | Bug Description: The Windows Sync API should have plug-in points Reviewed by: nkinder (Thanks!) Fix Description: Several plug-in points have been added to the windows sync code, available to regular plug-ins that register with the winsync api via the slapi api broker interface. winsync-plugin.h documents the use of these along with some example plug-in code. The windows private data structure has been extended to add two additional fields: raw_entry - the raw entry read from AD - this is passed to several plug-in callbacks to allow them to have access to all of the attributes and values in the entry in case further processing is needed. This required a change to the function that reads the entry, to have it save the raw entry read each time from AD, in addition to the "cooked" entry it passes back to the caller. api_cookie - this is the plug-in private data passed back to each plug-in callback and allows the plug-in to specify some additional context Both of these are stored in the private data field in the agreement, so some of the existing functions had to be changed to pass in the connection object or the protocol object in order to gain access to the agreement object. There were several small memory leaks in the existing code that have been fixed - these are the places where a free() function of some sort has been added. Also the usage of slapi_sdn_init_dn_byval leaked - slapi_sdn_new_dn_byval must be used here instead - cannot mix slapi_sdn_new with slapi_sdn_init* I also cleaned up several compiler warnings. The slapi changes are not strictly necessary, but they provide some conveniences to the winsync code and to plug-in writers. The good thing is that they were already private functions, so mostly just needed to have public api wrappers. Platforms tested: RHEL5 Flag Day: no Doc impact: no
* Resolves: #188320Noriko Hosoi2007-10-181-26/+4
| | | | Summary: HP-UX: warnings reported by the HP-UX compiler
* Resolves: 238504Nathan Kinder2007-09-271-0/+28
| | | | Summary: Don't replay AD originated password changes back to AD.
* Resolves: 243227Nathan Kinder2007-09-121-18/+98
| | | | Summary: Handle syncing add opererations that have a ntuniqueid present.
* Resolves: #214533Noriko Hosoi2006-11-101-0/+5
| | | | | | | | | | Summary: configure needs to support --with-fhs (Comment #6) Changes: Added the following include next to the end of the copyright block. + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif +
* Bug(s) fixed: 186280Rich Megginson2006-04-111-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Bug Description: ldapserver: Close potential security vulnerabilities in CGI code Reviewed by: Nathan, Noriko, and Pete (Thanks!) Fix Description: Clean up usage of sprintf, strcpy, fgets instead of gets, fixed buffer usage, etc., mostly in the CGI code and other user facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick to force it to check printf style varargs functions, to check the format string against the argument string, for type mismatches, missing arguments, and too many arguments. In the CGI form argument parsing code, we needed to be more careful about checking for bad input - good input is supposed to look like this: name=value&name=value&..... &name=value. I don't think the original code was checking properly for something like name&name=value. There was another place where we were not checking to see if a buffer had enough room before appending a string to it. I had to change a couple of functions to allow passing in the size of the buffer. Fixed some issues raised by Noriko and Nathan. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
* Bug(s) fixed: 181827Nathan Kinder2006-02-201-1/+13
| | | | | | | | | | | | | | | | | | Bug Description: If you delete an attribute from an entry on AD, the attribute doesn't get deleted on the DS side. The replication code doesn't even notice that the entry changed. Reviewed by: Rich, Noriko, Pete (thanks!) Files: see diffs Branch: HEAD, Directory71Branch Fix Description: The dirsync search control passes back deleted attributes with no values. If you try to add a Slapi_Attr with no values to a Slapi_Entry, it doesn't get added. This fix stuffs the deleted attributes into the deleted attributes list in the Slapi_Entry and checks for them when creating the modification operations to be performed on the local entry. Flag Day: no Doc impact: no QA impact: A regression test needs to be added New Tests integrated into TET: none
* 163064 - It appears that Active Directory has a problem where it allows ↵Nathan Kinder2005-10-271-2/+5
| | | | duplicate values for system-only multivalued attributes. This change just skips the dscorepropagationdata attibute when receiving a change from DirSync.
* also checkin fix for 170350 onto trunkRich Megginson2005-10-211-7/+29
|
* 169954 - Moved illegal declaration to the top of code blockNathan Kinder2005-10-061-1/+3
|
* 169954 - Winsync initialization would hang with certain entries. Fixed ↵Nathan Kinder2005-10-061-2/+11
| | | | improper use of ldap_get_next.
* Fix for #156449 : mangle 'street' attribute to defeat our schema aliasing it ↵David Boreham2005-05-091-1/+10
| | | | with 'streetaddress'
* Fix for 155063: remove error messages due to entry parsing failureDavid Boreham2005-04-271-17/+30
|
* Fixed licensing typoNathan Kinder2005-04-191-1/+3
|
* 155068 - Added license to source filesNathan Kinder2005-04-151-0/+30
|
* Fixes for windows sync for NT4David Boreham2005-04-141-2/+14
|
* New windows sync codeDavid Boreham2005-03-311-39/+252
|
* Updated copyright infoNathan Kinder2005-03-231-2/+2
|
* Merge over new code: fractional replication, wan replication and windows ↵David Boreham2005-03-111-0/+1503
sync plus associated UI