SF.net SVN: gar:[23394] csw/mgar/pkg/389-ds-base/trunk

cgrzemba at users.sourceforge.net cgrzemba at users.sourceforge.net
Fri Apr 11 10:57:12 CEST 2014


Revision: 23394
          http://sourceforge.net/p/gar/code/23394
Author:   cgrzemba
Date:     2014-04-11 08:57:11 +0000 (Fri, 11 Apr 2014)
Log Message:
-----------
389-ds-base/trunk: merge branch vers1.3.2

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

Added Paths:
-----------
    csw/mgar/pkg/389-ds-base/trunk/files/0006-remove-bashism-in-shell-templates.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0010-no-Crun-Cstd-lib-config.ac.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0015-use-PL_strcasestr-acllas.c.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0016-fix-bigendian-utf8compare.c
    csw/mgar/pkg/389-ds-base/trunk/files/0017-disable-asm-for-Sparc.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0018-correct-64bit-ptr-bind.c
    csw/mgar/pkg/389-ds-base/trunk/files/0019-void-ptr-conntable.c.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0020-debug-label-main.c.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0021-include-lber.h-slapi-plugin.h.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0022-adjust-mozldap-version-sasl_io.c.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0023-phtread-include-slapi2nspr.c.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0024-strndup.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0025-posix-winsync.rawentry.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0026-handle-delete-memberuid-posix-winsync.c.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0027-Slapi-rwlock-size.patch
    csw/mgar/pkg/389-ds-base/trunk/files/0030-reconstruct-memberuid-generation-task.patch

Property Changed:
----------------
    csw/mgar/pkg/389-ds-base/trunk/

Index: csw/mgar/pkg/389-ds-base/trunk
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk	2014-04-11 07:30:19 UTC (rev 23393)
+++ csw/mgar/pkg/389-ds-base/trunk	2014-04-11 08:57:11 UTC (rev 23394)

Property changes on: csw/mgar/pkg/389-ds-base/trunk
___________________________________________________________________
Added: svn:mergeinfo
## -0,0 +1 ##
+/csw/mgar/pkg/389-ds-base/branches/vers1.3.2:23147-23393
\ No newline at end of property
Modified: csw/mgar/pkg/389-ds-base/trunk/Makefile
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/Makefile	2014-04-11 07:30:19 UTC (rev 23393)
+++ csw/mgar/pkg/389-ds-base/trunk/Makefile	2014-04-11 08:57:11 UTC (rev 23394)
@@ -2,7 +2,7 @@
 # TODO (release-critical prefixed with !, non release-critical with *)
 #
 NAME = 389-ds-base
-VERSION = 1.2.11.25
+VERSION = 1.3.2.14
 GARTYPE = v2
 
 DESCRIPTION = The enterprise-class Open Source LDAP server
@@ -12,25 +12,30 @@
 
 BUNDLE = 389-ds
 
-MASTER_SITES = http://port389.org/sources/
+MASTER_SITES = https://git.fedorahosted.org/cgit/389/ds.git/snapshot/
+# MASTER_SITES = http://port389.org/sources/
 DISTFILES  = $(NAME)-$(VERSION).tar.bz2
 DISTFILES += CSW389-ds-base.postinstall
 DISTFILES += CSW389-ds-base.postremove
 
-# BUILD64	= 1
+BUILD64	= 1
 PACKAGING_PLATFORMS += solaris10-sparc
 PACKAGING_PLATFORMS += solaris10-i386
 
 LICENSE = LICENSE
 
 GARCOMPILER = SOS12U3
+# builds but was not able to debug
+# GARCOMPILER = GCC4
+LDAPAPI=mozldap
+# LDAPAPI=openldap
 
 PATCHFILES += 0005-add-standard-path.patch
 PATCHFILES += 0006-replace-SV-sh-with-Posix-sh.patch
-# PATCHFILES += 0006-remove-bashism-in-shell-templates.patch
 PATCHFILES += 0005-smf-autoenable-no.patch
 PATCHFILES += 0005-add-var-run-create-initconfig.in.patch
 PATCHFILES += 0005-add-var-run-create-template-initconfig.in.patch
+PATCHFILES += 0006-remove-bashism-in-shell-templates.patch
 PATCHFILES += 0007-fixup-Makefile.am.patch
 # PATCHFILES += 0007-fixup-plugin_syntax.c.patch
 PATCHFILES += 0008-mntent-daemon.c.patch
@@ -39,17 +44,34 @@
 # PATCHFILES += 0011-Makefile.am.patch
 # PATCHFILES += 0009-fix-for-550-memberuid-not-created.patch
 # PATCHFILES += 0012-fix-for-47327.patch
+
+# PATCHFILES += 0013-use-posix-threads-configure.ac.patch
+# PATCHFILES += 0023-phtread-include-slapi2nspr.c.patch
+PATCHFILES += 0027-Slapi-rwlock-size.patch
+
 PATCHFILES += 0014-ldap-include-Makefile.am.patch
+# needed at least on GCC4
+PATCHFILES += 0015-use-PL_strcasestr-acllas.c.patch
+PATCHFILES_GCC4 += 0010-no-Crun-Cstd-lib-config.ac.patch
+PATCHFILES += 0016-fix-bigendian-utf8compare.c
+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 += 0024-strndup.patch
+PATCHFILES += 0025-posix-winsync.rawentry.patch
+PATCHFILES += 0030-reconstruct-memberuid-generation-task.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 += CSWmozldap-dev
-BUILD_DEP_PKGS += CSWmozldap-tools
+# 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
@@ -77,18 +99,31 @@
 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibnssdbm3
 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibpcre1
 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWpm-netaddr-ip
-RUNTIME_DEP_PKGS_CSW389-ds-base += CSWliblber2-4-2
+RUNTIME_DEP_PKGS_CSW389-ds-base_openldap += CSWliblber2-4-2
 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibicui18n52
 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibicuuc52
-RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibldap-r2-4-2
-RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibldap2-4-2
+RUNTIME_DEP_PKGS_CSW389-ds-base_openldap += CSWlibldap-r2-4-2
+RUNTIME_DEP_PKGS_CSW389-ds-base_openldap += CSWlibldap2-4-2
+
+RUNTIME_DEP_PKGS_CSW389-ds-base_mozldap += CSWlibprldap60
+RUNTIME_DEP_PKGS_CSW389-ds-base_mozldap += CSWlibldif60
+RUNTIME_DEP_PKGS_CSW389-ds-base_mozldap += CSWlibldap60
+RUNTIME_DEP_PKGS_CSW389-ds-base_mozldap += CSWlibssldap60
+
 RUNTIME_DEP_PKGS_CSW389-ds-base_sparc += CSWlibk5crypto3
 RUNTIME_DEP_PKGS_CSW389-ds-base_sparc += CSWlibintl8
 RUNTIME_DEP_PKGS_CSW389-ds-base_sparc += CSWlibicudata52
