Branch '389-ds-base-1.3.1' - 2 commits - Makefile.am Makefile.in configure configure.ac
by Noriko Hosoi
Makefile.am | 8 ++++---
Makefile.in | 65 ++++++++++++++++++++++++++++++++++++++++-------------------
configure | 6 +++++
configure.ac | 5 ++++
4 files changed, 61 insertions(+), 23 deletions(-)
New commits:
commit 99d5d3e59827c132ba2666c67f9e22bd62aaacab
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Feb 20 15:31:05 2014 -0800
Ticket #47709 - package issue in 389-ds-base
Description: Automatically generated files: Makefile.in, configure
diff --git a/Makefile.in b/Makefile.in
index d90f130..21d9dc5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -144,9 +144,9 @@ am__installdirs = "$(DESTDIR)$(serverdir)" \
"$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" \
"$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" \
"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" \
- "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)" \
- "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(updatedir)" \
- "$(DESTDIR)$(serverincdir)"
+ "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(sampledatadir)" \
+ "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" \
+ "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"
LTLIBRARIES = $(server_LTLIBRARIES) $(serverplugin_LTLIBRARIES)
am__DEPENDENCIES_1 =
libacctpolicy_plugin_la_DEPENDENCIES = libslapd.la \
@@ -1104,8 +1104,8 @@ NROFF = nroff
MANS = $(dist_man_MANS)
DATA = $(config_DATA) $(inf_DATA) $(initconfig_DATA) $(mib_DATA) \
$(nodist_property_DATA) $(perl_DATA) $(pkgconfig_DATA) \
- $(property_DATA) $(sampledata_DATA) $(schema_DATA) \
- $(systemdsystemunit_DATA) $(update_DATA)
+ $(property_DATA) $(python_DATA) $(sampledata_DATA) \
+ $(schema_DATA) $(systemdsystemunit_DATA) $(update_DATA)
HEADERS = $(serverinc_HEADERS)
ETAGS = etags
CTAGS = ctags
@@ -1314,6 +1314,7 @@ prefix = @prefix@
program_transform_name = @program_transform_name@
propertydir = $(datadir)@propertydir@
psdir = @psdir@
+pythondir = $(libdir)@pythondir@
sampledatadir = $(datadir)@sampledatadir@
sasl_inc = @sasl_inc@
sasl_lib = @sasl_lib@
@@ -1519,9 +1520,7 @@ config_DATA = $(srcdir)/lib/ldaputil/certmap.conf \
# with the default schema e.g. there is
# considerable overlap of 60changelog.ldif and 01common.ldif
# and 60inetmail.ldif and 50ns-mail.ldif among others
-sampledata_DATA = ldap/admin/src/scripts/failedbinds.py \
- ldap/admin/src/scripts/DSSharedLib \
- ldap/admin/src/scripts/logregex.py \
+sampledata_DATA = ldap/admin/src/scripts/DSSharedLib \
$(srcdir)/ldap/ldif/Ace.ldif \
$(srcdir)/ldap/ldif/European.ldif \
$(srcdir)/ldap/ldif/Eurosuffix.ldif \
@@ -1674,6 +1673,9 @@ perl_DATA = ldap/admin/src/scripts/SetupLog.pm \
ldap/admin/src/scripts/DSUpdate.pm \
ldap/admin/src/scripts/DSUpdateDialogs.pm
+python_DATA = ldap/admin/src/scripts/failedbinds.py \
+ ldap/admin/src/scripts/logregex.py
+
property_DATA = ldap/admin/src/scripts/setup-ds.res \
ldap/admin/src/scripts/migrate-ds.res
@@ -9547,6 +9549,27 @@ uninstall-propertyDATA:
@list='$(property_DATA)'; test -n "$(propertydir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(propertydir)'; $(am__uninstall_files_from_dir)
+install-pythonDATA: $(python_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(python_DATA)'; test -n "$(pythondir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pythondir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pythondir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pythondir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pythondir)" || exit $$?; \
+ done
+
+uninstall-pythonDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(python_DATA)'; test -n "$(pythondir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(pythondir)'; $(am__uninstall_files_from_dir)
install-sampledataDATA: $(sampledata_DATA)
@$(NORMAL_INSTALL)
@list='$(sampledata_DATA)'; test -n "$(sampledatadir)" || list=; \
@@ -9903,7 +9926,7 @@ check: $(BUILT_SOURCES)
all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) \
$(MANS) $(DATA) $(HEADERS) config.h
installdirs:
- for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(taskdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"; do \
+ for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(taskdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
@@ -10058,7 +10081,7 @@ info-am:
install-data-am: install-configDATA install-infDATA \
install-initSCRIPTS install-initconfigDATA install-man \
install-mibDATA install-nodist_propertyDATA install-perlDATA \
- install-pkgconfigDATA install-propertyDATA \
+ install-pkgconfigDATA install-propertyDATA install-pythonDATA \
install-sampledataDATA install-schemaDATA \
install-serverLTLIBRARIES install-serverincHEADERS \
install-serverpluginLTLIBRARIES install-systemdsystemunitDATA \
@@ -10116,10 +10139,10 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
uninstall-initconfigDATA uninstall-man uninstall-mibDATA \
uninstall-nodist_propertyDATA uninstall-perlDATA \
uninstall-pkgconfigDATA uninstall-propertyDATA \
- uninstall-sampledataDATA uninstall-sbinPROGRAMS \
- uninstall-sbinSCRIPTS uninstall-schemaDATA \
- uninstall-serverLTLIBRARIES uninstall-serverincHEADERS \
- uninstall-serverpluginLTLIBRARIES \
+ uninstall-pythonDATA uninstall-sampledataDATA \
+ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS \
+ uninstall-schemaDATA uninstall-serverLTLIBRARIES \
+ uninstall-serverincHEADERS uninstall-serverpluginLTLIBRARIES \
uninstall-systemdsystemunitDATA uninstall-taskSCRIPTS \
uninstall-updateDATA uninstall-updateSCRIPTS
@@ -10145,8 +10168,9 @@ uninstall-man: uninstall-man1 uninstall-man8
install-man1 install-man8 install-mibDATA \
install-nodist_propertyDATA install-pdf install-pdf-am \
install-perlDATA install-pkgconfigDATA install-propertyDATA \
- install-ps install-ps-am install-sampledataDATA \
- install-sbinPROGRAMS install-sbinSCRIPTS install-schemaDATA \
+ install-ps install-ps-am install-pythonDATA \
+ install-sampledataDATA install-sbinPROGRAMS \
+ install-sbinSCRIPTS install-schemaDATA \
install-serverLTLIBRARIES install-serverincHEADERS \
install-serverpluginLTLIBRARIES install-strip \
install-systemdsystemunitDATA install-taskSCRIPTS \
@@ -10160,15 +10184,16 @@ uninstall-man: uninstall-man1 uninstall-man8
uninstall-man1 uninstall-man8 uninstall-mibDATA \
uninstall-nodist_propertyDATA uninstall-perlDATA \
uninstall-pkgconfigDATA uninstall-propertyDATA \
- uninstall-sampledataDATA uninstall-sbinPROGRAMS \
- uninstall-sbinSCRIPTS uninstall-schemaDATA \
- uninstall-serverLTLIBRARIES uninstall-serverincHEADERS \
- uninstall-serverpluginLTLIBRARIES \
+ uninstall-pythonDATA uninstall-sampledataDATA \
+ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS \
+ uninstall-schemaDATA uninstall-serverLTLIBRARIES \
+ uninstall-serverincHEADERS uninstall-serverpluginLTLIBRARIES \
uninstall-systemdsystemunitDATA uninstall-taskSCRIPTS \
uninstall-updateDATA uninstall-updateSCRIPTS
clean-local:
+ -rm -rf dist
-rm -rf selinux-built
dberrstrs.h: Makefile
diff --git a/configure b/configure
index 22cc78f..fd1bfb6 100755
--- a/configure
+++ b/configure
@@ -720,6 +720,7 @@ defaultuser
updatedir
mibdir
infdir
+pythondir
perldir
scripttemplatedir
serverplugindir
@@ -17934,6 +17935,8 @@ if test "$with_fhs_opt" = "yes"; then
propertydir=/properties
# relative to libdir
perldir=/perl
+ # relative to libdir
+ pythondir=/python
else
if test "$with_fhs" = "yes"; then
ac_default_prefix=/usr
@@ -17963,6 +17966,8 @@ else
propertydir=/$PACKAGE_NAME/properties
# relative to libdir
perldir=/$PACKAGE_NAME/perl
+ # relative to libdir
+ pythondir=/$PACKAGE_NAME/python
fi
# if mandir is the default value, override it
@@ -18216,6 +18221,7 @@ fi
+
# check for --with-instconfigdir
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-instconfigdir" >&5
$as_echo_n "checking for --with-instconfigdir... " >&6; }
commit f1bbfe2ff0768128b10903ca1262302313b74ad6
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Feb 20 13:18:06 2014 -0800
Ticket #47709 - package issue in 389-ds-base
Description: Following the package guideline, moving pytyon binaries
to the architecture aware location and libns-dshttpd.so* from 389-ds-base
to 389-ds-base-libs.
https://fedorahosted.org/389/ticket/47709
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
(cherry picked from commit a32b2a9ddc5764d449b051c20077643585e81def)
(cherry picked from commit 011385ad8cb8afc42611b57a3a88600eb1d56932)
diff --git a/Makefile.am b/Makefile.am
index 3e65cd7..28206d0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -167,6 +167,7 @@ initdir = @initdir@
initconfigdir = $(sysconfdir)@initconfigdir@
instconfigdir = @instconfigdir@
perldir = $(libdir)@perldir@
+pythondir = $(libdir)@pythondir@
infdir = $(datadir)@infdir@
mibdir = $(datadir)@mibdir@
updatedir = $(datadir)@updatedir@
@@ -251,9 +252,7 @@ config_DATA = $(srcdir)/lib/ldaputil/certmap.conf \
# with the default schema e.g. there is
# considerable overlap of 60changelog.ldif and 01common.ldif
# and 60inetmail.ldif and 50ns-mail.ldif among others
-sampledata_DATA = ldap/admin/src/scripts/failedbinds.py \
- ldap/admin/src/scripts/DSSharedLib \
- ldap/admin/src/scripts/logregex.py \
+sampledata_DATA = ldap/admin/src/scripts/DSSharedLib \
$(srcdir)/ldap/ldif/Ace.ldif \
$(srcdir)/ldap/ldif/European.ldif \
$(srcdir)/ldap/ldif/Eurosuffix.ldif \
@@ -405,6 +404,9 @@ perl_DATA = ldap/admin/src/scripts/SetupLog.pm \
ldap/admin/src/scripts/DSUpdate.pm \
ldap/admin/src/scripts/DSUpdateDialogs.pm
+python_DATA = ldap/admin/src/scripts/failedbinds.py \
+ ldap/admin/src/scripts/logregex.py
+
property_DATA = ldap/admin/src/scripts/setup-ds.res \
ldap/admin/src/scripts/migrate-ds.res
diff --git a/configure.ac b/configure.ac
index 2376b34..908683e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -264,6 +264,8 @@ if test "$with_fhs_opt" = "yes"; then
propertydir=/properties
# relative to libdir
perldir=/perl
+ # relative to libdir
+ pythondir=/python
else
if test "$with_fhs" = "yes"; then
ac_default_prefix=/usr
@@ -295,6 +297,8 @@ else
propertydir=/$PACKAGE_NAME/properties
# relative to libdir
perldir=/$PACKAGE_NAME/perl
+ # relative to libdir
+ pythondir=/$PACKAGE_NAME/python
fi
# if mandir is the default value, override it
@@ -403,6 +407,7 @@ AC_SUBST(serverincdir)
AC_SUBST(serverplugindir)
AC_SUBST(scripttemplatedir)
AC_SUBST(perldir)
+AC_SUBST(pythondir)
AC_SUBST(infdir)
AC_SUBST(mibdir)
AC_SUBST(mandir)
10 years, 1 month
Branch '389-ds-base-1.3.2' - 2 commits - Makefile.am Makefile.in configure configure.ac
by Noriko Hosoi
Makefile.am | 8 ++++---
Makefile.in | 64 ++++++++++++++++++++++++++++++++++++++++-------------------
configure | 6 +++++
configure.ac | 5 ++++
4 files changed, 60 insertions(+), 23 deletions(-)
New commits:
commit 3700e92464d4673d8477a39d2667282c8b3c89bf
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Feb 20 15:23:18 2014 -0800
Ticket #47709 - package issue in 389-ds-base
Description: Automatically generated files: Makefile.in, configure
diff --git a/Makefile.in b/Makefile.in
index d5574ed..073a142 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -144,9 +144,9 @@ am__installdirs = "$(DESTDIR)$(serverdir)" \
"$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" \
"$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" \
"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" \
- "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)" \
- "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(updatedir)" \
- "$(DESTDIR)$(serverincdir)"
+ "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(sampledatadir)" \
+ "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" \
+ "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"
LTLIBRARIES = $(server_LTLIBRARIES) $(serverplugin_LTLIBRARIES)
am__DEPENDENCIES_1 =
libacctpolicy_plugin_la_DEPENDENCIES = libslapd.la \
@@ -1129,8 +1129,8 @@ NROFF = nroff
MANS = $(dist_man_MANS)
DATA = $(config_DATA) $(inf_DATA) $(initconfig_DATA) $(mib_DATA) \
$(nodist_property_DATA) $(perl_DATA) $(pkgconfig_DATA) \
- $(property_DATA) $(sampledata_DATA) $(schema_DATA) \
- $(systemdsystemunit_DATA) $(update_DATA)
+ $(property_DATA) $(python_DATA) $(sampledata_DATA) \
+ $(schema_DATA) $(systemdsystemunit_DATA) $(update_DATA)
HEADERS = $(serverinc_HEADERS)
ETAGS = etags
CTAGS = ctags
@@ -1339,6 +1339,7 @@ prefix = @prefix@
program_transform_name = @program_transform_name@
propertydir = $(datadir)@propertydir@
psdir = @psdir@
+pythondir = $(libdir)@pythondir@
sampledatadir = $(datadir)@sampledatadir@
sasl_inc = @sasl_inc@
sasl_lib = @sasl_lib@
@@ -1547,9 +1548,7 @@ config_DATA = $(srcdir)/lib/ldaputil/certmap.conf \
# with the default schema e.g. there is
# considerable overlap of 60changelog.ldif and 01common.ldif
# and 60inetmail.ldif and 50ns-mail.ldif among others
-sampledata_DATA = ldap/admin/src/scripts/failedbinds.py \
- ldap/admin/src/scripts/DSSharedLib \
- ldap/admin/src/scripts/logregex.py \
+sampledata_DATA = ldap/admin/src/scripts/DSSharedLib \
$(srcdir)/ldap/ldif/Ace.ldif \
$(srcdir)/ldap/ldif/European.ldif \
$(srcdir)/ldap/ldif/Eurosuffix.ldif \
@@ -1702,6 +1701,9 @@ perl_DATA = ldap/admin/src/scripts/SetupLog.pm \
ldap/admin/src/scripts/DSUpdate.pm \
ldap/admin/src/scripts/DSUpdateDialogs.pm
+python_DATA = ldap/admin/src/scripts/failedbinds.py \
+ ldap/admin/src/scripts/logregex.py
+
property_DATA = ldap/admin/src/scripts/setup-ds.res \
ldap/admin/src/scripts/migrate-ds.res
@@ -9674,6 +9676,27 @@ uninstall-propertyDATA:
@list='$(property_DATA)'; test -n "$(propertydir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(propertydir)'; $(am__uninstall_files_from_dir)
+install-pythonDATA: $(python_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(python_DATA)'; test -n "$(pythondir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pythondir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pythondir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pythondir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pythondir)" || exit $$?; \
+ done
+
+uninstall-pythonDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(python_DATA)'; test -n "$(pythondir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(pythondir)'; $(am__uninstall_files_from_dir)
install-sampledataDATA: $(sampledata_DATA)
@$(NORMAL_INSTALL)
@list='$(sampledata_DATA)'; test -n "$(sampledatadir)" || list=; \
@@ -10030,7 +10053,7 @@ check: $(BUILT_SOURCES)
all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) \
$(MANS) $(DATA) $(HEADERS) config.h
installdirs:
- for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(taskdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"; do \
+ for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(taskdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
@@ -10189,7 +10212,7 @@ info-am:
install-data-am: install-configDATA install-infDATA \
install-initSCRIPTS install-initconfigDATA install-man \
install-mibDATA install-nodist_propertyDATA install-perlDATA \
- install-pkgconfigDATA install-propertyDATA \
+ install-pkgconfigDATA install-propertyDATA install-pythonDATA \
install-sampledataDATA install-schemaDATA \
install-serverLTLIBRARIES install-serverincHEADERS \
install-serverpluginLTLIBRARIES install-systemdsystemunitDATA \
@@ -10247,10 +10270,10 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
uninstall-initconfigDATA uninstall-man uninstall-mibDATA \
uninstall-nodist_propertyDATA uninstall-perlDATA \
uninstall-pkgconfigDATA uninstall-propertyDATA \
- uninstall-sampledataDATA uninstall-sbinPROGRAMS \
- uninstall-sbinSCRIPTS uninstall-schemaDATA \
- uninstall-serverLTLIBRARIES uninstall-serverincHEADERS \
- uninstall-serverpluginLTLIBRARIES \
+ uninstall-pythonDATA uninstall-sampledataDATA \
+ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS \
+ uninstall-schemaDATA uninstall-serverLTLIBRARIES \
+ uninstall-serverincHEADERS uninstall-serverpluginLTLIBRARIES \
uninstall-systemdsystemunitDATA uninstall-taskSCRIPTS \
uninstall-updateDATA uninstall-updateSCRIPTS
@@ -10276,8 +10299,9 @@ uninstall-man: uninstall-man1 uninstall-man8
install-man1 install-man8 install-mibDATA \
install-nodist_propertyDATA install-pdf install-pdf-am \
install-perlDATA install-pkgconfigDATA install-propertyDATA \
- install-ps install-ps-am install-sampledataDATA \
- install-sbinPROGRAMS install-sbinSCRIPTS install-schemaDATA \
+ install-ps install-ps-am install-pythonDATA \
+ install-sampledataDATA install-sbinPROGRAMS \
+ install-sbinSCRIPTS install-schemaDATA \
install-serverLTLIBRARIES install-serverincHEADERS \
install-serverpluginLTLIBRARIES install-strip \
install-systemdsystemunitDATA install-taskSCRIPTS \
@@ -10291,10 +10315,10 @@ uninstall-man: uninstall-man1 uninstall-man8
uninstall-man1 uninstall-man8 uninstall-mibDATA \
uninstall-nodist_propertyDATA uninstall-perlDATA \
uninstall-pkgconfigDATA uninstall-propertyDATA \
- uninstall-sampledataDATA uninstall-sbinPROGRAMS \
- uninstall-sbinSCRIPTS uninstall-schemaDATA \
- uninstall-serverLTLIBRARIES uninstall-serverincHEADERS \
- uninstall-serverpluginLTLIBRARIES \
+ uninstall-pythonDATA uninstall-sampledataDATA \
+ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS \
+ uninstall-schemaDATA uninstall-serverLTLIBRARIES \
+ uninstall-serverincHEADERS uninstall-serverpluginLTLIBRARIES \
uninstall-systemdsystemunitDATA uninstall-taskSCRIPTS \
uninstall-updateDATA uninstall-updateSCRIPTS
diff --git a/configure b/configure
index 22cc78f..fd1bfb6 100755
--- a/configure
+++ b/configure
@@ -720,6 +720,7 @@ defaultuser
updatedir
mibdir
infdir
+pythondir
perldir
scripttemplatedir
serverplugindir
@@ -17934,6 +17935,8 @@ if test "$with_fhs_opt" = "yes"; then
propertydir=/properties
# relative to libdir
perldir=/perl
+ # relative to libdir
+ pythondir=/python
else
if test "$with_fhs" = "yes"; then
ac_default_prefix=/usr
@@ -17963,6 +17966,8 @@ else
propertydir=/$PACKAGE_NAME/properties
# relative to libdir
perldir=/$PACKAGE_NAME/perl
+ # relative to libdir
+ pythondir=/$PACKAGE_NAME/python
fi
# if mandir is the default value, override it
@@ -18216,6 +18221,7 @@ fi
+
# check for --with-instconfigdir
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-instconfigdir" >&5
$as_echo_n "checking for --with-instconfigdir... " >&6; }
commit 011385ad8cb8afc42611b57a3a88600eb1d56932
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Feb 20 13:18:06 2014 -0800
Ticket #47709 - package issue in 389-ds-base
Description: Following the package guideline, moving pytyon binaries
to the architecture aware location and libns-dshttpd.so* from 389-ds-base
to 389-ds-base-libs.
https://fedorahosted.org/389/ticket/47709
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
(cherry picked from commit a32b2a9ddc5764d449b051c20077643585e81def)
diff --git a/Makefile.am b/Makefile.am
index 26174bf..be5a4f9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -168,6 +168,7 @@ initdir = @initdir@
initconfigdir = $(sysconfdir)@initconfigdir@
instconfigdir = @instconfigdir@
perldir = $(libdir)@perldir@
+pythondir = $(libdir)@pythondir@
infdir = $(datadir)@infdir@
mibdir = $(datadir)@mibdir@
updatedir = $(datadir)@updatedir@
@@ -254,9 +255,7 @@ config_DATA = $(srcdir)/lib/ldaputil/certmap.conf \
# with the default schema e.g. there is
# considerable overlap of 60changelog.ldif and 01common.ldif
# and 60inetmail.ldif and 50ns-mail.ldif among others
-sampledata_DATA = ldap/admin/src/scripts/failedbinds.py \
- ldap/admin/src/scripts/DSSharedLib \
- ldap/admin/src/scripts/logregex.py \
+sampledata_DATA = ldap/admin/src/scripts/DSSharedLib \
$(srcdir)/ldap/ldif/Ace.ldif \
$(srcdir)/ldap/ldif/European.ldif \
$(srcdir)/ldap/ldif/Eurosuffix.ldif \
@@ -408,6 +407,9 @@ perl_DATA = ldap/admin/src/scripts/SetupLog.pm \
ldap/admin/src/scripts/DSUpdate.pm \
ldap/admin/src/scripts/DSUpdateDialogs.pm
+python_DATA = ldap/admin/src/scripts/failedbinds.py \
+ ldap/admin/src/scripts/logregex.py
+
property_DATA = ldap/admin/src/scripts/setup-ds.res \
ldap/admin/src/scripts/migrate-ds.res
diff --git a/configure.ac b/configure.ac
index 2376b34..908683e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -264,6 +264,8 @@ if test "$with_fhs_opt" = "yes"; then
propertydir=/properties
# relative to libdir
perldir=/perl
+ # relative to libdir
+ pythondir=/python
else
if test "$with_fhs" = "yes"; then
ac_default_prefix=/usr
@@ -295,6 +297,8 @@ else
propertydir=/$PACKAGE_NAME/properties
# relative to libdir
perldir=/$PACKAGE_NAME/perl
+ # relative to libdir
+ pythondir=/$PACKAGE_NAME/python
fi
# if mandir is the default value, override it
@@ -403,6 +407,7 @@ AC_SUBST(serverincdir)
AC_SUBST(serverplugindir)
AC_SUBST(scripttemplatedir)
AC_SUBST(perldir)
+AC_SUBST(pythondir)
AC_SUBST(infdir)
AC_SUBST(mibdir)
AC_SUBST(mandir)
10 years, 1 month
2 commits - configure configure.ac Makefile.am Makefile.in
by Noriko Hosoi
Makefile.am | 8 ++++---
Makefile.in | 64 ++++++++++++++++++++++++++++++++++++++++-------------------
configure | 42 +++++++++++++++++++++++++++++++++++---
configure.ac | 22 ++++++++++++++++++++
4 files changed, 110 insertions(+), 26 deletions(-)
New commits:
commit b7e9f9f3c35e7b3e964378a5606594942cf44b5f
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Feb 20 13:18:53 2014 -0800
Ticket #47709 - package issue in 389-ds-base
Description: Automatically generated files: Makefile.in, configure
diff --git a/Makefile.in b/Makefile.in
index 780227f..1d8fa47 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -176,9 +176,9 @@ am__installdirs = "$(DESTDIR)$(serverdir)" \
"$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" \
"$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" \
"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" \
- "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)" \
- "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(updatedir)" \
- "$(DESTDIR)$(serverincdir)"
+ "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(sampledatadir)" \
+ "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" \
+ "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"
LTLIBRARIES = $(server_LTLIBRARIES) $(serverplugin_LTLIBRARIES)
am__DEPENDENCIES_1 =
libacctpolicy_plugin_la_DEPENDENCIES = libslapd.la \
@@ -1227,8 +1227,8 @@ NROFF = nroff
MANS = $(dist_man_MANS)
DATA = $(config_DATA) $(inf_DATA) $(initconfig_DATA) $(mib_DATA) \
$(nodist_property_DATA) $(perl_DATA) $(pkgconfig_DATA) \
- $(property_DATA) $(sampledata_DATA) $(schema_DATA) \
- $(systemdsystemunit_DATA) $(update_DATA)
+ $(property_DATA) $(python_DATA) $(sampledata_DATA) \
+ $(schema_DATA) $(systemdsystemunit_DATA) $(update_DATA)
HEADERS = $(serverinc_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
@@ -1456,6 +1456,7 @@ prefix = @prefix@
program_transform_name = @program_transform_name@
propertydir = $(datadir)@propertydir@
psdir = @psdir@
+pythondir = $(libdir)@pythondir@
sampledatadir = $(datadir)@sampledatadir@
sasl_inc = @sasl_inc@
sasl_lib = @sasl_lib@
@@ -1664,9 +1665,7 @@ config_DATA = $(srcdir)/lib/ldaputil/certmap.conf \
# with the default schema e.g. there is
# considerable overlap of 60changelog.ldif and 01common.ldif
# and 60inetmail.ldif and 50ns-mail.ldif among others
-sampledata_DATA = ldap/admin/src/scripts/failedbinds.py \
- ldap/admin/src/scripts/DSSharedLib \
- ldap/admin/src/scripts/logregex.py \
+sampledata_DATA = ldap/admin/src/scripts/DSSharedLib \
$(srcdir)/ldap/ldif/Ace.ldif \
$(srcdir)/ldap/ldif/European.ldif \
$(srcdir)/ldap/ldif/Eurosuffix.ldif \
@@ -1819,6 +1818,9 @@ perl_DATA = ldap/admin/src/scripts/SetupLog.pm \
ldap/admin/src/scripts/DSUpdate.pm \
ldap/admin/src/scripts/DSUpdateDialogs.pm
+python_DATA = ldap/admin/src/scripts/failedbinds.py \
+ ldap/admin/src/scripts/logregex.py
+
property_DATA = ldap/admin/src/scripts/setup-ds.res \
ldap/admin/src/scripts/migrate-ds.res
@@ -9851,6 +9853,27 @@ uninstall-propertyDATA:
@list='$(property_DATA)'; test -n "$(propertydir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(propertydir)'; $(am__uninstall_files_from_dir)
+install-pythonDATA: $(python_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(python_DATA)'; test -n "$(pythondir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pythondir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pythondir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pythondir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pythondir)" || exit $$?; \
+ done
+
+uninstall-pythonDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(python_DATA)'; test -n "$(pythondir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(pythondir)'; $(am__uninstall_files_from_dir)
install-sampledataDATA: $(sampledata_DATA)
@$(NORMAL_INSTALL)
@list='$(sampledata_DATA)'; test -n "$(sampledatadir)" || list=; \
@@ -10177,7 +10200,7 @@ check: $(BUILT_SOURCES)
all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) \
$(MANS) $(DATA) $(HEADERS) config.h
installdirs:
- for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(taskdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"; do \
+ for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(taskdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
@@ -10336,7 +10359,7 @@ info-am:
install-data-am: install-configDATA install-infDATA \
install-initSCRIPTS install-initconfigDATA install-man \
install-mibDATA install-nodist_propertyDATA install-perlDATA \
- install-pkgconfigDATA install-propertyDATA \
+ install-pkgconfigDATA install-propertyDATA install-pythonDATA \
install-sampledataDATA install-schemaDATA \
install-serverLTLIBRARIES install-serverincHEADERS \
install-serverpluginLTLIBRARIES install-systemdsystemunitDATA \
@@ -10394,10 +10417,10 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
uninstall-initconfigDATA uninstall-man uninstall-mibDATA \
uninstall-nodist_propertyDATA uninstall-perlDATA \
uninstall-pkgconfigDATA uninstall-propertyDATA \
- uninstall-sampledataDATA uninstall-sbinPROGRAMS \
- uninstall-sbinSCRIPTS uninstall-schemaDATA \
- uninstall-serverLTLIBRARIES uninstall-serverincHEADERS \
- uninstall-serverpluginLTLIBRARIES \
+ uninstall-pythonDATA uninstall-sampledataDATA \
+ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS \
+ uninstall-schemaDATA uninstall-serverLTLIBRARIES \
+ uninstall-serverincHEADERS uninstall-serverpluginLTLIBRARIES \
uninstall-systemdsystemunitDATA uninstall-taskSCRIPTS \
uninstall-updateDATA uninstall-updateSCRIPTS
@@ -10423,8 +10446,9 @@ uninstall-man: uninstall-man1 uninstall-man8
install-man1 install-man8 install-mibDATA \
install-nodist_propertyDATA install-pdf install-pdf-am \
install-perlDATA install-pkgconfigDATA install-propertyDATA \
- install-ps install-ps-am install-sampledataDATA \
- install-sbinPROGRAMS install-sbinSCRIPTS install-schemaDATA \
+ install-ps install-ps-am install-pythonDATA \
+ install-sampledataDATA install-sbinPROGRAMS \
+ install-sbinSCRIPTS install-schemaDATA \
install-serverLTLIBRARIES install-serverincHEADERS \
install-serverpluginLTLIBRARIES install-strip \
install-systemdsystemunitDATA install-taskSCRIPTS \
@@ -10438,10 +10462,10 @@ uninstall-man: uninstall-man1 uninstall-man8
uninstall-man1 uninstall-man8 uninstall-mibDATA \
uninstall-nodist_propertyDATA uninstall-perlDATA \
uninstall-pkgconfigDATA uninstall-propertyDATA \
- uninstall-sampledataDATA uninstall-sbinPROGRAMS \
- uninstall-sbinSCRIPTS uninstall-schemaDATA \
- uninstall-serverLTLIBRARIES uninstall-serverincHEADERS \
- uninstall-serverpluginLTLIBRARIES \
+ uninstall-pythonDATA uninstall-sampledataDATA \
+ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS \
+ uninstall-schemaDATA uninstall-serverLTLIBRARIES \
+ uninstall-serverincHEADERS uninstall-serverpluginLTLIBRARIES \
uninstall-systemdsystemunitDATA uninstall-taskSCRIPTS \
uninstall-updateDATA uninstall-updateSCRIPTS
diff --git a/configure b/configure
index b37b5e2..da1517c 100755
--- a/configure
+++ b/configure
@@ -720,6 +720,7 @@ defaultuser
updatedir
mibdir
infdir
+pythondir
perldir
scripttemplatedir
serverplugindir
@@ -914,6 +915,7 @@ with_fhs
with_fhs_opt
with_tmpfiles_d
with_perldir
+with_pythondir
with_systemdsystemunitdir
with_systemdsystemconfdir
with_systemdgroupname
@@ -1639,6 +1641,8 @@ Optional Packages:
--with-perldir=PATH Directory for perl)
+ --with-pythondir=PATH Directory for python)
+
--with-systemdsystemunitdir=PATH
Directory for systemd service files (default:
$with_systemdsystemunitdir)
@@ -7430,7 +7434,7 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
@@ -7448,7 +7452,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- ppc64-*linux*|powerpc64-*linux*)
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -7467,7 +7474,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- ppc*-*linux*|powerpc*-*linux*)
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
@@ -17988,6 +17998,8 @@ if test "$with_fhs_opt" = "yes"; then
propertydir=/properties
# relative to libdir
perldir=/perl
+ # relative to libdir
+ pythondir=/python
else
if test "$with_fhs" = "yes"; then
ac_default_prefix=/usr
@@ -18017,6 +18029,8 @@ else
propertydir=/$PACKAGE_NAME/properties
# relative to libdir
perldir=/$PACKAGE_NAME/perl
+ # relative to libdir
+ pythondir=/$PACKAGE_NAME/python
fi
# if mandir is the default value, override it
@@ -18204,6 +18218,27 @@ else
with_perldir=
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pythondir" >&5
+$as_echo_n "checking for --with-pythondir... " >&6; }
+
+# Check whether --with-pythondir was given.
+if test "${with_pythondir+set}" = set; then :
+ withval=$with_pythondir;
+fi
+
+if test -n "$with_pythondir"; then
+ if test "$with_pythondir" = yes ; then
+ as_fn_error $? "You must specify --with-pythondir=/full/path/to/python" "$LINENO" 5
+ elif test "$with_pythondir" = no ; then
+ with_pythondir=
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pythondir" >&5
+$as_echo "$with_pythondir" >&6; }
+ fi
+else
+ with_pythondir=
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-systemdsystemunitdir" >&5
$as_echo_n "checking for --with-systemdsystemunitdir... " >&6; }
@@ -18292,6 +18327,7 @@ fi
+
# check for --with-instconfigdir
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-instconfigdir" >&5
$as_echo_n "checking for --with-instconfigdir... " >&6; }
commit a32b2a9ddc5764d449b051c20077643585e81def
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Feb 20 13:18:06 2014 -0800
Ticket #47709 - package issue in 389-ds-base
Description: Following the package guideline, moving pytyon binaries
to the architecture aware location and libns-dshttpd.so* from 389-ds-base
to 389-ds-base-libs.
https://fedorahosted.org/389/ticket/47709
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
diff --git a/Makefile.am b/Makefile.am
index 60c3d3c..04bada8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -168,6 +168,7 @@ initdir = @initdir@
initconfigdir = $(sysconfdir)@initconfigdir@
instconfigdir = @instconfigdir@
perldir = $(libdir)@perldir@
+pythondir = $(libdir)@pythondir@
infdir = $(datadir)@infdir@
mibdir = $(datadir)@mibdir@
updatedir = $(datadir)@updatedir@
@@ -254,9 +255,7 @@ config_DATA = $(srcdir)/lib/ldaputil/certmap.conf \
# with the default schema e.g. there is
# considerable overlap of 60changelog.ldif and 01common.ldif
# and 60inetmail.ldif and 50ns-mail.ldif among others
-sampledata_DATA = ldap/admin/src/scripts/failedbinds.py \
- ldap/admin/src/scripts/DSSharedLib \
- ldap/admin/src/scripts/logregex.py \
+sampledata_DATA = ldap/admin/src/scripts/DSSharedLib \
$(srcdir)/ldap/ldif/Ace.ldif \
$(srcdir)/ldap/ldif/European.ldif \
$(srcdir)/ldap/ldif/Eurosuffix.ldif \
@@ -408,6 +407,9 @@ perl_DATA = ldap/admin/src/scripts/SetupLog.pm \
ldap/admin/src/scripts/DSUpdate.pm \
ldap/admin/src/scripts/DSUpdateDialogs.pm
+python_DATA = ldap/admin/src/scripts/failedbinds.py \
+ ldap/admin/src/scripts/logregex.py
+
property_DATA = ldap/admin/src/scripts/setup-ds.res \
ldap/admin/src/scripts/migrate-ds.res
diff --git a/configure.ac b/configure.ac
index 7216f88..16ab6a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -264,6 +264,8 @@ if test "$with_fhs_opt" = "yes"; then
propertydir=/properties
# relative to libdir
perldir=/perl
+ # relative to libdir
+ pythondir=/python
else
if test "$with_fhs" = "yes"; then
ac_default_prefix=/usr
@@ -295,6 +297,8 @@ else
propertydir=/$PACKAGE_NAME/properties
# relative to libdir
perldir=/$PACKAGE_NAME/perl
+ # relative to libdir
+ pythondir=/$PACKAGE_NAME/python
fi
# if mandir is the default value, override it
@@ -355,6 +359,23 @@ else
with_perldir=
fi
+AC_MSG_CHECKING(for --with-pythondir)
+AC_ARG_WITH([pythondir],
+ AS_HELP_STRING([--with-pythondir=PATH],
+ [Directory for python)])
+)
+if test -n "$with_pythondir"; then
+ if test "$with_pythondir" = yes ; then
+ AC_MSG_ERROR([You must specify --with-pythondir=/full/path/to/python])
+ elif test "$with_pythondir" = no ; then
+ with_pythondir=
+ else
+ AC_MSG_RESULT([$with_pythondir])
+ fi
+else
+ with_pythondir=
+fi
+
AC_MSG_CHECKING(for --with-systemdsystemunitdir)
AC_ARG_WITH([systemdsystemunitdir],
AS_HELP_STRING([--with-systemdsystemunitdir=PATH],
@@ -421,6 +442,7 @@ AC_SUBST(serverincdir)
AC_SUBST(serverplugindir)
AC_SUBST(scripttemplatedir)
AC_SUBST(perldir)
+AC_SUBST(pythondir)
AC_SUBST(infdir)
AC_SUBST(mibdir)
AC_SUBST(mandir)
10 years, 1 month
Branch '389-ds-base-1.3.1' - 2 commits - ldap/servers
by Noriko Hosoi
ldap/servers/plugins/posix-winsync/posix-group-func.c | 2
ldap/servers/plugins/replication/windows_protocol_util.c | 563 +++++++++++----
ldap/servers/slapd/valueset.c | 17
3 files changed, 437 insertions(+), 145 deletions(-)
New commits:
commit 8772ea1ac524f1f011d51d0a42c0055f5641e2e6
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Aug 5 12:53:18 2013 -0700
Ticket #415 - winsync doesn't sync DN valued attributes if DS DN value doesn't exist
Bug description:
2 case were fixed.
1) A group on AD has a member which is not a target of windows
sync and exists only on AD. The member value in the group is
synchronized to DS. If an operation is executed on AD so that
the member is replaced with other members which are the target
of the windows sync, the new member values are not synchronized.
2) If a group on AD and DS have members which are local and are
not synchronized and the members are removed in the group on
the other side, the delete operation is synchronized and
deletes all the members including the local members.
Fix description:
1) In windows_generate_update_mods, even if a sync'ed member value
in a DS entry is not the target of windows sync and it is does
not exist on DS, a following modify operation including the member
value is proceeded by confirming the existence on AD.
2) AD->DS: in windows_map_mods_for_replay
DS->AD: in windwos_generate_update_mods
added the code to check if an attribute is completely deleted on
one side, then the each value on the other side is in the sync
scope or not. Put the value to the mod for the delete only if
the value is in the sync scope.
Reviewed by Rich (Thank you!!)
https://fedorahosted.org/389/ticket/415
(cherry picked from commit 03814dd74df7f1f0d2842c5096c6425609da6f2c)
diff --git a/ldap/servers/plugins/posix-winsync/posix-group-func.c b/ldap/servers/plugins/posix-winsync/posix-group-func.c
index 664d637..aa76d6c 100644
--- a/ldap/servers/plugins/posix-winsync/posix-group-func.c
+++ b/ldap/servers/plugins/posix-winsync/posix-group-func.c
@@ -98,7 +98,7 @@ getEntry(const char *udn, char **attrs)
}
else {
slapi_log_error(SLAPI_LOG_FATAL, POSIX_WINSYNC_PLUGIN_NAME,
- "getEntry: error searching for uid: %d", rc);
+ "getEntry: error searching for uid: %d\n", rc);
}
return NULL;
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index caf4306..88b0e70 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -409,12 +409,19 @@ map_dn_values(Private_Repl_Protocol *prp,Slapi_ValueSet *original_values, Slapi_
int retval = 0;
int i = 0;
+ if (NULL == mapped_values) {
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "%s: map_dn_values: arg mapped_values is NULL.\n",
+ agmt_get_long_name(prp->agmt));
+ return;
+ }
+
/* Set the keep raw entry flag to avoid overwriting the existing raw entry. */
windows_private_set_keep_raw_entry(prp->agmt, 1);
/* For each value: */
- i= slapi_valueset_first_value(original_values,&original_value);
- while ( i != -1 ) {
+ i= slapi_valueset_first_value(original_values,&original_value);
+ while ( i != -1 ) {
int is_ours = 0;
char *new_dn_string = NULL;
@@ -480,7 +487,7 @@ map_dn_values(Private_Repl_Protocol *prp,Slapi_ValueSet *original_values, Slapi_
local_entry = NULL;
}
} else
- {
+ { /* from windows */
Slapi_Entry *remote_entry = NULL;
Slapi_DN *local_dn = NULL;
/* Try to get the remote entry */
@@ -1584,89 +1591,111 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op
slapi_entry_free(ad_entry); /* getting sets windows_private_get_raw_entry */
}
+ /*
+ * If the magic objectclass and attributes have been added to the entry
+ * to make the entry sync-able, add the entry first, then apply the other
+ * mods
+ */
+ if (sync_attrs_added(op->p.p_modify.modify_mods, local_entry)) {
+ Slapi_Entry *ad_entry = NULL;
- windows_map_mods_for_replay(prp,op->p.p_modify.modify_mods, &mapped_mods, is_user, &password);
- if (is_user) {
- winsync_plugin_call_pre_ad_mod_user_mods_cb(prp->agmt,
- windows_private_get_raw_entry(prp->agmt),
- local_dn,
- local_entry,
- op->p.p_modify.modify_mods,
- remote_dn,
- &mapped_mods);
- } else if (is_group) {
- winsync_plugin_call_pre_ad_mod_group_mods_cb(prp->agmt,
- windows_private_get_raw_entry(prp->agmt),
- local_dn,
- local_entry,
- op->p.p_modify.modify_mods,
- remote_dn,
- &mapped_mods);
+ return_value = process_replay_add(prp,local_entry,local_entry,local_dn,remote_dn,is_user,missing_entry,&password);
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "%s: windows_replay_update: "
+ "The modify operation added the sync objectclass and attribute, so "
+ "the entry was added to windows - result [%d]\n",
+ agmt_get_long_name(prp->agmt), return_value);
+ if (return_value) {
+ break; /* error adding entry - cannot continue */
}
+ /* the modify op needs the new remote entry, so retrieve it */
+ windows_get_remote_entry(prp, remote_dn, &ad_entry);
+ slapi_entry_free(ad_entry); /* getting sets windows_private_get_raw_entry */
+ }
- /* Check if a naming attribute is being modified. */
- if (windows_check_mods_for_rdn_change(prp, op->p.p_modify.modify_mods, local_entry, remote_dn, &newrdn)) {
- /* Issue MODRDN */
- slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "%s: renaming remote entry \"%s\" with new RDN of \"%s\"\n",
- agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn), newrdn);
- return_value = windows_conn_send_rename(prp->conn, slapi_sdn_get_dn(remote_dn),
- newrdn, NULL, 1 /* delete old RDN */,
- NULL, NULL /* returned controls */);
- slapi_ch_free_string(&newrdn);
- }
+ windows_map_mods_for_replay(prp,op->p.p_modify.modify_mods, &mapped_mods, is_user, &password);
+ if (is_user) {
+ winsync_plugin_call_pre_ad_mod_user_mods_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ local_dn,
+ local_entry,
+ op->p.p_modify.modify_mods,
+ remote_dn,
+ &mapped_mods);
+ } else if (is_group) {
+ winsync_plugin_call_pre_ad_mod_group_mods_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ local_dn,
+ local_entry,
+ op->p.p_modify.modify_mods,
+ remote_dn,
+ &mapped_mods);
+ }
- /* It's possible that the mapping process results in an empty mod list, in which case we don't bother with the replay */
- if ( mapped_mods == NULL || *(mapped_mods)== NULL )
- {
- return_value = CONN_OPERATION_SUCCESS;
- } else
+ /* Check if a naming attribute is being modified. */
+ if (windows_check_mods_for_rdn_change(prp, op->p.p_modify.modify_mods, local_entry, remote_dn, &newrdn)) {
+ /* Issue MODRDN */
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "%s: renaming remote entry \"%s\" with new RDN of \"%s\"\n",
+ agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn), newrdn);
+ return_value = windows_conn_send_rename(prp->conn, slapi_sdn_get_dn(remote_dn),
+ newrdn, NULL, 1 /* delete old RDN */,
+ NULL, NULL /* returned controls */);
+ slapi_ch_free_string(&newrdn);
+ }
+
+ /* It's possible that the mapping process results in an empty mod list, in which case we don't bother with the replay */
+ if ((mapped_mods == NULL) || (*mapped_mods == NULL))
+ {
+ return_value = CONN_OPERATION_SUCCESS;
+ } else
+ {
+ int ldap_op = 0;
+ int ldap_result_code = 0;
+ if (slapi_is_loglevel_set(SLAPI_LOG_REPL))
{
- int ldap_op = 0;
- int ldap_result_code = 0;
- if (slapi_is_loglevel_set(SLAPI_LOG_REPL))
+ int i = 0;
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "dump mods for replay update:\n");
+ for(i=0;mapped_mods[i];i++)
{
- int i = 0;
- slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,"dump mods for replay update:");
- for(i=0;mapped_mods[i];i++)
- {
- slapi_mod_dump(mapped_mods[i],i);
- }
- }
- return_value = windows_conn_send_modify(prp->conn, slapi_sdn_get_dn(remote_dn), mapped_mods, NULL, NULL /* returned controls */);
- windows_conn_get_error(prp->conn, &ldap_op, &ldap_result_code);
- if ((return_value != CONN_OPERATION_SUCCESS) && !ldap_result_code) {
- /* op failed but no ldap error code ??? */
- ldap_result_code = LDAP_OPERATIONS_ERROR;
- }
- if (is_user) {
- winsync_plugin_call_post_ad_mod_user_mods_cb(prp->agmt,
- windows_private_get_raw_entry(prp->agmt),
- local_dn, local_entry,
- op->p.p_modify.modify_mods,
- remote_dn, mapped_mods, &ldap_result_code);
- } else if (is_group) {
- winsync_plugin_call_post_ad_mod_group_mods_cb(prp->agmt,
- windows_private_get_raw_entry(prp->agmt),
- local_dn, local_entry,
- op->p.p_modify.modify_mods,
- remote_dn, mapped_mods, &ldap_result_code);
- }
- /* see if plugin reset success/error condition */
- if ((return_value != CONN_OPERATION_SUCCESS) && !ldap_result_code) {
- return_value = CONN_OPERATION_SUCCESS;
- windows_conn_set_error(prp->conn, ldap_result_code);
- } else if ((return_value == CONN_OPERATION_SUCCESS) && ldap_result_code) {
- return_value = CONN_OPERATION_FAILED;
- windows_conn_set_error(prp->conn, ldap_result_code);
+ slapi_mod_dump(mapped_mods[i],i);
}
}
- if (mapped_mods)
- {
- ldap_mods_free(mapped_mods,1);
- mapped_mods = NULL;
+ return_value = windows_conn_send_modify(prp->conn, slapi_sdn_get_dn(remote_dn), mapped_mods, NULL, NULL /* returned controls */);
+ windows_conn_get_error(prp->conn, &ldap_op, &ldap_result_code);
+ if ((return_value != CONN_OPERATION_SUCCESS) && !ldap_result_code) {
+ /* op failed but no ldap error code ??? */
+ ldap_result_code = LDAP_OPERATIONS_ERROR;
+ }
+ if (is_user) {
+ winsync_plugin_call_post_ad_mod_user_mods_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ local_dn, local_entry,
+ op->p.p_modify.modify_mods,
+ remote_dn, mapped_mods, &ldap_result_code);
+ } else if (is_group) {
+ winsync_plugin_call_post_ad_mod_group_mods_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ local_dn, local_entry,
+ op->p.p_modify.modify_mods,
+ remote_dn, mapped_mods, &ldap_result_code);
+ }
+ /* see if plugin reset success/error condition */
+ if ((return_value != CONN_OPERATION_SUCCESS) && !ldap_result_code) {
+ return_value = CONN_OPERATION_SUCCESS;
+ windows_conn_set_error(prp->conn, ldap_result_code);
+ } else if ((return_value == CONN_OPERATION_SUCCESS) && ldap_result_code) {
+ return_value = CONN_OPERATION_FAILED;
+ windows_conn_set_error(prp->conn, ldap_result_code);
}
}
+ if (mapped_mods)
+ {
+ ldap_mods_free(mapped_mods,1);
+ mapped_mods = NULL;
+ }
break;
+ }
case SLAPI_OPERATION_DELETE:
if (delete_remote_entry_allowed(local_entry))
{
@@ -2638,17 +2667,34 @@ done:
static void
-windows_map_mods_for_replay(Private_Repl_Protocol *prp,LDAPMod **original_mods, LDAPMod ***returned_mods, int is_user, char** password)
+windows_map_mods_for_replay(Private_Repl_Protocol *prp,
+ LDAPMod **original_mods,
+ LDAPMod ***returned_mods,
+ int is_user,
+ char** password)
{
Slapi_Mods smods = {0};
Slapi_Mods mapped_smods = {0};
LDAPMod *mod = NULL;
- int is_nt4 = windows_private_get_isnt4(prp->agmt);
+ int is_nt4 = 0;
Slapi_Mod *mysmod = NULL;
const Slapi_Entry *ad_entry = NULL;
Slapi_Entry *ad_entry_copy = NULL;
+ const Slapi_DN *windows_subtree = NULL;
LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_map_mods_for_replay\n", 0, 0, 0 );
+ if (NULL == prp) {
+ LDAPDebug(LDAP_DEBUG_TRACE,
+ "<= windows_map_mods_for_replay; NULL protocol; NOOP\n", 0, 0, 0);
+ return;
+ }
+ windows_subtree = windows_private_get_windows_subtree(prp->agmt);
+ if (NULL == windows_subtree) {
+ LDAPDebug(LDAP_DEBUG_TRACE,
+ "<= windows_map_mods_for_replay; NULL agreement subtree; NOOP\n", 0, 0, 0);
+ return;
+ }
+ is_nt4 = windows_private_get_isnt4(prp->agmt);
/* Iterate through the original mods, looking each attribute type up in the maps for either user or group */
@@ -2736,13 +2782,66 @@ windows_map_mods_for_replay(Private_Repl_Protocol *prp,LDAPMod **original_mods,
mapped_values = NULL;
} else
{
- /* this might be a del: mod, in which case there are no values */
- if (mod->mod_op & LDAP_MOD_DELETE)
+ if (slapi_valueset_isempty(vs) && (mod->mod_op & LDAP_MOD_DELETE))
{
- mysmod = slapi_mod_new();
- slapi_mod_init(mysmod, 0);
- slapi_mod_set_operation(mysmod, LDAP_MOD_DELETE|LDAP_MOD_BVALUES);
- slapi_mod_set_type(mysmod, mapped_type);
+ /* modify - del all, in which case there are no values */
+ Slapi_Attr *attr = NULL;
+
+ /*
+ * ad_entry:
+ * get mapped_type values
+ * get in-scope values from the values
+ */
+ slapi_entry_attr_find(ad_entry, mapped_type, &attr);
+ if (attr) {
+ Slapi_ValueSet *thisvs = NULL;
+ Slapi_Value *valp = NULL;
+ Slapi_DN *sdn = slapi_sdn_new();
+ int i;
+ int is_in_subtree = 0;
+ Slapi_Value **myva = NULL;
+
+ slapi_attr_get_valueset(attr, &thisvs); /* thisvs is dup'ed */
+ for (i = slapi_valueset_first_value(thisvs, &valp);
+ (i != -1) && (valp != NULL);
+ i = slapi_valueset_next_value(thisvs, i, &valp)) {
+ /* valp is a pointer to va in thisvs */
+ const char *strval = slapi_value_get_string(valp); /* no dup */
+ if (strval) {
+ slapi_sdn_set_dn_byref(sdn, strval);
+ is_in_subtree = slapi_sdn_scope_test(sdn, windows_subtree,
+ LDAP_SCOPE_SUBTREE);
+ if (is_in_subtree) {
+ /*
+ * If delete all on DS,
+ * we could delete the values on AD in the scope.
+ */
+ /* myva is (re)allocated and valp is copied */
+ valuearray_add_value(&myva, valp);
+ }
+ }
+ }
+ if (myva) {
+ Slapi_ValueSet *myvs = NULL;
+
+ myvs = slapi_valueset_new();
+ valueset_set_valuearray_passin(myvs, myva);
+ mysmod = slapi_mod_new();
+ slapi_mod_init_valueset_byval(mysmod,
+ LDAP_MOD_DELETE|LDAP_MOD_BVALUES,
+ mapped_type,
+ myvs);
+ slapi_valueset_free(myvs);
+ }
+ slapi_sdn_free(&sdn);
+ slapi_valueset_free(thisvs);
+ } else {
+ /*
+ * No corresponsing attribute in AD.
+ * There's no need to do anything on AD.
+ * slapi_mod_set_type(mysmod, mapped_type);
+ */
+ }
}
}
slapi_mod_done(&smod);
@@ -4295,19 +4394,20 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
int is_group = 0;
int rc = 0;
int is_nt4 = windows_private_get_isnt4(prp->agmt);
+ const Slapi_DN *local_subtree = NULL;
/* Iterate over the attributes on the remote entry, updating the local entry where appropriate */
LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_generate_update_mods\n", 0, 0, 0 );
*do_modify = 0;
- if (!remote_entry || !local_entry) {
- slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
- "%s: windows_generate_update_mods: remote_entry is [%s] local_entry is [%s] "
- "cannot generate update mods\n", agmt_get_long_name(prp->agmt),
- remote_entry ? slapi_entry_get_dn_const(remote_entry) : "NULL",
- local_entry ? slapi_entry_get_dn_const(local_entry) : "NULL");
- goto bail;
- }
+ if (!remote_entry || !local_entry) {
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "%s: windows_generate_update_mods: remote_entry is [%s] local_entry is [%s] "
+ "cannot generate update mods\n", agmt_get_long_name(prp->agmt),
+ remote_entry ? slapi_entry_get_dn_const(remote_entry) : "NULL",
+ local_entry ? slapi_entry_get_dn_const(local_entry) : "NULL");
+ goto bail;
+ }
if (to_windows)
{
@@ -4317,8 +4417,8 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
windows_is_remote_entry_user_or_group(remote_entry,&is_user,&is_group);
}
- for (rc = slapi_entry_first_attr(remote_entry, &attr); rc == 0;
- rc = slapi_entry_next_attr(remote_entry, attr, &attr))
+ for (rc = slapi_entry_first_attr(remote_entry, &attr); rc == 0;
+ rc = slapi_entry_next_attr(remote_entry, attr, &attr))
{
int is_present_local = 0;
char *type = NULL;
@@ -4462,15 +4562,17 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
} else {
/* A dn-valued attribute : need to take special steps */
Slapi_ValueSet *mapped_remote_values = NULL;
+ Slapi_ValueSet *local_values = NULL;
+
+ /* We ignore any DNs that are outside the scope of the agreement (on both sides) */
+ slapi_attr_get_valueset(local_attr,&local_values);
+
/* First map all the DNs to that they're in a consistent domain */
map_dn_values(prp,vs,&mapped_remote_values, to_windows,0);
if (mapped_remote_values)
{
- Slapi_ValueSet *local_values = NULL;
Slapi_ValueSet *restricted_local_values = NULL;
/* Now do a compare on the values, generating mods to bring them into consistency (if any) */
- /* We ignore any DNs that are outside the scope of the agreement (on both sides) */
- slapi_attr_get_valueset(local_attr,&local_values);
if (local_values)
{
map_dn_values(prp,local_values,&restricted_local_values,!to_windows,1);
@@ -4482,6 +4584,9 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
}
else
{
+ windows_generate_dn_value_mods(local_type, local_attr, smods,
+ mapped_remote_values,
+ local_values,do_modify);
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"windows_generate_update_mods: no restricted local values found for "
"local attribute %s in local entry %s for remote attribute "
@@ -4491,9 +4596,9 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
type ? type : "NULL",
slapi_entry_get_dn(remote_entry));
}
- slapi_valueset_free(local_values);
- local_values = NULL;
} else {
+ windows_generate_dn_value_mods(local_type, local_attr, smods,
+ mapped_remote_values, NULL, do_modify);
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"windows_generate_update_mods: no local values found for "
"local attribute %s in local entry %s for remote attribute "
@@ -4506,18 +4611,25 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
slapi_valueset_free(mapped_remote_values);
mapped_remote_values = NULL;
} else {
- slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
- "windows_generate_update_mods: could not map the values in "
- "local attribute %s in local entry %s for remote attribute "
- "%s in remote entry %s\n",
- local_type,
- slapi_entry_get_dn(local_entry),
- type ? type : "NULL",
- slapi_entry_get_dn(remote_entry));
+ if (local_values) {
+ windows_generate_dn_value_mods(local_type, local_attr, smods,
+ NULL, local_values, do_modify);
+ } else {
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "windows_generate_update_mods: could not map the values in "
+ "local attribute %s in local entry %s for remote attribute "
+ "%s in remote entry %s\n",
+ local_type,
+ slapi_entry_get_dn(local_entry),
+ type ? type : "NULL",
+ slapi_entry_get_dn(remote_entry));
+ }
}
+ slapi_valueset_free(local_values);
+ local_values = NULL;
}
} else
- {
+ { /* !is_present_local || is_guid */
if (!is_present_local)
{
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
@@ -4614,37 +4726,91 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
slapi_ch_free_string(&local_type);
}
- /* Check if any attributes were deleted from the remote entry */
- entry_first_deleted_attribute(remote_entry, &del_attr);
- while (del_attr != NULL) {
- Slapi_Attr *local_attr = NULL;
- char *type = NULL;
- char *local_type = NULL;
- int mapdn = 0;
+ /* Check if any attributes were deleted from the remote entry */
+ entry_first_deleted_attribute(remote_entry, &del_attr);
+ local_subtree = windows_private_get_directory_subtree(prp->agmt);
+ while (del_attr != NULL) {
+ Slapi_Attr *local_attr = NULL;
+ char *type = NULL;
+ char *local_type = NULL;
+ int mapdn = 0;
- /* Map remote type to local type */
+ /* Map remote type to local type */
slapi_attr_get_type(del_attr, &type);
- if ( is_straight_mapped_attr(type,is_user,is_nt4) ) {
- local_type = slapi_ch_strdup(type);
- } else {
- windows_map_attr_name(type , to_windows, is_user, 0 /* not create */, &local_type, &mapdn);
- }
-
- /* Check if this attr exists in the local entry */
- if (local_type) {
- slapi_entry_attr_find(local_entry, local_type, &local_attr);
- if (local_attr) {
- slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
- "windows_generate_update_mods: deleting %s attribute from local entry\n", local_type);
- /* Delete this attr from the local entry */
- slapi_mods_add_mod_values(smods, LDAP_MOD_DELETE, local_type, NULL);
+ if ( is_straight_mapped_attr(type,is_user,is_nt4) ) {
+ local_type = slapi_ch_strdup(type);
+ } else {
+ windows_map_attr_name(type , to_windows, is_user, 0 /* not create */, &local_type, &mapdn);
+ }
+
+ /* Check if this attr exists in the local entry */
+ if (local_type) {
+ slapi_entry_attr_find(local_entry, local_type, &local_attr);
+ if (local_attr) {
+ Slapi_Mod *mysmod = NULL;
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "windows_generate_update_mods: deleting %s attribute from local entry\n", local_type);
+ /* Delete this attr from the local entry */
+ /* if type is dn and the dn is out of winsync scope, keep them.
+ * othewise delete all attr. */
+ if (mapdn) {
+ Slapi_ValueSet *vs = NULL;
+ Slapi_Value *valp = NULL;
+ Slapi_DN *sdn = slapi_sdn_new();
+ int i = 0;
+ int is_in_subtree = 0;
+ Slapi_Value **myva = NULL;
+
+ slapi_attr_get_valueset(local_attr, &vs); /* thisvs is dup'ed */
+ for (i = slapi_valueset_first_value(vs, &valp);
+ (i != -1) && (valp != NULL);
+ i = slapi_valueset_next_value(vs, i, &valp)) {
+ /* valp is a pointer to va in vs */
+ const char *strval = slapi_value_get_string(valp); /* no dup */
+ if (strval) {
+ slapi_sdn_set_dn_byref(sdn, strval);
+ is_in_subtree = slapi_sdn_scope_test(sdn, local_subtree,
+ LDAP_SCOPE_SUBTREE);
+ if (is_in_subtree) {
+ /*
+ * If delete all on AD,
+ * we could delete the values on DS in the scope.
+ */
+ /* myva is (re)allocated and valp is copied */
+ valuearray_add_value(&myva, valp);
+ }
+ }
+ }
+ if (myva) {
+ Slapi_ValueSet *myvs = NULL;
+
+ myvs = slapi_valueset_new();
+ valueset_set_valuearray_passin(myvs, myva);
+ mysmod = slapi_mod_new();
+ slapi_mod_init_valueset_byval(mysmod,
+ LDAP_MOD_DELETE|LDAP_MOD_BVALUES,
+ local_type,
+ myvs);
+ slapi_valueset_free(myvs);
+ }
+ slapi_sdn_free(&sdn);
+ slapi_valueset_free(vs);
+ if (mysmod) {
+ slapi_mods_add_ldapmod(smods, slapi_mod_get_ldapmod_passout(mysmod));
+ }
+ if (mysmod) {
+ slapi_mod_free(&mysmod);
+ }
+ } else {
+ slapi_mods_add_mod_values(smods, LDAP_MOD_DELETE, local_type, NULL);
+ }
*do_modify = 1;
- }
- }
+ }
+ }
- entry_next_deleted_attribute(remote_entry, &del_attr);
+ entry_next_deleted_attribute(remote_entry, &del_attr);
slapi_ch_free_string(&local_type);
- }
+ }
if (to_windows) {
if (is_user) {
@@ -4749,7 +4915,7 @@ windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry
static int
windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,Slapi_Entry *local_entry)
{
- Slapi_Mods smods;
+ Slapi_Mods smods = {0};
int retval = 0;
Slapi_PBlock *pb = NULL;
int do_modify = 0;
@@ -4795,9 +4961,9 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
/* compare the parents */
retval = windows_get_superior_change(prp,
- slapi_entry_get_sdn(local_entry),
- mapped_sdn,
- &newsuperior, 0 /* to_windows */);
+ slapi_entry_get_sdn(local_entry),
+ mapped_sdn,
+ &newsuperior, 0 /* to_windows */);
if (newsuperior || newrdn) {
char *escaped_filter_val;
@@ -5504,7 +5670,7 @@ retry:
void
windows_dirsync_inc_run(Private_Repl_Protocol *prp)
- {
+{
int rc = 0;
int done = 0;
diff --git a/ldap/servers/slapd/valueset.c b/ldap/servers/slapd/valueset.c
index 65086dd..a3ac7b7 100644
--- a/ldap/servers/slapd/valueset.c
+++ b/ldap/servers/slapd/valueset.c
@@ -696,12 +696,24 @@ slapi_valueset_join_attr_valueset(const Slapi_Attr *a, Slapi_ValueSet *vs1, cons
int
slapi_valueset_first_value( Slapi_ValueSet *vs, Slapi_Value **v )
{
+ if (NULL == vs) {
+ if (v) {
+ *v = NULL;
+ }
+ return 0;
+ }
return valuearray_first_value(vs->va,v);
}
int
slapi_valueset_next_value( Slapi_ValueSet *vs, int index, Slapi_Value **v)
{
+ if (NULL == vs) {
+ if (v) {
+ *v = NULL;
+ }
+ return index;
+ }
return valuearray_next_value(vs->va,index,v);
}
@@ -728,6 +740,9 @@ slapi_valueset_isempty( const Slapi_ValueSet *vs)
int
valueset_isempty( const Slapi_ValueSet *vs)
{
+ if (NULL == vs) {
+ return 1; /* true */
+ }
return valuearray_isempty(vs->va);
}
@@ -736,7 +751,7 @@ Slapi_Value *
slapi_valueset_find(const Slapi_Attr *a, const Slapi_ValueSet *vs, const Slapi_Value *v)
{
Slapi_Value *r= NULL;
- if(vs->num > 0 )
+ if(vs && (vs->num > 0))
{
if (vs->sorted) {
r = valueset_find_sorted(a,vs,v,NULL);
commit ab4893cb851533d89e1b02c91972255a48776ce4
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Feb 18 10:36:15 2014 -0800
Ticket #47642 - Windows Sync group issues
Bug Description: When an entry is moved on AD, and the entry is
a member of a group, the value of the member in the group is
automatically updated. But Windows Sync Control request only
returns the renamed entry; it does not return the group having
the member in it even though the value is updated. This is
because an AD group stores DNT (Distinguish Name Tag -- ID in
integer) instead of the dn itself. Since the rename operation
does not change DNT, the group entry on AD has no change, either.
On the DS side, the group entry stores the full DN which needs
to be adjusted to the renamed DN to complete the synchronization
with AD.
Fix Description: Once rename operation is received from AD,
windows_update_local_entry searches groups having a member value
matches the pre-renamed dn on DS, and replaces the old dn with the
renamed one.
Thanks to tbordaz(a)redhat.com for pointing out the possibility of
NULL dereference. The problem is fixed, as well.
Thanks to rmeggins(a)redhat.com for suggesting to escape the search
filter value. It was added.
https://fedorahosted.org/389/ticket/47642
(cherry picked from commit 98ddd817e26f236adebd80270ec71d7ec372c20e)
(cherry picked from commit 86515d1b18a96b9d7e6143f870b343030a7af5a7)
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index 5559f7e..caf4306 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -3930,6 +3930,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int
} else
{
/* Error, no username */
+ retval = ENTRY_NOTFOUND;
}
}
if (new_dn)
@@ -4748,7 +4749,7 @@ windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry
static int
windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,Slapi_Entry *local_entry)
{
- Slapi_Mods smods = {0};
+ Slapi_Mods smods;
int retval = 0;
Slapi_PBlock *pb = NULL;
int do_modify = 0;
@@ -4760,14 +4761,24 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
Slapi_DN *mapped_sdn = NULL;
Slapi_RDN rdn = {0};
Slapi_Entry *orig_local_entry = NULL;
+ const Slapi_DN *orig_local_sdn = NULL;
+
+ /* Variables for updating local groups */
+ Slapi_Entry **entries = NULL;
+ char *filter_string = NULL;
+ const Slapi_DN *local_subtree = NULL;
+ const Slapi_DN *local_subtree_sdn = NULL;
+ char *attrs[3];
+ /* Variables for updating local groups */
+ slapi_mods_init(&smods, 0);
windows_is_local_entry_user_or_group(local_entry, &is_user, &is_group);
/* Get the mapped DN. We don't want to locate the existing entry by
* guid or username. We want to get the mapped DN just as we would
* if we were creating a new entry. */
retval = map_entry_dn_inbound_ext(remote_entry, &mapped_sdn, prp->agmt, 0 /* use_guid */, 0 /* use_username */);
- if (retval != 0) {
+ if (retval || (NULL == mapped_sdn)) {
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"unable to map remote entry to local DN\n");
return retval;
@@ -4789,8 +4800,10 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
&newsuperior, 0 /* to_windows */);
if (newsuperior || newrdn) {
+ char *escaped_filter_val;
+ int free_it = 0;
/* remote parent is different from the local parent */
- Slapi_PBlock *pb = slapi_pblock_new ();
+ pb = slapi_pblock_new ();
if (NULL == newrdn) {
newdn = slapi_entry_get_dn_const(local_entry);
@@ -4837,10 +4850,108 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
orig_local_entry = NULL;
goto bail;
}
- }
-
- slapi_mods_init (&smods, 0);
+ /* WinSync control req does not return the member updates
+ * in the groups caused by moving member entries.
+ * We need to update the local groups manually... */
+ local_subtree = agmt_get_replarea(prp->agmt);
+ local_subtree_sdn = local_subtree;
+ orig_local_sdn = slapi_entry_get_sdn_const(orig_local_entry);
+ escaped_filter_val = slapi_escape_filter_value((char *)slapi_sdn_get_ndn(orig_local_sdn),
+ slapi_sdn_get_ndn_len(orig_local_sdn));
+ if(escaped_filter_val) {
+ free_it = 1;
+ } else {
+ escaped_filter_val = (char *)slapi_sdn_get_ndn(orig_local_sdn);
+ }
+ /* Search entries which have pre-renamed members */
+ filter_string = PR_smprintf("(&(objectclass=ntGroup)(|(member=%s)(uniquemember=%s)))",
+ escaped_filter_val, escaped_filter_val);
+ attrs[0] = "member";
+ attrs[1] = "uniquemember";
+ attrs[2] = NULL;
+ pb = slapi_pblock_new ();
+ slapi_search_internal_set_pb(pb, slapi_sdn_get_dn(local_subtree_sdn),
+ LDAP_SCOPE_SUBTREE, filter_string, attrs, 0, NULL, NULL,
+ repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION), 0);
+ slapi_search_internal_pb(pb);
+ if (free_it) {
+ slapi_ch_free_string(&escaped_filter_val);
+ }
+ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &retval);
+ if (LDAP_SUCCESS == retval) {
+ Slapi_Entry **ep;
+ const char *prev_member = slapi_sdn_get_ndn(orig_local_sdn);
+ const char *new_member = slapi_sdn_get_ndn(mapped_sdn);
+ size_t prev_member_len = slapi_sdn_get_ndn_len(orig_local_sdn);
+ size_t new_member_len = strlen(new_member);
+ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries);
+ for (ep = entries; ep && *ep; ep++) {
+ /* there are group entries whose member matches the renamed entry. */
+ Slapi_PBlock *mod_pb = NULL;
+ Slapi_Attr *mattr = NULL;
+ Slapi_Attr *umattr = NULL;
+ char *type = NULL;
+ slapi_entry_attr_find(*ep, "member", &mattr);
+ slapi_entry_attr_find(*ep, "uniquemember", &umattr);
+ if (mattr) {
+ if (umattr) {
+ /* This entry has both member and uniquemember ... */
+ Slapi_Value *v = NULL;
+ int i = 0;
+ for (i = slapi_attr_first_value(mattr, &v);
+ v && (i != -1);
+ i = slapi_attr_next_value(mattr, i, &v)) {
+ const char *s = slapi_value_get_string(v);
+ if (NULL == s) {
+ continue;
+ }
+ if (0 == strcasecmp(s, prev_member)) {
+ type = "member";
+ break;
+ }
+ }
+ if (!type) {
+ type = "uniquemember";
+ }
+ } else {
+ type = "member";
+ }
+ } else {
+ if (umattr) {
+ type = "uniquemember";
+ }
+ }
+ if (type) {
+ mod_pb = slapi_pblock_new();
+ slapi_mods_add(&smods, LDAP_MOD_DELETE, type, prev_member_len, prev_member);
+ slapi_mods_add(&smods, LDAP_MOD_ADD, type, new_member_len, new_member);
+ slapi_modify_internal_set_pb_ext(mod_pb, slapi_entry_get_sdn(*ep),
+ slapi_mods_get_ldapmods_byref(&smods), NULL, NULL,
+ repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION),
+ 0);
+ slapi_modify_internal_pb(mod_pb);
+ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &retval);
+ if (retval) {
+ slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name,
+ "windows_update_local_entry: "
+ "failed to modify entry %s replacing %s with %s "
+ "- error %d:%s\n",
+ slapi_entry_get_dn(*ep), prev_member, new_member,
+ retval, ldap_err2string(retval));
+ }
+ slapi_pblock_destroy(mod_pb);
+ slapi_mods_done(&smods);
+ } /* if (type) */
+ } /* for (ep = entries; ep && *ep; ep++) */
+ } /* if (LDAP_SUCCESS == retval) - searching with "(|(member=..)(uniquemember=..)) */
+ slapi_free_search_results_internal(pb);
+ slapi_pblock_destroy(pb);
+ if (filter_string) {
+ PR_smprintf_free(filter_string);
+ }
+ slapi_sdn_free((Slapi_DN **)&local_subtree);
+ } /* if (newsuperior || newrdn) */
retval = windows_generate_update_mods(prp,remote_entry,local_entry,0,&smods,&do_modify);
/* Now perform the modify if we need to */
10 years, 1 month
Branch '389-ds-base-1.2.11' - 2 commits - ldap/servers
by Noriko Hosoi
ldap/servers/plugins/posix-winsync/posix-group-func.c | 2
ldap/servers/plugins/replication/windows_protocol_util.c | 557 +++++++++++----
ldap/servers/slapd/slapi-plugin.h | 10
ldap/servers/slapd/valueset.c | 23
4 files changed, 447 insertions(+), 145 deletions(-)
New commits:
commit 737169e0afd0547b6de0a61081508314d076cc6a
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Feb 20 14:32:41 2014 -0800
Ticket #415 - winsync doesn't sync DN valued attributes if DS DN value doesn't exist
Bug description:
2 case were fixed.
1) A group on AD has a member which is not a target of windows
sync and exists only on AD. The member value in the group is
synchronized to DS. If an operation is executed on AD so that
the member is replaced with other members which are the target
of the windows sync, the new member values are not synchronized.
2) If a group on AD and DS have members which are local and are
not synchronized and the members are removed in the group on
the other side, the delete operation is synchronized and
deletes all the members including the local members.
Fix description:
1) In windows_generate_update_mods, even if a sync'ed member value
in a DS entry is not the target of windows sync and it is does
not exist on DS, a following modify operation including the member
value is proceeded by confirming the existence on AD.
2) AD->DS: in windows_map_mods_for_replay
DS->AD: in windwos_generate_update_mods
added the code to check if an attribute is completely deleted on
one side, then the each value on the other side is in the sync
scope or not. Put the value to the mod for the delete only if
the value is in the sync scope.
Reviewed by Rich (Thank you!!)
https://fedorahosted.org/389/ticket/415
(cherry picked from commit 03814dd74df7f1f0d2842c5096c6425609da6f2c)
(cherry picked from commit 8772ea1ac524f1f011d51d0a42c0055f5641e2e6)
diff --git a/ldap/servers/plugins/posix-winsync/posix-group-func.c b/ldap/servers/plugins/posix-winsync/posix-group-func.c
index 60528f5..6a7aa84 100644
--- a/ldap/servers/plugins/posix-winsync/posix-group-func.c
+++ b/ldap/servers/plugins/posix-winsync/posix-group-func.c
@@ -100,7 +100,7 @@ getEntry(const char *udn, char **attrs)
}
else {
slapi_log_error(SLAPI_LOG_FATAL, POSIX_WINSYNC_PLUGIN_NAME,
- "getEntry: error searching for uid: %d", rc);
+ "getEntry: error searching for uid: %d\n", rc);
}
return NULL;
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index bac6573..811d2fd 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -409,12 +409,19 @@ map_dn_values(Private_Repl_Protocol *prp,Slapi_ValueSet *original_values, Slapi_
int retval = 0;
int i = 0;
+ if (NULL == mapped_values) {
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "%s: map_dn_values: arg mapped_values is NULL.\n",
+ agmt_get_long_name(prp->agmt));
+ return;
+ }
+
/* Set the keep raw entry flag to avoid overwriting the existing raw entry. */
windows_private_set_keep_raw_entry(prp->agmt, 1);
/* For each value: */
- i= slapi_valueset_first_value(original_values,&original_value);
- while ( i != -1 ) {
+ i= slapi_valueset_first_value(original_values,&original_value);
+ while ( i != -1 ) {
int is_ours = 0;
char *new_dn_string = NULL;
@@ -480,7 +487,7 @@ map_dn_values(Private_Repl_Protocol *prp,Slapi_ValueSet *original_values, Slapi_
local_entry = NULL;
}
} else
- {
+ { /* from windows */
Slapi_Entry *remote_entry = NULL;
Slapi_DN *local_dn = NULL;
/* Try to get the remote entry */
@@ -1584,89 +1591,111 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op
slapi_entry_free(ad_entry); /* getting sets windows_private_get_raw_entry */
}
+ /*
+ * If the magic objectclass and attributes have been added to the entry
+ * to make the entry sync-able, add the entry first, then apply the other
+ * mods
+ */
+ if (sync_attrs_added(op->p.p_modify.modify_mods, local_entry)) {
+ Slapi_Entry *ad_entry = NULL;
- windows_map_mods_for_replay(prp,op->p.p_modify.modify_mods, &mapped_mods, is_user, &password);
- if (is_user) {
- winsync_plugin_call_pre_ad_mod_user_mods_cb(prp->agmt,
- windows_private_get_raw_entry(prp->agmt),
- local_dn,
- local_entry,
- op->p.p_modify.modify_mods,
- remote_dn,
- &mapped_mods);
- } else if (is_group) {
- winsync_plugin_call_pre_ad_mod_group_mods_cb(prp->agmt,
- windows_private_get_raw_entry(prp->agmt),
- local_dn,
- local_entry,
- op->p.p_modify.modify_mods,
- remote_dn,
- &mapped_mods);
+ return_value = process_replay_add(prp,local_entry,local_entry,local_dn,remote_dn,is_user,missing_entry,&password);
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "%s: windows_replay_update: "
+ "The modify operation added the sync objectclass and attribute, so "
+ "the entry was added to windows - result [%d]\n",
+ agmt_get_long_name(prp->agmt), return_value);
+ if (return_value) {
+ break; /* error adding entry - cannot continue */
}
+ /* the modify op needs the new remote entry, so retrieve it */
+ windows_get_remote_entry(prp, remote_dn, &ad_entry);
+ slapi_entry_free(ad_entry); /* getting sets windows_private_get_raw_entry */
+ }
- /* Check if a naming attribute is being modified. */
- if (windows_check_mods_for_rdn_change(prp, op->p.p_modify.modify_mods, local_entry, remote_dn, &newrdn)) {
- /* Issue MODRDN */
- slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "%s: renaming remote entry \"%s\" with new RDN of \"%s\"\n",
- agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn), newrdn);
- return_value = windows_conn_send_rename(prp->conn, slapi_sdn_get_dn(remote_dn),
- newrdn, NULL, 1 /* delete old RDN */,
- NULL, NULL /* returned controls */);
- slapi_ch_free_string(&newrdn);
- }
+ windows_map_mods_for_replay(prp,op->p.p_modify.modify_mods, &mapped_mods, is_user, &password);
+ if (is_user) {
+ winsync_plugin_call_pre_ad_mod_user_mods_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ local_dn,
+ local_entry,
+ op->p.p_modify.modify_mods,
+ remote_dn,
+ &mapped_mods);
+ } else if (is_group) {
+ winsync_plugin_call_pre_ad_mod_group_mods_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ local_dn,
+ local_entry,
+ op->p.p_modify.modify_mods,
+ remote_dn,
+ &mapped_mods);
+ }
- /* It's possible that the mapping process results in an empty mod list, in which case we don't bother with the replay */
- if ( mapped_mods == NULL || *(mapped_mods)== NULL )
- {
- return_value = CONN_OPERATION_SUCCESS;
- } else
+ /* Check if a naming attribute is being modified. */
+ if (windows_check_mods_for_rdn_change(prp, op->p.p_modify.modify_mods, local_entry, remote_dn, &newrdn)) {
+ /* Issue MODRDN */
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "%s: renaming remote entry \"%s\" with new RDN of \"%s\"\n",
+ agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn), newrdn);
+ return_value = windows_conn_send_rename(prp->conn, slapi_sdn_get_dn(remote_dn),
+ newrdn, NULL, 1 /* delete old RDN */,
+ NULL, NULL /* returned controls */);
+ slapi_ch_free_string(&newrdn);
+ }
+
+ /* It's possible that the mapping process results in an empty mod list, in which case we don't bother with the replay */
+ if ((mapped_mods == NULL) || (*mapped_mods == NULL))
+ {
+ return_value = CONN_OPERATION_SUCCESS;
+ } else
+ {
+ int ldap_op = 0;
+ int ldap_result_code = 0;
+ if (slapi_is_loglevel_set(SLAPI_LOG_REPL))
{
- int ldap_op = 0;
- int ldap_result_code = 0;
- if (slapi_is_loglevel_set(SLAPI_LOG_REPL))
+ int i = 0;
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "dump mods for replay update:\n");
+ for(i=0;mapped_mods[i];i++)
{
- int i = 0;
- slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,"dump mods for replay update:");
- for(i=0;mapped_mods[i];i++)
- {
- slapi_mod_dump(mapped_mods[i],i);
- }
- }
- return_value = windows_conn_send_modify(prp->conn, slapi_sdn_get_dn(remote_dn), mapped_mods, NULL, NULL /* returned controls */);
- windows_conn_get_error(prp->conn, &ldap_op, &ldap_result_code);
- if ((return_value != CONN_OPERATION_SUCCESS) && !ldap_result_code) {
- /* op failed but no ldap error code ??? */
- ldap_result_code = LDAP_OPERATIONS_ERROR;
- }
- if (is_user) {
- winsync_plugin_call_post_ad_mod_user_mods_cb(prp->agmt,
- windows_private_get_raw_entry(prp->agmt),
- local_dn, local_entry,
- op->p.p_modify.modify_mods,
- remote_dn, mapped_mods, &ldap_result_code);
- } else if (is_group) {
- winsync_plugin_call_post_ad_mod_group_mods_cb(prp->agmt,
- windows_private_get_raw_entry(prp->agmt),
- local_dn, local_entry,
- op->p.p_modify.modify_mods,
- remote_dn, mapped_mods, &ldap_result_code);
- }
- /* see if plugin reset success/error condition */
- if ((return_value != CONN_OPERATION_SUCCESS) && !ldap_result_code) {
- return_value = CONN_OPERATION_SUCCESS;
- windows_conn_set_error(prp->conn, ldap_result_code);
- } else if ((return_value == CONN_OPERATION_SUCCESS) && ldap_result_code) {
- return_value = CONN_OPERATION_FAILED;
- windows_conn_set_error(prp->conn, ldap_result_code);
+ slapi_mod_dump(mapped_mods[i],i);
}
}
- if (mapped_mods)
- {
- ldap_mods_free(mapped_mods,1);
- mapped_mods = NULL;
+ return_value = windows_conn_send_modify(prp->conn, slapi_sdn_get_dn(remote_dn), mapped_mods, NULL, NULL /* returned controls */);
+ windows_conn_get_error(prp->conn, &ldap_op, &ldap_result_code);
+ if ((return_value != CONN_OPERATION_SUCCESS) && !ldap_result_code) {
+ /* op failed but no ldap error code ??? */
+ ldap_result_code = LDAP_OPERATIONS_ERROR;
+ }
+ if (is_user) {
+ winsync_plugin_call_post_ad_mod_user_mods_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ local_dn, local_entry,
+ op->p.p_modify.modify_mods,
+ remote_dn, mapped_mods, &ldap_result_code);
+ } else if (is_group) {
+ winsync_plugin_call_post_ad_mod_group_mods_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ local_dn, local_entry,
+ op->p.p_modify.modify_mods,
+ remote_dn, mapped_mods, &ldap_result_code);
}
+ /* see if plugin reset success/error condition */
+ if ((return_value != CONN_OPERATION_SUCCESS) && !ldap_result_code) {
+ return_value = CONN_OPERATION_SUCCESS;
+ windows_conn_set_error(prp->conn, ldap_result_code);
+ } else if ((return_value == CONN_OPERATION_SUCCESS) && ldap_result_code) {
+ return_value = CONN_OPERATION_FAILED;
+ windows_conn_set_error(prp->conn, ldap_result_code);
+ }
+ }
+ if (mapped_mods)
+ {
+ ldap_mods_free(mapped_mods,1);
+ mapped_mods = NULL;
}
break;
+ }
case SLAPI_OPERATION_DELETE:
if (delete_remote_entry_allowed(local_entry))
{
@@ -2569,17 +2598,34 @@ done:
static void
-windows_map_mods_for_replay(Private_Repl_Protocol *prp,LDAPMod **original_mods, LDAPMod ***returned_mods, int is_user, char** password)
+windows_map_mods_for_replay(Private_Repl_Protocol *prp,
+ LDAPMod **original_mods,
+ LDAPMod ***returned_mods,
+ int is_user,
+ char** password)
{
Slapi_Mods smods = {0};
Slapi_Mods mapped_smods = {0};
LDAPMod *mod = NULL;
- int is_nt4 = windows_private_get_isnt4(prp->agmt);
+ int is_nt4 = 0;
Slapi_Mod *mysmod = NULL;
const Slapi_Entry *ad_entry = NULL;
Slapi_Entry *ad_entry_copy = NULL;
+ const Slapi_DN *windows_subtree = NULL;
LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_map_mods_for_replay\n", 0, 0, 0 );
+ if (NULL == prp) {
+ LDAPDebug(LDAP_DEBUG_TRACE,
+ "<= windows_map_mods_for_replay; NULL protocol; NOOP\n", 0, 0, 0);
+ return;
+ }
+ windows_subtree = windows_private_get_windows_subtree(prp->agmt);
+ if (NULL == windows_subtree) {
+ LDAPDebug(LDAP_DEBUG_TRACE,
+ "<= windows_map_mods_for_replay; NULL agreement subtree; NOOP\n", 0, 0, 0);
+ return;
+ }
+ is_nt4 = windows_private_get_isnt4(prp->agmt);
/* Iterate through the original mods, looking each attribute type up in the maps for either user or group */
@@ -2667,13 +2713,66 @@ windows_map_mods_for_replay(Private_Repl_Protocol *prp,LDAPMod **original_mods,
mapped_values = NULL;
} else
{
- /* this might be a del: mod, in which case there are no values */
- if (mod->mod_op & LDAP_MOD_DELETE)
+ if (slapi_valueset_isempty(vs) && (mod->mod_op & LDAP_MOD_DELETE))
{
- mysmod = slapi_mod_new();
- slapi_mod_init(mysmod, 0);
- slapi_mod_set_operation(mysmod, LDAP_MOD_DELETE|LDAP_MOD_BVALUES);
- slapi_mod_set_type(mysmod, mapped_type);
+ /* modify - del all, in which case there are no values */
+ Slapi_Attr *attr = NULL;
+
+ /*
+ * ad_entry:
+ * get mapped_type values
+ * get in-scope values from the values
+ */
+ slapi_entry_attr_find(ad_entry, mapped_type, &attr);
+ if (attr) {
+ Slapi_ValueSet *thisvs = NULL;
+ Slapi_Value *valp = NULL;
+ Slapi_DN *sdn = slapi_sdn_new();
+ int i;
+ int is_in_subtree = 0;
+ Slapi_Value **myva = NULL;
+
+ slapi_attr_get_valueset(attr, &thisvs); /* thisvs is dup'ed */
+ for (i = slapi_valueset_first_value(thisvs, &valp);
+ (i != -1) && (valp != NULL);
+ i = slapi_valueset_next_value(thisvs, i, &valp)) {
+ /* valp is a pointer to va in thisvs */
+ const char *strval = slapi_value_get_string(valp); /* no dup */
+ if (strval) {
+ slapi_sdn_set_dn_byref(sdn, strval);
+ is_in_subtree = slapi_sdn_scope_test(sdn, windows_subtree,
+ LDAP_SCOPE_SUBTREE);
+ if (is_in_subtree) {
+ /*
+ * If delete all on DS,
+ * we could delete the values on AD in the scope.
+ */
+ /* myva is (re)allocated and valp is copied */
+ valuearray_add_value(&myva, valp);
+ }
+ }
+ }
+ if (myva) {
+ Slapi_ValueSet *myvs = NULL;
+
+ myvs = slapi_valueset_new();
+ valueset_set_valuearray_passin(myvs, myva);
+ mysmod = slapi_mod_new();
+ slapi_mod_init_valueset_byval(mysmod,
+ LDAP_MOD_DELETE|LDAP_MOD_BVALUES,
+ mapped_type,
+ myvs);
+ slapi_valueset_free(myvs);
+ }
+ slapi_sdn_free(&sdn);
+ slapi_valueset_free(thisvs);
+ } else {
+ /*
+ * No corresponsing attribute in AD.
+ * There's no need to do anything on AD.
+ * slapi_mod_set_type(mysmod, mapped_type);
+ */
+ }
}
}
slapi_mod_done(&smod);
@@ -4236,19 +4335,20 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
int is_group = 0;
int rc = 0;
int is_nt4 = windows_private_get_isnt4(prp->agmt);
+ const Slapi_DN *local_subtree = NULL;
/* Iterate over the attributes on the remote entry, updating the local entry where appropriate */
LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_generate_update_mods\n", 0, 0, 0 );
*do_modify = 0;
- if (!remote_entry || !local_entry) {
- slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
- "%s: windows_generate_update_mods: remote_entry is [%s] local_entry is [%s] "
- "cannot generate update mods\n", agmt_get_long_name(prp->agmt),
- remote_entry ? slapi_entry_get_dn_const(remote_entry) : "NULL",
- local_entry ? slapi_entry_get_dn_const(local_entry) : "NULL");
- goto bail;
- }
+ if (!remote_entry || !local_entry) {
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "%s: windows_generate_update_mods: remote_entry is [%s] local_entry is [%s] "
+ "cannot generate update mods\n", agmt_get_long_name(prp->agmt),
+ remote_entry ? slapi_entry_get_dn_const(remote_entry) : "NULL",
+ local_entry ? slapi_entry_get_dn_const(local_entry) : "NULL");
+ goto bail;
+ }
if (to_windows)
{
@@ -4258,8 +4358,8 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
windows_is_remote_entry_user_or_group(remote_entry,&is_user,&is_group);
}
- for (rc = slapi_entry_first_attr(remote_entry, &attr); rc == 0;
- rc = slapi_entry_next_attr(remote_entry, attr, &attr))
+ for (rc = slapi_entry_first_attr(remote_entry, &attr); rc == 0;
+ rc = slapi_entry_next_attr(remote_entry, attr, &attr))
{
int is_present_local = 0;
char *type = NULL;
@@ -4403,15 +4503,17 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
} else {
/* A dn-valued attribute : need to take special steps */
Slapi_ValueSet *mapped_remote_values = NULL;
+ Slapi_ValueSet *local_values = NULL;
+
+ /* We ignore any DNs that are outside the scope of the agreement (on both sides) */
+ slapi_attr_get_valueset(local_attr,&local_values);
+
/* First map all the DNs to that they're in a consistent domain */
map_dn_values(prp,vs,&mapped_remote_values, to_windows,0);
if (mapped_remote_values)
{
- Slapi_ValueSet *local_values = NULL;
Slapi_ValueSet *restricted_local_values = NULL;
/* Now do a compare on the values, generating mods to bring them into consistency (if any) */
- /* We ignore any DNs that are outside the scope of the agreement (on both sides) */
- slapi_attr_get_valueset(local_attr,&local_values);
if (local_values)
{
map_dn_values(prp,local_values,&restricted_local_values,!to_windows,1);
@@ -4423,6 +4525,9 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
}
else
{
+ windows_generate_dn_value_mods(local_type, local_attr, smods,
+ mapped_remote_values,
+ local_values,do_modify);
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"windows_generate_update_mods: no restricted local values found for "
"local attribute %s in local entry %s for remote attribute "
@@ -4432,9 +4537,9 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
type ? type : "NULL",
slapi_entry_get_dn(remote_entry));
}
- slapi_valueset_free(local_values);
- local_values = NULL;
} else {
+ windows_generate_dn_value_mods(local_type, local_attr, smods,
+ mapped_remote_values, NULL, do_modify);
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"windows_generate_update_mods: no local values found for "
"local attribute %s in local entry %s for remote attribute "
@@ -4447,18 +4552,25 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
slapi_valueset_free(mapped_remote_values);
mapped_remote_values = NULL;
} else {
- slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
- "windows_generate_update_mods: could not map the values in "
- "local attribute %s in local entry %s for remote attribute "
- "%s in remote entry %s\n",
- local_type,
- slapi_entry_get_dn(local_entry),
- type ? type : "NULL",
- slapi_entry_get_dn(remote_entry));
+ if (local_values) {
+ windows_generate_dn_value_mods(local_type, local_attr, smods,
+ NULL, local_values, do_modify);
+ } else {
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "windows_generate_update_mods: could not map the values in "
+ "local attribute %s in local entry %s for remote attribute "
+ "%s in remote entry %s\n",
+ local_type,
+ slapi_entry_get_dn(local_entry),
+ type ? type : "NULL",
+ slapi_entry_get_dn(remote_entry));
+ }
}
+ slapi_valueset_free(local_values);
+ local_values = NULL;
}
} else
- {
+ { /* !is_present_local || is_guid */
if (!is_present_local)
{
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
@@ -4555,37 +4667,91 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
slapi_ch_free_string(&local_type);
}
- /* Check if any attributes were deleted from the remote entry */
- entry_first_deleted_attribute(remote_entry, &del_attr);
- while (del_attr != NULL) {
- Slapi_Attr *local_attr = NULL;
- char *type = NULL;
- char *local_type = NULL;
- int mapdn = 0;
+ /* Check if any attributes were deleted from the remote entry */
+ entry_first_deleted_attribute(remote_entry, &del_attr);
+ local_subtree = windows_private_get_directory_subtree(prp->agmt);
+ while (del_attr != NULL) {
+ Slapi_Attr *local_attr = NULL;
+ char *type = NULL;
+ char *local_type = NULL;
+ int mapdn = 0;
- /* Map remote type to local type */
+ /* Map remote type to local type */
slapi_attr_get_type(del_attr, &type);
- if ( is_straight_mapped_attr(type,is_user,is_nt4) ) {
- local_type = slapi_ch_strdup(type);
- } else {
- windows_map_attr_name(type , to_windows, is_user, 0 /* not create */, &local_type, &mapdn);
- }
-
- /* Check if this attr exists in the local entry */
- if (local_type) {
- slapi_entry_attr_find(local_entry, local_type, &local_attr);
- if (local_attr) {
- slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
- "windows_generate_update_mods: deleting %s attribute from local entry\n", local_type);
- /* Delete this attr from the local entry */
- slapi_mods_add_mod_values(smods, LDAP_MOD_DELETE, local_type, NULL);
+ if ( is_straight_mapped_attr(type,is_user,is_nt4) ) {
+ local_type = slapi_ch_strdup(type);
+ } else {
+ windows_map_attr_name(type , to_windows, is_user, 0 /* not create */, &local_type, &mapdn);
+ }
+
+ /* Check if this attr exists in the local entry */
+ if (local_type) {
+ slapi_entry_attr_find(local_entry, local_type, &local_attr);
+ if (local_attr) {
+ Slapi_Mod *mysmod = NULL;
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
+ "windows_generate_update_mods: deleting %s attribute from local entry\n", local_type);
+ /* Delete this attr from the local entry */
+ /* if type is dn and the dn is out of winsync scope, keep them.
+ * othewise delete all attr. */
+ if (mapdn) {
+ Slapi_ValueSet *vs = NULL;
+ Slapi_Value *valp = NULL;
+ Slapi_DN *sdn = slapi_sdn_new();
+ int i = 0;
+ int is_in_subtree = 0;
+ Slapi_Value **myva = NULL;
+
+ slapi_attr_get_valueset(local_attr, &vs); /* thisvs is dup'ed */
+ for (i = slapi_valueset_first_value(vs, &valp);
+ (i != -1) && (valp != NULL);
+ i = slapi_valueset_next_value(vs, i, &valp)) {
+ /* valp is a pointer to va in vs */
+ const char *strval = slapi_value_get_string(valp); /* no dup */
+ if (strval) {
+ slapi_sdn_set_dn_byref(sdn, strval);
+ is_in_subtree = slapi_sdn_scope_test(sdn, local_subtree,
+ LDAP_SCOPE_SUBTREE);
+ if (is_in_subtree) {
+ /*
+ * If delete all on AD,
+ * we could delete the values on DS in the scope.
+ */
+ /* myva is (re)allocated and valp is copied */
+ valuearray_add_value(&myva, valp);
+ }
+ }
+ }
+ if (myva) {
+ Slapi_ValueSet *myvs = NULL;
+
+ myvs = slapi_valueset_new();
+ valueset_set_valuearray_passin(myvs, myva);
+ mysmod = slapi_mod_new();
+ slapi_mod_init_valueset_byval(mysmod,
+ LDAP_MOD_DELETE|LDAP_MOD_BVALUES,
+ local_type,
+ myvs);
+ slapi_valueset_free(myvs);
+ }
+ slapi_sdn_free(&sdn);
+ slapi_valueset_free(vs);
+ if (mysmod) {
+ slapi_mods_add_ldapmod(smods, slapi_mod_get_ldapmod_passout(mysmod));
+ }
+ if (mysmod) {
+ slapi_mod_free(&mysmod);
+ }
+ } else {
+ slapi_mods_add_mod_values(smods, LDAP_MOD_DELETE, local_type, NULL);
+ }
*do_modify = 1;
- }
- }
+ }
+ }
- entry_next_deleted_attribute(remote_entry, &del_attr);
+ entry_next_deleted_attribute(remote_entry, &del_attr);
slapi_ch_free_string(&local_type);
- }
+ }
if (to_windows) {
if (is_user) {
@@ -4690,7 +4856,7 @@ windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry
static int
windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,Slapi_Entry *local_entry)
{
- Slapi_Mods smods;
+ Slapi_Mods smods = {0};
int retval = 0;
Slapi_PBlock *pb = NULL;
int do_modify = 0;
@@ -4736,9 +4902,9 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
/* compare the parents */
retval = windows_get_superior_change(prp,
- slapi_entry_get_sdn(local_entry),
- mapped_sdn,
- &newsuperior, 0 /* to_windows */);
+ slapi_entry_get_sdn(local_entry),
+ mapped_sdn,
+ &newsuperior, 0 /* to_windows */);
if (newsuperior || newrdn) {
char *escaped_filter_val;
@@ -5439,7 +5605,7 @@ retry:
void
windows_dirsync_inc_run(Private_Repl_Protocol *prp)
- {
+{
int rc = 0;
int done = 0;
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index dc7f87f..5c29b0c 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -7005,6 +7005,16 @@ int slapi_set_plugin_default_config(const char *type, Slapi_Value *value);
*/
int slapi_get_plugin_default_config(char *type, Slapi_ValueSet **valueset);
+/**
+ * Checks if a \c Slapi_ValueSet structure has values
+ *
+ * \param vs Pointer to the \c Slapi_ValueSet structure of which
+ * you wish to get the count.
+ * \return 1 if there are no values contained in the \c Slapi_ValueSet structure.
+ * \return 0 if there are values contained in the \c Slapi_ValueSet structure.
+ */
+int slapi_valueset_isempty(const Slapi_ValueSet *vs);
+
int slapi_check_account_lock( Slapi_PBlock *pb, Slapi_Entry *bind_target_entry, int pwresponse_req, int check_password_policy, int send_result);
/* backend get/set info */
diff --git a/ldap/servers/slapd/valueset.c b/ldap/servers/slapd/valueset.c
index de6914f..732b411 100644
--- a/ldap/servers/slapd/valueset.c
+++ b/ldap/servers/slapd/valueset.c
@@ -890,12 +890,24 @@ slapi_valueset_set_valueset(Slapi_ValueSet *vs1, const Slapi_ValueSet *vs2)
int
slapi_valueset_first_value( Slapi_ValueSet *vs, Slapi_Value **v )
{
+ if (NULL == vs) {
+ if (v) {
+ *v = NULL;
+ }
+ return 0;
+ }
return valuearray_first_value(vs->va,v);
}
int
slapi_valueset_next_value( Slapi_ValueSet *vs, int index, Slapi_Value **v)
{
+ if (NULL == vs) {
+ if (v) {
+ *v = NULL;
+ }
+ return index;
+ }
return valuearray_next_value(vs->va,index,v);
}
@@ -914,8 +926,17 @@ slapi_valueset_count( const Slapi_ValueSet *vs)
}
int
+slapi_valueset_isempty(const Slapi_ValueSet *vs)
+{
+ return valueset_isempty(vs);
+}
+
+int
valueset_isempty( const Slapi_ValueSet *vs)
{
+ if (NULL == vs) {
+ return 1; /* true */
+ }
return valuearray_isempty(vs->va);
}
@@ -924,7 +945,7 @@ Slapi_Value *
slapi_valueset_find(const Slapi_Attr *a, const Slapi_ValueSet *vs, const Slapi_Value *v)
{
Slapi_Value *r= NULL;
- if(!valuearray_isempty(vs->va))
+ if(vs && !valuearray_isempty(vs->va))
{
int i= valuearray_find(a,vs->va,v);
if(i!=-1)
commit 5324aeca04c8fd0dd3787565815e92bfad1eb3d4
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Feb 20 14:29:16 2014 -0800
Ticket #47642 - Windows Sync group issues
Bug Description: When an entry is moved on AD, and the entry is
a member of a group, the value of the member in the group is
automatically updated. But Windows Sync Control request only
returns the renamed entry; it does not return the group having
the member in it even though the value is updated. This is
because an AD group stores DNT (Distinguish Name Tag -- ID in
integer) instead of the dn itself. Since the rename operation
does not change DNT, the group entry on AD has no change, either.
On the DS side, the group entry stores the full DN which needs
to be adjusted to the renamed DN to complete the synchronization
with AD.
Fix Description: Once rename operation is received from AD,
windows_update_local_entry searches groups having a member value
matches the pre-renamed dn on DS, and replaces the old dn with the
renamed one.
Thanks to tbordaz(a)redhat.com for pointing out the possibility of
NULL dereference. The problem is fixed, as well.
Thanks to rmeggins(a)redhat.com for suggesting to escape the search
filter value. It was added.
https://fedorahosted.org/389/ticket/47642
(cherry picked from commit 98ddd817e26f236adebd80270ec71d7ec372c20e)
(cherry picked from commit 86515d1b18a96b9d7e6143f870b343030a7af5a7)
(cherry picked from commit ab4893cb851533d89e1b02c91972255a48776ce4)
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index 93246ec..bac6573 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -3871,6 +3871,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int
} else
{
/* Error, no username */
+ retval = ENTRY_NOTFOUND;
}
}
if (new_dn)
@@ -4689,7 +4690,7 @@ windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry
static int
windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,Slapi_Entry *local_entry)
{
- Slapi_Mods smods = {0};
+ Slapi_Mods smods;
int retval = 0;
Slapi_PBlock *pb = NULL;
int do_modify = 0;
@@ -4701,14 +4702,24 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
Slapi_DN *mapped_sdn = NULL;
Slapi_RDN rdn = {0};
Slapi_Entry *orig_local_entry = NULL;
+ const Slapi_DN *orig_local_sdn = NULL;
+
+ /* Variables for updating local groups */
+ Slapi_Entry **entries = NULL;
+ char *filter_string = NULL;
+ const Slapi_DN *local_subtree = NULL;
+ const Slapi_DN *local_subtree_sdn = NULL;
+ char *attrs[3];
+ /* Variables for updating local groups */
+ slapi_mods_init(&smods, 0);
windows_is_local_entry_user_or_group(local_entry, &is_user, &is_group);
/* Get the mapped DN. We don't want to locate the existing entry by
* guid or username. We want to get the mapped DN just as we would
* if we were creating a new entry. */
retval = map_entry_dn_inbound_ext(remote_entry, &mapped_sdn, prp->agmt, 0 /* use_guid */, 0 /* use_username */);
- if (retval != 0) {
+ if (retval || (NULL == mapped_sdn)) {
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"unable to map remote entry to local DN\n");
return retval;
@@ -4730,8 +4741,10 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
&newsuperior, 0 /* to_windows */);
if (newsuperior || newrdn) {
+ char *escaped_filter_val;
+ const char *ptr;
/* remote parent is different from the local parent */
- Slapi_PBlock *pb = slapi_pblock_new ();
+ pb = slapi_pblock_new ();
if (NULL == newrdn) {
newdn = slapi_entry_get_dn_const(local_entry);
@@ -4778,10 +4791,102 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
orig_local_entry = NULL;
goto bail;
}
- }
-
- slapi_mods_init (&smods, 0);
+ /* WinSync control req does not return the member updates
+ * in the groups caused by moving member entries.
+ * We need to update the local groups manually... */
+ local_subtree = agmt_get_replarea(prp->agmt);
+ local_subtree_sdn = local_subtree;
+ orig_local_sdn = slapi_entry_get_sdn_const(orig_local_entry);
+ escaped_filter_val = slapi_ch_malloc(slapi_sdn_get_ndn_len(orig_local_sdn) * 3 + 1);
+ ptr = escape_filter_value((char *)slapi_sdn_get_ndn(orig_local_sdn),
+ slapi_sdn_get_ndn_len(orig_local_sdn), escaped_filter_val);
+ /* Search entries which have pre-renamed members */
+ filter_string = PR_smprintf("(&(objectclass=ntGroup)(|(member=%s)(uniquemember=%s)))",
+ ptr, ptr);
+ slapi_ch_free_string(&escaped_filter_val);
+ attrs[0] = "member";
+ attrs[1] = "uniquemember";
+ attrs[2] = NULL;
+ pb = slapi_pblock_new ();
+ slapi_search_internal_set_pb(pb, slapi_sdn_get_dn(local_subtree_sdn),
+ LDAP_SCOPE_SUBTREE, filter_string, attrs, 0, NULL, NULL,
+ repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION), 0);
+ slapi_search_internal_pb(pb);
+ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &retval);
+ if (LDAP_SUCCESS == retval) {
+ Slapi_Entry **ep;
+ const char *prev_member = slapi_sdn_get_ndn(orig_local_sdn);
+ const char *new_member = slapi_sdn_get_ndn(mapped_sdn);
+ size_t prev_member_len = slapi_sdn_get_ndn_len(orig_local_sdn);
+ size_t new_member_len = strlen(new_member);
+ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries);
+ for (ep = entries; ep && *ep; ep++) {
+ /* there are group entries whose member matches the renamed entry. */
+ Slapi_PBlock *mod_pb = NULL;
+ Slapi_Attr *mattr = NULL;
+ Slapi_Attr *umattr = NULL;
+ char *type = NULL;
+ slapi_entry_attr_find(*ep, "member", &mattr);
+ slapi_entry_attr_find(*ep, "uniquemember", &umattr);
+ if (mattr) {
+ if (umattr) {
+ /* This entry has both member and uniquemember ... */
+ Slapi_Value *v = NULL;
+ int i = 0;
+ for (i = slapi_attr_first_value(mattr, &v);
+ v && (i != -1);
+ i = slapi_attr_next_value(mattr, i, &v)) {
+ const char *s = slapi_value_get_string(v);
+ if (NULL == s) {
+ continue;
+ }
+ if (0 == strcasecmp(s, prev_member)) {
+ type = "member";
+ break;
+ }
+ }
+ if (!type) {
+ type = "uniquemember";
+ }
+ } else {
+ type = "member";
+ }
+ } else {
+ if (umattr) {
+ type = "uniquemember";
+ }
+ }
+ if (type) {
+ mod_pb = slapi_pblock_new();
+ slapi_mods_add(&smods, LDAP_MOD_DELETE, type, prev_member_len, prev_member);
+ slapi_mods_add(&smods, LDAP_MOD_ADD, type, new_member_len, new_member);
+ slapi_modify_internal_set_pb_ext(mod_pb, slapi_entry_get_sdn(*ep),
+ slapi_mods_get_ldapmods_byref(&smods), NULL, NULL,
+ repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION),
+ 0);
+ slapi_modify_internal_pb(mod_pb);
+ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &retval);
+ if (retval) {
+ slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name,
+ "windows_update_local_entry: "
+ "failed to modify entry %s replacing %s with %s "
+ "- error %d:%s\n",
+ slapi_entry_get_dn(*ep), prev_member, new_member,
+ retval, ldap_err2string(retval));
+ }
+ slapi_pblock_destroy(mod_pb);
+ slapi_mods_done(&smods);
+ } /* if (type) */
+ } /* for (ep = entries; ep && *ep; ep++) */
+ } /* if (LDAP_SUCCESS == retval) - searching with "(|(member=..)(uniquemember=..)) */
+ slapi_free_search_results_internal(pb);
+ slapi_pblock_destroy(pb);
+ if (filter_string) {
+ PR_smprintf_free(filter_string);
+ }
+ slapi_sdn_free((Slapi_DN **)&local_subtree);
+ } /* if (newsuperior || newrdn) */
retval = windows_generate_update_mods(prp,remote_entry,local_entry,0,&smods,&do_modify);
/* Now perform the modify if we need to */
10 years, 1 month
Branch '389-ds-base-1.3.2' - include/base include/libaccess
by Noriko Hosoi
include/base/ereport.h | 4 ++--
include/libaccess/aclerror.h | 10 ----------
include/libaccess/acleval.h | 3 +--
3 files changed, 3 insertions(+), 14 deletions(-)
New commits:
commit e9dd44b661e4c950c38e50a13684bcd9bb543ff1
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Feb 18 15:28:54 2014 -0800
Ticket #47700 - Unresolved external symbol references break loading of the ACL plugin
Description of problem by nalin(a)redhat.com:
Various functions in the directory server are declared with extern "C"
linkage, causing the compiler to emit references to an unmangled symbol
name, but because their definitions don't match the declarations, and
the definitions are compiled using the C++ compiler, the implementations
are emitted as mangled symbols.
Fix description: Using ld option "-z defs", cleaned all the undefined
references.
https://fedorahosted.org/389/ticket/47700
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
(cherry picked from commit 16386dde80e62b3d45697b7538d84dcb4a09255a)
diff --git a/include/base/ereport.h b/include/base/ereport.h
index 40813ea..e97be14 100644
--- a/include/base/ereport.h
+++ b/include/base/ereport.h
@@ -65,13 +65,13 @@ NSPR_BEGIN_EXTERN_C
* the current date.
*/
-NSAPI_PUBLIC int INTereport(int degree, const char *fmt, ...)
+NSAPI_PUBLIC int INTereport(int degree, char *fmt, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 2, 3)));
#else
;
#endif
-NSAPI_PUBLIC int INTereport_v(int degree, const char *fmt, va_list args);
+NSAPI_PUBLIC int INTereport_v(int degree, char *fmt, va_list args);
NSPR_END_EXTERN_C
diff --git a/include/libaccess/aclerror.h b/include/libaccess/aclerror.h
index 3aff2c7..32610dc 100644
--- a/include/libaccess/aclerror.h
+++ b/include/libaccess/aclerror.h
@@ -219,16 +219,6 @@ NSPR_END_EXTERN_C
/* ACL_DatabaseRegister */
#define ACLERR4500 4500 /* database name is missing */
-/* ACL_ReadDbMapFile */
-#define ACLERR4600 4600 /* Error reading the Map file */
-#define ACLERR4610 4610 /* Couldn't determine dbtype */
-#define ACLERR4620 4620 /* Missing URL for database */
-#define ACLERR4630 4630 /* Invalid proprty pair */
-#define ACLERR4640 4640 /* Register database failed */
-#define ACLERR4650 4650 /* Default database not LDAP */
-#define ACLERR4660 4660 /* Multiple default databases */
-#define ACLERR4670 4670 /* No default database */
-
/* LASDnsBuild */
#define ACLERR4700 4700 /* Cannot allocatae hash */
#define ACLERR4710 4710 /* Cannot add token to hash */
diff --git a/include/libaccess/acleval.h b/include/libaccess/acleval.h
index 15e1f5e..43c7ef8 100644
--- a/include/libaccess/acleval.h
+++ b/include/libaccess/acleval.h
@@ -63,8 +63,7 @@
NSPR_BEGIN_EXTERN_C
/* Functions in acleval.c */
-extern int aclDNSLookup(DNSFilter_t * dnf,
- char * dnsspec, int fqdn, char **match);
+extern int aclDNSLookup(DNSFilter_t * dnf, const char * dnsspec, int fqdn, const char **match);
extern int aclIPLookup(IPFilter_t * ipf, IPAddr_t ipaddr, void **match);
extern int aclUserLookup(UidUser_t * uup, UserObj_t * uoptr);
extern int aclEvaluate(ACL_t * acl, USI_t arid, ClAuth_t * clauth, int * padn);
10 years, 1 month
include/base include/libaccess
by Noriko Hosoi
include/base/ereport.h | 4 ++--
include/libaccess/aclerror.h | 10 ----------
include/libaccess/acleval.h | 3 +--
3 files changed, 3 insertions(+), 14 deletions(-)
New commits:
commit 16386dde80e62b3d45697b7538d84dcb4a09255a
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Feb 18 15:28:54 2014 -0800
Ticket #47700 - Unresolved external symbol references break loading of the ACL plugin
Description of problem by nalin(a)redhat.com:
Various functions in the directory server are declared with extern "C"
linkage, causing the compiler to emit references to an unmangled symbol
name, but because their definitions don't match the declarations, and
the definitions are compiled using the C++ compiler, the implementations
are emitted as mangled symbols.
Fix description: Using ld option "-z defs", cleaned all the undefined
references.
https://fedorahosted.org/389/ticket/47700
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
diff --git a/include/base/ereport.h b/include/base/ereport.h
index 40813ea..e97be14 100644
--- a/include/base/ereport.h
+++ b/include/base/ereport.h
@@ -65,13 +65,13 @@ NSPR_BEGIN_EXTERN_C
* the current date.
*/
-NSAPI_PUBLIC int INTereport(int degree, const char *fmt, ...)
+NSAPI_PUBLIC int INTereport(int degree, char *fmt, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 2, 3)));
#else
;
#endif
-NSAPI_PUBLIC int INTereport_v(int degree, const char *fmt, va_list args);
+NSAPI_PUBLIC int INTereport_v(int degree, char *fmt, va_list args);
NSPR_END_EXTERN_C
diff --git a/include/libaccess/aclerror.h b/include/libaccess/aclerror.h
index 3aff2c7..32610dc 100644
--- a/include/libaccess/aclerror.h
+++ b/include/libaccess/aclerror.h
@@ -219,16 +219,6 @@ NSPR_END_EXTERN_C
/* ACL_DatabaseRegister */
#define ACLERR4500 4500 /* database name is missing */
-/* ACL_ReadDbMapFile */
-#define ACLERR4600 4600 /* Error reading the Map file */
-#define ACLERR4610 4610 /* Couldn't determine dbtype */
-#define ACLERR4620 4620 /* Missing URL for database */
-#define ACLERR4630 4630 /* Invalid proprty pair */
-#define ACLERR4640 4640 /* Register database failed */
-#define ACLERR4650 4650 /* Default database not LDAP */
-#define ACLERR4660 4660 /* Multiple default databases */
-#define ACLERR4670 4670 /* No default database */
-
/* LASDnsBuild */
#define ACLERR4700 4700 /* Cannot allocatae hash */
#define ACLERR4710 4710 /* Cannot add token to hash */
diff --git a/include/libaccess/acleval.h b/include/libaccess/acleval.h
index 15e1f5e..43c7ef8 100644
--- a/include/libaccess/acleval.h
+++ b/include/libaccess/acleval.h
@@ -63,8 +63,7 @@
NSPR_BEGIN_EXTERN_C
/* Functions in acleval.c */
-extern int aclDNSLookup(DNSFilter_t * dnf,
- char * dnsspec, int fqdn, char **match);
+extern int aclDNSLookup(DNSFilter_t * dnf, const char * dnsspec, int fqdn, const char **match);
extern int aclIPLookup(IPFilter_t * ipf, IPAddr_t ipaddr, void **match);
extern int aclUserLookup(UidUser_t * uup, UserObj_t * uoptr);
extern int aclEvaluate(ACL_t * acl, USI_t arid, ClAuth_t * clauth, int * padn);
10 years, 1 month
ldap/servers
by Noriko Hosoi
ldap/servers/plugins/retrocl/retrocl_trim.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit b377d7da2b03fcbc43abaf2195b418debde27ce4
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Feb 18 13:26:39 2014 -0800
Ticket #47701 - Make retro changelog trim interval programmable
Description: Fixing 3 syntax errors introduced by commit
bb4f0c428f9e53bccb875a552f5cae1ee6f733be
diff --git a/ldap/servers/plugins/retrocl/retrocl_trim.c b/ldap/servers/plugins/retrocl/retrocl_trim.c
index f8c6f51..cb18889 100644
--- a/ldap/servers/plugins/retrocl/retrocl_trim.c
+++ b/ldap/servers/plugins/retrocl/retrocl_trim.c
@@ -506,19 +506,19 @@ void retrocl_init_trimming (void)
return;
}
ageval = age_str2time (cl_maxage);
- slapi_ch_free_string(&cl_maxage);
+ slapi_ch_free_string((char **)&cl_maxage);
if (cl_trim_interval) {
trim_interval = strtol(cl_trim_interval, (char **)NULL, 10);
if (0 == trim_interval) {
slapi_log_error(SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME,
"retrocl_init_trimming: ignoring invalid %s value %s; "
- "resetting the default %s\n",
+ "resetting the default %d\n",
CONFIG_CHANGELOG_TRIM_INTERVAL, cl_trim_interval,
DEFAULT_CHANGELOGDB_TRIM_INTERVAL);
trim_interval = DEFAULT_CHANGELOGDB_TRIM_INTERVAL;
}
- slapi_ch_free_string(&cl_trim_interval);
+ slapi_ch_free_string((char **)&cl_trim_interval);
}
ts.ts_c_max_age = ageval;
10 years, 1 month
ldap/servers
by Mark Reynolds
ldap/servers/slapd/task.c | 192 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 192 insertions(+)
New commits:
commit 681be0dc578cb4e4b03242c7f9e0422604d02f91
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Feb 18 13:52:19 2014 -0500
Ticket 47453 - configure SASL/GSSAPI/Kerberos without server restart
Bug Description: Setting up SASL requires aserver restart to take effect.
Fix Description: The restart was required so that the KRB5 config and keytab
environment variables would be loaded. To allow this without
a restart, a new task was created to reload the sysconfig file,
or any file with the new environment variables/values. The
task entry can also specify if the changes should be logged
to the error log.
https://fedorahosted.org/389/ticket/47453
Reviewed by: rmeggins(Thanks!)
diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c
index 3ffd799..6ca1a49 100644
--- a/ldap/servers/slapd/task.c
+++ b/ldap/servers/slapd/task.c
@@ -75,6 +75,8 @@ static int shutting_down = 0;
#define TASK_WORK_NAME "nsTaskTotalItems"
#define DEFAULT_TTL "120" /* seconds */
+#define TASK_SYSCONFIG_FILE_ATTR "sysconfigfile" /* sysconfig reload task file attr */
+#define TASK_SYSCONFIG_LOGCHANGES_ATTR "logchanges"
#define LOG_BUFFER 256
/* if the cumul. log gets larger than this, it's truncated: */
@@ -1883,6 +1885,195 @@ out:
return SLAPI_DSE_CALLBACK_OK;
}
+/*
+ * sysconfig reload task
+ *
+ * dn: cn=keytab_update,cn=sysconfig reload,cn=tasks,cn=config
+ * objectclass: top
+ * objectclass: extensibleObject
+ * cn: keytab_update
+ * sysconfigfile: /etc/sysconfig/dirsrv-localhost
+ * logchanges: <boolean>
+ *
+ * Reload environment variables from the instance sysconfig file, or
+ * any file using the following formats:
+ *
+ * VARIABLE=value
+ * export VARIABLE=value
+ * set VARIABLE value
+ * unset VARIABLE
+ * setenv VARIABLE value
+ * unsetenv VARIABLE
+ */
+static int
+task_sysconfig_reload_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter, int *returncode,
+ char *returntext, void *arg)
+{
+ FILE *file = NULL;
+ char *filename = NULL;
+ PRBool logchanges = 0;
+ int rc = SLAPI_DSE_CALLBACK_OK;
+
+ *returncode = LDAP_SUCCESS;
+
+ if(( filename = slapi_entry_attr_get_charptr(e, TASK_SYSCONFIG_FILE_ATTR))){
+ file = fopen ( filename, "r" );
+ } else {
+ *returncode = LDAP_OPERATIONS_ERROR;
+ PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE, "missing required attribute \"%s\".",
+ TASK_SYSCONFIG_FILE_ATTR);
+ LDAPDebug(LDAP_DEBUG_ANY, "sysconfig reload task: %s\n", returntext, 0, 0);
+ rc = SLAPI_DSE_CALLBACK_ERROR;
+ goto done;
+ }
+
+ /* see if we should log the changes made */
+ logchanges = slapi_entry_attr_get_bool(e, TASK_SYSCONFIG_LOGCHANGES_ATTR);
+
+ if ( file != NULL ){
+ char line[4096];
+ char *s = NULL;
+
+ if(logchanges){
+ LDAPDebug(LDAP_DEBUG_ANY, "sysconfig reload task: processing file (%s)\n",
+ filename, 0 , 0);
+ }
+
+ while ( fgets ( line, sizeof line, file ) != NULL ){
+ if(line[0] == '#'){
+ /* skip comments */
+ continue;
+ } else {
+ char env_value[4096];
+ char env_var[4096];
+ int using_setenv = 0;
+ int value_index = 0;
+ int start_value = 0;
+ int var_index = 0;
+ int inquotes = 0;
+
+ memset(env_var, 0, sizeof(env_var));
+ memset(env_value, 0, sizeof(env_value));
+
+ /*
+ * Remove leading spaces and tabs
+ */
+ for (s = line; s && *s; s++){
+ if(*s != ' ' && *s != '\t'){
+ break;
+ }
+ }
+
+ /*
+ * Check for "export", "setenv", and "unsetenv" assignments
+ */
+ if(strncmp(s, "export ", 7) == 0 ||
+ strncmp(s, "set ", 4) == 0 ||
+ strncmp(s, "unset ", 6) == 0 ||
+ strncmp(s, "setenv ", 7) == 0 ||
+ strncmp(s, "unsetenv ", 9) == 0 )
+ {
+ if(*s == 's' || *s == 'u'){ /* */
+ /*
+ * Using setenv/unsetenv/set/unset, so we need to handle spaces
+ * differently for these assignments.
+ */
+ using_setenv = 1;
+ }
+ if(strncmp(s, "export ", 7) == 0){
+ /* strip off "export " */
+ s = s + 7;
+ } else if(strncmp(s, "set ", 4) == 0){
+ /* strip off "set " */
+ s = s + 4;
+ } else if(strncmp(s, "unset ", 6) == 0){
+ /* strip off "unset " */
+ s = s + 6;
+ } else if(strncmp(s, "setenv ", 7) == 0){
+ /* strip off "setenv " */
+ s = s + 7;
+ } else if(strncmp(s, "unsetenv ", 9) == 0){
+ /* strip off "unsetenv " */
+ s = s + 9;
+ }
+ while(*s == ' ' || *s == '\t'){
+ /* remove any extra spaces/tabs between the assignment cmd and the name */
+ s++;
+ }
+ }
+
+ /*
+ * Start parsing the names and values
+ */
+ for (; s && *s; s++){
+ /*
+ * If using "setenv", allow the first space/tab only, and start on the env value
+ */
+ if(using_setenv && (*s == ' ' || *s == '\t')){
+ using_setenv = 0; /* finished doing special space parsing for setenv */
+ start_value = 1; /* start working on the value */
+ while(*s == ' ' || *s == '\t'){
+ /* remove any extra spaces/tabs between variable name and value */
+ s++;
+ }
+ } else if( ((*s == ';' || *s == ' ') && !inquotes) || *s == '\0' || *s == '\n' || *s == '\r'){
+ /* we're done processing the value */
+ break;
+ }
+
+ /* need to handle quoted values */
+ if(*s == '"'){
+ if(inquotes){
+ inquotes = 0;
+ } else {
+ inquotes = 1;
+ }
+ }
+
+ if(start_value){
+ /* Build the environment variable value */
+ env_value[value_index] = *s;
+ value_index++;
+ } else if(*s == '='){
+ /* Start on the environment variable value next */
+ start_value = 1;
+ } else {
+ /* Build the environment variable name. skip "export" */
+ env_var[var_index] = *s;
+ var_index++;
+ }
+ }
+ if(var_index > 0){
+ /* Update the environment variable */
+ if(setenv(env_var, env_value, 1) != 0){
+ *returncode = LDAP_OPERATIONS_ERROR;
+ PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"failed to set (%s)", env_var);
+ LDAPDebug(LDAP_DEBUG_ANY, "sysconfig reload task: %s\n",returntext,0,0);
+ rc = SLAPI_DSE_CALLBACK_ERROR;
+ break;
+ }
+ if(logchanges){
+ LDAPDebug(LDAP_DEBUG_ANY, "sysconfig reload task: set (%s) to (%s)\n",
+ env_var, env_value , 0);
+ }
+ }
+ }
+ }
+ fclose ( file );
+ } else {
+ *returncode = LDAP_OPERATIONS_ERROR;
+ PR_snprintf (returntext, SLAPI_DSE_RETURNTEXT_SIZE,"failed to open file \"%s\" (%s)",
+ filename, strerror(errno));
+ LDAPDebug(LDAP_DEBUG_ANY, "sysconfig reload task: %s\n", returntext, 0, 0);
+ rc = SLAPI_DSE_CALLBACK_ERROR;
+ }
+
+done:
+ slapi_ch_free_string(&filename);
+
+ return rc;
+}
+
/* cleanup old tasks that may still be in the DSE from a previous session
* (this can happen if the server crashes [no matter how unlikely we like
* to think that is].)
@@ -1962,6 +2153,7 @@ void task_init(void)
slapi_task_register_handler("restore", task_restore_add);
slapi_task_register_handler("index", task_index_add);
slapi_task_register_handler("upgradedb", task_upgradedb_add);
+ slapi_task_register_handler("sysconfig reload", task_sysconfig_reload_add);
}
/* called when the server is shutting down -- abort all existing tasks */
10 years, 1 month
ldap/servers
by Noriko Hosoi
ldap/servers/plugins/retrocl/retrocl.h | 4 +-
ldap/servers/plugins/retrocl/retrocl_trim.c | 56 ++++++++++++++++++----------
2 files changed, 39 insertions(+), 21 deletions(-)
New commits:
commit bb4f0c428f9e53bccb875a552f5cae1ee6f733be
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Feb 17 11:51:34 2014 -0800
Ticket #47701 - Make retro changelog trim interval programmable
Description: Currently, retro changelog trim interval is hardcoded
with 5 minutes.
#define CHANGELOGDB_TRIM_INTERVAL 300*1000 /* 5 minutes
Better have a control on the interval based upon the DS usage --
e.g., if there is no updates, we don't need to call changelog_trim
via retrocl_housekeeping every 5 minutes.
https://fedorahosted.org/389/ticket/47701
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!)
diff --git a/ldap/servers/plugins/retrocl/retrocl.h b/ldap/servers/plugins/retrocl/retrocl.h
index 3f808e6..7c6865a 100644
--- a/ldap/servers/plugins/retrocl/retrocl.h
+++ b/ldap/servers/plugins/retrocl/retrocl.h
@@ -80,7 +80,9 @@ typedef struct _cnumRet {
/*
* How often the changelog trimming thread runs. This is the minimum trim age.
*/
-#define CHANGELOGDB_TRIM_INTERVAL 300*1000 /* 5 minutes in milliseconds */
+#define DEFAULT_CHANGELOGDB_TRIM_INTERVAL 300 /* in second */
+
+#define CONFIG_CHANGELOG_TRIM_INTERVAL "nsslapd-changelog-trim-interval"
#if defined(__hpux) && defined(__ia64)
#define RETROCL_DLL_DEFAULT_THREAD_STACKSIZE 524288L
diff --git a/ldap/servers/plugins/retrocl/retrocl_trim.c b/ldap/servers/plugins/retrocl/retrocl_trim.c
index 756f13b..f8c6f51 100644
--- a/ldap/servers/plugins/retrocl/retrocl_trim.c
+++ b/ldap/servers/plugins/retrocl/retrocl_trim.c
@@ -52,6 +52,7 @@ typedef struct _trim_status {
PRLock *ts_s_trim_mutex; /* protects ts_s_trimming */
} trim_status;
static trim_status ts = {0L, 0L, 0, 0, NULL};
+static int trim_interval = DEFAULT_CHANGELOGDB_TRIM_INTERVAL; /* in second */
/*
* All standard changeLogEntry attributes (initialized in get_cleattrs)
@@ -80,12 +81,12 @@ static const char **get_cleattrs(void)
cleattrs[ 1 ] = attr_changenumber;
cleattrs[ 2 ] = attr_targetdn;
cleattrs[ 3 ] = attr_changetype;
- cleattrs[ 4 ] = attr_newrdn;
- cleattrs[ 5 ] = attr_deleteoldrdn;
- cleattrs[ 6 ] = attr_changes;
- cleattrs[ 7 ] = attr_newsuperior;
- cleattrs[ 8 ] = attr_changetime;
- cleattrs[ 9 ] = NULL;
+ cleattrs[ 4 ] = attr_newrdn;
+ cleattrs[ 5 ] = attr_deleteoldrdn;
+ cleattrs[ 6 ] = attr_changes;
+ cleattrs[ 7 ] = attr_newsuperior;
+ cleattrs[ 8 ] = attr_changetime;
+ cleattrs[ 9 ] = NULL;
}
return cleattrs;
}
@@ -109,20 +110,21 @@ delete_changerecord( changeNumber cnum )
int delrc;
dnbuf = slapi_ch_smprintf("%s=%ld, %s", attr_changenumber, cnum,
- RETROCL_CHANGELOG_DN);
+ RETROCL_CHANGELOG_DN);
pb = slapi_pblock_new ();
slapi_delete_internal_set_pb ( pb, dnbuf, NULL /*controls*/, NULL /* uniqueid */,
- g_plg_identity[PLUGIN_RETROCL], 0 /* actions */ );
+ g_plg_identity[PLUGIN_RETROCL], 0 /* actions */ );
slapi_delete_internal_pb (pb);
slapi_pblock_get( pb, SLAPI_PLUGIN_INTOP_RESULT, &delrc );
slapi_pblock_destroy( pb );
if ( delrc != LDAP_SUCCESS ) {
- slapi_log_error( SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME, "delete_changerecord: could not delete "
- "change record %lu\n", cnum );
+ slapi_log_error( SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME,
+ "delete_changerecord: could not delete change record %lu (rc: %d)\n",
+ cnum, delrc );
} else {
- slapi_log_error( SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME,
- "delete_changerecord: deleted changelog entry \"%s\"\n", dnbuf);
+ slapi_log_error( SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME,
+ "delete_changerecord: deleted changelog entry \"%s\"\n", dnbuf);
}
slapi_ch_free((void **) &dnbuf );
return delrc;
@@ -251,7 +253,7 @@ static int trim_changelog(void)
lt = ts.ts_s_last_trim;
PR_Unlock( ts.ts_s_trim_mutex );
- if ( now - lt >= (CHANGELOGDB_TRIM_INTERVAL / 1000) ) {
+ if ( now - lt >= trim_interval ) {
/*
* Trim the changelog. Read sequentially through all the
@@ -313,7 +315,7 @@ static int trim_changelog(void)
}
} else {
LDAPDebug(LDAP_DEBUG_PLUGIN, "not yet time to trim: %ld < (%d+%d)\n",
- now,lt,(CHANGELOGDB_TRIM_INTERVAL/1000));
+ now, lt, trim_interval);
}
PR_Lock( ts.ts_s_trim_mutex );
ts.ts_s_trimming = 0;
@@ -494,23 +496,38 @@ void retrocl_init_trimming (void)
{
const char *cl_maxage;
time_t ageval;
+ const char *cl_trim_interval;
cl_maxage = retrocl_get_config_str(CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE);
+ cl_trim_interval = retrocl_get_config_str(CONFIG_CHANGELOG_TRIM_INTERVAL);
if (cl_maxage == NULL) {
LDAPDebug0Args(LDAP_DEBUG_TRACE,"No maxage, not trimming retro changelog.\n");
return;
}
ageval = age_str2time (cl_maxage);
- slapi_ch_free ((void **)&cl_maxage);
+ slapi_ch_free_string(&cl_maxage);
+
+ if (cl_trim_interval) {
+ trim_interval = strtol(cl_trim_interval, (char **)NULL, 10);
+ if (0 == trim_interval) {
+ slapi_log_error(SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME,
+ "retrocl_init_trimming: ignoring invalid %s value %s; "
+ "resetting the default %s\n",
+ CONFIG_CHANGELOG_TRIM_INTERVAL, cl_trim_interval,
+ DEFAULT_CHANGELOGDB_TRIM_INTERVAL);
+ trim_interval = DEFAULT_CHANGELOGDB_TRIM_INTERVAL;
+ }
+ slapi_ch_free_string(&cl_trim_interval);
+ }
ts.ts_c_max_age = ageval;
ts.ts_s_last_trim = (time_t) 0L;
ts.ts_s_trimming = 0;
if (( ts.ts_s_trim_mutex = PR_NewLock()) == NULL ) {
- slapi_log_error( SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME, "set_changelog_trim_constraints: "
- "cannot create new lock.\n" );
- exit( 1 );
+ slapi_log_error( SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME, "set_changelog_trim_constraints: "
+ "cannot create new lock.\n" );
+ exit( 1 );
}
ts.ts_s_initialized = 1;
retrocl_trimming = 1;
@@ -518,8 +535,7 @@ void retrocl_init_trimming (void)
retrocl_trim_ctx = slapi_eq_repeat(retrocl_housekeeping,
NULL, (time_t)0,
/* in milliseconds */
- CHANGELOGDB_TRIM_INTERVAL);
-
+ trim_interval * 1000);
}
/*
10 years, 1 month