ldap/schema
by Richard Allen Megginson
ldap/schema/60qmail.ldif | 20 ++++++++++----------
ldap/schema/60sabayon.ldif | 10 +++++-----
2 files changed, 15 insertions(+), 15 deletions(-)
New commits:
commit 453eb976e821275c3279af8790820e8ed5e12ee6
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Mar 30 11:17:50 2012 -0600
schema def must have DESC '' - close paren must be preceded by space
Some of the qmail schema had DESC with no quoted string - for an empty
DESC, the string must be specified as ''
For the multiline schema definitions, the close paren must not be the
first char on the line because that violates LDIF line wrapping - add
a space before the close paren
Reviewed by: nhosoi (Thanks!)
diff --git a/ldap/schema/60qmail.ldif b/ldap/schema/60qmail.ldif
index c118bef..b1bc391 100644
--- a/ldap/schema/60qmail.ldif
+++ b/ldap/schema/60qmail.ldif
@@ -308,7 +308,7 @@ attributeTypes: (
attributeTypes: (
1.3.6.1.4.1.7914.1.4.1.1
NAME 'qladnmanager'
- DESC
+ DESC ''
EQUALITY distinguishedNameMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.12
)
@@ -318,7 +318,7 @@ attributeTypes: (
attributeTypes: (
1.3.6.1.4.1.7914.1.4.1.2
NAME 'qlaDomainList'
- DESC
+ DESC ''
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256}
@@ -329,7 +329,7 @@ attributeTypes: (
attributeTypes: (
1.3.6.1.4.1.7914.1.4.1.3
NAME 'qlaUidPrefix'
- DESC
+ DESC ''
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256}
@@ -341,7 +341,7 @@ attributeTypes: (
attributeTypes: (
1.3.6.1.4.1.7914.1.4.1.4
NAME 'qlaQmailUid'
- DESC
+ DESC ''
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
SINGLE-VALUE
@@ -352,7 +352,7 @@ attributeTypes: (
attributeTypes: (
1.3.6.1.4.1.7914.1.4.1.5
NAME 'qlaQmailGid'
- DESC
+ DESC ''
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
SINGLE-VALUE
@@ -363,7 +363,7 @@ attributeTypes: (
attributeTypes: (
1.3.6.1.4.1.7914.1.4.1.6
NAME 'qlaMailMStorePrefix'
- DESC
+ DESC ''
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256}
@@ -375,7 +375,7 @@ attributeTypes: (
attributeTypes: (
1.3.6.1.4.1.7914.1.4.1.7
NAME 'qlaMailQuotaSize'
- DESC
+ DESC ''
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
SINGLE-VALUE
@@ -386,7 +386,7 @@ attributeTypes: (
attributeTypes: (
1.3.6.1.4.1.7914.1.4.1.8
NAME 'qlaMailQuotaCount'
- DESC
+ DESC ''
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
SINGLE-VALUE
@@ -397,7 +397,7 @@ attributeTypes: (
attributeTypes: (
1.3.6.1.4.1.7914.1.4.1.9
NAME 'qlaMailSizeMax'
- DESC
+ DESC ''
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
SINGLE-VALUE
@@ -408,7 +408,7 @@ attributeTypes: (
attributeTypes: (
1.3.6.1.4.1.7914.1.4.1.10
NAME 'qlaMailHostList'
- DESC
+ DESC ''
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256}
diff --git a/ldap/schema/60sabayon.ldif b/ldap/schema/60sabayon.ldif
index 9441a41..7fbc455 100644
--- a/ldap/schema/60sabayon.ldif
+++ b/ldap/schema/60sabayon.ldif
@@ -15,7 +15,7 @@ attributeTypes: (
DESC 'The URL of a sabayon profile'
SUP labeledURI
X-ORIGIN 'Sabayon'
-)
+ )
# This attribute is used to store the name of a sabayon profile.
# It can refer to either a local zipfile (which will be looked up
# in /etc/desktop-profiles/$(name).zip), or it can be used to
@@ -29,7 +29,7 @@ attributeTypes: (
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE
X-ORIGIN 'Sabayon'
-)
+ )
# Simple example object to store profile information
# If you use this or something similar instead of a direct URL
# in your user object you get more flexibility.
@@ -42,7 +42,7 @@ objectClasses: (
MUST cn
MAY ( sabayonProfileURL $ description )
X-ORIGIN 'Sabayon'
-)
+ )
# Use these to put sabayonProfileName or sabayonProfileURL
# attributes in an objetc
objectClasses: (
@@ -53,7 +53,7 @@ objectClasses: (
AUXILIARY
MUST sabayonProfileName
X-ORIGIN 'Sabayon'
-)
+ )
objectClasses: (
1.3.6.1.4.1.2312.4.3.4.3
NAME 'sabayonProfileURLObject'
@@ -63,4 +63,4 @@ objectClasses: (
MUST cn
MAY sabayonProfileURL
X-ORIGIN 'Sabayon'
-)
+ )
11 years, 6 months
ldap/admin
by Noriko Hosoi
ldap/admin/src/scripts/DSUtil.pm.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 796dcfedee3d8e884dafb02ed0fce86cd95199b2
Author: Noriko Hosoi <nhosoi(a)totoro.usersys.redhat.com>
Date: Thu Mar 29 15:38:16 2012 -0700
Trac Ticket #46 - (additional) setup-ds-admin.pl does not
like ipv6 only hostnames
commit 850005499bd92c5b9b0027f944fcd33633c8db46 included a logic bug.
The host name returned from getnameinfo needs to be checked with the
original when the host name is not NULL.
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index a3a8abf..e84f482 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -269,7 +269,7 @@ sub checkHostname {
debug(1, "ipaddr=", $ip, "\n");
# see if reverse resolution works
my ($hn2, $service) = getnameinfo($saddr);
- if (!$hn2) {
+ if ($hn2) {
push @hostip, [$hn2, $ip];
if (lc($hn) eq lc($hn2)) {
$found = 1;
11 years, 6 months
ldap/servers
by Richard Allen Megginson
ldap/servers/plugins/replication/cl5_api.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
New commits:
commit 9c7e9d51309cb8daa900a3e37c56267477aa666d
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Mar 28 16:11:20 2012 -0600
Ticket #331 - transaction errors with db 4.3 and db 4.2
https://fedorahosted.org/389/ticket/331
Resolves: Ticket #331
Bug Description: transaction errors with db 4.3 and db 4.2
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description:
we are enabling transactions everywhere - since we are opening databases
with DB_AUTO_COMMIT we must either open and pass a valid txn handle to
all operations that modify the database (put, del) or we must pass the
DB_AUTO_COMMIT flag to those operations.
Platforms tested: RHEL6 x86_64, RHEL5 i386
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 3c02d41..2b57f91 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -95,7 +95,15 @@
#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4100
#define USE_DB_TXN 1 /* use transactions */
#define DEFAULT_DB_ENV_OP_FLAGS DB_AUTO_COMMIT
-#define DEFAULT_DB_OP_FLAGS 0
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR <= 4300
+/* we are enabling transactions everywhere - since we are opening databases
+ with DB_AUTO_COMMIT we must either open and pass a valid txn handle to
+ all operations that modify the database (put, del) or we must pass the
+ DB_AUTO_COMMIT flag to those operations */
+#define DEFAULT_DB_OP_FLAGS(txn) (txn ? 0 : DB_AUTO_COMMIT)
+#else
+#define DEFAULT_DB_OP_FLAGS(txn) 0
+#endif
#define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \
{ \
if (((oflags) & DB_INIT_TXN) && ((oflags) & DB_INIT_LOG)) \
@@ -108,7 +116,7 @@
} \
}
#else /* older then db 41 */
-#define DEFAULT_DB_OP_FLAGS 0
+#define DEFAULT_DB_OP_FLAGS(txn) 0
#define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \
(rval) = (db)->open((db), (file), (database), (type), (flags), (mode))
#endif
@@ -3676,7 +3684,7 @@ static int _cl5ReadRUV (const char *replGen, Object *obj, PRBool purge)
/* delete the entry; it is re-added when file
is successfully closed */
- file->db->del (file->db, NULL, &key, DEFAULT_DB_OP_FLAGS);
+ file->db->del (file->db, NULL, &key, DEFAULT_DB_OP_FLAGS(NULL));
rc = CL5_SUCCESS;
goto done;
@@ -3747,7 +3755,7 @@ static int _cl5WriteRUV (CL5DBFile *file, PRBool purge)
return CL5_DB_ERROR;
}
#endif
- rc = file->db->put(file->db, txnid, &key, &data, DEFAULT_DB_OP_FLAGS);
+ rc = file->db->put(file->db, txnid, &key, &data, DEFAULT_DB_OP_FLAGS(txnid));
slapi_ch_free (&(data.data));
if ( rc == 0 )
@@ -4039,7 +4047,7 @@ static int _cl5GetEntryCount (CL5DBFile *file)
/* delete the entry. the entry is re-added when file
is successfully closed */
- file->db->del (file->db, NULL, &key, DEFAULT_DB_OP_FLAGS);
+ file->db->del (file->db, NULL, &key, DEFAULT_DB_OP_FLAGS(NULL));
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"_cl5GetEntryCount: %d changes for replica %s\n",
file->entryCount, file->replName);
@@ -4103,7 +4111,7 @@ static int _cl5WriteEntryCount (CL5DBFile *file)
return CL5_DB_ERROR;
}
#endif
- rc = file->db->put(file->db, txnid, &key, &data, DEFAULT_DB_OP_FLAGS);
+ rc = file->db->put(file->db, txnid, &key, &data, DEFAULT_DB_OP_FLAGS(txnid));
if (rc == 0)
{
#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 4100
@@ -4599,7 +4607,7 @@ static int _cl5WriteOperationTxn(const char *replName, const char *replGen,
{
PR_WaitSemaphore(file->sema);
}
- rc = file->db->put(file->db, txnid, &key, data, DEFAULT_DB_OP_FLAGS);
+ rc = file->db->put(file->db, txnid, &key, data, DEFAULT_DB_OP_FLAGS(txnid));
if ( file->sema )
{
PR_PostSemaphore(file->sema);
11 years, 6 months
config.h.in configure configure.ac Makefile.am Makefile.in
by Richard Allen Megginson
Makefile.am | 4 +-
Makefile.in | 6 +--
config.h.in | 3 +
configure | 108 ++++++++++++++++++++++++++++++++++++++++-------------------
configure.ac | 20 ++++++++--
5 files changed, 98 insertions(+), 43 deletions(-)
New commits:
commit ac6a81f6f8eb1ce987e32134dee2fd4c2ae3aa1b
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Mar 28 13:56:55 2012 -0600
Ticket #261 - Add Solaris i386
https://fedorahosted.org/389/ticket/261
Resolves: Ticket #261
Bug Description: Add Solaris i386
Reviewed by: rmeggins
Branch: master
Fix Description: Allow building on Solaris i386
Platforms tested: RHEL6 x86_64 (build only)
Flag Day: yes - configure changes
Doc impact: no
Contributed by: cgrzemba (Thanks!)
diff --git a/Makefile.am b/Makefile.am
index 521f4f4..0efea66 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -698,7 +698,7 @@ libslapd_la_SOURCES = ldap/servers/slapd/add.c \
$(libavl_a_SOURCES)
libslapd_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @sasl_inc@ @db_inc@ @svrcore_inc@ @kerberos_inc@ @pcre_inc@
-if SOLARIS
+if SPARC
libslapd_la_SOURCES += ldap/servers/slapd/slapi_counter_sunos_sparcv9.S
endif
@@ -888,7 +888,7 @@ libcollation_plugin_la_SOURCES = ldap/servers/plugins/collation/collate.c \
ldap/servers/plugins/collation/config.c \
ldap/servers/plugins/collation/orfilter.c
-libcollation_plugin_la_CPPFLAGS = @icu_inc@ $(PLUGIN_CPPFLAGS)
+libcollation_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @icu_inc@
libcollation_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK) $(ICU_LINK) $(LIBCSTD) $(LIBCRUN)
libcollation_plugin_la_LDFLAGS = -avoid-version
libcollation_plugin_la_LINK = $(CXXLINK) -avoid-version
diff --git a/Makefile.in b/Makefile.in
index 3aaf49f..4b0897f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -45,7 +45,7 @@ bin_PROGRAMS = dbscan-bin$(EXEEXT) dsktune-bin$(EXEEXT) \
migratecred-bin$(EXEEXT) mmldif-bin$(EXEEXT) \
pwdhash-bin$(EXEEXT) rsearch-bin$(EXEEXT)
noinst_PROGRAMS = makstrdb$(EXEEXT)
-@SOLARIS_TRUE@am__append_1 = ldap/servers/slapd/slapi_counter_sunos_sparcv9.S
+@SPARC_TRUE@am__append_1 = ldap/servers/slapd/slapi_counter_sunos_sparcv9.S
@SOLARIS_TRUE@am__append_2 = -lrt
@SOLARIS_TRUE@am__append_3 = ldap/servers/slapd/tools/ldclt/opCheck.c
subdir = .
@@ -652,7 +652,7 @@ am__libslapd_la_SOURCES_DIST = ldap/servers/slapd/add.c \
ldap/servers/slapd/vattr.c ldap/libraries/libavl/avl.c \
ldap/servers/slapd/slapi_counter_sunos_sparcv9.S
am__objects_2 = ldap/libraries/libavl/libslapd_la-avl.lo
-@SOLARIS_TRUE@am__objects_3 = ldap/servers/slapd/libslapd_la-slapi_counter_sunos_sparcv9.lo
+@SPARC_TRUE@am__objects_3 = ldap/servers/slapd/libslapd_la-slapi_counter_sunos_sparcv9.lo
am_libslapd_la_OBJECTS = ldap/servers/slapd/libslapd_la-add.lo \
ldap/servers/slapd/libslapd_la-agtmmap.lo \
ldap/servers/slapd/libslapd_la-apibroker.lo \
@@ -2032,7 +2032,7 @@ libcollation_plugin_la_SOURCES = ldap/servers/plugins/collation/collate.c \
ldap/servers/plugins/collation/config.c \
ldap/servers/plugins/collation/orfilter.c
-libcollation_plugin_la_CPPFLAGS = @icu_inc@ $(PLUGIN_CPPFLAGS)
+libcollation_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @icu_inc@
libcollation_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK) $(ICU_LINK) $(LIBCSTD) $(LIBCRUN)
libcollation_plugin_la_LDFLAGS = -avoid-version
libcollation_plugin_la_LINK = $(CXXLINK) -avoid-version
diff --git a/config.h.in b/config.h.in
index 247d962..46e93eb 100644
--- a/config.h.in
+++ b/config.h.in
@@ -104,6 +104,9 @@
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
+/* have getpeerucred */
+#undef HAVE_GETPEERUCRED
+
/* define if you have HEIMDAL Kerberos */
#undef HAVE_HEIMDAL_KERBEROS
diff --git a/configure b/configure
index fc70250..a70bfb6 100755
--- a/configure
+++ b/configure
@@ -832,6 +832,8 @@ nss_inc
nspr_libdir
nspr_lib
nspr_inc
+SPARC_FALSE
+SPARC_TRUE
OPENLDAP_FALSE
OPENLDAP_TRUE
SELINUX_FALSE
@@ -5508,13 +5510,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:5511: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:5513: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:5514: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:5516: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:5517: output\"" >&5)
+ (eval echo "\"\$as_me:5519: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -6720,7 +6722,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 6723 "configure"' > conftest.$ac_ext
+ echo '#line 6725 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -9285,11 +9287,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9288: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9290: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:9292: \$? = $ac_status" >&5
+ echo "$as_me:9294: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -9624,11 +9626,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9627: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9629: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:9631: \$? = $ac_status" >&5
+ echo "$as_me:9633: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -9729,11 +9731,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9732: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9734: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:9736: \$? = $ac_status" >&5
+ echo "$as_me:9738: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -9784,11 +9786,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9787: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9789: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:9791: \$? = $ac_status" >&5
+ echo "$as_me:9793: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -12587,7 +12589,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12590 "configure"
+#line 12592 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12683,7 +12685,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12686 "configure"
+#line 12688 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14703,11 +14705,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14706: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14708: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14710: \$? = $ac_status" >&5
+ echo "$as_me:14712: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14802,11 +14804,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14805: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14807: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14809: \$? = $ac_status" >&5
+ echo "$as_me:14811: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14854,11 +14856,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14857: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14859: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14861: \$? = $ac_status" >&5
+ echo "$as_me:14863: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -21231,7 +21233,7 @@ _ACEOF
# HPUX doesn't use /etc for this
initdir=/init.d
;;
- sparc-sun-solaris*)
+ *-*-solaris*)
cat >>confdefs.h <<\_ACEOF
#define XP_UNIX 1
@@ -21264,11 +21266,6 @@ _ACEOF
cat >>confdefs.h <<\_ACEOF
-#define CPU_sparc /**/
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
#define OS_solaris 1
_ACEOF
@@ -21292,11 +21289,6 @@ cat >>confdefs.h <<\_ACEOF
#define NO_DOMAINNAME 1
_ACEOF
-
-cat >>confdefs.h <<\_ACEOF
-#define ATOMIC_64BIT_OPERATIONS 1
-_ACEOF
-
LIBSOCKET=-lsocket
LIBSOCKET=$LIBSOCKET
@@ -21313,9 +21305,29 @@ _ACEOF
LIBCRUN=$LIBCRUN
platform="solaris"
- # assume 64 bit
- perlexec='/usr/lib/sparcv9/dirsec/perl5x/bin/perl'
initdir='$(sysconfdir)/init.d'
+ case $host in
+ i?86-*-solaris2.1[0-9]*)
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPEERUCRED 1
+_ACEOF
+
+ ;;
+ sparc-*-solaris*)
+
+cat >>confdefs.h <<\_ACEOF
+#define ATOMIC_64BIT_OPERATIONS 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define CPU_sparc /**/
+_ACEOF
+
+ TARGET='SPARC'
+ ;;
+ esac
;;
*)
platform=""
@@ -24901,6 +24913,22 @@ else
OPENLDAP_FALSE=
fi
+ if test "$platform" = "solaris"; then
+ SOLARIS_TRUE=
+ SOLARIS_FALSE='#'
+else
+ SOLARIS_TRUE='#'
+ SOLARIS_FALSE=
+fi
+
+ if test "x$TARGET" = xSPARC; then
+ SPARC_TRUE=
+ SPARC_FALSE='#'
+else
+ SPARC_TRUE='#'
+ SPARC_FALSE=
+fi
+
# write out paths for binary components
@@ -25236,6 +25264,20 @@ $as_echo "$as_me: error: conditional \"OPENLDAP\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${SOLARIS_TRUE}" && test -z "${SOLARIS_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"SOLARIS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"SOLARIS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${SPARC_TRUE}" && test -z "${SPARC_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"SPARC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"SPARC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
: ${CONFIG_STATUS=./config.status}
ac_write_fail=0
diff --git a/configure.ac b/configure.ac
index f993e37..c24084d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -524,20 +524,18 @@ case $host in
# HPUX doesn't use /etc for this
initdir=/init.d
;;
- sparc-sun-solaris*)
+ *-*-solaris*)
AC_DEFINE([XP_UNIX], [1], [UNIX])
AC_DEFINE([SVR4], [1], [SVR4])
AC_DEFINE([__svr4], [1], [SVR4])
AC_DEFINE([__svr4__], [1], [SVR4])
AC_DEFINE([_SVID_GETTOD], [1], [SVID_GETTOD])
AC_DEFINE([SOLARIS], [1], [SOLARIS])
- AC_DEFINE([CPU_sparc], [], [cpu type sparc])
AC_DEFINE([OS_solaris], [1], [OS SOLARIS])
AC_DEFINE([sunos5], [1], [SunOS5])
AC_DEFINE([OSVERSION], [509], [OS version])
AC_DEFINE([_REENTRANT], [1], [_REENTRANT])
AC_DEFINE([NO_DOMAINNAME], [1], [no getdomainname])
- AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
dnl socket nsl and dl are required to link several programs and libdb
LIBSOCKET=-lsocket
AC_SUBST([LIBSOCKET], [$LIBSOCKET])
@@ -551,9 +549,19 @@ dnl Cstd and Crun are required to link any C++ related code
LIBCRUN=-lCrun
AC_SUBST([LIBCRUN], [$LIBCRUN])
platform="solaris"
- # assume 64 bit
- perlexec='/usr/lib/sparcv9/dirsec/perl5x/bin/perl'
initdir='$(sysconfdir)/init.d'
+ case $host in
+ i?86-*-solaris2.1[[0-9]]*)
+dnl I dont know why i386 need this explicit
+ AC_DEFINE([HAVE_GETPEERUCRED], [1], [have getpeerucred])
+ ;;
+ sparc-*-solaris*)
+dnl includes some assembler stuff in counter.o
+ AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
+ AC_DEFINE([CPU_sparc], [], [cpu type sparc])
+ TARGET='SPARC'
+ ;;
+ esac
;;
*)
platform=""
@@ -612,6 +620,8 @@ fi
AM_CONDITIONAL(SELINUX,test "$with_selinux" = "yes")
AM_CONDITIONAL(OPENLDAP,test "$with_openldap" = "yes")
+AM_CONDITIONAL(SOLARIS,test "$platform" = "solaris")
+AM_CONDITIONAL(SPARC,test "x$TARGET" = xSPARC)
# write out paths for binary components
AC_SUBST(nspr_inc)
11 years, 6 months
ldap/admin
by Noriko Hosoi
ldap/admin/src/scripts/DSUtil.pm.in | 107 ++++++++++++++++++++++++++++--------
1 file changed, 84 insertions(+), 23 deletions(-)
New commits:
commit 850005499bd92c5b9b0027f944fcd33633c8db46
Author: Noriko Hosoi <nhosoi(a)totoro.usersys.redhat.com>
Date: Tue Mar 27 16:15:50 2012 -0700
Trac Ticket #46 - (take 3) setup-ds-admin.pl does not like ipv6 only hostnames
https://fedorahosted.org/389/ticket/46
Fix Description:
Perl functions (gethostbyname, gethostbyaddr) do not support IPv6
addresses. This patch addes the IPv6 support if an IPv6 enabled
socket module is available. If Socket::addrinfo subsystem is
found, use getaddrinfo and getnameinfo from the module. If not
and if Socket6 module is available, the module is used. If both
are not found on the system, the existing non-IPv6 methods are
called.
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index 9e4b322..a3a8abf 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -59,7 +59,16 @@ require Exporter;
use strict;
use Socket;
-use Socket6 qw( getaddrinfo getnameinfo unpack_sockaddr_in6 );
+BEGIN {
+ if (eval {require Socket::addrinfo; 1}) {
+ import Socket qw (:addrinfo inet_ntoa
+ unpack_sockaddr_in unpack_sockaddr_in6
+ AF_INET INADDR_ANY
+ PF_INET SO_REUSEADDR SOCK_STREAM SOL_SOCKET);
+ } elsif (eval {require Socket6; 1}) {
+ import Socket6 qw (getaddrinfo getnameinfo unpack_sockaddr_in6);
+ }
+}
use NetAddr::IP::Util qw( ipv6_n2x );
use File::Temp qw(tempfile tempdir);
@@ -210,35 +219,87 @@ sub checkHostname {
}
# see if we can resolve the hostname (IPv6 supported)
- my @aires = getaddrinfo( $hn, "ldap", AF_UNSPEC, SOCK_STREAM );
- if (scalar(@aires) < 5) {
- return $res->getText('warning_no_such_hostname', $hn);
- }
my $found = 0;
my @hostip = ();
- my $ailen = scalar(@aires);
- while ( $ailen >= 5 ) {
- debug(1, "found for hostname $hn\n");
- my ($family, $socktype, $proto, $saddr, $canonname, @aires) = @aires;
- $ailen = scalar(@aires);
- my $ip;
- if ($family == AF_INET) {
- my ( $port, $ipaddr ) = unpack_sockaddr_in( $saddr );
- $ip = inet_ntoa($ipaddr);
- } else {
- my ( $port, $ipaddr ) = unpack_sockaddr_in6( $saddr );
- $ip = ipv6_n2x($ipaddr);
+ if (eval {require Socket::addrinfo; 1}) {
+ my %hints = (socktype => SOCK_STREAM);
+ my ($err, @aires) = getaddrinfo($hn, "ldap", \%hints);
+ if ($err) {
+ return $res->getText('warning_no_such_hostname', $hn);
+ }
+ while (my $ai = shift @aires) {
+ debug(1, "found for hostname $hn\n");
+ my $ip;
+ if ($ai->{family} == AF_INET) {
+ my ( $port, $ipaddr ) = unpack_sockaddr_in( $ai->{addr} );
+ $ip = inet_ntoa($ipaddr);
+ } else {
+ my ( $port, $ipaddr ) = unpack_sockaddr_in6( $ai->{addr} );
+ $ip = ipv6_n2x($ipaddr);
+ }
+ debug(1, "ipaddr=", $ip, "\n");
+ # see if reverse resolution works
+ my ($err, $hn2, $service) = getnameinfo($ai->{addr});
+ if (!$err) {
+ push @hostip, [$hn2, $ip];
+ if (lc($hn) eq lc($hn2)) {
+ $found = 1;
+ last;
+ }
+ }
+ }
+ } elsif (eval {require Socket6; 1}) {
+ my @aires = getaddrinfo($hn, "ldap", AF_UNSPEC, SOCK_STREAM);
+ if (scalar(@aires) < 5) {
+ return $res->getText('warning_no_such_hostname', $hn);
+ }
+ my $ailen = scalar(@aires);
+ while ($ailen >= 5) {
+ debug(1, "found for hostname $hn\n");
+ my ($family, $socktype, $proto, $saddr, $canonname, @aires) = @aires;
+ $ailen = scalar(@aires);
+ my $ip;
+ if ($family == AF_INET) {
+ my ($port, $ipaddr) = unpack_sockaddr_in($saddr);
+ $ip = inet_ntoa($ipaddr);
+ } else {
+ my ($port, $ipaddr) = unpack_sockaddr_in6($saddr);
+ $ip = ipv6_n2x($ipaddr);
+ }
+ debug(1, "ipaddr=", $ip, "\n");
+ # see if reverse resolution works
+ my ($hn2, $service) = getnameinfo($saddr);
+ if (!$hn2) {
+ push @hostip, [$hn2, $ip];
+ if (lc($hn) eq lc($hn2)) {
+ $found = 1;
+ }
+ }
}
- debug(1, "ipaddr=", $ip, "\n");
- # see if reverse resolution works
- my ( $hn2, $service ) = getnameinfo( $saddr );
- if (!$hn2) {
+ } else {
+ # see if we can resolve the hostname
+ my ($name, $aliases, $addrtype, $length, @addrs) = gethostbyname($hn);
+ if (!$name) {
+ if ($res) {
+ return $res->getText('warning_no_such_hostname', $hn);
+ } else {
+ return "Warning: could not resolve hostname $hn\n";
+ }
+ }
+ debug(1, "found for hostname $hn: name=$name\n");
+ debug(1, "aliases=$aliases\n");
+ debug(1, "addrtype=$addrtype\n");
+ # see if reverse resolution works
+ foreach my $ii (@addrs) {
+ my $hn2 = gethostbyaddr($ii, $addrtype);
+ my $ip = join('.', unpack('C4', $ii));
+ debug(1, "\thost=$hn2 ip=$ip\n");
push @hostip, [$hn2, $ip];
if (lc($hn) eq lc($hn2)) {
$found = 1;
last;
- }
- }
+ }
+ }
}
if (!$found) {
11 years, 6 months
2 commits - ldap/admin ldap/servers
by Richard Allen Megginson
ldap/admin/src/scripts/DSUtil.pm.in | 24 -
ldap/servers/plugins/replication/windows_private.c | 328 +++++++++++---
ldap/servers/plugins/replication/windows_protocol_util.c | 156 ++++++-
ldap/servers/plugins/replication/windowsrepl.h | 35 +
ldap/servers/plugins/replication/winsync-plugin.h | 334 ++++++++++++++-
5 files changed, 771 insertions(+), 106 deletions(-)
New commits:
commit 0610f9a7495b5cc995796e8a0bbaa6bc61449c33
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Mar 27 14:07:16 2012 -0600
Ticket #316 and Ticket #70 - add post add/mod and AD add callback hooks
https://fedorahosted.org/389/ticket/316
https://fedorahosted.org/389/ticket/70
Resolves: Ticket #316 and Ticket #70
Bug Description: Add user post callback hook to winsync plugin API
Bug Description: Winsync API should have callback functions for new entries sync to AD
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: New callbacks for all post-add and post-modify (both to
and from AD) operations. All post op callbacks have an int *return
parameter. This parameter is the ldap result code from the add/mod op.
The plugin will be called upon op success or failure, so should use this
parameter to find out what happened. The plugin can also change this value
to, for example, make a failed op pass, or to tell winsync to make a
successful op fail (it will not roll back the op in this case though, but
the plugin can tell winsync to stop on this op).
There are also new callbacks for AD user/group add for ticket 70.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: yes - doc the new functions
diff --git a/ldap/servers/plugins/replication/windows_private.c b/ldap/servers/plugins/replication/windows_private.c
index 6c19e4a..72cb721 100644
--- a/ldap/servers/plugins/replication/windows_private.c
+++ b/ldap/servers/plugins/replication/windows_private.c
@@ -1019,6 +1019,10 @@ windows_private_set_sync_interval(Repl_Agmt *ra, char *str)
/* an array of function pointers */
static void **_WinSyncAPI = NULL;
+static int maxapiidx = WINSYNC_PLUGIN_VERSION_1_END;
+#define DECL_WINSYNC_API_FUNC(idx,thetype,thefunc) \
+ thetype thefunc = (_WinSyncAPI && (idx <= maxapiidx) && _WinSyncAPI[idx]) ? \
+ (thetype)_WinSyncAPI[idx] : NULL;
void
windows_plugin_init(Repl_Agmt *ra)
@@ -1031,14 +1035,34 @@ windows_plugin_init(Repl_Agmt *ra)
/* if the function pointer array is null, get the functions - we will
call init once per replication agreement, but will only grab the
api once */
- if((NULL == _WinSyncAPI) &&
- (slapi_apib_get_interface(WINSYNC_v1_0_GUID, &_WinSyncAPI) ||
- (NULL == _WinSyncAPI)))
- {
- LDAPDebug1Arg( LDAP_DEBUG_PLUGIN,
- "<-- windows_plugin_init_start -- no windows plugin API registered for GUID [%s] -- end\n",
- WINSYNC_v1_0_GUID);
- return;
+ if(NULL == _WinSyncAPI) {
+ if (slapi_apib_get_interface(WINSYNC_v2_0_GUID, &_WinSyncAPI) ||
+ (NULL == _WinSyncAPI))
+ {
+ LDAPDebug1Arg( LDAP_DEBUG_PLUGIN,
+ "<-- windows_plugin_init_start -- no windows plugin API registered for GUID [%s] -- end\n",
+ WINSYNC_v2_0_GUID);
+ } else if (_WinSyncAPI) {
+ LDAPDebug1Arg( LDAP_DEBUG_PLUGIN,
+ "<-- windows_plugin_init_start -- found windows plugin API registered for GUID [%s] -- end\n",
+ WINSYNC_v2_0_GUID);
+ maxapiidx = WINSYNC_PLUGIN_VERSION_2_END;
+ }
+ }
+
+ if (NULL == _WinSyncAPI) { /* no v2 interface - look for v1 */
+ if (slapi_apib_get_interface(WINSYNC_v1_0_GUID, &_WinSyncAPI) ||
+ (NULL == _WinSyncAPI))
+ {
+ LDAPDebug1Arg( LDAP_DEBUG_PLUGIN,
+ "<-- windows_plugin_init_start -- no windows plugin API registered for GUID [%s] -- end\n",
+ WINSYNC_v1_0_GUID);
+ return;
+ } else {
+ LDAPDebug1Arg( LDAP_DEBUG_PLUGIN,
+ "<-- windows_plugin_init_start -- found windows plugin API registered for GUID [%s] -- end\n",
+ WINSYNC_v1_0_GUID);
+ }
}
initfunc = (winsync_plugin_init_cb)_WinSyncAPI[WINSYNC_PLUGIN_INIT_CB];
@@ -1057,10 +1081,7 @@ winsync_plugin_call_dirsync_search_params_cb(const Repl_Agmt *ra, const char *ag
char **base, int *scope, char **filter,
char ***attrs, LDAPControl ***serverctrls)
{
- winsync_search_params_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_DIRSYNC_SEARCH_CB]) ?
- (winsync_search_params_cb)_WinSyncAPI[WINSYNC_PLUGIN_DIRSYNC_SEARCH_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_DIRSYNC_SEARCH_CB,winsync_search_params_cb,thefunc);
if (!thefunc) {
return;
@@ -1077,10 +1098,7 @@ winsync_plugin_call_pre_ad_search_cb(const Repl_Agmt *ra, const char *agmt_dn,
char **base, int *scope, char **filter,
char ***attrs, LDAPControl ***serverctrls)
{
- winsync_search_params_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_SEARCH_CB]) ?
- (winsync_search_params_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_SEARCH_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_AD_SEARCH_CB,winsync_search_params_cb,thefunc);
if (!thefunc) {
return;
@@ -1097,10 +1115,7 @@ winsync_plugin_call_pre_ds_search_entry_cb(const Repl_Agmt *ra, const char *agmt
char **base, int *scope, char **filter,
char ***attrs, LDAPControl ***serverctrls)
{
- winsync_search_params_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_SEARCH_ENTRY_CB]) ?
- (winsync_search_params_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_SEARCH_ENTRY_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_DS_SEARCH_ENTRY_CB,winsync_search_params_cb,thefunc);
if (!thefunc) {
return;
@@ -1117,10 +1132,7 @@ winsync_plugin_call_pre_ds_search_all_cb(const Repl_Agmt *ra, const char *agmt_d
char **base, int *scope, char **filter,
char ***attrs, LDAPControl ***serverctrls)
{
- winsync_search_params_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_SEARCH_ALL_CB]) ?
- (winsync_search_params_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_SEARCH_ALL_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_DS_SEARCH_ALL_CB,winsync_search_params_cb,thefunc);
if (!thefunc) {
return;
@@ -1137,10 +1149,7 @@ winsync_plugin_call_pre_ad_mod_user_cb(const Repl_Agmt *ra, const Slapi_Entry *r
Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
Slapi_Mods *smods, int *do_modify)
{
- winsync_pre_mod_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_USER_CB]) ?
- (winsync_pre_mod_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_USER_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_AD_MOD_USER_CB,winsync_pre_mod_cb,thefunc);
if (!thefunc) {
return;
@@ -1157,10 +1166,7 @@ winsync_plugin_call_pre_ad_mod_group_cb(const Repl_Agmt *ra, const Slapi_Entry *
Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
Slapi_Mods *smods, int *do_modify)
{
- winsync_pre_mod_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_GROUP_CB]) ?
- (winsync_pre_mod_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_GROUP_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_AD_MOD_GROUP_CB,winsync_pre_mod_cb,thefunc);
if (!thefunc) {
return;
@@ -1177,10 +1183,7 @@ winsync_plugin_call_pre_ds_mod_user_cb(const Repl_Agmt *ra, const Slapi_Entry *r
Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
Slapi_Mods *smods, int *do_modify)
{
- winsync_pre_mod_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_MOD_USER_CB]) ?
- (winsync_pre_mod_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_MOD_USER_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_DS_MOD_USER_CB,winsync_pre_mod_cb,thefunc);
if (!thefunc) {
return;
@@ -1197,10 +1200,7 @@ winsync_plugin_call_pre_ds_mod_group_cb(const Repl_Agmt *ra, const Slapi_Entry *
Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
Slapi_Mods *smods, int *do_modify)
{
- winsync_pre_mod_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_MOD_GROUP_CB]) ?
- (winsync_pre_mod_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_MOD_GROUP_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_DS_MOD_GROUP_CB,winsync_pre_mod_cb,thefunc);
if (!thefunc) {
return;
@@ -1216,10 +1216,7 @@ void
winsync_plugin_call_pre_ds_add_user_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
Slapi_Entry *ad_entry, Slapi_Entry *ds_entry)
{
- winsync_pre_add_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_ADD_USER_CB]) ?
- (winsync_pre_add_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_ADD_USER_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_DS_ADD_USER_CB,winsync_pre_add_cb,thefunc);
if (!thefunc) {
return;
@@ -1235,10 +1232,7 @@ void
winsync_plugin_call_pre_ds_add_group_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
Slapi_Entry *ad_entry, Slapi_Entry *ds_entry)
{
- winsync_pre_add_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_ADD_GROUP_CB]) ?
- (winsync_pre_add_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_DS_ADD_GROUP_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_DS_ADD_GROUP_CB,winsync_pre_add_cb,thefunc);
if (!thefunc) {
return;
@@ -1255,10 +1249,7 @@ winsync_plugin_call_get_new_ds_user_dn_cb(const Repl_Agmt *ra, const Slapi_Entry
Slapi_Entry *ad_entry, char **new_dn_string,
const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix)
{
- winsync_get_new_dn_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_GET_NEW_DS_USER_DN_CB]) ?
- (winsync_get_new_dn_cb)_WinSyncAPI[WINSYNC_PLUGIN_GET_NEW_DS_USER_DN_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_GET_NEW_DS_USER_DN_CB,winsync_get_new_dn_cb,thefunc);
if (!thefunc) {
return;
@@ -1275,10 +1266,7 @@ winsync_plugin_call_get_new_ds_group_dn_cb(const Repl_Agmt *ra, const Slapi_Entr
Slapi_Entry *ad_entry, char **new_dn_string,
const Slapi_DN *ds_suffix, const Slapi_DN *ad_suffix)
{
- winsync_get_new_dn_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_GET_NEW_DS_GROUP_DN_CB]) ?
- (winsync_get_new_dn_cb)_WinSyncAPI[WINSYNC_PLUGIN_GET_NEW_DS_GROUP_DN_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_GET_NEW_DS_GROUP_DN_CB,winsync_get_new_dn_cb,thefunc);
if (!thefunc) {
return;
@@ -1297,10 +1285,7 @@ winsync_plugin_call_pre_ad_mod_user_mods_cb(const Repl_Agmt *ra, const Slapi_Ent
LDAPMod * const *origmods,
Slapi_DN *remote_dn, LDAPMod ***modstosend)
{
- winsync_pre_ad_mod_mods_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_USER_MODS_CB]) ?
- (winsync_pre_ad_mod_mods_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_USER_MODS_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_AD_MOD_USER_MODS_CB,winsync_pre_ad_mod_mods_cb,thefunc);
if (!thefunc) {
return;
@@ -1319,10 +1304,7 @@ winsync_plugin_call_pre_ad_mod_group_mods_cb(const Repl_Agmt *ra, const Slapi_En
LDAPMod * const *origmods,
Slapi_DN *remote_dn, LDAPMod ***modstosend)
{
- winsync_pre_ad_mod_mods_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_GROUP_MODS_CB]) ?
- (winsync_pre_ad_mod_mods_cb)_WinSyncAPI[WINSYNC_PLUGIN_PRE_AD_MOD_GROUP_MODS_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_AD_MOD_GROUP_MODS_CB,winsync_pre_ad_mod_mods_cb,thefunc);
if (!thefunc) {
return;
@@ -1338,10 +1320,7 @@ int
winsync_plugin_call_can_add_entry_to_ad_cb(const Repl_Agmt *ra, const Slapi_Entry *local_entry,
const Slapi_DN *remote_dn)
{
- winsync_can_add_to_ad_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_CAN_ADD_ENTRY_TO_AD_CB]) ?
- (winsync_can_add_to_ad_cb)_WinSyncAPI[WINSYNC_PLUGIN_CAN_ADD_ENTRY_TO_AD_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_CAN_ADD_ENTRY_TO_AD_CB,winsync_can_add_to_ad_cb,thefunc);
if (!thefunc) {
return 1; /* default is entry can be added to AD */
@@ -1354,10 +1333,7 @@ void
winsync_plugin_call_begin_update_cb(const Repl_Agmt *ra, const Slapi_DN *ds_subtree,
const Slapi_DN *ad_subtree, int is_total)
{
- winsync_plugin_update_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_BEGIN_UPDATE_CB]) ?
- (winsync_plugin_update_cb)_WinSyncAPI[WINSYNC_PLUGIN_BEGIN_UPDATE_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_BEGIN_UPDATE_CB,winsync_plugin_update_cb,thefunc);
if (!thefunc) {
return;
@@ -1372,10 +1348,7 @@ void
winsync_plugin_call_end_update_cb(const Repl_Agmt *ra, const Slapi_DN *ds_subtree,
const Slapi_DN *ad_subtree, int is_total)
{
- winsync_plugin_update_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_END_UPDATE_CB]) ?
- (winsync_plugin_update_cb)_WinSyncAPI[WINSYNC_PLUGIN_END_UPDATE_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_END_UPDATE_CB,winsync_plugin_update_cb,thefunc);
if (!thefunc) {
return;
@@ -1391,10 +1364,7 @@ winsync_plugin_call_destroy_agmt_cb(const Repl_Agmt *ra,
const Slapi_DN *ds_subtree,
const Slapi_DN *ad_subtree)
{
- winsync_plugin_destroy_agmt_cb thefunc =
- (_WinSyncAPI && _WinSyncAPI[WINSYNC_PLUGIN_DESTROY_AGMT_CB]) ?
- (winsync_plugin_destroy_agmt_cb)_WinSyncAPI[WINSYNC_PLUGIN_DESTROY_AGMT_CB] :
- NULL;
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_DESTROY_AGMT_CB,winsync_plugin_destroy_agmt_cb,thefunc);
if (thefunc) {
(*thefunc)(windows_private_get_api_cookie(ra), ds_subtree, ad_subtree);
@@ -1403,6 +1373,204 @@ winsync_plugin_call_destroy_agmt_cb(const Repl_Agmt *ra,
return;
}
+void
+winsync_plugin_call_post_ad_mod_user_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
+ Slapi_Mods *smods, int *result)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_POST_AD_MOD_USER_CB,winsync_post_mod_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), rawentry, ad_entry,
+ ds_entry, smods, result);
+
+ return;
+}
+
+void
+winsync_plugin_call_post_ad_mod_group_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
+ Slapi_Mods *smods, int *result)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_POST_AD_MOD_GROUP_CB,winsync_post_mod_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), rawentry, ad_entry,
+ ds_entry, smods, result);
+
+ return;
+}
+
+void
+winsync_plugin_call_post_ds_mod_user_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
+ Slapi_Mods *smods, int *result)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_POST_DS_MOD_USER_CB,winsync_post_mod_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), rawentry, ad_entry,
+ ds_entry, smods, result);
+
+ return;
+}
+
+void
+winsync_plugin_call_post_ds_mod_group_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
+ Slapi_Mods *smods, int *result)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_POST_DS_MOD_GROUP_CB,winsync_post_mod_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), rawentry, ad_entry,
+ ds_entry, smods, result);
+
+ return;
+}
+
+void
+winsync_plugin_call_post_ds_add_user_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_POST_DS_ADD_USER_CB,winsync_post_add_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), rawentry, ad_entry,
+ ds_entry, result);
+
+ return;
+}
+
+void
+winsync_plugin_call_post_ds_add_group_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_POST_DS_ADD_GROUP_CB,winsync_post_add_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), rawentry, ad_entry,
+ ds_entry, result);
+
+ return;
+}
+
+void
+winsync_plugin_call_pre_ad_add_user_cb(const Repl_Agmt *ra, Slapi_Entry *ad_entry,
+ Slapi_Entry *ds_entry)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_AD_ADD_USER_CB,winsync_pre_ad_add_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), ad_entry, ds_entry);
+
+ return;
+}
+
+void
+winsync_plugin_call_pre_ad_add_group_cb(const Repl_Agmt *ra, Slapi_Entry *ad_entry,
+ Slapi_Entry *ds_entry)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_PRE_AD_ADD_GROUP_CB,winsync_pre_ad_add_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), ad_entry, ds_entry);
+
+ return;
+}
+
+void
+winsync_plugin_call_post_ad_add_user_cb(const Repl_Agmt *ra, Slapi_Entry *ad_entry,
+ Slapi_Entry *ds_entry, int *result)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_POST_AD_ADD_USER_CB,winsync_post_ad_add_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), ad_entry, ds_entry, result);
+
+ return;
+}
+
+void
+winsync_plugin_call_post_ad_add_group_cb(const Repl_Agmt *ra, Slapi_Entry *ad_entry,
+ Slapi_Entry *ds_entry, int *result)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_POST_AD_ADD_GROUP_CB,winsync_post_ad_add_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), ad_entry, ds_entry, result);
+
+ return;
+}
+
+void
+winsync_plugin_call_post_ad_mod_user_mods_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ const Slapi_DN *local_dn,
+ const Slapi_Entry *ds_entry,
+ LDAPMod * const *origmods,
+ Slapi_DN *remote_dn, LDAPMod **modstosend, int *result)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_POST_AD_MOD_USER_MODS_CB,winsync_post_ad_mod_mods_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), rawentry, local_dn,
+ ds_entry, origmods, remote_dn, modstosend, result);
+
+ return;
+}
+
+void
+winsync_plugin_call_post_ad_mod_group_mods_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ const Slapi_DN *local_dn,
+ const Slapi_Entry *ds_entry,
+ LDAPMod * const *origmods,
+ Slapi_DN *remote_dn, LDAPMod **modstosend, int *result)
+{
+ DECL_WINSYNC_API_FUNC(WINSYNC_PLUGIN_POST_AD_MOD_GROUP_MODS_CB,winsync_post_ad_mod_mods_cb,thefunc);
+
+ if (!thefunc) {
+ return;
+ }
+
+ (*thefunc)(windows_private_get_api_cookie(ra), rawentry, local_dn,
+ ds_entry, origmods, remote_dn, modstosend, result);
+
+ return;
+}
+
/* #define WINSYNC_TEST_IPA */
#ifdef WINSYNC_TEST_IPA
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index a1b012c..d42cd96 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -80,7 +80,7 @@ static const char* op2string (int op);
static int is_subject_of_agreement_remote(Slapi_Entry *e, const Repl_Agmt *ra);
static int map_entry_dn_inbound(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra);
static int map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int use_guid, int user_username);
-static int windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,Slapi_Entry *local_entry);
+static int windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,Slapi_Entry *local_entry,int is_user);
static int is_guid_dn(Slapi_DN *remote_dn);
static int map_windows_tombstone_dn(Slapi_Entry *e, Slapi_DN **dn, Private_Repl_Protocol *prp, int *exists);
static int windows_check_mods_for_rdn_change(Private_Repl_Protocol *prp, LDAPMod **original_mods,
@@ -1184,6 +1184,13 @@ process_replay_add(Private_Repl_Protocol *prp, Slapi_Entry *add_entry, Slapi_Ent
/* Convert entry to mods */
if (0 == rc && mapped_entry)
{
+ if (is_user) {
+ winsync_plugin_call_pre_ad_add_user_cb(prp->agmt, mapped_entry, add_entry);
+ } else {
+ winsync_plugin_call_pre_ad_add_group_cb(prp->agmt, mapped_entry, add_entry);
+ }
+ /* plugin may reset DN */
+ slapi_sdn_copy(slapi_entry_get_sdn(mapped_entry), remote_dn);
(void)slapi_entry2mods (mapped_entry , NULL /* &entrydn : We don't need it */, &entryattrs);
slapi_entry_free(mapped_entry);
mapped_entry = NULL;
@@ -1196,9 +1203,29 @@ process_replay_add(Private_Repl_Protocol *prp, Slapi_Entry *add_entry, Slapi_Ent
}
else
{
+ int ldap_op = 0;
+ int ldap_result_code = 0;
windows_log_add_entry_remote(local_dn, remote_dn);
return_value = windows_conn_send_add(prp->conn, slapi_sdn_get_dn(remote_dn),
entryattrs, NULL, NULL);
+ 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_add_user_cb(prp->agmt, mapped_entry, add_entry, &ldap_result_code);
+ } else {
+ winsync_plugin_call_post_ad_add_group_cb(prp->agmt, mapped_entry, add_entry, &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);
+ }
/* It's possible that the entry already exists in AD, in which
* case we fall back to modify it */
/* NGK - This fallback doesn't seem to happen, at least not at this point
@@ -1229,7 +1256,7 @@ modify_fallback:
/* Fetch the remote entry */
rc = windows_get_remote_entry(prp, remote_dn,&remote_entry);
if (0 == rc && remote_entry) {
- return_value = windows_update_remote_entry(prp,remote_entry,local_entry);
+ return_value = windows_update_remote_entry(prp,remote_entry,local_entry,is_user);
}
if (remote_entry)
{
@@ -1546,6 +1573,8 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op
return_value = CONN_OPERATION_SUCCESS;
} else
{
+ int ldap_op = 0;
+ int ldap_result_code = 0;
if (slapi_is_loglevel_set(SLAPI_LOG_REPL))
{
int i = 0;
@@ -1556,6 +1585,32 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op
}
}
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)
{
@@ -3872,6 +3927,7 @@ windows_create_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
int rc = 0;
char *guid_str = NULL;
int is_nt4 = windows_private_get_isnt4(prp->agmt);
+ Slapi_Entry *post_entry = NULL;
char *local_user_entry_template =
"dn: %s\n"
@@ -3996,11 +4052,23 @@ windows_create_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
/* Store it */
windows_dump_entry("Adding new local entry",local_entry);
pb = slapi_pblock_new();
- slapi_add_entry_internal_set_pb(pb, local_entry, NULL,repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION),0);
+ slapi_add_entry_internal_set_pb(pb, local_entry, NULL,repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION),0);
+ post_entry = slapi_entry_dup(local_entry);
slapi_add_internal_pb(pb);
local_entry = NULL; /* consumed by add */
slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &retval);
+ if (is_user) {
+ winsync_plugin_call_post_ds_add_user_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ remote_entry, post_entry, &retval);
+ } else if (is_group) {
+ winsync_plugin_call_post_ds_add_group_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ remote_entry, post_entry, &retval);
+ }
+ slapi_entry_free(post_entry);
+
if (retval) {
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"add operation of entry %s returned: %d\n", slapi_sdn_get_dn(local_sdn), retval);
@@ -4429,11 +4497,13 @@ windows_generate_update_mods(Private_Repl_Protocol *prp,Slapi_Entry *remote_entr
}
static int
-windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,Slapi_Entry *local_entry)
+windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,Slapi_Entry *local_entry, int is_user)
{
Slapi_Mods smods = {0};
int retval = 0;
int do_modify = 0;
+ int ldap_op = 0;
+ int ldap_result_code = 0;
slapi_mods_init (&smods, 0);
retval = windows_generate_update_mods(prp,local_entry,remote_entry,1,&smods,&do_modify);
@@ -4446,6 +4516,33 @@ windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry
"windows_update_remote_entry: modifying entry %s\n", escape_string(dn, dnbuf));
retval = windows_conn_send_modify(prp->conn, slapi_sdn_get_dn(slapi_entry_get_sdn_const(remote_entry)),slapi_mods_get_ldapmods_byref(&smods), NULL,NULL);
+
+ windows_conn_get_error(prp->conn, &ldap_op, &ldap_result_code);
+ if ((retval != 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_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ remote_entry, /* the cooked ad entry */
+ local_entry, /* the ds entry */
+ &smods, &ldap_result_code);
+ } else {
+ winsync_plugin_call_post_ad_mod_group_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ remote_entry, /* the cooked ad entry */
+ local_entry, /* the ds entry */
+ &smods, &ldap_result_code);
+ }
+ /* see if plugin reset success/error condition */
+ if ((retval != CONN_OPERATION_SUCCESS) && !ldap_result_code) {
+ retval = CONN_OPERATION_SUCCESS;
+ windows_conn_set_error(prp->conn, ldap_result_code);
+ } else if ((retval == CONN_OPERATION_SUCCESS) && ldap_result_code) {
+ retval = CONN_OPERATION_FAILED;
+ windows_conn_set_error(prp->conn, ldap_result_code);
+ }
} else
{
char dnbuf[BUFSIZ];
@@ -4453,7 +4550,8 @@ windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"no mods generated for remote entry: %s\n", escape_string(dn, dnbuf));
}
- slapi_mods_done(&smods);
+
+ slapi_mods_done(&smods);
return retval;
}
@@ -4572,6 +4670,19 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
repl_get_plugin_identity (PLUGIN_MULTIMASTER_REPLICATION), 0);
slapi_modify_internal_pb (pb);
slapi_pblock_get (pb, SLAPI_PLUGIN_INTOP_RESULT, &rc);
+ if (is_user) {
+ winsync_plugin_call_post_ds_mod_user_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ remote_entry, /* the cooked ad entry */
+ local_entry, /* the ds entry */
+ &smods, &rc);
+ } else if (is_group) {
+ winsync_plugin_call_post_ds_mod_group_cb(prp->agmt,
+ windows_private_get_raw_entry(prp->agmt),
+ remote_entry, /* the cooked ad entry */
+ local_entry, /* the ds entry */
+ &smods, &rc);
+ }
if (rc)
{
slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name,
@@ -4624,11 +4735,17 @@ windows_process_total_add(Private_Repl_Protocol *prp,Slapi_Entry *e, Slapi_DN* r
}
}
/* Convert entry to mods */
+ windows_is_local_entry_user_or_group(e, &is_user, NULL);
if (0 == retval && mapped_entry)
{
+ if (is_user) {
+ winsync_plugin_call_pre_ad_add_user_cb(prp->agmt, mapped_entry, e);
+ } else {
+ winsync_plugin_call_pre_ad_add_group_cb(prp->agmt, mapped_entry, e);
+ }
+ /* plugin may reset DN */
+ slapi_sdn_copy(slapi_entry_get_sdn(mapped_entry), remote_dn);
(void)slapi_entry2mods (mapped_entry , NULL /* &entrydn : We don't need it */, &entryattrs);
- slapi_entry_free(mapped_entry);
- mapped_entry = NULL;
if (NULL == entryattrs)
{
slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name,"%s: windows_replay_update: Cannot convert entry to LDAPMods.\n",agmt_get_long_name(prp->agmt));
@@ -4636,8 +4753,28 @@ windows_process_total_add(Private_Repl_Protocol *prp,Slapi_Entry *e, Slapi_DN* r
}
else
{
+ int ldap_op = 0;
+ int ldap_result_code = 0;
windows_log_add_entry_remote(local_dn, remote_dn);
retval = windows_conn_send_add(prp->conn, slapi_sdn_get_dn(remote_dn), entryattrs, NULL, NULL /* returned controls */);
+ windows_conn_get_error(prp->conn, &ldap_op, &ldap_result_code);
+ if ((retval != 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_add_user_cb(prp->agmt, mapped_entry, e, &ldap_result_code);
+ } else {
+ winsync_plugin_call_post_ad_add_group_cb(prp->agmt, mapped_entry, e, &ldap_result_code);
+ }
+ /* see if plugin reset success/error condition */
+ if ((retval != CONN_OPERATION_SUCCESS) && !ldap_result_code) {
+ retval = CONN_OPERATION_SUCCESS;
+ windows_conn_set_error(prp->conn, ldap_result_code);
+ } else if ((retval == CONN_OPERATION_SUCCESS) && ldap_result_code) {
+ retval = CONN_OPERATION_FAILED;
+ windows_conn_set_error(prp->conn, ldap_result_code);
+ }
/* It's possible that the entry already exists in AD, in which case we fall back to modify it */
if (retval)
{
@@ -4646,7 +4783,6 @@ windows_process_total_add(Private_Repl_Protocol *prp,Slapi_Entry *e, Slapi_DN* r
ldap_mods_free(entryattrs, 1);
entryattrs = NULL;
- windows_is_local_entry_user_or_group(e, &is_user, NULL);
if ((retval == 0) && is_user) {
/* set the account control bits only for users */
retval = send_accountcontrol_modify(remote_dn, prp, missing_entry);
@@ -4660,7 +4796,7 @@ windows_process_total_add(Private_Repl_Protocol *prp,Slapi_Entry *e, Slapi_DN* r
retval = windows_get_remote_entry(prp, remote_dn,&remote_entry);
if (0 == retval && remote_entry)
{
- retval = windows_update_remote_entry(prp,remote_entry,e);
+ retval = windows_update_remote_entry(prp,remote_entry,e,is_user);
/* Detect the case where the error is benign */
if (retval)
{
@@ -4679,6 +4815,8 @@ windows_process_total_add(Private_Repl_Protocol *prp,Slapi_Entry *e, Slapi_DN* r
slapi_entry_free(remote_entry);
}
}
+ slapi_entry_free(mapped_entry);
+ mapped_entry = NULL;
slapi_ch_free_string(&password);
return retval;
}
diff --git a/ldap/servers/plugins/replication/windowsrepl.h b/ldap/servers/plugins/replication/windowsrepl.h
index 52b8dac..7da855c 100644
--- a/ldap/servers/plugins/replication/windowsrepl.h
+++ b/ldap/servers/plugins/replication/windowsrepl.h
@@ -179,6 +179,41 @@ void winsync_plugin_call_end_update_cb(const Repl_Agmt *ra, const Slapi_DN *ds_s
void winsync_plugin_call_destroy_agmt_cb(const Repl_Agmt *ra,
const Slapi_DN *ds_subtree,
const Slapi_DN *ad_subtree);
+void winsync_plugin_call_post_ad_mod_user_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
+ Slapi_Mods *smods, int *result);
+void winsync_plugin_call_post_ad_mod_group_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
+ Slapi_Mods *smods, int *result);
+void winsync_plugin_call_post_ds_mod_user_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
+ Slapi_Mods *smods, int *result);
+void winsync_plugin_call_post_ds_mod_group_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry,
+ Slapi_Mods *smods, int *result);
+void winsync_plugin_call_post_ds_add_user_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result);
+void winsync_plugin_call_post_ds_add_group_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result);
+void winsync_plugin_call_pre_ad_add_user_cb(const Repl_Agmt *ra, Slapi_Entry *ad_entry,
+ Slapi_Entry *ds_entry);
+void winsync_plugin_call_pre_ad_add_group_cb(const Repl_Agmt *ra, Slapi_Entry *ad_entry,
+ Slapi_Entry *ds_entry);
+void winsync_plugin_call_post_ad_add_user_cb(const Repl_Agmt *ra, Slapi_Entry *ad_entry,
+ Slapi_Entry *ds_entry, int *result);
+void winsync_plugin_call_post_ad_add_group_cb(const Repl_Agmt *ra, Slapi_Entry *ad_entry,
+ Slapi_Entry *ds_entry, int *result);
+void winsync_plugin_call_post_ad_mod_user_mods_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ const Slapi_DN *local_dn,
+ const Slapi_Entry *ds_entry,
+ LDAPMod * const *origmods,
+ Slapi_DN *remote_dn, LDAPMod **modstosend, int *result);
+void winsync_plugin_call_post_ad_mod_group_mods_cb(const Repl_Agmt *ra, const Slapi_Entry *rawentry,
+ const Slapi_DN *local_dn,
+ const Slapi_Entry *ds_entry,
+ LDAPMod * const *origmods,
+ Slapi_DN *remote_dn, LDAPMod **modstosend, int *result);
+
/*
Call stack for all places where windows_LDAPMessage2Entry is called:
diff --git a/ldap/servers/plugins/replication/winsync-plugin.h b/ldap/servers/plugins/replication/winsync-plugin.h
index e70c4a9..9ac5621 100644
--- a/ldap/servers/plugins/replication/winsync-plugin.h
+++ b/ldap/servers/plugins/replication/winsync-plugin.h
@@ -49,6 +49,7 @@
* WinSync plug-in API
*/
#define WINSYNC_v1_0_GUID "CDA8F029-A3C6-4EBB-80B8-A2E183DB0481"
+#define WINSYNC_v2_0_GUID "706B83AA-FC51-444A-ACC9-53DC73D641D4"
/*
* This callback is called when a winsync agreement is created.
@@ -60,6 +61,8 @@
*/
typedef void * (*winsync_plugin_init_cb)(const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree);
#define WINSYNC_PLUGIN_INIT_CB 1
+#define WINSYNC_PLUGIN_VERSION_1_BEGIN WINSYNC_PLUGIN_INIT_CB
+
/* agmt_dn - const - the original AD base dn from the winsync agreement
scope - set directly e.g. *scope = 42;
base, filter - malloced - to set, free first e.g.
@@ -184,12 +187,99 @@ typedef void (*winsync_plugin_update_cb)(void *cookie, const Slapi_DN *ds_subtre
*/
typedef void (*winsync_plugin_destroy_agmt_cb)(void *cookie, const Slapi_DN *ds_subtree, const Slapi_DN *ad_subtree);
#define WINSYNC_PLUGIN_DESTROY_AGMT_CB 19
+#define WINSYNC_PLUGIN_VERSION_1_END WINSYNC_PLUGIN_DESTROY_AGMT_CB
+
+/* Functions added for API version 2.0 */
+/*
+ * These callbacks are called after a modify operation. They are called upon both
+ * success and failure of the modify operation. The plugin is responsible for
+ * looking at the result code of the modify to decide what action to take. The
+ * plugin may change the result code e.g. to force an error for an otherwise
+ * successful operation, or to ignore certain errors.
+ * rawentry - the raw AD entry, read directly from AD - this is read only
+ * ad_entry - the "cooked" AD entry - the entry passed to the pre_mod callback
+ * ds_entry - the entry from the ds - the DS entry passed to the pre_mod callback
+ * smods - the mods used in the modify operation
+ * result - the result code from the modify operation - the plugin can change this
+ */
+typedef void (*winsync_post_mod_cb)(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result);
+#define WINSYNC_PLUGIN_POST_AD_MOD_USER_CB 20
+#define WINSYNC_PLUGIN_POST_AD_MOD_GROUP_CB 21
+#define WINSYNC_PLUGIN_POST_DS_MOD_USER_CB 22
+#define WINSYNC_PLUGIN_POST_DS_MOD_GROUP_CB 23
+
+#define WINSYNC_PLUGIN_VERSION_2_BEGIN WINSYNC_PLUGIN_POST_AD_MOD_USER_CB
+/*
+ * These callbacks are called after an attempt to add a new entry to the
+ * local directory server from AD. They are called upon success or failure
+ * of the add attempt. The result code tells if the operation succeeded.
+ * The plugin may change the result code e.g. to force an error for an
+ * otherwise successful operation, or to ignore certain errors.
+ * rawentry - the raw AD entry, read directly from AD - this is read only
+ * ad_entry - the "cooked" AD entry
+ * ds_entry - the entry attempted to be added to the DS
+ * result - the result code from the add operation - plugin may change this
+ */
+typedef void (*winsync_post_add_cb)(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result);
+#define WINSYNC_PLUGIN_POST_DS_ADD_USER_CB 24
+#define WINSYNC_PLUGIN_POST_DS_ADD_GROUP_CB 25
/*
+ * These callbacks are called when a new entry is being added to AD from
+ * the local directory server.
+ * ds_entry - the local DS entry
+ * ad_entry - the entry to be added to AD - all modifications should
+ * be made to this entry, including changing the DN if needed,
+ * since the DN of this entry will be used as the ADD target DN
+ * This entry will already have had the default schema mapping applied
+*/
+typedef void (*winsync_pre_ad_add_cb)(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry);
+#define WINSYNC_PLUGIN_PRE_AD_ADD_USER_CB 26
+#define WINSYNC_PLUGIN_PRE_AD_ADD_GROUP_CB 27
+
+/*
+ * These callbacks are called after an attempt to add a new entry to AD from
+ * the local directory server. They are called upon success or failure
+ * of the add attempt. The result code tells if the operation succeeded.
+ * The plugin may change the result code e.g. to force an error for an
+ * otherwise successful operation, or to ignore certain errors.
+ * ad_entry - the AD entry
+ * ds_entry - the DS entry
+ * result - the result code from the add operation - plugin may change this
+ */
+typedef void (*winsync_post_ad_add_cb)(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result);
+#define WINSYNC_PLUGIN_POST_AD_ADD_USER_CB 28
+#define WINSYNC_PLUGIN_POST_AD_ADD_GROUP_CB 29
+
+/*
+ * These callbacks are called after a mod operation has been replayed
+ * to AD. This case is different than the pre add or pre mod callbacks
+ * above because in this context, we may only have the list of modifications
+ * and the DN to which the mods were applied. If the plugin wants the modified
+ * entry, the plugin can search for it from AD. The plugin is called upon
+ * success or failure of the modify operation. The result parameter gives
+ * the ldap result code of the operation. The plugin may change the result code
+ * e.g. to force an error for an otherwise successful operation, or to ignore
+ * certain errors.
+ * rawentry - the raw AD entry, read directly from AD - may be NULL
+ * local_dn - the original local DN used in the modification
+ * ds_entry - the current DS entry that has the operation nsUniqueID
+ * origmods - the original mod list
+ * remote_dn - the DN of the AD entry
+ * modstosend - the mods sent to AD
+ * result - the result code of the modify operation
+ *
+ */
+typedef void (*winsync_post_ad_mod_mods_cb)(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod **modstosend, int *result);
+#define WINSYNC_PLUGIN_POST_AD_MOD_USER_MODS_CB 30
+#define WINSYNC_PLUGIN_POST_AD_MOD_GROUP_MODS_CB 31
+#define WINSYNC_PLUGIN_VERSION_2_END WINSYNC_PLUGIN_POST_AD_MOD_GROUP_MODS_CB
+/*
The following are sample code stubs to show how to implement
a plugin which uses this api
*/
+/* #define WINSYNC_SAMPLE_CODE */
#ifdef WINSYNC_SAMPLE_CODE
#include "slapi-plugin.h"
@@ -373,13 +463,13 @@ test_winsync_get_new_ds_user_dn_cb(void *cbdata, const Slapi_Entry *rawentry,
rdns = slapi_ldap_explode_dn(*new_dn_string, 0);
if (!rdns || !rdns[0]) {
- ldap_value_free(rdns);
+ slapi_ldap_value_free(rdns);
return;
}
slapi_ch_free_string(new_dn_string);
*new_dn_string = PR_smprintf("%s,%s", rdns[0], slapi_sdn_get_dn(ds_suffix));
- ldap_value_free(rdns);
+ slapi_ldap_value_free(rdns);
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
"<-- test_winsync_get_new_ds_user_dn_cb -- new dn [%s] -- end\n",
@@ -442,7 +532,8 @@ test_winsync_can_add_entry_to_ad_cb(void *cbdata, const Slapi_Entry *local_entry
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
"<-- test_winsync_can_add_entry_to_ad_cb -- end\n");
- return 0; /* false - do not allow entries to be added to ad */
+ /* return 0;*/ /* false - do not allow entries to be added to ad */
+ return 1; /* true - allow entries to be added to ad */
}
static void
@@ -486,6 +577,200 @@ test_winsync_destroy_agmt_cb(void *cbdata, const Slapi_DN *ds_subtree,
return;
}
+static void
+test_winsync_post_ad_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_post_ad_mod_user_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Result of modifying AD entry [%s] was [%d:%s]\n",
+ slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result));
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_post_ad_mod_user_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_post_ad_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_post_ad_mod_group_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Result of modifying AD entry [%s] was [%d:%s]\n",
+ slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result));
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_post_ad_mod_group_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_post_ds_mod_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_post_ds_mod_user_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Result of modifying DS entry [%s] was [%d:%s]\n",
+ slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result));
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_post_ds_mod_user_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_post_ds_mod_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, Slapi_Mods *smods, int *result)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_post_ds_mod_group_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Result of modifying DS entry [%s] was [%d:%s]\n",
+ slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result));
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_post_ds_mod_group_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_post_ds_add_user_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_post_ds_add_user_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Result of adding DS entry [%s] was [%d:%s]\n",
+ slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result));
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_post_ds_add_user_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_post_ds_add_group_cb(void *cookie, const Slapi_Entry *rawentry, Slapi_Entry *ad_entry, Slapi_Entry *ds_entry, int *result)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_post_ds_add_group_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Result of adding DS entry [%s] was [%d:%s]\n",
+ slapi_entry_get_dn(ds_entry), *result, ldap_err2string(*result));
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_post_ds_add_group_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_pre_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_pre_ad_add_user_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Adding AD entry [%s] from add of DS entry [%s]\n",
+ slapi_entry_get_dn(ad_entry), slapi_entry_get_dn(ds_entry));
+ /* make modifications to ad_entry here */
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_pre_ad_add_user_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_pre_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_pre_ad_add_group_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Adding AD entry [%s] from add of DS entry [%s]\n",
+ slapi_entry_get_dn(ad_entry), slapi_entry_get_dn(ds_entry));
+ /* make modifications to ad_entry here */
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_pre_ad_add_group_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_post_ad_add_user_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_post_ad_add_user_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Result of adding AD entry [%s] was [%d:%s]\n",
+ slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result));
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_post_ad_add_user_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_post_ad_add_group_cb(void *cookie, Slapi_Entry *ds_entry, Slapi_Entry *ad_entry, int *result)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_post_ad_add_group_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Result of adding AD entry [%s] was [%d:%s]\n",
+ slapi_entry_get_dn(ad_entry), *result, ldap_err2string(*result));
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_post_ad_add_group_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_post_ad_mod_user_mods_cb(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend, int *result)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_post_ad_mod_user_mods_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Result of modifying AD entry [%s] was [%d:%s]\n",
+ slapi_sdn_get_dn(remote_dn), *result, ldap_err2string(*result));
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_post_ad_mod_user_mods_cb -- end\n");
+
+ return;
+}
+
+static void
+test_winsync_post_ad_mod_group_mods_cb(void *cookie, const Slapi_Entry *rawentry, const Slapi_DN *local_dn, const Slapi_Entry *ds_entry, LDAPMod * const *origmods, Slapi_DN *remote_dn, LDAPMod ***modstosend, int *result)
+{
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "--> test_winsync_post_ad_mod_group_mods_cb -- begin\n");
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "Result of modifying AD entry [%s] was [%d:%s]\n",
+ slapi_sdn_get_dn(remote_dn), *result, ldap_err2string(*result));
+
+ slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
+ "<-- test_winsync_post_ad_mod_group_mods_cb -- end\n");
+
+ return;
+}
+
/**
* Plugin identifiers
*/
@@ -498,7 +783,8 @@ static Slapi_PluginDesc test_winsync_pdesc = {
static Slapi_ComponentId *test_winsync_plugin_id = NULL;
-static void *test_winsync_api[] = {
+#ifdef TEST_V1_WINSYNC_API
+static void *test_winsync_api_v1[] = {
NULL, /* reserved for api broker use, must be zero */
test_winsync_api_init,
test_winsync_dirsync_search_params_cb,
@@ -520,6 +806,42 @@ static void *test_winsync_api[] = {
test_winsync_end_update_cb,
test_winsync_destroy_agmt_cb
};
+#endif /* TEST_V1_WINSYNC_API */
+
+static void *test_winsync_api_v2[] = {
+ NULL, /* reserved for api broker use, must be zero */
+ test_winsync_api_init,
+ test_winsync_dirsync_search_params_cb,
+ test_winsync_pre_ad_search_cb,
+ test_winsync_pre_ds_search_entry_cb,
+ test_winsync_pre_ds_search_all_cb,
+ test_winsync_pre_ad_mod_user_cb,
+ test_winsync_pre_ad_mod_group_cb,
+ test_winsync_pre_ds_mod_user_cb,
+ test_winsync_pre_ds_mod_group_cb,
+ test_winsync_pre_ds_add_user_cb,
+ test_winsync_pre_ds_add_group_cb,
+ test_winsync_get_new_ds_user_dn_cb,
+ test_winsync_get_new_ds_group_dn_cb,
+ test_winsync_pre_ad_mod_user_mods_cb,
+ test_winsync_pre_ad_mod_group_mods_cb,
+ test_winsync_can_add_entry_to_ad_cb,
+ test_winsync_begin_update_cb,
+ test_winsync_end_update_cb,
+ test_winsync_destroy_agmt_cb,
+ test_winsync_post_ad_mod_user_cb,
+ test_winsync_post_ad_mod_group_cb,
+ test_winsync_post_ds_mod_user_cb,
+ test_winsync_post_ds_mod_group_cb,
+ test_winsync_post_ds_add_user_cb,
+ test_winsync_post_ds_add_group_cb,
+ test_winsync_pre_ad_add_user_cb,
+ test_winsync_pre_ad_add_group_cb,
+ test_winsync_post_ad_add_user_cb,
+ test_winsync_post_ad_add_group_cb,
+ test_winsync_post_ad_mod_user_mods_cb,
+ test_winsync_post_ad_mod_group_mods_cb
+};
static int
test_winsync_plugin_start(Slapi_PBlock *pb)
@@ -527,7 +849,7 @@ test_winsync_plugin_start(Slapi_PBlock *pb)
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
"--> test_winsync_plugin_start -- begin\n");
- if( slapi_apib_register(WINSYNC_v1_0_GUID, test_winsync_api) ) {
+ if( slapi_apib_register(WINSYNC_v2_0_GUID, test_winsync_api_v2) ) {
slapi_log_error( SLAPI_LOG_FATAL, test_winsync_plugin_name,
"<-- test_winsync_plugin_start -- failed to register winsync api -- end\n");
return -1;
@@ -544,7 +866,7 @@ test_winsync_plugin_close(Slapi_PBlock *pb)
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
"--> test_winsync_plugin_close -- begin\n");
- slapi_apib_unregister(WINSYNC_v1_0_GUID);
+ slapi_apib_unregister(WINSYNC_v2_0_GUID);
slapi_log_error(SLAPI_LOG_PLUGIN, test_winsync_plugin_name,
"<-- test_winsync_plugin_close -- end\n");
commit a02bbf034d0a4d248025fa8b44e9e97f1f8cc422
Author: Noriko Hosoi <nhosoi(a)totoro.sjc.redhat.com>
Date: Fri Mar 23 17:27:44 2012 -0700
Trac Ticket #46 (revised) - setup-ds-admin.pl does not like ipv6 only hostnames
https://fedorahosted.org/389/ticket/46
Fix Description:
Socket::GetAddrInfo class is not available on all the supported
platforms. Instead, this patch uses Socket6, which has better
supports.
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index 2f3306b..9e4b322 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -59,7 +59,7 @@ require Exporter;
use strict;
use Socket;
-use Socket::GetAddrInfo qw( :newapi getaddrinfo getnameinfo AI_CANONNAME );
+use Socket6 qw( getaddrinfo getnameinfo unpack_sockaddr_in6 );
use NetAddr::IP::Util qw( ipv6_n2x );
use File::Temp qw(tempfile tempdir);
@@ -210,27 +210,29 @@ sub checkHostname {
}
# see if we can resolve the hostname (IPv6 supported)
- my %hints = ( flags => AI_CANONNAME, socktype => SOCK_STREAM );
- my ( $err, @aires ) = getaddrinfo( $hn, "ldap", \%hints );
- if ($err) {
+ my @aires = getaddrinfo( $hn, "ldap", AF_UNSPEC, SOCK_STREAM );
+ if (scalar(@aires) < 5) {
return $res->getText('warning_no_such_hostname', $hn);
}
my $found = 0;
my @hostip = ();
- while ( my $ai = shift @aires ) {
- debug(1, "found for hostname $hn: name=$ai->{canonname}\n");
+ my $ailen = scalar(@aires);
+ while ( $ailen >= 5 ) {
+ debug(1, "found for hostname $hn\n");
+ my ($family, $socktype, $proto, $saddr, $canonname, @aires) = @aires;
+ $ailen = scalar(@aires);
my $ip;
- if ($ai->{family} == AF_INET) {
- my ( $port, $ipaddr ) = unpack_sockaddr_in( $ai->{addr} );
+ if ($family == AF_INET) {
+ my ( $port, $ipaddr ) = unpack_sockaddr_in( $saddr );
$ip = inet_ntoa($ipaddr);
} else {
- my ( $port, $ipaddr ) = unpack_sockaddr_in6( $ai->{addr} );
+ my ( $port, $ipaddr ) = unpack_sockaddr_in6( $saddr );
$ip = ipv6_n2x($ipaddr);
}
debug(1, "ipaddr=", $ip, "\n");
# see if reverse resolution works
- my ( $err, $hn2, $service ) = getnameinfo( $ai->{addr} );
- if (!$err) {
+ my ( $hn2, $service ) = getnameinfo( $saddr );
+ if (!$hn2) {
push @hostip, [$hn2, $ip];
if (lc($hn) eq lc($hn2)) {
$found = 1;
11 years, 6 months
Changes to 'refs/tags/389-admin-1.1.29'
by Richard Allen Megginson
Changes since 389-admin-1.1.11:
Endi S. Dewata (3):
Bug 573889 - Migration does not remove deprecated schema
Bug 644929 - FDS to 389 DS migration results in both Fedora and 389 entries
Bug 470576 - Migration could do addition checks before commiting actions
Mark Reynolds (1):
Ticket #286 - compilation fixes for 'format-security'
Nathan Kinder (42):
Bug 648949 - Merge selinux policy into base OS
Regenerated autoconf files
Bug 638511 - dirsrv-admin crashes at startup with SELinux enabled
Bug 668950 - Add posix group support to Console
Bug 672468 - Don't use empty path elements in LD_LIBRARY_PATH
Bug 618897 - Wrong permissions when creating instance from Console
Bug 493424 - remove unneeded modules for admin server apache config
Bug 614690 - Don't use exec to call genrb
Bug 699815 - (cov#10859) Add missing braces in mod_admserv code
Bug 699815 - (cov#10858) getenv() called twice in viewlog cgi
Bug 699815 - (cov#10849,10851) Remove unused variables
Bug 699907 - (cov#10844) Uninitialized time struct
Bug 699907 - (cov#10843) Use of uninitialized variable in logging code
Bug 699907 - (cov#10840) Use of uninitialized buffer in security cgi
Bug 699907 - (cov#10836) Use of uninitialized var in http conn code
Bug 699907 - (cov#10833) Use of uninitialized vars in SNMP code
Bug 700532 - (cov#10832) Incorrect if condition in dsalib
Bug 700875 - (cov#10778) Cleanup ds_bring_up_server_install() in dsalib
Bug 700890 - (cov#10812) Check return value of open() properly in libadmin
Bug 700948 - (cov#10846) - Use of uninitialized variable in mod_admserv
Bug 700948 - (cov#10845) Use of uninitialized variable in mod_admserv
Bug 700948 - (cov#10839) Use of uninitialized variable in security cgi
Bug 700948 - (cov#10837) Use of uninitialized variable in monreplication
Bug 700948 - (cov#10835) Use of unitialized pointer in config cgi
Bug 700948 - (cov#10813) dynamic overrun possibility in ds_listdb cgi
Bug 700948 - (cov#10842) Use of unintialized variable in statusping
Bug 700948 - (cov#10842) Use of unintialized variable in statusping
Bug 702150 - (cov#10823) File descriptors leaked in help cgi
Bug 702150 - (cov#10822,10821) file descriptor leaks in config cgi
Bug 702150 - (cov#10820,10819) file descriptor leaks in readlog cgi
Bug 702150 - leak of config array in dsalib
Bug 702150 - (cov#10816) file descriptor leak in dsalib
Bug 702150 - (cov#10817) Leak of string in libdsa
Bug 702150 - Resouce leaks in htmladmin.c
Bug 702705 - (cov#10830) NULL pointer dereference in htmladmin
Bug 702705 - NULL pointer dereferences in viewlog cgi
Bug 702705 - (cov#10803) NULL pointer dereference in security cgi
Bug 702705 - (cov#10785) NULL pointer dereference in ds_snmpctrl
Bug 702705 - (cov#10784,10783) NULL pointer dereferences in dsalib
Bug 719056 - migrate-ds-admin.pl needs to update SELinux policy
Bug 724808 - startup CGIs write temp file to /
Bug 730079 - Update SELinux policy during upgrades
Noriko Hosoi (14):
Bug 151705 - Need to update Console Cipher Preferences with new ciphers
start-ds-admin.in -- replaced "return 1" with "exit 1"
Bug 616260 - libds-admin-serv linking fails due to unresolved link-time dependencies
Bug 618858 - move start-ds-admin env file into main admin server
Bug 387981 - plain files can be chosen on the Restore Directory dialog
Bug 604881 - admin server log files have incorrect permissions/ownerships
Bug 604881 - admin server log files have incorrect permissions/ownerships
Bug 245278 - Changing to a password with a single quote does not work
Bug 211296 - Clean up all HTML pages (Admin Express, Repl Monitor, etc)
Bug 158926 - Unable to install CA certificate when using
Bug 476925 - Admin Server: Do not allow 8-bit passwords for the admin user
Bug 476925 - Admin Server: Do not allow 8-bit passwords for
Trac Ticket #307 - htmladmin keeps segfaulting
If htmladmin fails to connect to the server, the cgi could crash.
Rich Megginson (51):
bump version to 1.1.12.a1
initial support for openldap
add selinux policy for dsgw
skip LD_PRELOAD if using openldap
add more log information if nss init fails
add even more nss debugging
Bug 618454 - mod_admserv should only clear NSS caches and shutdown if NSS is initialized
bump version to 1.1.12.a2
fix building with mozldap
bump version to 1.1.12.a3
fix autotool build issues with properties files
setup-ds-admin.pl -u exits with ServerAdminID and as_uid related error
Bug 656441 - Missing library path entry causes LD_PRELOAD error
bump version to 1.1.13
bump version to 1.1.14.a1
Bug 664671 - Admin server segfault when full SSL access (http+ldap+console) required
bump version to 1.1.14
bump version to 1.1.15
bump version to 1.1.16
Bug 703990 - Support upgrade from Red Hat Directory Server
bump version to 1.1.17
add support for different skins
skip rebranding current brand
bump version to 1.1.18
look for separate openldap ldif library
bump version to 1.1.19
Bug 710372 - Not able to open the Manage Certificate from DS-console
better NSS error handling - reduce memory leaks
fix typo in NSS_Shutdown warning message
added tests for the security cgi
Bug 713000 - Migration stops if old admin server cannot be stopped
Bug 718079 - Perl errors when running migrate-ds-admin.pl
Bug 718285 - AdminServer should use "service" command instead of start/stop/restart scripts
bump version to 1.1.20
bump version to 1.1.21
handle binary upgrade
add man pages for ds_removal and ds_unregister
bump version to 1.1.22
fix binary paths
bump version to 1.1.23
bump version to 1.1.24
Bug 695741 - Providing native systemd file for upcoming F16 Feature Systemd
Bug 740959 - 389-console put CA certificates into wrong database
bump version to 1.1.25
Bug 767823 - selinux: need to allow admin server to connect to ldap port
bump version to 1.1.26
Ticket #161 - Review and address latest Coverity issues
Ticket #281 - TLS not working with latest openldap
bump version to 1.1.27
bump version to 1.1.28
bump version to 1.1.29
---
Makefile.am | 104
Makefile.in | 1444
VERSION.sh | 4
aclocal.m4 | 6991 ---
admserv/cfgstuff/httpd-2.2.conf.in | 13
admserv/cfgstuff/httpd.conf.in | 2
admserv/cfgstuff/initconfig.in | 5
admserv/cfgstuff/start-ds-admin.in | 83
admserv/cgi-ds/ds_listdb.c | 26
admserv/cgi-ds/ds_snmpctrl.c | 5
admserv/cgi-src40/ReadLog.c | 18
admserv/cgi-src40/admlib.mk | 119
admserv/cgi-src40/admpw.c | 70
admserv/cgi-src40/cgicommon.h | 1
admserv/cgi-src40/cgicommon.properties | 3
admserv/cgi-src40/config.c | 34
admserv/cgi-src40/dllglue.c | 42
admserv/cgi-src40/ds_create.in | 6
admserv/cgi-src40/dsconfig.c | 9
admserv/cgi-src40/head.html | 1
admserv/cgi-src40/help.c | 15
admserv/cgi-src40/htmladmin.c | 809
admserv/cgi-src40/htmladmin.properties | 42
admserv/cgi-src40/monreplication.c | 6
admserv/cgi-src40/repl-monitor-cgi.pl.in | 37
admserv/cgi-src40/restartsrv.c | 8
admserv/cgi-src40/sec-activate.c | 21
admserv/cgi-src40/security.c | 196
admserv/cgi-src40/statpingserv.c | 81
admserv/cgi-src40/stopsrv.c | 9
admserv/cgi-src40/ugdsconfig.c | 38
admserv/cgi-src40/viewdata.c | 156
admserv/cgi-src40/viewdata.properties | 2
admserv/cgi-src40/viewlog.c | 74
admserv/cgi-src40/viewlog.properties | 6
admserv/genrb_wrapper.sh | 2
admserv/html/admserv.html.in | 11
admserv/html/htmladmin.html.in | 13
admserv/html/monreplication.html | 20
admserv/html/viewdata.html | 6
admserv/html/viewlog.html | 14
admserv/makeUpgradeTar.sh | 30
admserv/newinst/src/25changefedorato389.pl | 250
admserv/newinst/src/25rebrand.pl.in | 413
admserv/newinst/src/30updateglobalpref.pl.in | 9
admserv/newinst/src/AdminMigration.pm.in | 79
admserv/newinst/src/AdminServer.pm.in | 141
admserv/newinst/src/AdminUtil.pm.in | 78
admserv/newinst/src/ConfigDSDialogs.pm | 30
admserv/newinst/src/dirserver.map.in | 1
admserv/newinst/src/setup-ds-admin.res.in | 3
admserv/schema/ldif/02globalpreferences.ldif.tmpl | 49
admserv/schema/ldif/10dsdata.ldif.tmpl | 39
compile | 21
config.guess | 302
config.h.in | 24
config.sub | 232
configure |40598 ++++++++++------------
configure.ac | 106
depcomp | 172
include/base/file.h | 3
include/base/util.h | 3
include/libadmin/libadmin.h | 92
include/libdsa/dsalib.h | 15
install-sh | 517
lib/base/file.cpp | 22
lib/base/nscputil.cpp | 46
lib/libadmin/dllglue.c | 77
lib/libadmin/httpcon.c | 2
lib/libadmin/referer.c | 4
lib/libadmin/template.c | 29
lib/libadmin/util.c | 1003
lib/libdsa/dsalib_conf.c | 37
lib/libdsa/dsalib_confs.c | 79
lib/libdsa/dsalib_location.c | 46
lib/libdsa/dsalib_tailf.c | 1
lib/libdsa/dsalib_updown.c | 78
lib/libdsa/dsalib_util.c | 48
ltmain.sh |13199 +++----
m4/mozldap.m4 | 116
m4/openldap.m4 | 138
m4/selinux.m4 | 3
man/man8/ds_removal.8 | 54
man/man8/ds_unregister.8 | 48
man/man8/restart-ds-admin.8 | 10
man/man8/start-ds-admin.8 | 10
man/man8/stop-ds-admin.8 | 10
missing | 104
mod_admserv/mod_admserv.c | 182
mod_admserv/mod_admserv.h | 15
mod_restartd/mod_restartd-2.2.c | 6
selinux/dirsrv-admin.fc.in | 5
selinux/dirsrv-admin.te | 2
tests/ds_create/testget.1 | 2
tests/htmladmin/testget.2 | 2
tests/htmladmin/testget.3 | 2
tests/htmladmin/testget.4 | 2
tests/htmladmin/testget.5 | 2
tests/htmladmin/testget.6 | 2
tests/htmladmin/testget.7 | 2
tests/htmladmin/testget.8 | 2
tests/security/testpost.1 | 1
tests/security/testpost.10 | 1
tests/security/testpost.11 | 1
tests/security/testpost.12 | 1
tests/security/testpost.13 | 1
tests/security/testpost.14 | 1
tests/security/testpost.15 | 1
tests/security/testpost.16 | 1
tests/security/testpost.17 | 1
tests/security/testpost.18 | 1
tests/security/testpost.19 | 1
tests/security/testpost.2 | 1
tests/security/testpost.20 | 1
tests/security/testpost.21 | 1
tests/security/testpost.3 | 1
tests/security/testpost.4 | 1
tests/security/testpost.5 | 1
tests/security/testpost.6 | 1
tests/security/testpost.7 | 1
tests/security/testpost.8 | 1
tests/security/testpost.9 | 1
tests/setup.sh | 250
tests/ugdsconfig/testget.10 | 2
tests/viewdata/testget.2 | 2
tests/viewdata/testget.3 | 2
tests/viewdata/testget.4 | 2
tests/viewlog/testget.3 | 2
tests/viewlog/testget.4 | 2
wrappers/systemd.service.in | 24
130 files changed, 33083 insertions(+), 36367 deletions(-)
---
11 years, 6 months
VERSION.sh
by Richard Allen Megginson
VERSION.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 57715ea53ce886776d388c931d6c266a47cea43a
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Mar 27 08:11:21 2012 -0600
bump version to 1.1.29
diff --git a/VERSION.sh b/VERSION.sh
index 762df84..b8be7e2 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -11,7 +11,7 @@ vendorurl=http://port389.org
# PACKAGE_VERSION is constructed from these
VERSION_MAJOR=1
VERSION_MINOR=1
-VERSION_MAINT=28
+VERSION_MAINT=29
# if this is a PRERELEASE, set VERSION_PREREL
# otherwise, comment it out
# be sure to include the dot prefix in the prerel
11 years, 6 months
ldap/servers
by Richard Allen Megginson
ldap/servers/plugins/replication/windows_protocol_util.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit b4a09b602425074810618d9564cf0145f07b79c6
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri Mar 23 20:16:37 2012 -0600
Ticket #324 - redux: Sync with group attribute containing () fails
https://fedorahosted.org/389/ticket/324
Resolves: Ticket #324
Bug Description: Sync with group attribute containing () fails
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: Previous fix broke cases that did not need escaping. Have
to use the return value of escape_filter_value() rather than use the buffer
passed to that function. If the value doesn't need escaping, the original
value is returned, and the buffer is empty.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index 0c16bdd..a1b012c 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -2794,9 +2794,8 @@ find_entry_by_attr_value_remote(const char *attribute, const char *value, Slapi_
vallen = value ? strlen(value) : 0;
filter_escaped_value = slapi_ch_calloc(sizeof(char), vallen*3+1);
- escape_filter_value(value, vallen, filter_escaped_value);
/* should not have to escape attribute names */
- filter = PR_smprintf("(%s=%s)",attribute,filter_escaped_value);
+ filter = PR_smprintf("(%s=%s)",attribute,escape_filter_value(value, vallen, filter_escaped_value));
slapi_ch_free_string(&filter_escaped_value);
searchbase = slapi_sdn_get_dn(windows_private_get_windows_subtree(prp->agmt));
cres = windows_search_entry(prp->conn, (char*)searchbase, filter, &found_entry);
@@ -2930,9 +2929,8 @@ find_entry_by_attr_value(const char *attribute, const char *value, Slapi_Entry *
vallen = value ? strlen(value) : 0;
filter_escaped_value = slapi_ch_calloc(sizeof(char), vallen*3+1);
- escape_filter_value(value, vallen, filter_escaped_value);
/* should not have to escape attribute names */
- query = slapi_ch_smprintf("(%s=%s)", attribute, filter_escaped_value);
+ query = slapi_ch_smprintf("(%s=%s)", attribute, escape_filter_value(value, vallen, filter_escaped_value));
slapi_ch_free_string(&filter_escaped_value);
if (query == NULL)
11 years, 6 months
admserv/cgi-src40
by Noriko Hosoi
admserv/cgi-src40/htmladmin.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit 4ec23c03450d45639282c173d2e095c4023876bb
Author: Noriko Hosoi <nhosoi(a)totoro.sjc.redhat.com>
Date: Fri Mar 23 13:13:08 2012 -0700
If htmladmin fails to connect to the server, the cgi could crash.
This patch checks the flag for the server status and avoids the
unnecessary free.
diff --git a/admserv/cgi-src40/htmladmin.c b/admserv/cgi-src40/htmladmin.c
index 09d0ad0..7110526 100644
--- a/admserv/cgi-src40/htmladmin.c
+++ b/admserv/cgi-src40/htmladmin.c
@@ -1175,8 +1175,8 @@ int output_topology(AdmldapInfo ldapInfo,
char *admin_url;
char *server_host;
int *server_port;
- int running;
- char *href;
+ int running = 0;
+ char *href = NULL;
char *info_link;
char *log_link;
@@ -1232,7 +1232,10 @@ int output_topology(AdmldapInfo ldapInfo,
free((void *)dn_escaped);
free((void *)val_escaped);
- PR_smprintf_free((char *)href);
+ if (running == 1) {
+ PR_smprintf_free((char *)href);
+ href = NULL;
+ }
PR_smprintf_free((char *)info_link);
PR_smprintf_free((char *)log_link);
} else if(strstr(ldap_get_dn(server, sie_entry), "Directory")) {
@@ -1276,7 +1279,9 @@ int output_topology(AdmldapInfo ldapInfo,
free((void *)dn_escaped);
free((void *)val_escaped);
free((void *)host_escaped);
- PR_smprintf_free((char *)href);
+ if (href) {
+ PR_smprintf_free((char *)href);
+ }
PR_smprintf_free((char *)info_link);
PR_smprintf_free((char *)log_link);
PR_smprintf_free((char *)repl_link);
11 years, 6 months