+RUNTIME_DEP_PKGS_CSW389-ds-base_sparc_GCC4 += CSWlibgcc-s1
+RUNTIME_DEP_PKGS_CSW389-ds-base_sparc_GCC4 += CSWlibstdc++6
 RUNTIME_DEP_PKGS_CSW389-ds-base += $(RUNTIME_DEP_PKGS_CSW389-ds-base_$(GARCH))
+RUNTIME_DEP_PKGS_CSW389-ds-base += $(RUNTIME_DEP_PKGS_CSW389-ds-base_$(GARCH)_$(GARCOMPILER))
+RUNTIME_DEP_PKGS_CSW389-ds-base += $(RUNTIME_DEP_PKGS_CSW389-ds-base_$(LDAPAPI))
 
 
+# it is only a comment
 CHECKPKG_OVERRIDES_CSW389-ds-base += file-with-bad-content|/usr/share|root/opt/csw/lib/dirsrv/perl/DSUpdate.pm
+CHECKPKG_OVERRIDES_CSW389-ds-base += file-with-bad-content|/usr/share|root/opt/csw/lib/sparcv9/dirsrv/perl/DSUpdate.pm
+CHECKPKG_OVERRIDES_CSW389-ds-base += file-with-bad-content|/usr/share|root/opt/csw/lib/amd64/dirsrv/perl/DSUpdate.pm
 CHECKPKG_OVERRIDES_CSW389-ds-base += surplus-dependency|CSWpython
 CHECKPKG_OVERRIDES_CSW389-ds-base += init-file-missing-cswinitsmf-class|/etc/opt/csw/init.d/dirsrv-snmp|class=none
 # is needed for setup scripts!
@@ -100,19 +135,25 @@
 
 
 EXTRA_LIB = /opt/csw/bdb48/lib
-# remove -I/opt/csw/include
+# if use MozillaLDAP remove -I/opt/csw/include because there are OpenLDAP header
 CPPFLAGS = 
-EXTRA_LINKER_FLAGS = -xnorunpath -norunpath
+EXTRA_CFLAGS_SOS12U3 = -xnorunpath
+EXTRA_CXXFLAGS_SOS12U3 = -norunpath
+EXTRA_CPPFLAGS_GCC4 = -DSOLARIS_GCC
+EXTRA_CPPFLAGS += $(EXTRA_CPPFLAGS_$(GARCOMPILER))
+EXTRA_CXXFLAGS += $(EXTRA_CXXFLAGS_$(GARCOMPILER))
+EXTRA_CFLAGS += $(EXTRA_CFLAGS_$(GARCOMPILER))
+STRIP_LIBTOOL = 1
 
