SF.net SVN: gar:[23311] csw/mgar/pkg/389-ds-base/branches/vers1.3.2

cgrzemba at users.sourceforge.net cgrzemba at users.sourceforge.net
Wed Apr 2 16:32:25 CEST 2014


Revision: 23311
          http://sourceforge.net/p/gar/code/23311
Author:   cgrzemba
Date:     2014-04-02 14:32:24 +0000 (Wed, 02 Apr 2014)
Log Message:
-----------
389-ds-base/branches/vers1.3.2: fix problems with 64bit and posix-winsync

Modified Paths:
--------------
    csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile
    csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0014-ldap-include-Makefile.am.patch

Added Paths:
-----------
    csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0019-void-ptr-conntable.c.patch
    csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0020-debug-label-main.c.patch
    csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0021-include-lber.h-slapi-plugin.h.patch
    csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0022-adjust-mozldap-version-sasl_io.c.patch
    csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0023-phtread-include-slapi2nspr.c.patch
    csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0024-strndup.patch
    csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0025-posix-winsync.rawentry.patch
    csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0026-fix-check-memberuid-posix-winsync.c.patch

Modified: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile
===================================================================
--- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile	2014-04-02 13:48:36 UTC (rev 23310)
+++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile	2014-04-02 14:32:24 UTC (rev 23311)
@@ -52,16 +52,21 @@
 PATCHFILES += 0017-disable-asm-for-Sparc.patch
 # probably only with openLDAP 
 PATCHFILES += 0018-correct-64bit-ptr-bind.c
+PATCHFILES += 0021-include-lber.h-slapi-plugin.h.patch
+PATCHFILES += 0022-adjust-mozldap-version-sasl_io.c.patch
+PATCHFILES += 0023-phtread-include-slapi2nspr.c.patch
+PATCHFILES += 0024-strndup.patch
+PATCHFILES += 0025-posix-winsync.rawentry.patch
 PATCHFILES += $(PATCHFILES_$(GARCOMPILER))
 
-
 BUILD_DEP_PKGS += CSWautoconf
 BUILD_DEP_PKGS += CSWautomake
 BUILD_DEP_PKGS += CSWbdb48devel
 BUILD_DEP_PKGS += CSWnspr-dev
 BUILD_DEP_PKGS += CSWlibnss-dev
 BUILD_DEP_PKGS += CSWnetsnmp-dev
-BUILD_DEP_PKGS += CSWopenldap-dev
+# BUILD_DEP_PKGS += CSWopenldap-dev
+BUILD_DEP_PKGS += CSWmozldap-dev
 BUILD_DEP_PKGS += CSWsasl-dev
 BUILD_DEP_PKGS += CSWlibicu-dev
 BUILD_DEP_PKGS += CSWlibsvrcore0-dev
@@ -113,7 +118,7 @@
 
 EXTRA_LIB = /opt/csw/bdb48/lib
 # if use MozillaLDAP remove -I/opt/csw/include because there are OpenLDAP header
-# CPPFLAGS = 
+CPPFLAGS = 
 EXTRA_CFLAGS_SOS12U3 = -xnorunpath
 EXTRA_CXXFLAGS_SOS12U3 = -norunpath
 EXTRA_CPPFLAGS_GCC4 = -DSOLARIS_GCC
@@ -125,12 +130,12 @@
 GARFLAVOR = DBG
 
 CONFIGURE_ARGS = $(DIRPATHS)
-# CONFIGURE_ARGS += --with-ldapsdk-inc=$(includedir)/dirsrv 
-# CONFIGURE_ARGS += --with-ldapsdk-lib=$(libdir)
-## CONFIGURE_ARGS += --with-ldapsdk-bin=$(abspath $(prefix)/dirsrv/bin/$(MM_BINDIR))
+CONFIGURE_ARGS += --with-ldapsdk-inc=$(includedir)/dirsrv 
+CONFIGURE_ARGS += --with-ldapsdk-lib=$(libdir)
+CONFIGURE_ARGS += --with-ldapsdk-bin=$(abspath $(prefix)/dirsrv/bin/$(MM_BINDIR))
 # CONFIGURE_ARGS += --with-ldapsdk-bin=$(bindir)