-GARFLAVOR = DBG
+# 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=$(prefix)/dirsrv/bin
 # 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)

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0006-remove-bashism-in-shell-templates.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0006-remove-bashism-in-shell-templates.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0006-remove-bashism-in-shell-templates.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0006-remove-bashism-in-shell-templates.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -0,0 +1,263 @@
+From 76daf2857988a218400fe4d7c747862118112700 Mon Sep 17 00:00:00 2001
+From: Carsten Grzemba <cgrzemba at opencsw.org>
+Date: Wed, 5 Mar 2014 11:14:22 +0100
+Subject: [PATCH 2/2] remove bashism in shell templates
+
+---
+ ldap/admin/src/scripts/bak2db.in          | 4 ++--
+ ldap/admin/src/scripts/db2bak.in          | 4 ++--
+ ldap/admin/src/scripts/db2index.in        | 4 ++--
+ ldap/admin/src/scripts/db2ldif.in         | 4 ++--
+ ldap/admin/src/scripts/dbverify.in        | 4 ++--
+ ldap/admin/src/scripts/dn2rdn.in          | 4 ++--
+ ldap/admin/src/scripts/ldif2db.in         | 4 ++--
+ ldap/admin/src/scripts/ldif2ldap.in       | 4 ++--
+ ldap/admin/src/scripts/monitor.in         | 4 ++--
+ ldap/admin/src/scripts/restart-dirsrv.in  | 2 +-
+ ldap/admin/src/scripts/restoreconfig.in   | 4 ++--
+ ldap/admin/src/scripts/saveconfig.in      | 4 ++--
+ ldap/admin/src/scripts/start-dirsrv.in    | 2 +-
+ ldap/admin/src/scripts/stop-dirsrv.in     | 2 +-
+ ldap/admin/src/scripts/suffix2instance.in | 4 ++--
+ ldap/admin/src/scripts/upgradedb.in       | 4 ++--
+ ldap/admin/src/scripts/upgradednformat.in | 4 ++--
+ ldap/admin/src/scripts/vlvindex.in        | 4 ++--
+ 18 files changed, 33 insertions(+), 33 deletions(-)
+
+diff --git a/ldap/admin/src/scripts/bak2db.in b/ldap/admin/src/scripts/bak2db.in
+index f0cede4..b7ff1a7 100755
+--- a/ldap/admin/src/scripts/bak2db.in
++++ b/ldap/admin/src/scripts/bak2db.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@nss_libdir@"
+diff --git a/ldap/admin/src/scripts/db2bak.in b/ldap/admin/src/scripts/db2bak.in
+index dacd7b0..4394100 100755
+--- a/ldap/admin/src/scripts/db2bak.in
++++ b/ldap/admin/src/scripts/db2bak.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@nss_libdir@"
+diff --git a/ldap/admin/src/scripts/db2index.in b/ldap/admin/src/scripts/db2index.in
+index a1321ea..9d42b1a 100755
+--- a/ldap/admin/src/scripts/db2index.in
++++ b/ldap/admin/src/scripts/db2index.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@nss_libdir@"
+diff --git a/ldap/admin/src/scripts/db2ldif.in b/ldap/admin/src/scripts/db2ldif.in
+index d7e0ff0..a3e6ed6 100755
+--- a/ldap/admin/src/scripts/db2ldif.in
++++ b/ldap/admin/src/scripts/db2ldif.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@nss_libdir@"
+diff --git a/ldap/admin/src/scripts/dbverify.in b/ldap/admin/src/scripts/dbverify.in
+index 6306a07..a5258d7 100755
+--- a/ldap/admin/src/scripts/dbverify.in
++++ b/ldap/admin/src/scripts/dbverify.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@nss_libdir@"
+diff --git a/ldap/admin/src/scripts/dn2rdn.in b/ldap/admin/src/scripts/dn2rdn.in
+index 32a70c8..5a38dc0 100755
+--- a/ldap/admin/src/scripts/dn2rdn.in
++++ b/ldap/admin/src/scripts/dn2rdn.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@nss_libdir@"
+diff --git a/ldap/admin/src/scripts/ldif2db.in b/ldap/admin/src/scripts/ldif2db.in
+index ce15349..7763c04 100755
+--- a/ldap/admin/src/scripts/ldif2db.in
++++ b/ldap/admin/src/scripts/ldif2db.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@nss_libdir@"
+diff --git a/ldap/admin/src/scripts/ldif2ldap.in b/ldap/admin/src/scripts/ldif2ldap.in
+index 874b1bb..bc3840f 100755
+--- a/ldap/admin/src/scripts/ldif2ldap.in
++++ b/ldap/admin/src/scripts/ldif2ldap.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@ldapsdk_libdir@"
+ libpath_add "@libdir@"
+diff --git a/ldap/admin/src/scripts/monitor.in b/ldap/admin/src/scripts/monitor.in
+index 7b2058b..4bb51b1 100755
+--- a/ldap/admin/src/scripts/monitor.in
++++ b/ldap/admin/src/scripts/monitor.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@ldapsdk_libdir@"
+diff --git a/ldap/admin/src/scripts/restart-dirsrv.in b/ldap/admin/src/scripts/restart-dirsrv.in
+index 270b71b..4dfb8ed 100644
+--- a/ldap/admin/src/scripts/restart-dirsrv.in
++++ b/ldap/admin/src/scripts/restart-dirsrv.in
+@@ -7,7 +7,7 @@
+ #       2: Server started successfully (was not running)
+ #       3: Server could not be stopped
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ restart_instance() {
+     SERV_ID=$1
+diff --git a/ldap/admin/src/scripts/restoreconfig.in b/ldap/admin/src/scripts/restoreconfig.in
+index 9bb1acf..c500e21 100755
+--- a/ldap/admin/src/scripts/restoreconfig.in
++++ b/ldap/admin/src/scripts/restoreconfig.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@nss_libdir@"
+diff --git a/ldap/admin/src/scripts/saveconfig.in b/ldap/admin/src/scripts/saveconfig.in
+index 65d80f3..55b3a3c 100755
+--- a/ldap/admin/src/scripts/saveconfig.in
++++ b/ldap/admin/src/scripts/saveconfig.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@libdir@"
+diff --git a/ldap/admin/src/scripts/start-dirsrv.in b/ldap/admin/src/scripts/start-dirsrv.in
+index a5c1bf6..ebc5c50 100755
+--- a/ldap/admin/src/scripts/start-dirsrv.in
++++ b/ldap/admin/src/scripts/start-dirsrv.in
+@@ -6,7 +6,7 @@
+ #       1: Server could not be started
+ #       2: Server already running
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ # Starts a single instance
+ start_instance() {
+diff --git a/ldap/admin/src/scripts/stop-dirsrv.in b/ldap/admin/src/scripts/stop-dirsrv.in
+index 5cf126b..278af70 100755
+--- a/ldap/admin/src/scripts/stop-dirsrv.in
++++ b/ldap/admin/src/scripts/stop-dirsrv.in
+@@ -6,7 +6,7 @@
+ #       1: Server could not be stopped
+ #       2: Server was not running
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ stop_instance() {
+     SERV_ID=$1
+diff --git a/ldap/admin/src/scripts/suffix2instance.in b/ldap/admin/src/scripts/suffix2instance.in
+index e2f73c3..5507bb6 100755
+--- a/ldap/admin/src/scripts/suffix2instance.in
++++ b/ldap/admin/src/scripts/suffix2instance.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@libdir@"
+diff --git a/ldap/admin/src/scripts/upgradedb.in b/ldap/admin/src/scripts/upgradedb.in
+index 211bdce..8a941f4 100755
+--- a/ldap/admin/src/scripts/upgradedb.in
++++ b/ldap/admin/src/scripts/upgradedb.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@libdir@"
+diff --git a/ldap/admin/src/scripts/upgradednformat.in b/ldap/admin/src/scripts/upgradednformat.in
+index e9d8cab..30a5eb9 100755
+--- a/ldap/admin/src/scripts/upgradednformat.in
++++ b/ldap/admin/src/scripts/upgradednformat.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ # upgradednformat -- upgrade DN format to the new style (RFC 4514)
+ # Usgae: upgradednformat [-N] -n backend_instance -a db_instance_directory
+diff --git a/ldap/admin/src/scripts/vlvindex.in b/ldap/admin/src/scripts/vlvindex.in
+index 0b46b27..175c618 100755
+--- a/ldap/admin/src/scripts/vlvindex.in
++++ b/ldap/admin/src/scripts/vlvindex.in
+@@ -1,6 +1,6 @@
+-#!/bin/sh
++#!/usr/xpg4/bin/sh
+ 
+-source @datadir@/@package_name@/data/DSSharedLib
++. @datadir@/@package_name@/data/DSSharedLib
+ 
+ libpath_add "@libdir@/@package_name@/"
+ libpath_add "@libdir@"
+-- 
+1.8.4.1
+

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0010-no-Crun-Cstd-lib-config.ac.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0010-no-Crun-Cstd-lib-config.ac.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0010-no-Crun-Cstd-lib-config.ac.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0010-no-Crun-Cstd-lib-config.ac.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -0,0 +1,14 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -570,9 +570,9 @@ dnl socket nsl and dl are required to link several programs and libdb
+     LIBDL=-ldl
+     AC_SUBST([LIBDL], [$LIBDL])
+ dnl Cstd and Crun are required to link any C++ related code
+-    LIBCSTD=-lCstd
++    LIBCSTD=
+     AC_SUBST([LIBCSTD], [$LIBCSTD])
+-    LIBCRUN=-lCrun
++    LIBCRUN=
+     AC_SUBST([LIBCRUN], [$LIBCRUN])
+     platform="solaris"
+     initdir='$(sysconfdir)/init.d'

Modified: csw/mgar/pkg/389-ds-base/trunk/files/0014-ldap-include-Makefile.am.patch
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0014-ldap-include-Makefile.am.patch	2014-04-11 07:30:19 UTC (rev 23393)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0014-ldap-include-Makefile.am.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -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

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0015-use-PL_strcasestr-acllas.c.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0015-use-PL_strcasestr-acllas.c.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0015-use-PL_strcasestr-acllas.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0015-use-PL_strcasestr-acllas.c.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -0,0 +1,138 @@
+--- a/ldap/servers/plugins/acl/acllas.c
++++ b/ldap/servers/plugins/acl/acllas.c
+@@ -584,9 +584,9 @@ DS_LASUserDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
+ 		} else {
+ 			/* URL format */
+ 			
+-			if ((strcasestr (user, ACL_RULE_MACRO_DN_KEY) != NULL) ||
+-				(strcasestr (user, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
+-				(strcasestr (user, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
++			if ((PL_strcasestr (user, ACL_RULE_MACRO_DN_KEY) != NULL) ||
++				(PL_strcasestr (user, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
++				(PL_strcasestr (user, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
+ 				
+ 				matched = aclutil_evaluate_macro( s_user, &lasinfo,
+ 													ACL_EVAL_USER);
+@@ -856,9 +856,9 @@ DS_LASGroupDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
+ 					"Group not evaluated(%s)\n", groupName);
+ 			break;
+ 		} else {			
+-			if ((strcasestr (groupName, ACL_RULE_MACRO_DN_KEY) != NULL) ||
+-				(strcasestr (groupName, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
+-				(strcasestr (groupName, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
++			if ((PL_strcasestr (groupName, ACL_RULE_MACRO_DN_KEY) != NULL) ||
++				(PL_strcasestr (groupName, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
++				(PL_strcasestr (groupName, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
+ 				matched = aclutil_evaluate_macro( groupName, &lasinfo,
+ 													ACL_EVAL_GROUP);
+ 				slapi_log_error ( SLAPI_LOG_ACL, plugin_name,
+@@ -1075,9 +1075,9 @@ DS_LASRoleDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
+ 		} else {
+ 
+ 			/* Take care of param strings */
+-			if ((strcasestr (role, ACL_RULE_MACRO_DN_KEY) != NULL) ||
+-				(strcasestr (role, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
+-				(strcasestr (role, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
++			if ((PL_strcasestr (role, ACL_RULE_MACRO_DN_KEY) != NULL) ||
++				(PL_strcasestr (role, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
++				(PL_strcasestr (role, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
+ 				
+ 				matched = aclutil_evaluate_macro( role, &lasinfo,
+ 													ACL_EVAL_ROLE);
+@@ -2630,9 +2630,9 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
+ 
+ 		/* In this case "grppupdnattr="ldap:///base??attr" */
+ 
+-		if ((strcasestr (attrName, ACL_RULE_MACRO_DN_KEY) != NULL) ||
+-			(strcasestr (attrName, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
+-			(strcasestr (attrName, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
++		if ((PL_strcasestr (attrName, ACL_RULE_MACRO_DN_KEY) != NULL) ||
++			(PL_strcasestr (attrName, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) ||
++			(PL_strcasestr (attrName, ACL_RULE_MACRO_ATTR_KEY) != NULL)) {			
+ 				
+ 				matched = aclutil_evaluate_macro( attrName, &lasinfo,
+ 													ACL_EVAL_GROUPDNATTR);
+@@ -4203,12 +4203,12 @@ acllas_replace_dn_macro( char *rule, char *matched_val, lasInfo *lasinfo) {
+ 	int has_macro_levels = 0;
+ 	
+ 	/* Determine what the rule's got once */
+-	if ( strcasestr(rule, ACL_RULE_MACRO_DN_KEY) != NULL) {
++	if ( PL_strcasestr(rule, ACL_RULE_MACRO_DN_KEY) != NULL) {
+ 		/* ($dn) exists */
+ 		has_macro_dn = 1;
+ 	}
+ 
+-	if ( strcasestr(rule, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) {
++	if ( PL_strcasestr(rule, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL) {
+ 		/* [$dn] exists */
+ 		has_macro_levels = 1;
+ 	}
+@@ -4312,7 +4312,7 @@ acllas_replace_attr_macro( char *rule, lasInfo *lasinfo)
+ 	int l;
+ 	Slapi_Attr *attr = NULL;
+ 	
+-	str = strcasestr(rule, ACL_RULE_MACRO_ATTR_KEY);
++	str = PL_strcasestr(rule, ACL_RULE_MACRO_ATTR_KEY);
+ 	if ( str == NULL ) {
+ 
+ 		charray_add(&a, slapi_ch_strdup(rule));
+@@ -4321,7 +4321,7 @@ acllas_replace_attr_macro( char *rule, lasInfo *lasinfo)
+ 	} else {
+ 	
+ 		working_rule = slapi_ch_strdup(rule);
+-		str = strcasestr(working_rule, ACL_RULE_MACRO_ATTR_KEY);
++		str = PL_strcasestr(working_rule, ACL_RULE_MACRO_ATTR_KEY);
+ 		charray_add(&working_list, working_rule );
+ 		
+ 		while( str != NULL) {
+@@ -4419,7 +4419,7 @@ acllas_replace_attr_macro( char *rule, lasInfo *lasinfo)
+ 			slapi_ch_free_string(&macro_str);
+ 			slapi_ch_free_string(&macro_attr_name);
+ 			
+-			str = strcasestr(working_rule, ACL_RULE_MACRO_ATTR_KEY);
++			str = PL_strcasestr(working_rule, ACL_RULE_MACRO_ATTR_KEY);
+ 		
+         }/* while */
+ 		
+--- a/ldap/servers/plugins/acl/aclparse.c
++++ b/ldap/servers/plugins/acl/aclparse.c
+@@ -315,8 +315,8 @@ __aclp__parse_aci(char *str, aci_t  *aci_item, char **errbuf)
+ 			 * have a target and it must have a macro.
+ 			*/
+ 		
+-			if ((strcasestr(str, ACL_RULE_MACRO_DN_KEY) != NULL) ||
+-			    (strcasestr(str, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL)) {
++			if ((PL_strcasestr(str, ACL_RULE_MACRO_DN_KEY) != NULL) ||
++			    (PL_strcasestr(str, ACL_RULE_MACRO_DN_LEVELS_KEY) != NULL)) {
+ 			
+ 				/* Must have a targetmacro */
+ 				if ( !(aci_item->aci_type & ACI_TARGET_MACRO_DN)) {
+--- a/ldap/servers/plugins/acl/aclutil.c
++++ b/ldap/servers/plugins/acl/aclutil.c
+@@ -1247,7 +1247,7 @@ acl_replace_str(char * s, char *substr, char* replace_with_str) {
+ 		char *working_s, *suffix, *prefix, *patched;
+ 		int replace_with_len, substr_len, prefix_len, suffix_len;
+ 
+-		if (strcasestr(s, substr) == NULL) {
++		if (PL_strcasestr(s, substr) == NULL) {
+ 			return(slapi_ch_strdup(s));
+ 		} else {
+ 
+@@ -1257,7 +1257,7 @@ acl_replace_str(char * s, char *substr, char* replace_with_str) {
+ 		
+ 			working_s = slapi_ch_strdup(s);	
+ 			prefix = working_s;
+-			str = strcasestr(prefix, substr);
++			str = PL_strcasestr(prefix, substr);
+ 			
+ 			while (str != NULL) {
+ 				
+@@ -1284,7 +1284,7 @@ acl_replace_str(char * s, char *substr, char* replace_with_str) {
+ 
+ 				working_s = patched;
+ 				prefix = working_s;
+-				str = strcasestr(prefix, substr);		
++				str = PL_strcasestr(prefix, substr);		
+ 				
+ 			}
+ 

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0016-fix-bigendian-utf8compare.c (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0016-fix-bigendian-utf8compare.c)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0016-fix-bigendian-utf8compare.c	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0016-fix-bigendian-utf8compare.c	2014-04-11 08:57:11 UTC (rev 23394)
@@ -0,0 +1,34 @@
+--- a/ldap/servers/slapd/utf8compare.c
++++ b/ldap/servers/slapd/utf8compare.c
+@@ -60,6 +60,7 @@ typedef struct sUpperLowerTbl {
+ int
+ slapi_has8thBit(unsigned char *s)
+ {
++#if (defined(CPU_x86) || defined(CPU_x86_64)) 
+ #define MY8THBITWIDTH 4 /* sizeof(PRUint32) */
+ #define MY8THBITFILTER 0x80808080
+     unsigned char *p, *stail, *ltail;
+@@ -73,14 +74,20 @@ slapi_has8thBit(unsigned char *s)
+              return 1;
+         }
+     }
+-    for (; p < ltail; p++) {
++#undef MY8THBITWIDTH 
++#undef MY8THBITFILTER 
++    for (; p < ltail; p++) 
++#else 
++    unsigned char *p, *tail; 
++    tail = s + strlen((char *)s);  
++    for (p = s; p < tail; p++) 
++#endif 
++    { 
+         if (0x80 & *p) {
+              return 1;
+         }
+     }
+     return 0;
+-#undef MY8THBITWIDTH
+-#undef MY8THBITFILTER
+ }
+ 
+ /*

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0017-disable-asm-for-Sparc.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0017-disable-asm-for-Sparc.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0017-disable-asm-for-Sparc.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0017-disable-asm-for-Sparc.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -0,0 +1,10 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -583,7 +583,6 @@ dnl I dont know why i386 need this explicit
+         ;;
+       sparc-*-solaris*)
+ dnl includes some assembler stuff in counter.o
+-        AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
+         AC_DEFINE([CPU_sparc], [], [cpu type sparc])
+         TARGET='SPARC'
+         ;;

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0018-correct-64bit-ptr-bind.c (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0018-correct-64bit-ptr-bind.c)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0018-correct-64bit-ptr-bind.c	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0018-correct-64bit-ptr-bind.c	2014-04-11 08:57:11 UTC (rev 23394)
@@ -0,0 +1,30 @@
+--- a/ldap/servers/slapd/bind.c
++++ b/ldap/servers/slapd/bind.c
+@@ -119,7 +119,8 @@ do_bind( Slapi_PBlock *pb )
+ {
+     BerElement	*ber = pb->pb_op->o_ber;
+     int		err, isroot;
+-    ber_tag_t 	method = LBER_DEFAULT;
++    ber_tag_t 	ber_method = LBER_DEFAULT;
++    int 	method = 0;
+     ber_int_t	version = -1;
+     int		auth_response_requested = 0;
+     int		pw_response_requested = 0;
+@@ -162,7 +163,7 @@ do_bind( Slapi_PBlock *pb )
+      *	}
+      */
+ 
+-    ber_rc = ber_scanf( ber, "{iat", &version, &rawdn, &method );
++    ber_rc = ber_scanf( ber, "{iat", &version, &rawdn, &ber_method );
+     if ( ber_rc == LBER_ERROR ) {
+         LDAPDebug( LDAP_DEBUG_ANY,
+                    "ber_scanf failed (op=Bind; params=Version,DN,Method)\n",
+@@ -173,6 +174,8 @@ do_bind( Slapi_PBlock *pb )
+         slapi_ch_free_string(&rawdn);
+         return;
+     }
++    /* (int) = (long) */
++    method = (int)(ber_method & 0xffff);
+     /* Check if we should be performing strict validation. */
+     if (rawdn && config_get_dn_validate_strict()) { 
+         /* check that the dn is formatted correctly */

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0019-void-ptr-conntable.c.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0019-void-ptr-conntable.c.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0019-void-ptr-conntable.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0019-void-ptr-conntable.c.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -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;

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0020-debug-label-main.c.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0020-debug-label-main.c.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0020-debug-label-main.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0020-debug-label-main.c.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -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()

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0021-include-lber.h-slapi-plugin.h.patch (from rev 23393, 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/trunk/files/0021-include-lber.h-slapi-plugin.h.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0021-include-lber.h-slapi-plugin.h.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -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"
+ 

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0022-adjust-mozldap-version-sasl_io.c.patch (from rev 23393, 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/trunk/files/0022-adjust-mozldap-version-sasl_io.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0022-adjust-mozldap-version-sasl_io.c.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -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)

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0023-phtread-include-slapi2nspr.c.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0023-phtread-include-slapi2nspr.c.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0023-phtread-include-slapi2nspr.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0023-phtread-include-slapi2nspr.c.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -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 --------------------------------------
+  */

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0024-strndup.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0024-strndup.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0024-strndup.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0024-strndup.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -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
+  */

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0025-posix-winsync.rawentry.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0025-posix-winsync.rawentry.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0025-posix-winsync.rawentry.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0025-posix-winsync.rawentry.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -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)

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0026-handle-delete-memberuid-posix-winsync.c.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0026-handle-delete-memberuid-posix-winsync.c.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0026-handle-delete-memberuid-posix-winsync.c.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0026-handle-delete-memberuid-posix-winsync.c.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -0,0 +1,53 @@
+--- a/ldap/servers/plugins/posix-winsync/posix-winsync.c
++++ b/ldap/servers/plugins/posix-winsync/posix-winsync.c
+@@ -954,17 +955,19 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla
+ 
+         slapi_attr_get_type(attr, &type);
+         for (; attr_map[i].windows_attribute_name != NULL; i++) {
++            Slapi_Attr *local_attr = NULL;
++            char *local_type = NULL;
++            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 (0 == slapi_attr_type_cmp(type, attr_map[i].windows_attribute_name,
+-                                         SLAPI_TYPE_CMP_SUBTYPE)) {
+-                Slapi_Attr *local_attr = NULL;
+-                char *local_type = NULL;
++                                         SLAPI_TYPE_CMP_SUBTYPE)) 
++            {
++
+ 
+                 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, 
+@@ -989,10 +992,21 @@ posix_winsync_pre_ds_mod_group_cb(void *cbdata, const Slapi_Entry *rawentry, Sla
+                 }
+                 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);
+-                /* what about if delete all values on windows ???? */
+-            }
++             } else {
++                 /* what about if delete all values on windows ? -> delete*/
++                 if (is_present_local) {
++                     slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,
++                                    "_pre_ds_mod_group_cb -- update mods: %s, %s : values deleted -> modify\n",
++                                    slapi_sdn_get_dn(slapi_entry_get_sdn_const(ds_entry)),
++                                    local_type);
++
++                               
++                               slapi_mods_add_mod_values(smods, LDAP_MOD_DELETE, local_type, NULL);
++                    *do_modify = 1;
++                 }
++             }
++            slapi_ch_free((void**) &local_type);
+         }
+     }
+     slapi_log_error(SLAPI_LOG_PLUGIN, posix_winsync_plugin_name,

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0027-Slapi-rwlock-size.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0027-Slapi-rwlock-size.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0027-Slapi-rwlock-size.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0027-Slapi-rwlock-size.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -0,0 +1,32 @@
+--- a/ldap/servers/slapd/entry.c
++++ b/ldap/servers/slapd/entry.c
+@@ -2064,7 +2064,7 @@ slapi_entry_size(Slapi_Entry *e)
+     if (e->e_uniqueid) size += strlen(e->e_uniqueid) + 1;
+     if (e->e_dncsnset) size += csnset_size(e->e_dncsnset);
+     if (e->e_maxcsn) size += sizeof( CSN );
+-    if (e->e_virtual_lock) size += sizeof(Slapi_RWLock);
++    if (e->e_virtual_lock) size += sizeof(Slapi_RWLock_size);
+     /* Slapi_DN and RDN are included in Slapi_Entry */
+     size += (slapi_sdn_get_size(&e->e_sdn) - sizeof(Slapi_DN));
+     size += (slapi_rdn_get_size(&e->e_srdn) - sizeof(Slapi_RDN));
+--- a/ldap/servers/slapd/pw.c
++++ b/ldap/servers/slapd/pw.c
+@@ -2728,7 +2728,7 @@ pw_get_ext_size(Slapi_Entry *entry, size_t *size)
+         return LDAP_SUCCESS;
+     }
+     *size += sizeof(struct slapi_pw_entry_ext);
+-    *size += sizeof(Slapi_RWLock);
++    *size += sizeof(Slapi_RWLock_size);
+     if (LDAP_SUCCESS == slapi_pw_get_entry_ext(entry, &pw_entry_values)) {
+         Slapi_Value *cvalue;
+         int idx = valuearray_first_value(pw_entry_values, &cvalue);
+--- a/ldap/servers/slapd/slapi-plugin.h
++++ b/ldap/servers/slapd/slapi-plugin.h
+@@ -6000,6 +6000,7 @@ typedef struct slapi_condvar	Slapi_CondVar;
+ typedef pthread_rwlock_t	Slapi_RWLock;
+ #else
+ typedef struct slapi_rwlock	Slapi_RWLock;
++#define Slapi_RWLock_size (5*sizeof(void*)+(4*sizeof(PRUint32)))
+ #endif
+ Slapi_Mutex *slapi_new_mutex( void );
+ void slapi_destroy_mutex( Slapi_Mutex *mutex );

Copied: csw/mgar/pkg/389-ds-base/trunk/files/0030-reconstruct-memberuid-generation-task.patch (from rev 23393, csw/mgar/pkg/389-ds-base/branches/vers1.3.2/files/0030-reconstruct-memberuid-generation-task.patch)
===================================================================
--- csw/mgar/pkg/389-ds-base/trunk/files/0030-reconstruct-memberuid-generation-task.patch	                        (rev 0)
+++ csw/mgar/pkg/389-ds-base/trunk/files/0030-reconstruct-memberuid-generation-task.patch	2014-04-11 08:57:11 UTC (rev 23394)
@@ -0,0 +1,375 @@
+From 4e356cca64387b814a5ae08f1bf246132372370b Mon Sep 17 00:00:00 2001
+From: Carsten Grzemba <cgrzemba at opencsw.org>
+Date: Tue, 8 Apr 2014 15:30:21 +0200
+Subject: [PATCH] reconstruct memberuid generation task
+
+---
+ .../plugins/posix-winsync/posix-group-task.c       | 144 +++++++++++++++++----
+ .../plugins/posix-winsync/posix-winsync-config.c   |   2 +-
+ .../plugins/posix-winsync/posix-wsp-ident.h        |   2 +-
+ 3 files changed, 119 insertions(+), 29 deletions(-)
+
+diff --git a/ldap/servers/plugins/posix-winsync/posix-group-task.c b/ldap/servers/plugins/posix-winsync/posix-group-task.c
+index 9f558bf..d038f08 100644
+--- a/ldap/servers/plugins/posix-winsync/posix-group-task.c
++++ b/ldap/servers/plugins/posix-winsync/posix-group-task.c
+@@ -31,7 +31,7 @@ valueset_get_valuearray(const Slapi_ValueSet *vs); /* stolen from proto-slap.h *
+ 
+ /* interface function */
+ int
+-posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int *returncode,
++posix_group_memberuid_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int *returncode,
+     char *returntext, void *arg);
+ 
+ Slapi_Entry *
+@@ -62,7 +62,7 @@ fetch_attr(Slapi_Entry *e, const char *attrname, const char *default_val)
+ 
+ /* e configEntry */
+ int
+-posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int *returncode,
++posix_group_memberuid_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int *returncode,
+     char *returntext, void *arg)
+ {
+     PRThread *thread = NULL;
+@@ -76,7 +76,7 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int
+ 
+ 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "posix_group_task_add: ==>\n");
++                    "posix_group_memberuid_task_add: ==>\n");
+ 
+     /* get arg(s) */
+     /* default: set replication basedn */
+@@ -87,16 +87,16 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int
+     }
+ 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "posix_group_task_add: retrieved basedn: %s\n", dn);
++                    "posix_group_memberuid_task_add: retrieved basedn: %s\n", dn);
+ 
+-    if ((filter = fetch_attr(e, "filter", "(objectclass=ntGroup)")) == NULL) {
++    if ((filter = fetch_attr(e, "filter", "(&(objectclass=posixGroup)(uniquemember=*))")) == NULL) {
+         *returncode = LDAP_OBJECT_CLASS_VIOLATION;
+         rv = SLAPI_DSE_CALLBACK_ERROR;
+         goto out;
+     }
+ 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "posix_group_task_add: retrieved filter: %s\n", filter);
++                    "posix_group_memberuid_task_add: retrieved filter: %s\n", filter);
+ 
+     /* setup our task data */
+     mytaskdata = (task_data*) slapi_ch_malloc(sizeof(task_data));
+@@ -109,31 +109,31 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int
+     mytaskdata->filter_str = slapi_ch_strdup(filter);
+ 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "posix_group_task_add: task data allocated\n");
++                    "posix_group_memberuid_task_add: task data allocated\n");
+ 
+     /* allocate new task now */
+     char * ndn = slapi_entry_get_ndn(e);
+ 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "posix_group_task_add: creating task object: %s\n",
++                    "posix_group_memberuid_task_add: creating task object: %s\n",
+                     ndn);
+ 
+     task = slapi_new_task(ndn);
+ 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "posix_group_task_add: task object created\n");
++                    "posix_group_memberuid_task_add: task object created\n");
+ 
+     /* register our destructor for cleaning up our private data */
+     slapi_task_set_destructor_fn(task, posix_group_task_destructor);
+ 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "posix_group_task_add: task destructor set\n");
++                    "posix_group_memberuid_task_add: task destructor set\n");
+ 
+     /* Stash a pointer to our data in the task */
+     slapi_task_set_data(task, mytaskdata);
+ 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "posix_group_task_add: task object initialized\n");
++                    "posix_group_memberuid_task_add: task object initialized\n");
+ 
+     /* start the sample task as a separate thread */
+     thread = PR_CreateThread(PR_USER_THREAD, posix_group_fixup_task_thread, (void *) task,
+@@ -141,7 +141,7 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int
+                              SLAPD_DEFAULT_THREAD_STACKSIZE);
+ 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "posix_group_task_add: thread created\n");
++                    "posix_group_memberuid_task_add: thread created\n");
+ 
+     if (thread == NULL) {
+         slapi_log_error(SLAPI_LOG_FATAL, POSIX_WINSYNC_PLUGIN_NAME,
+@@ -155,7 +155,7 @@ posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int
+ 
+ out: 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "posix_group_task_add: <==\n");
++                    "posix_group_memberuid_task_add: <==\n");
+ 
+     return rv;
+ }
+@@ -174,7 +174,6 @@ posix_group_task_destructor(Slapi_Task *task)
+     }
+ }
+ 
+-#if 0 /* NOT USED */
+ static int
+ posix_group_del_memberuid_callback(Slapi_Entry *e, void *callback_data)
+ {
+@@ -209,7 +208,6 @@ posix_group_del_memberuid_callback(Slapi_Entry *e, void *callback_data)
+ 
+     return rc;
+ }
+-#endif
+ 
+ static int
+ posix_group_fix_memberuid(char *dn, char *filter_str, void *txn)
+@@ -220,6 +218,9 @@ posix_group_fix_memberuid(char *dn, char *filter_str, void *txn)
+ 
+     /* char *attrs[]={"uniquemember","memberuid",NULL}; */
+ 
++    slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
++        "_fix_memberuid, filter: %s==>\n", filter_str );
++    
+     slapi_search_internal_set_pb(search_pb, dn, LDAP_SCOPE_SUBTREE, filter_str, 0, 0, 0, 0,
+                                  posix_winsync_get_plugin_identity(), 0);
+ 
+@@ -229,6 +230,8 @@ posix_group_fix_memberuid(char *dn, char *filter_str, void *txn)
+ 
+     slapi_pblock_destroy(search_pb);
+ 
++    slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
++                    "_fix_memberuid for entry: <== rc=%d\n", rc );
+     return rc;
+ }
+ 
+@@ -238,10 +241,12 @@ posix_group_fix_memberuid(char *dn, char *filter_str, void *txn)
+  * 1. forall uniquemember search if posixAccount ? add uid : ""
+  */
+ static int
+-posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
++posix_group_fix_memberuid_cb(Slapi_Entry *e, void *callback_data)
+ {
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "_fix_memberuid ==>\n");
++                    "_fix_memberuid_cb for entry: %s==>\n",
++                    slapi_entry_get_dn_const(e));
++
+     cb_data *the_cb_data = (cb_data *) callback_data;
+ 
+     int rc;
+@@ -270,7 +275,7 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
+         }
+ 
+         slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                        "_fix_memberuid scan for orphaned memberuids\n");
++                        "_fix_memberuid_cb scan for orphaned memberuids\n");
+ 
+         int i;
+         for (i = slapi_attr_first_value(muid_attr, &v); i != -1;
+@@ -278,7 +283,7 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
+             char *muid = (char *)slapi_value_get_string(v);
+ 
+             slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                            "_fix_memberuid iterating memberuid: %s\n",
++                            "_fix_memberuid_cb iterating memberuid: %s\n",
+                             muid);
+ 
+             size_t vallen = muid ? strlen(muid) : 0;
+@@ -296,7 +301,7 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
+                                          posix_winsync_get_plugin_identity(), 0);
+ 
+             slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                            "_fix_memberuid searching %s with filter: %s\n",
++                            "_fix_memberuid_cb searching %s with filter: %s\n",
+                             the_cb_data->dn, filter);
+ 
+             rc = slapi_search_internal_pb(search_pb);
+@@ -305,14 +310,14 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
+ 
+             if (!search_entries || !search_entries[0]) {
+                 slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                                "_fix_memberuid Adding bad memberuid %s\n",
++                                "_fix_memberuid_cb deleting bad memberuid %s\n",
+                                 slapi_value_get_string(v));
+ 
+                 slapi_mods_add_string(smods, LDAP_MOD_DELETE, "memberuid", slapi_value_get_string(v));
+ 
+                 if (dsmuid_vs && slapi_valueset_find(dsmuid_attr, dsmuid_vs, v)) {
+                     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                                    "_fix_memberuid Adding bad dsonlymemberuid %s\n",
++                                    "_fix_memberuid_cb delete bad dsonlymemberuid %s\n",
+                                     slapi_value_get_string(v));
+ 
+                     slapi_mods_add_string(smods, LDAP_MOD_DELETE, "dsonlymemberuid", slapi_value_get_string(v));
+@@ -342,7 +347,7 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
+         Slapi_Value * uniqval = NULL;            /* uniquemeber Attribute values          */
+ 
+         slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                        "_fix_memberuid scan uniquemember, group %s\n", dn);
++                        "_fix_memberuid_cb scan uniquemember, group %s\n", dn);
+         for (i = slapi_attr_first_value(obj_attr, &uniqval); i != -1;
+              i = slapi_attr_next_value(obj_attr, i, &uniqval)) {
+ 
+@@ -352,7 +357,7 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
+ 
+             if (!child) {
+                 slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                                "_fix_memberuid orphaned uniquemember found: %s\n", member);
++                                "_fix_memberuid_cb orphaned uniquemember found: %s\n", member);
+ 
+                 if (strncasecmp(member, "cn=", 3) == 0) {
+                     fixMembership = 1;
+@@ -365,13 +370,13 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
+         }
+ 
+         slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                        "_fix_memberuid Finishing...\n");
++                        "_fix_memberuid_cb Finishing...\n");
+ 
+         if (fixMembership  && posix_winsync_config_get_mapNestedGrouping()) {
+             Slapi_ValueSet *del_nested_vs = slapi_valueset_new();
+ 
+             slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                            "_fix_memberuid group deleted, recalculating nesting\n");
++                            "_fix_memberuid_cb group deleted, recalculating nesting\n");
+             propogateDeletionsUpward(e, sdn, bad_ums, del_nested_vs, 0);
+ 
+             slapi_valueset_free(del_nested_vs); del_nested_vs = NULL;
+@@ -386,6 +391,8 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
+     mods = slapi_mods_get_ldapmods_passout(smods);
+     if (mods) {
+         Slapi_PBlock *mod_pb = NULL;
++        if (slapi_is_loglevel_set(SLAPI_LOG_PLUGIN))
++            slapi_mods_dump(smods, "fix_memberuid_cb - mods dump - change memberuids");
+         mod_pb = slapi_pblock_new();
+         slapi_modify_internal_set_pb_ext(mod_pb, sdn, mods, 0, 0,
+                                         posix_winsync_get_plugin_identity(), 0);
+@@ -399,7 +406,90 @@ posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
+     slapi_mods_free(&smods);
+ 
+     slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+-                    "_fix_memberuid <==\n");
++                    "_fix_memberuid_cb <==\n");
++    return rc;
++}
++
++static int
++posix_group_fix_memberuid_callback(Slapi_Entry *e, void *callback_data)
++{
++    int rc = 0;
++    char *dn = slapi_entry_get_dn(e);
++    Slapi_DN *sdn = slapi_entry_get_sdn(e);
++
++    Slapi_Attr *obj_attr = NULL;
++
++    rc = slapi_entry_attr_find(e, "uniquemember", &obj_attr);
++    if (rc == 0) { /* Found uniquemember, so...  */
++        int i;
++        Slapi_Value * value = slapi_value_new(); /* new memberuid Attribute values        */
++        Slapi_Value * uniqval = NULL; /* uniquemeber Attribute values        */
++        Slapi_ValueSet *uids = slapi_valueset_new();
++
++        slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
++                        "_fix_memberuid scan uniquemember, group %s\n", dn);
++        for (i = slapi_attr_first_value(obj_attr, &uniqval); i != -1;
++             i = slapi_attr_next_value(obj_attr, i, &uniqval)) {
++            const char *member = NULL;
++            char * uid = NULL;
++            member = slapi_value_get_string(uniqval);
++            /* search uid for member (DN) */
++            slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME, "search %s\n", member);
++            if ((uid = searchUid(member)) != NULL) {
++                slapi_value_set_string(value, uid);
++                /* add uids ValueSet */
++                slapi_valueset_add_value(uids, value);
++            }
++        }
++        slapi_value_free(&value);
++
++        /* If we found some posix members, replace the existing memberuid attribute
++         * with the found values.  */
++        if (uids && slapi_valueset_count(uids)) {
++            Slapi_PBlock *mod_pb = slapi_pblock_new();
++            Slapi_Value *val = 0;
++            Slapi_Mod *smod;
++            LDAPMod **mods = (LDAPMod **) slapi_ch_malloc(2 * sizeof(LDAPMod *));
++            int hint = 0;
++            cb_data *the_cb_data = (cb_data *) callback_data;
++
++            smod = slapi_mod_new();
++            slapi_mod_init(smod, 0);
++            slapi_mod_set_operation(smod, LDAP_MOD_REPLACE | LDAP_MOD_BVALUES);
++            slapi_mod_set_type(smod, "memberuid");
++
++            /* Loop through all of our values and add them to smod */
++            hint = slapi_valueset_first_value(uids, &val);
++            while (val) {
++                /* this makes a copy of the berval */
++                slapi_mod_add_value(smod, slapi_value_get_berval(val));
++                hint = slapi_valueset_next_value(uids, hint, &val);
++            }
++
++            mods[0] = slapi_mod_get_ldapmod_passout(smod);
++            mods[1] = 0;
++            
++            if (slapi_is_loglevel_set(SLAPI_LOG_PLUGIN))
++                slapi_mods_dump(mods, "_fix_memberuid_callback - mods dump - change memberuids");
++
++            slapi_modify_internal_set_pb_ext(mod_pb, sdn, mods, 0, 0,
++                                             posix_winsync_get_plugin_identity(), 0);
++
++            slapi_pblock_set(mod_pb, SLAPI_TXN, the_cb_data->txn);
++            slapi_modify_internal_pb(mod_pb);
++
++            slapi_pblock_get(mod_pb, SLAPI_PLUGIN_INTOP_RESULT, &rc);
++
++            ldap_mods_free(mods, 1);
++            slapi_mod_free(&smod);
++            slapi_pblock_destroy(mod_pb);
++        } else {
++            /* No member were found, so remove the memberuid attribute
++             * from this entry. */
++            posix_group_del_memberuid_callback(e, callback_data);
++        }
++        slapi_valueset_free(uids);
++    }
+     return rc;
+ }
+ 
+diff --git a/ldap/servers/plugins/posix-winsync/posix-winsync-config.c b/ldap/servers/plugins/posix-winsync/posix-winsync-config.c
+index a7fd6e9..4098ee2 100644
+--- a/ldap/servers/plugins/posix-winsync/posix-winsync-config.c
++++ b/ldap/servers/plugins/posix-winsync/posix-winsync-config.c
+@@ -205,7 +205,7 @@ posix_winsync_config(Slapi_Entry *config_e)
+                                        LDAP_SCOPE_BASE, POSIX_WINSYNC_CONFIG_FILTER,
+                                        posix_winsync_apply_config, NULL);
+ 
+-        rc = slapi_task_register_handler("memberuid task", posix_group_task_add);
++        rc = slapi_task_register_handler("memberuid task", posix_group_memberuid_task_add);
+         if (rc) {
+             slapi_log_error(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
+                             "posix_winsync_config -- register memberuid task failed\n");
+diff --git a/ldap/servers/plugins/posix-winsync/posix-wsp-ident.h b/ldap/servers/plugins/posix-winsync/posix-wsp-ident.h
+index f36fe40..88f6a9f 100644
+--- a/ldap/servers/plugins/posix-winsync/posix-wsp-ident.h
++++ b/ldap/servers/plugins/posix-winsync/posix-wsp-ident.h
+@@ -45,7 +45,7 @@ void posix_winsync_config_set_MOFTaskCreated();
+ PRBool posix_winsync_config_get_MOFTaskCreated();
+ PRBool posix_winsync_config_get_mapNestedGrouping();
+ 
+-int posix_group_task_add(Slapi_PBlock *pb, Slapi_Entry *e,
++int posix_group_memberuid_task_add(Slapi_PBlock *pb, Slapi_Entry *e,
+     Slapi_Entry *eAfter, int *returncode, char *returntext,
+     void *arg);
+ 
+-- 
+1.8.4.1
+

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