-CONFIGURE_ARGS += --with-openldap=$(prefix)
-CONFIGURE_ARGS += --with-openldap-inc=$(includedir)
+# CONFIGURE_ARGS += --with-openldap=$(prefix)
+# CONFIGURE_ARGS += --with-openldap-inc=$(includedir)
 CONFIGURE_ARGS += --with-db-inc=$(prefix)/bdb48/include 
 CONFIGURE_ARGS += --with-db-lib=$(abspath $(prefix)/bdb48/lib/$(MM_LIBDIR))
 CONFIGURE_ARGS += --with-icu-inc=$(includedir)

Modified: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0014-ldap-include-Makefile.am.patch
===================================================================
--- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0014-ldap-include-Makefile.am.patch	2014-04-02 13:48:36 UTC (rev 23310)
+++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0014-ldap-include-Makefile.am.patch	2014-04-02 14:32:24 UTC (rev 23311)
@@ -9,3 +9,14 @@
  # We need to make sure that libpthread is linked before libc on HP-UX.
  if HPUX
  AM_LDFLAGS = -lpthread
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1362,7 +1362,7 @@ ldap_agent_bin_SOURCES = ldap/servers/snmp/main.c \
+ 	ldap/servers/snmp/ldap-agent.c \
+ 	ldap/servers/slapd/agtmmap.c
+ 
+-ldap_agent_bin_CPPFLAGS = $(AM_CPPFLAGS) @netsnmp_inc@ @openldap_inc@ @ldapsdk_inc@ @nss_inc@ @nspr_inc@
++ldap_agent_bin_CPPFLAGS = $(AM_CPPFLAGS) @openldap_inc@ @ldapsdk_inc@ @netsnmp_inc@ @nss_inc@ @nspr_inc@
+ ldap_agent_bin_LDADD = $(LDAPSDK_LINK_NOTHR) $(SASL_LINK) $(NSS_LINK) $(NSPR_LINK) $(NETSNMP_LINK) $(THREADLIB)
+ if SOLARIS
+ ldap_agent_bin_LDADD += -lrt

Added: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0019-void-ptr-conntable.c.patch
===================================================================
--- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0019-void-ptr-conntable.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0019-void-ptr-conntable.c.patch	2014-04-02 14:32:24 UTC (rev 23311)
@@ -0,0 +1,18 @@
+--- a/ldap/servers/slapd/conntable.c
++++ b/ldap/servers/slapd/conntable.c
+@@ -50,6 +50,7 @@ connection_table_new(int table_size)
+ 	Connection_Table *ct;
+ 	int i = 0;
+ 	ber_len_t maxbersize = config_get_maxbersize();
++    LBER_SOCKET invalid_socket;
+ 
+ 	ct= (Connection_Table*)slapi_ch_calloc( 1, sizeof(Connection_Table) );
+ 	ct->size= table_size;
+@@ -62,7 +63,6 @@ connection_table_new(int table_size)
+ 	 */
+ 	for ( i = 0; i < table_size; i++ )
+ 	{
+-		LBER_SOCKET invalid_socket;
+ 		/* DBDB---move this out of here once everything works */
+ 		ct->c[i].c_sb = ber_sockbuf_alloc();
+ 		invalid_socket = SLAPD_INVALID_SOCKET;

Added: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0020-debug-label-main.c.patch
===================================================================
--- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0020-debug-label-main.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0020-debug-label-main.c.patch	2014-04-02 14:32:24 UTC (rev 23311)
@@ -0,0 +1,14 @@
+--- a/ldap/servers/slapd/main.c
++++ b/ldap/servers/slapd/main.c
+@@ -124,6 +124,11 @@ static void cmd_set_shutdown(int);
+  * global variables
+  */
+ 
++#if defined(USE_MOZLDAP) && defined(LDAP_DEBUG)
++int ldap_debug = 1;
++int lber_debug = 1;
++#endif
++
+ static int slapd_exemode = SLAPD_EXEMODE_UNKNOWN;
+ 
+ static int init_cmd_shutdown_detect()

Added: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0021-include-lber.h-slapi-plugin.h.patch
===================================================================
--- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0021-include-lber.h-slapi-plugin.h.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0021-include-lber.h-slapi-plugin.h.patch	2014-04-02 14:32:24 UTC (rev 23311)
@@ -0,0 +1,17 @@
+--- a/ldap/servers/slapd/slapi-plugin.h
++++ b/ldap/servers/slapd/slapi-plugin.h
+@@ -7347,14 +7347,6 @@ char **slapi_str2charray_ext( char *str, char *brkstr, int allow_dups );
+ #define LDAP_SASL_EXTERNAL      "EXTERNAL"      /* TLS/SSL extension */
+ #endif
+ 
+-#ifndef LBER_SOCKET
+-#ifdef LBER_SOCKET_T
+-#define LBER_SOCKET LBER_SOCKET_T
+-#else
+-#define LBER_SOCKET int
+-#endif
+-#endif
+-
+ /* Used to make unhashed passwords available to plugins. */
+ #define	PSEUDO_ATTR_UNHASHEDUSERPASSWORD	"unhashed#user#password"
+ 

Added: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0022-adjust-mozldap-version-sasl_io.c.patch
===================================================================
--- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0022-adjust-mozldap-version-sasl_io.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0022-adjust-mozldap-version-sasl_io.c.patch	2014-04-02 14:32:24 UTC (rev 23311)
@@ -0,0 +1,11 @@
+--- a/ldap/servers/slapd/sasl_io.c
++++ b/ldap/servers/slapd/sasl_io.c
+@@ -47,7 +47,7 @@
+ #include <arpa/inet.h>
+ #ifndef USE_OPENLDAP
+ #include "mozldap.h"
+-#if LDAP_VENDOR_VERSION > 604
++#if LDAP_VENDOR_VERSION > 607
+ /* garbage to cause build to fail */
+ MOZLDAP is newer than expected, if the ber structure has not changed
+ (see ldap/server/slapd/mozldap.h), please bump the version number(604 -> new version)

Added: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0023-phtread-include-slapi2nspr.c.patch
===================================================================
--- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0023-phtread-include-slapi2nspr.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0023-phtread-include-slapi2nspr.c.patch	2014-04-02 14:32:24 UTC (rev 23311)
@@ -0,0 +1,13 @@
+--- a/ldap/servers/slapd/slapi2nspr.c
++++ b/ldap/servers/slapd/slapi2nspr.c
+@@ -60,7 +60,9 @@
+  * directly to their NSPR equivalents.  Clever, huh?
+  */
+ 
+-
++#ifdef USE_POSIX_RWLOCKS
++#include <pthread.h>
++#endif
+ /*
+  * ---------------- SLAPI API Functions --------------------------------------
+  */

Added: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0024-strndup.patch
===================================================================
--- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0024-strndup.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0024-strndup.patch	2014-04-02 14:32:24 UTC (rev 23311)
@@ -0,0 +1,27 @@
+--- a/ldap/servers/plugins/automember/automember.c
++++ b/ldap/servers/plugins/automember/automember.c
+@@ -44,7 +44,10 @@
+  */
+ #include "automember.h"
+ 
+-
++#include "plstr.h"
++#ifndef strndup
++#define strndup PL_strndup
++#endif
+ /*
+  * Plug-in globals
+  */
+--- a/ldap/servers/plugins/mep/mep.c
++++ b/ldap/servers/plugins/mep/mep.c
+@@ -39,6 +39,10 @@
+ #  include <config.h>
+ #endif
+ 
++#include "plstr.h"
++#ifndef strndup
++#define strndup PL_strndup
++#endif
+ /*
+  * Managed Entries Plug-in
+  */

Added: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0025-posix-winsync.rawentry.patch
===================================================================
--- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0025-posix-winsync.rawentry.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0025-posix-winsync.rawentry.patch	2014-04-02 14:32:24 UTC (rev 23311)
@@ -0,0 +1,173 @@
+--- a/ldap/servers/plugins/posix-winsync/posix-winsync.c
++++ b/ldap/servers/plugins/posix-winsync/posix-winsync.c
+@@ -372,23 +372,38 @@ sync_acct_disable(void *cbdata, /* the usual domain config data */
+     return;
+ }
+ 
+-/* Returns non-zero if the attribute value sets are identical.  */
++
+ static int
+ attr_compare_equal(Slapi_Attr *a, Slapi_Attr *b)
+ {
+-    int i = 0;
+-    Slapi_Value *va = NULL;
+-
+-    /* Iterate through values in attr a and search for each in attr b */
+-    for (i = slapi_attr_first_value(a, &va); va && (i != -1); i = slapi_attr_next_value(a, i, &va)) {
+-
+-        /* Compare the entire attribute value */
+-        if (slapi_attr_value_find(b, slapi_value_get_berval(va)) != 0) {
+-            return 0;
++	/* For now only handle single values */
++	Slapi_Value *va = NULL;
++	Slapi_Value *vb = NULL;
++	int num_a = 0;
++	int num_b = 0;
++	int match = 1;
++
++	slapi_attr_get_numvalues(a,&num_a);
++	slapi_attr_get_numvalues(b,&num_b);
++
++	if (num_a == num_b) {
++		slapi_attr_first_value(a, &va);
++		slapi_attr_first_value(b, &vb);
++
++		/* If either val is less than n, then check if the length, then values are
++		 * equal.  If both are n or greater, then only compare the first n chars. 
++		 * If n is 0, then just compare the entire attribute. */
++        if (va->bv.bv_len == vb->bv.bv_len) {
++            if (slapi_attr_value_find(b, slapi_value_get_berval(va)) != 0) {
++                match = 0;
++            }
++        } else {
++            match = 0;
+         }
+-    }
+-    return 1;
+-}
++	} else {
++		match = 0;
++	}
++	return match;}
+ 
+ /* look in the parent nodes of ds_entry for nis domain entry */
+ char *
+@@ -777,10 +792,10 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap
+     slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
+                     "--> _pre_ds_mod_user_cb -- begin\n");
+ 
+-    if ((NULL == rawentry) || (NULL == ad_entry) || (NULL == ds_entry)) {
++    if ((NULL == ad_entry) || (NULL == ds_entry)) {
+         slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
+                         "<-- _pre_ds_mod_user_cb -- Empty %s entry.\n",
+-                        (NULL==rawentry)?"rawentry":(NULL==ad_entry)?"ad entry":"ds entry");
++                        (NULL==ad_entry)?"ad entry":"ds entry");
+         return;
+     }
+ 
+@@ -898,7 +913,7 @@ posix_winsync_pre_ds_mod_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap
+         }
+         slapi_value_free(&voc);
+     }
+-    sync_acct_disable(cbdata, rawentry, ds_entry, ACCT_DISABLE_TO_DS, NULL, smods, do_modify);
++    sync_acct_disable(cbdata, ad_entry, ds_entry, ACCT_DISABLE_TO_DS, NULL, smods, do_modify);
+     slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_mod_user_cb %s %s\n",
+                     slapi_sdn_get_dn(slapi_entry_get_sdn_const(ds_entry)), (do_modify) ? "modified"
+                         : "not modified");
+@@ -944,14 +959,16 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla
+                 Slapi_Attr *local_attr = NULL;
+                 char *local_type = NULL;
+ 
+-                slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "1.\n");
++                slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, 
++                                "_pre_ds_mod_group_cb -- found AD attr %s\n", type);
+                 slapi_attr_get_valueset(attr, &vs);
+                 local_type = slapi_ch_strdup(attr_map[i].ldap_attribute_name);
+                 slapi_entry_attr_find(ds_entry, local_type, &local_attr);
+                 is_present_local = (NULL == local_attr) ? 0 : 1;
+                 if (is_present_local) {
+                     int values_equal = 0;
+-                    slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "2.\n");
++                    slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, 
++                                    "_pre_ds_mod_group_cb -- compare with DS attr %s\n", local_type);
+                     values_equal = attr_compare_equal(attr, local_attr);
+                     if (!values_equal) {
+                         slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
+@@ -964,13 +981,13 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla
+                         *do_modify = 1;
+                     }
+                 } else {
+-                    slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "3.\n");
++                    slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb --  add attr\n");
+ 
+                     slapi_mods_add_mod_values(smods, LDAP_MOD_ADD, local_type,
+                                               valueset_get_valuearray(vs));
+                     *do_modify = do_modify_local = 1;
+                 }
+-                slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "4.\n");
++                slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb -- values compared\n");
+ 
+                 slapi_ch_free((void**) &local_type);
+                 slapi_valueset_free(vs);
+@@ -1109,7 +1126,7 @@ posix_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap
+             }
+         }
+     }
+-    sync_acct_disable(cbdata, rawentry, ds_entry, ACCT_DISABLE_TO_DS, ds_entry, NULL, NULL);
++    sync_acct_disable(cbdata, ad_entry, ds_entry, ACCT_DISABLE_TO_DS, ds_entry, NULL, NULL);
+     slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_add_user_cb -- end\n");
+ 
+     return;
+--- a/ldap/servers/plugins/posix-winsync/posix-winsync.c
++++ b/ldap/servers/plugins/posix-winsync/posix-winsync.c
+@@ -68,6 +68,7 @@
+ #include <stdlib.h>
+ #include "posix-wsp-ident.h"
+ #include "posix-group-func.h"
++#include "slap.h"
+ 
+ #define MEMBEROFTASK "memberuid task"
+ Slapi_Value **
+@@ -136,7 +137,7 @@ enum
+  *         -1 - some sort of error
+  */
+ static int
+-check_account_lock(Slapi_Entry *ds_entry, int *isvirt)
++_check_account_lock(Slapi_Entry *ds_entry, int *isvirt)
+ {
+     int rc = 1;
+     Slapi_ValueSet *values = NULL;
+@@ -155,7 +156,7 @@ check_account_lock(Slapi_Entry *ds_entry, int *isvirt)
+         }
+         slapi_ch_free_string(&strval);
+         slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
+-                        "<-- check_account_lock - entry [%s] has real "
++                        "<-- _check_account_lock - entry [%s] has real "
+                             "attribute nsAccountLock and entry %s locked\n",
+                         slapi_entry_get_dn_const(ds_entry), rc ? "is not" : "is");
+         return rc;
+@@ -182,13 +183,13 @@ check_account_lock(Slapi_Entry *ds_entry, int *isvirt)
+             slapi_vattr_values_free(&values, &actual_type_name, attr_free_flags);
+         }
+         slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
+-                        "<-- check_account_lock - entry [%s] has virtual "
++                        "<-- _check_account_lock - entry [%s] has virtual "
+                             "attribute nsAccountLock and entry %s locked\n",
+                         slapi_entry_get_dn_const(ds_entry), rc ? "is not" : "is");
+     } else {
+         rc = 1; /* no attr == entry is enabled */
+         slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
+-                        "<-- check_account_lock - entry [%s] does not "
++                        "<-- _check_account_lock - entry [%s] does not "
+                             "have attribute nsAccountLock - entry is not locked\n",
+                         slapi_entry_get_dn_const(ds_entry));
+     }
+@@ -225,7 +226,7 @@ sync_acct_disable(void *cbdata, /* the usual domain config data */
+     int isvirt = 0;
+ 
+     /* get the account lock state of the ds entry */
+-    if (0 == check_account_lock(ds_entry, &isvirt)) {
++    if (0 == _check_account_lock(ds_entry, &isvirt)) {
+         ds_is_enabled = 0;
+     }
+     if (isvirt)

Added: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0026-fix-check-memberuid-posix-winsync.c.patch
===================================================================
--- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0026-fix-check-memberuid-posix-winsync.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0026-fix-check-memberuid-posix-winsync.c.patch	2014-04-02 14:32:24 UTC (rev 23311)
@@ -0,0 +1,62 @@
+--- a/ldap/servers/plugins/posix-winsync/posix-winsync.c
++++ b/ldap/servers/plugins/posix-winsync/posix-winsync.c
+@@ -373,8 +373,12 @@ sync_acct_disable(void *cbdata, /* the usual domain config data */
+ }
+ 
+ /* Returns non-zero if the attribute value sets are identical.  */
++/* reuse it from windwos_protocol_util.c */
+ static int
+-attr_compare_equal(Slapi_Attr *a, Slapi_Attr *b)
++attr_compare_equal(Slapi_Attr *a, Slapi_Attr *b, int n);
++
++static int
++pw_attr_compare_equal(Slapi_Attr *a, Slapi_Attr *b)
+ {
+     int i = 0;
+     Slapi_Value *va = NULL;
+@@ -944,15 +948,17 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla
+                 Slapi_Attr *local_attr = NULL;
+                 char *local_type = NULL;
+ 
+-                slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "1.\n");
++                slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, 
++                                "_pre_ds_mod_group_cb -- found AD attr %s\n", type);
+                 slapi_attr_get_valueset(attr, &vs);
+                 local_type = slapi_ch_strdup(attr_map[i].ldap_attribute_name);
+                 slapi_entry_attr_find(ds_entry, local_type, &local_attr);
+                 is_present_local = (NULL == local_attr) ? 0 : 1;
+                 if (is_present_local) {
+                     int values_equal = 0;
+-                    slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "2.\n");
+-                    values_equal = attr_compare_equal(attr, local_attr);
++                    slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, 
++                                    "_pre_ds_mod_group_cb -- compare with DS attr %s\n", local_type);
++                    values_equal = attr_compare_equal(attr, local_attr, 0);
+                     if (!values_equal) {
+                         slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
+                                         "_pre_ds_mod_group_cb -- update mods: %s, %s : values are different -> modify\n",
+@@ -964,13 +970,13 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla
+                         *do_modify = 1;
+                     }
+                 } else {
+-                    slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "3.\n");
++                    slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb --  add attr\n");
+ 
+                     slapi_mods_add_mod_values(smods, LDAP_MOD_ADD, local_type,
+                                               valueset_get_valuearray(vs));
+                     *do_modify = do_modify_local = 1;
+                 }
+-                slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "4.\n");
++                slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "_pre_ds_mod_group_cb -- values compared\n");
+ 
+                 slapi_ch_free((void**) &local_type);
+                 slapi_valueset_free(vs);
+@@ -1109,7 +1115,7 @@ posix_winsync_pre_ds_add_user_cb(void *cbdata, const Slapi_Entry *rawentry, Slap
+             }
+         }
+     }
+-    sync_acct_disable(cbdata, rawentry, ds_entry, ACCT_DISABLE_TO_DS, ds_entry, NULL, NULL);
++    sync_acct_disable(cbdata, ad_entry, ds_entry, ACCT_DISABLE_TO_DS, ds_entry, NULL, NULL);
+     slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name, "<-- _pre_ds_add_user_cb -- end\n");
+ 
+     return;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list