configure configure.ac ldap/admin ltmain.sh Makefile.am Makefile.in VERSION.sh
by Richard Allen Megginson
Makefile.am | 2 +
Makefile.in | 3 ++
VERSION.sh | 3 ++
configure | 60 ++++++++++++++++++++++----------------------
configure.ac | 1
ldap/admin/src/slapd.inf.in | 2 -
6 files changed, 41 insertions(+), 30 deletions(-)
New commits:
commit fe4d09a3f984fe821635a1147da12dc3510cd4d6
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue May 4 16:12:35 2010 -0600
Bug 586571 - DS Console shows escaped DNs
https://bugzilla.redhat.com/show_bug.cgi?id=586571
Resolves: bug 586571
Bug Description: DS Console shows escaped DNs
Reviewed by: nkinder (Thanks!)
Branch: HEAD
Fix Description: In order for the console fixed to be used to manage the
correct directory server, the directory server needs to be able to specify
the ds console jar file version down to 3 digits, as opposed to the current
two digits. To support this, instead of overriding PACKAGE_BASE_VERSION,
a new configure macro is introduced - CONSOLE_VERSION. This value is
set in VERSION.sh, so it can be easily updated, and it is used to set
the value for BaseVersion in slapd.inf, which is what the admin server
setup uses to set the ds console jar file version corresponding to the
directory server.
Platforms tested: RHEL5 x86_64, Fedora 12
Flag Day: no
Doc impact: no
diff --git a/Makefile.am b/Makefile.am
index 9d1bee6..f013a10 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1332,6 +1332,7 @@ fixupcmd = sed \
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
-e 's,@PACKAGE_BASE_VERSION\@,$(PACKAGE_BASE_VERSION),g' \
+ -e 's,@CONSOLE_VERSION\@,$(CONSOLE_VERSION),g' \
-e 's,@BUILDNUM\@,$(BUILDNUM),g' \
-e 's,@NQBUILD_NUM\@,$(NQBUILDNUM),g' \
-e 's,@perlpath\@,$(perldir) $(libdir)/perl/arch $(libdir)/perl,g' \
@@ -1386,6 +1387,7 @@ fixupcmd = sed \
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
-e 's,@PACKAGE_BASE_VERSION\@,$(PACKAGE_BASE_VERSION),g' \
+ -e 's,@CONSOLE_VERSION\@,$(CONSOLE_VERSION),g' \
-e 's,@BUILDNUM\@,$(BUILDNUM),g' \
-e 's,@NQBUILD_NUM\@,$(NQBUILDNUM),g' \
-e 's,@perlpath\@,$(perldir),g' \
diff --git a/Makefile.in b/Makefile.in
old mode 100755
new mode 100644
index 4ecd1c5..ee070d6
--- a/Makefile.in
+++ b/Makefile.in
@@ -956,6 +956,7 @@ CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CONSOLE_VERSION = @CONSOLE_VERSION@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
@@ -2318,6 +2319,7 @@ rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBS
@BUNDLE_FALSE@ -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
@BUNDLE_FALSE@ -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
@BUNDLE_FALSE@ -e 's,@PACKAGE_BASE_VERSION\@,$(PACKAGE_BASE_VERSION),g' \
+@BUNDLE_FALSE@ -e 's,@CONSOLE_VERSION\@,$(CONSOLE_VERSION),g' \
@BUNDLE_FALSE@ -e 's,@BUILDNUM\@,$(BUILDNUM),g' \
@BUNDLE_FALSE@ -e 's,@NQBUILD_NUM\@,$(NQBUILDNUM),g' \
@BUNDLE_FALSE@ -e 's,@perlpath\@,$(perldir),g' \
@@ -2382,6 +2384,7 @@ rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBS
@BUNDLE_TRUE@ -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
@BUNDLE_TRUE@ -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
@BUNDLE_TRUE@ -e 's,@PACKAGE_BASE_VERSION\@,$(PACKAGE_BASE_VERSION),g' \
+@BUNDLE_TRUE@ -e 's,@CONSOLE_VERSION\@,$(CONSOLE_VERSION),g' \
@BUNDLE_TRUE@ -e 's,@BUILDNUM\@,$(BUILDNUM),g' \
@BUNDLE_TRUE@ -e 's,@NQBUILD_NUM\@,$(NQBUILDNUM),g' \
@BUNDLE_TRUE@ -e 's,@perlpath\@,$(perldir) $(libdir)/perl/arch $(libdir)/perl,g' \
diff --git a/VERSION.sh b/VERSION.sh
index 4b8b43f..90b03e9 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -48,3 +48,6 @@ PACKAGE_TARNAME=${brand}-ds-base
# url for bug reports
PACKAGE_BUGREPORT="${PACKAGE_BUGREPORT}enter_bug.cgi?product=$brand"
PACKAGE_STRING="$PACKAGE_TARNAME $PACKAGE_VERSION"
+# the version of the ds console package that this directory server
+# is compatible with
+CONSOLE_VERSION=$VERSION_MAJOR.$VERSION_MINOR.2
diff --git a/configure b/configure
index 957f2ea..44858ca 100755
--- a/configure
+++ b/configure
@@ -465,7 +465,7 @@ ac_includes_default="\
#endif"
ac_default_prefix=/opt/$PACKAGE_NAME
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CCAS CCASFLAGS SED EGREP LN_S ECHO AR ac_ct_AR RANLIB a
c_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS debug_defs BUNDLE_TRUE BUNDLE_FALSE enable_pam_passthru_TRUE enable_pam_passthru_FALSE enable_dna_TRUE enable_dna_FALSE enable_ldapi_TRUE enable_ldapi_FALSE enable_autobind_TRUE enable_autobind_FALSE enable_auto_dn_suffix_TRUE enable_auto_dn_suffix_FALSE enable_bitwise_TRUE enable_bitwise_FALSE enable_presence_TRUE enable_presence_FALSE with_fhs_opt configdir sampledatadir propertydir schemadir serverdir serverplugindir scripttemplatedir perldir infdir mibdir updatedir defaultuser defaultgroup instconfigdir WINNT_TRUE WINNT_FALSE THREADLIB LIBCRYPT LIBSOCKET LIBNSL LIBDL LIBCSTD LIBCRUN initdir perlexec initconfigdir HPUX_TRUE HPUX_FALSE SOLARIS_TRUE SOLARIS_FALSE PKG_CONFIG ICU_CONFIG NETSNMP_CONFIG KRB5_CONFIG_BIN kerberos_inc kerberos_lib kerberos_libdir with_selinux PACKAGE_BASE_VERSION SELINUX_TRUE SELINUX_FALSE OPENLDAP_TRUE OPENLDAP_FALSE nspr_inc nspr_lib nspr_libdir nss_inc nss_lib nss_libdir ldapsdk_inc ld
apsdk_lib ldapsdk_libdir ldapsdk_bindir openldap_inc openldap_lib openldap_libdir openldap_bindir ol_libver db_inc db_incdir db_lib db_libdir db_bindir db_libver sasl_inc sasl_lib sasl_libdir sasl_path svrcore_inc svrcore_lib icu_lib icu_inc icu_bin netsnmp_inc netsnmp_lib netsnmp_libdir netsnmp_link pcre_inc pcre_lib pcre_libdir brand capbrand vendor LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CONSOLE_VERSION MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CCAS CCASFLAGS SED EGREP LN_S ECHO AR a
c_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS debug_defs BUNDLE_TRUE BUNDLE_FALSE enable_pam_passthru_TRUE enable_pam_passthru_FALSE enable_dna_TRUE enable_dna_FALSE enable_ldapi_TRUE enable_ldapi_FALSE enable_autobind_TRUE enable_autobind_FALSE enable_auto_dn_suffix_TRUE enable_auto_dn_suffix_FALSE enable_bitwise_TRUE enable_bitwise_FALSE enable_presence_TRUE enable_presence_FALSE with_fhs_opt configdir sampledatadir propertydir schemadir serverdir serverplugindir scripttemplatedir perldir infdir mibdir updatedir defaultuser defaultgroup instconfigdir WINNT_TRUE WINNT_FALSE THREADLIB LIBCRYPT LIBSOCKET LIBNSL LIBDL LIBCSTD LIBCRUN initdir perlexec initconfigdir HPUX_TRUE HPUX_FALSE SOLARIS_TRUE SOLARIS_FALSE PKG_CONFIG ICU_CONFIG NETSNMP_CONFIG KRB5_CONFIG_BIN kerberos_inc kerberos_lib kerberos_libdir with_selinux PACKAGE_BASE_VERSION SELINUX_TRUE SELINUX_FALSE OPENLDAP_TRUE OPENLDAP_FALSE nspr_inc nspr_lib nspr_libdir nss_inc nss_lib nss_libdi
r ldapsdk_inc ldapsdk_lib ldapsdk_libdir ldapsdk_bindir openldap_inc openldap_lib openldap_libdir openldap_bindir ol_libver db_inc db_incdir db_lib db_libdir db_bindir db_libver sasl_inc sasl_lib sasl_libdir sasl_path svrcore_inc svrcore_lib icu_lib icu_inc icu_bin netsnmp_inc netsnmp_lib netsnmp_libdir netsnmp_link pcre_inc pcre_lib pcre_libdir brand capbrand vendor LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -2076,6 +2076,7 @@ cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF
+
echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
@@ -4404,7 +4405,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4407 "configure"' > conftest.$ac_ext
+ echo '#line 4408 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -5539,7 +5540,7 @@ fi
# Provide some information about the compiler.
-echo "$as_me:5542:" \
+echo "$as_me:5543:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -6602,11 +6603,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:6605: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6606: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6609: \$? = $ac_status" >&5
+ echo "$as_me:6610: \$? = $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.
@@ -6870,11 +6871,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:6873: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6874: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6877: \$? = $ac_status" >&5
+ echo "$as_me:6878: \$? = $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.
@@ -6974,11 +6975,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:6977: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6978: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:6981: \$? = $ac_status" >&5
+ echo "$as_me:6982: \$? = $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
@@ -8443,7 +8444,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 8446 "configure"' > conftest.$ac_ext
+ echo '#line 8447 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -9340,7 +9341,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9343 "configure"
+#line 9344 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9440,7 +9441,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9443 "configure"
+#line 9444 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11783,11 +11784,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:11786: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11787: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11790: \$? = $ac_status" >&5
+ echo "$as_me:11791: \$? = $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.
@@ -11887,11 +11888,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:11890: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11891: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11894: \$? = $ac_status" >&5
+ echo "$as_me:11895: \$? = $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
@@ -12423,7 +12424,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 12426 "configure"' > conftest.$ac_ext
+ echo '#line 12427 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -13481,11 +13482,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:13484: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13485: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13488: \$? = $ac_status" >&5
+ echo "$as_me:13489: \$? = $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.
@@ -13585,11 +13586,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:13588: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13589: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13592: \$? = $ac_status" >&5
+ echo "$as_me:13593: \$? = $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
@@ -15034,7 +15035,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 15037 "configure"' > conftest.$ac_ext
+ echo '#line 15038 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -15812,11 +15813,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:15815: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15816: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15819: \$? = $ac_status" >&5
+ echo "$as_me:15820: \$? = $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.
@@ -16080,11 +16081,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:16083: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16084: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16087: \$? = $ac_status" >&5
+ echo "$as_me:16088: \$? = $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.
@@ -16184,11 +16185,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:16187: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16188: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16191: \$? = $ac_status" >&5
+ echo "$as_me:16192: \$? = $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
@@ -17653,7 +17654,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 17656 "configure"' > conftest.$ac_ext
+ echo '#line 17657 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -28233,6 +28234,7 @@ s,@am__leading_dot@,$am__leading_dot,;t t
s,@AMTAR@,$AMTAR,;t t
s,@am__tar@,$am__tar,;t t
s,@am__untar@,$am__untar,;t t
+s,@CONSOLE_VERSION@,$CONSOLE_VERSION,;t t
s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
s,@MAINT@,$MAINT,;t t
diff --git a/configure.ac b/configure.ac
index cd4ab80..e5f419d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,7 @@ VERSION=$PACKAGE_VERSION
PACKAGE=$PACKAGE_TARNAME
AC_DEFINE_UNQUOTED([VERSION], "$VERSION", [package version])
AC_DEFINE_UNQUOTED([PACKAGE], "$PACKAGE", [package tar name])
+AC_SUBST([CONSOLE_VERSION])
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
diff --git a/ldap/admin/src/slapd.inf.in b/ldap/admin/src/slapd.inf.in
index 140ff36..fa03543 100644
--- a/ldap/admin/src/slapd.inf.in
+++ b/ldap/admin/src/slapd.inf.in
@@ -46,7 +46,7 @@ Name= @capbrand@ Directory Server
InstanceNamePrefix= Directory Server
NickName= slapd
Version= @PACKAGE_VERSION@
-BaseVersion= @PACKAGE_BASE_VERSION@
+BaseVersion= @CONSOLE_VERSION@
Compatible= 1.0
BuildNumber= @NQBUILD_NUM@
Description= @capbrand@ Directory Server
diff --git a/ltmain.sh b/ltmain.sh
old mode 100755
new mode 100644
13 years, 11 months
console/src/com/netscape/management/client/components TimeDayPanel.java, 1.1.1.1, 1.2
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/console/src/com/netscape/management/client/components
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv9993/src/com/netscape/management/client/components
Modified Files:
TimeDayPanel.java
Log Message:
bump version to 1.1.5
Index: TimeDayPanel.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/components/TimeDayPanel.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- TimeDayPanel.java 18 Jul 2005 00:34:14 -0000 1.1.1.1
+++ TimeDayPanel.java 3 May 2010 20:56:32 -0000 1.2
@@ -203,7 +203,7 @@
{
JTable t = new JTable(new TimeTableModel());
timeTable = t;
- t.setRowSelectionAllowed(false);
+ t.setRowSelectionAllowed(true);
t.setColumnSelectionAllowed(true);
t.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
t.setCellSelectionEnabled(true);
@@ -438,6 +438,10 @@
timeTable.setColumnSelectionInterval(startHour+1, endHour+1);
}
+ public void setDayHourSelection(int day, int hour) {
+ timeTable.changeSelection(day, hour+1, true, true);
+ }
+
/**
* @return selected days.
*/
13 years, 12 months
console build.properties,1.18,1.19
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/console
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv9993
Modified Files:
build.properties
Log Message:
bump version to 1.1.5
Index: build.properties
===================================================================
RCS file: /cvs/dirsec/console/build.properties,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- build.properties 14 Apr 2010 22:10:35 -0000 1.18
+++ build.properties 3 May 2010 20:56:31 -0000 1.19
@@ -23,7 +23,7 @@
console.root=.
console.version=11
-console.dotversion=1.1.4
+console.dotversion=1.1.5
console.dotgenversion=1.1
mcc.core=idm-console-mcc
13 years, 12 months
Branch 'refs/tags/389-ds-console-1.2.2' - src/com
by Richard Allen Megginson
src/com/netscape/admin/dirserv/DSUtil.java | 281 ++++++++++----
src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java | 12
2 files changed, 222 insertions(+), 71 deletions(-)
New commits:
commit b2e8292736c270424f2e60a4e0e3bb243dacde74
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon May 3 11:33:34 2010 -0600
Bug 586571 - DS Console shows escaped DNs
https://bugzilla.redhat.com/show_bug.cgi?id=586571
Resolves: bug 586571
Bug Description: DS Console shows escaped DNs
Reviewed by: nkinder (Thanks!)
Branch: HEAD
Fix Description: Was not working correctly in the property and advanced
editor for editing some DNs that contained other DNs as RDN values.
I also moved a lot of the DN handling code into the main console package
into the LDAPUtil class. This will allow the main console to handle DN
escapes as well. Unfortunately, if managing a new DS on a machine which
only has the old console framework, these methods will be missing.
So, use the new methods if available, otherwise, fallback on the DSUtil
implementation.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
diff --git a/src/com/netscape/admin/dirserv/DSUtil.java b/src/com/netscape/admin/dirserv/DSUtil.java
index 6f0b3d1..316d62c 100644
--- a/src/com/netscape/admin/dirserv/DSUtil.java
+++ b/src/com/netscape/admin/dirserv/DSUtil.java
@@ -19,6 +19,7 @@
package com.netscape.admin.dirserv;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.awt.*;
import java.awt.image.*;
@@ -1809,57 +1810,6 @@ public class DSUtil {
return state ? IServerObject.STATUS_STARTED : IServerObject.STATUS_STOPPED;
}
- /**
- * Check if the string is a valid dn
- *
- */
- static public boolean isValidDN (String dn){
- if (dn.equals (""))
- return true;
-
- if (!netscape.ldap.util.DN.isDN(dn))
- return false;
-
- int eq = dn.indexOf('=');
-
- return (eq > 0 && eq < dn.length () -1 );
- }
-
- static public boolean equalDNs(DN dn1, DN dn2) {
- boolean status = (dn1 == null || dn2 == null);
- if (status) { // if at least one of the arguments is null
- status = (dn1 == dn2); // true if both are null, false otherwise
- return status; // short circuit
- }
-
- Vector thisRDNs = dn1.getRDNs();
- Vector thatRDNs = dn2.getRDNs();
- if (thisRDNs != null && thatRDNs != null &&
- thisRDNs.size() == thatRDNs.size()) {
- int ii;
- for (ii = 0; ii < thisRDNs.size(); ++ii) {
- RDN thisRDN = (RDN)thisRDNs.elementAt(ii);
- RDN thatRDN = (RDN)thatRDNs.elementAt(ii);
- if (!thisRDN.equals(thatRDN))
- break;
- }
-
- // all RDNs were equal
- if (ii == thisRDNs.size())
- status = true;
- }
-
- return status;
- }
-
- static public boolean equalDNs(String dn1, String dn2) {
- boolean retVal = false;
- if (isValidDN(dn1) && isValidDN(dn2)) {
- retVal = equalDNs(new DN(dn1), new DN(dn2));
- }
- return retVal;
- }
-
// returns true if dn1 completely contains dn2 or false otherwise
// contains is defined as dn2 is a parent of or is equal to dn1
// NOTE that this method is required until the ldapjdk
@@ -2021,6 +1971,125 @@ public class DSUtil {
}
}
+ private static Method isValidDN_meth = null;
+ private static Method equalDNs_str_meth = null;
+ private static Method equalDNs_dn_meth = null;
+ private static Method unEscapeRDNVal_meth = null;
+ private static Method unEscapeRDN_meth = null;
+ private static Method unEscapeDN_meth = null;
+ private static Method escapeDNVal_meth = null;
+ private static Method DNUsesLDAPv2Quoting_meth = null;
+ static {
+ try {
+ isValidDN_meth = LDAPUtil.class.getMethod("isValidDN", String.class);
+ equalDNs_str_meth = LDAPUtil.class.getMethod("equalDNs", String.class, String.class);
+ equalDNs_dn_meth = LDAPUtil.class.getMethod("equalDNs", DN.class, DN.class);
+ unEscapeRDNVal_meth = LDAPUtil.class.getMethod("unEscapeRDNVal", String.class);
+ unEscapeRDN_meth = LDAPUtil.class.getMethod("unEscapeRDN", String.class);
+ unEscapeDN_meth = LDAPUtil.class.getMethod("unEscapeDN", String.class);
+ escapeDNVal_meth = LDAPUtil.class.getMethod("escapeDNVal", String.class);
+ DNUsesLDAPv2Quoting_meth = LDAPUtil.class.getMethod("DNUsesLDAPv2Quoting", String.class);
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ throw e;
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Check if the string is a valid dn
+ *
+ */
+ static public boolean isValidDN (String dn){
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (isValidDN_meth != null) {
+ try {
+ return ((Boolean)isValidDN_meth.invoke(null, dn)).booleanValue();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ if (dn.equals (""))
+ return true;
+
+ if (!netscape.ldap.util.DN.isDN(dn))
+ return false;
+
+ int eq = dn.indexOf('=');
+
+ return (eq > 0 && eq < dn.length () -1 );
+ }
+
+ static public boolean equalDNs(DN dn1, DN dn2) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (equalDNs_dn_meth != null) {
+ try {
+ return ((Boolean)equalDNs_dn_meth.invoke(null, dn1, dn2)).booleanValue();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ boolean status = (dn1 == null || dn2 == null);
+ if (status) { // if at least one of the arguments is null
+ status = (dn1 == dn2); // true if both are null, false otherwise
+ return status; // short circuit
+ }
+
+ Vector thisRDNs = dn1.getRDNs();
+ Vector thatRDNs = dn2.getRDNs();
+ if (thisRDNs != null && thatRDNs != null &&
+ thisRDNs.size() == thatRDNs.size()) {
+ int ii;
+ for (ii = 0; ii < thisRDNs.size(); ++ii) {
+ RDN thisRDN = (RDN)thisRDNs.elementAt(ii);
+ RDN thatRDN = (RDN)thatRDNs.elementAt(ii);
+ if (!thisRDN.equals(thatRDN))
+ break;
+ }
+
+ // all RDNs were equal
+ if (ii == thisRDNs.size())
+ status = true;
+ }
+
+ return status;
+ }
+
+ static public boolean equalDNs(String dn1, String dn2) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (equalDNs_str_meth != null) {
+ try {
+ return ((Boolean)equalDNs_str_meth.invoke(null, dn1, dn2)).booleanValue();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ boolean retVal = false;
+ if (isValidDN(dn1) && isValidDN(dn2)) {
+ retVal = equalDNs(new DN(dn1), new DN(dn2));
+ }
+ return retVal;
+ }
+
/**
* Returns the RDN value after unescaping any escaped characters.
* Can be a simple escape - a \ followed by any character -
@@ -2040,6 +2109,20 @@ public class DSUtil {
* @see netscape.ldap.LDAPDN#escapeRDN(java.lang.String)
*/
public static String unEscapeRDNVal(String rdnval) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (unEscapeRDNVal_meth != null) {
+ try {
+ return (String)unEscapeRDNVal_meth.invoke(null, rdnval);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
StringBuffer copy = new StringBuffer();
CharacterIterator it = new StringCharacterIterator(rdnval);
for (char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
@@ -2089,6 +2172,20 @@ public class DSUtil {
* @see netscape.ldap.LDAPDN#escapeRDN(java.lang.String)
*/
public static String unEscapeRDN(String rdn) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (unEscapeRDN_meth != null) {
+ try {
+ return (String)unEscapeRDN_meth.invoke(null, rdn);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
RDN name = new RDN(rdn);
String[] vals = name.getValues();
if ( (vals == null) || (vals.length < 1) ) {
@@ -2123,6 +2220,20 @@ public class DSUtil {
* @return the unescaped DN or the original DN if there were errors
*/
public static String unEscapeDN(String dn) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (unEscapeDN_meth != null) {
+ try {
+ return (String)unEscapeDN_meth.invoke(null, dn);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
if ((dn == null) || (dn.equals(""))) {
return dn;
}
@@ -2175,6 +2286,20 @@ public class DSUtil {
* @return the escaped string
*/
public static String escapeDNVal(String dnval) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (escapeDNVal_meth != null) {
+ try {
+ return (String)escapeDNVal_meth.invoke(null, dnval);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
StringBuffer copy = new StringBuffer();
CharacterIterator it = new StringCharacterIterator(dnval);
for (char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
@@ -2196,26 +2321,40 @@ public class DSUtil {
* @return true if the given string contains LDAPv2 style quoting
*/
static public boolean DNUsesLDAPv2Quoting(String dn) {
- char ESC = '\\';
- char Q = '"';
- boolean ret = false;
-
- // check dn for a even number (incl. 0) of ESC followed by Q
- if (dn == null)
- return ret;
-
- int p = dn.indexOf(Q);
- if (p >= 0)
- {
- int nESC = 0;
- for (--p; (p >= 0) && (dn.charAt(p) == ESC); --p)
- ++nESC;
- // the quote is unescaped if it is preceeded by an even
- // number of escape characters, including 0
- ret = ((nESC % 2) == 0);
- }
-
- return ret;
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (DNUsesLDAPv2Quoting_meth != null) {
+ try {
+ return ((Boolean)DNUsesLDAPv2Quoting_meth.invoke(null, dn)).booleanValue();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ char ESC = '\\';
+ char Q = '"';
+ boolean ret = false;
+
+ // check dn for a even number (incl. 0) of ESC followed by Q
+ if (dn == null)
+ return ret;
+
+ int p = dn.indexOf(Q);
+ if (p >= 0)
+ {
+ int nESC = 0;
+ for (--p; (p >= 0) && (dn.charAt(p) == ESC); --p)
+ ++nESC;
+ // the quote is unescaped if it is preceeded by an even
+ // number of escape characters, including 0
+ ret = ((nESC % 2) == 0);
+ }
+
+ return ret;
}
static public void checkForLDAPv2Quoting(String dn, JFrame frame,
diff --git a/src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java b/src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java
index aff65a8..1d0193a 100644
--- a/src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java
+++ b/src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java
@@ -1492,6 +1492,18 @@ public class DSEntryPanel extends JPanel implements ActionListener,
typeWithValue = true;
break;
}
+ // note: current versions of the directory server
+ // use dn values as values of RDNs e.g.
+ // cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree, cn=config
+ // where dc\3Dexample\2Cdc\3Dcom is dc=example,dc=com
+ String unescval = DSUtil.unEscapeRDNVal(value);
+ if (DSUtil.isValidDN(unescval)) {
+ // compare as DNs
+ if (DSUtil.equalDNs(unescval, currentValue)) {
+ typeWithValue = true;
+ break;
+ }
+ }
}
if (typeWithValue) {
continue;
13 years, 12 months
src/com
by Richard Allen Megginson
src/com/netscape/admin/dirserv/DSUtil.java | 281 ++++++++++----
src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java | 12
2 files changed, 222 insertions(+), 71 deletions(-)
New commits:
commit b2e8292736c270424f2e60a4e0e3bb243dacde74
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon May 3 11:33:34 2010 -0600
Bug 586571 - DS Console shows escaped DNs
https://bugzilla.redhat.com/show_bug.cgi?id=586571
Resolves: bug 586571
Bug Description: DS Console shows escaped DNs
Reviewed by: nkinder (Thanks!)
Branch: HEAD
Fix Description: Was not working correctly in the property and advanced
editor for editing some DNs that contained other DNs as RDN values.
I also moved a lot of the DN handling code into the main console package
into the LDAPUtil class. This will allow the main console to handle DN
escapes as well. Unfortunately, if managing a new DS on a machine which
only has the old console framework, these methods will be missing.
So, use the new methods if available, otherwise, fallback on the DSUtil
implementation.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
diff --git a/src/com/netscape/admin/dirserv/DSUtil.java b/src/com/netscape/admin/dirserv/DSUtil.java
index 6f0b3d1..316d62c 100644
--- a/src/com/netscape/admin/dirserv/DSUtil.java
+++ b/src/com/netscape/admin/dirserv/DSUtil.java
@@ -19,6 +19,7 @@
package com.netscape.admin.dirserv;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.awt.*;
import java.awt.image.*;
@@ -1809,57 +1810,6 @@ public class DSUtil {
return state ? IServerObject.STATUS_STARTED : IServerObject.STATUS_STOPPED;
}
- /**
- * Check if the string is a valid dn
- *
- */
- static public boolean isValidDN (String dn){
- if (dn.equals (""))
- return true;
-
- if (!netscape.ldap.util.DN.isDN(dn))
- return false;
-
- int eq = dn.indexOf('=');
-
- return (eq > 0 && eq < dn.length () -1 );
- }
-
- static public boolean equalDNs(DN dn1, DN dn2) {
- boolean status = (dn1 == null || dn2 == null);
- if (status) { // if at least one of the arguments is null
- status = (dn1 == dn2); // true if both are null, false otherwise
- return status; // short circuit
- }
-
- Vector thisRDNs = dn1.getRDNs();
- Vector thatRDNs = dn2.getRDNs();
- if (thisRDNs != null && thatRDNs != null &&
- thisRDNs.size() == thatRDNs.size()) {
- int ii;
- for (ii = 0; ii < thisRDNs.size(); ++ii) {
- RDN thisRDN = (RDN)thisRDNs.elementAt(ii);
- RDN thatRDN = (RDN)thatRDNs.elementAt(ii);
- if (!thisRDN.equals(thatRDN))
- break;
- }
-
- // all RDNs were equal
- if (ii == thisRDNs.size())
- status = true;
- }
-
- return status;
- }
-
- static public boolean equalDNs(String dn1, String dn2) {
- boolean retVal = false;
- if (isValidDN(dn1) && isValidDN(dn2)) {
- retVal = equalDNs(new DN(dn1), new DN(dn2));
- }
- return retVal;
- }
-
// returns true if dn1 completely contains dn2 or false otherwise
// contains is defined as dn2 is a parent of or is equal to dn1
// NOTE that this method is required until the ldapjdk
@@ -2021,6 +1971,125 @@ public class DSUtil {
}
}
+ private static Method isValidDN_meth = null;
+ private static Method equalDNs_str_meth = null;
+ private static Method equalDNs_dn_meth = null;
+ private static Method unEscapeRDNVal_meth = null;
+ private static Method unEscapeRDN_meth = null;
+ private static Method unEscapeDN_meth = null;
+ private static Method escapeDNVal_meth = null;
+ private static Method DNUsesLDAPv2Quoting_meth = null;
+ static {
+ try {
+ isValidDN_meth = LDAPUtil.class.getMethod("isValidDN", String.class);
+ equalDNs_str_meth = LDAPUtil.class.getMethod("equalDNs", String.class, String.class);
+ equalDNs_dn_meth = LDAPUtil.class.getMethod("equalDNs", DN.class, DN.class);
+ unEscapeRDNVal_meth = LDAPUtil.class.getMethod("unEscapeRDNVal", String.class);
+ unEscapeRDN_meth = LDAPUtil.class.getMethod("unEscapeRDN", String.class);
+ unEscapeDN_meth = LDAPUtil.class.getMethod("unEscapeDN", String.class);
+ escapeDNVal_meth = LDAPUtil.class.getMethod("escapeDNVal", String.class);
+ DNUsesLDAPv2Quoting_meth = LDAPUtil.class.getMethod("DNUsesLDAPv2Quoting", String.class);
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ throw e;
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Check if the string is a valid dn
+ *
+ */
+ static public boolean isValidDN (String dn){
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (isValidDN_meth != null) {
+ try {
+ return ((Boolean)isValidDN_meth.invoke(null, dn)).booleanValue();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ if (dn.equals (""))
+ return true;
+
+ if (!netscape.ldap.util.DN.isDN(dn))
+ return false;
+
+ int eq = dn.indexOf('=');
+
+ return (eq > 0 && eq < dn.length () -1 );
+ }
+
+ static public boolean equalDNs(DN dn1, DN dn2) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (equalDNs_dn_meth != null) {
+ try {
+ return ((Boolean)equalDNs_dn_meth.invoke(null, dn1, dn2)).booleanValue();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ boolean status = (dn1 == null || dn2 == null);
+ if (status) { // if at least one of the arguments is null
+ status = (dn1 == dn2); // true if both are null, false otherwise
+ return status; // short circuit
+ }
+
+ Vector thisRDNs = dn1.getRDNs();
+ Vector thatRDNs = dn2.getRDNs();
+ if (thisRDNs != null && thatRDNs != null &&
+ thisRDNs.size() == thatRDNs.size()) {
+ int ii;
+ for (ii = 0; ii < thisRDNs.size(); ++ii) {
+ RDN thisRDN = (RDN)thisRDNs.elementAt(ii);
+ RDN thatRDN = (RDN)thatRDNs.elementAt(ii);
+ if (!thisRDN.equals(thatRDN))
+ break;
+ }
+
+ // all RDNs were equal
+ if (ii == thisRDNs.size())
+ status = true;
+ }
+
+ return status;
+ }
+
+ static public boolean equalDNs(String dn1, String dn2) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (equalDNs_str_meth != null) {
+ try {
+ return ((Boolean)equalDNs_str_meth.invoke(null, dn1, dn2)).booleanValue();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ boolean retVal = false;
+ if (isValidDN(dn1) && isValidDN(dn2)) {
+ retVal = equalDNs(new DN(dn1), new DN(dn2));
+ }
+ return retVal;
+ }
+
/**
* Returns the RDN value after unescaping any escaped characters.
* Can be a simple escape - a \ followed by any character -
@@ -2040,6 +2109,20 @@ public class DSUtil {
* @see netscape.ldap.LDAPDN#escapeRDN(java.lang.String)
*/
public static String unEscapeRDNVal(String rdnval) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (unEscapeRDNVal_meth != null) {
+ try {
+ return (String)unEscapeRDNVal_meth.invoke(null, rdnval);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
StringBuffer copy = new StringBuffer();
CharacterIterator it = new StringCharacterIterator(rdnval);
for (char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
@@ -2089,6 +2172,20 @@ public class DSUtil {
* @see netscape.ldap.LDAPDN#escapeRDN(java.lang.String)
*/
public static String unEscapeRDN(String rdn) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (unEscapeRDN_meth != null) {
+ try {
+ return (String)unEscapeRDN_meth.invoke(null, rdn);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
RDN name = new RDN(rdn);
String[] vals = name.getValues();
if ( (vals == null) || (vals.length < 1) ) {
@@ -2123,6 +2220,20 @@ public class DSUtil {
* @return the unescaped DN or the original DN if there were errors
*/
public static String unEscapeDN(String dn) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (unEscapeDN_meth != null) {
+ try {
+ return (String)unEscapeDN_meth.invoke(null, dn);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
if ((dn == null) || (dn.equals(""))) {
return dn;
}
@@ -2175,6 +2286,20 @@ public class DSUtil {
* @return the escaped string
*/
public static String escapeDNVal(String dnval) {
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (escapeDNVal_meth != null) {
+ try {
+ return (String)escapeDNVal_meth.invoke(null, dnval);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
StringBuffer copy = new StringBuffer();
CharacterIterator it = new StringCharacterIterator(dnval);
for (char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
@@ -2196,26 +2321,40 @@ public class DSUtil {
* @return true if the given string contains LDAPv2 style quoting
*/
static public boolean DNUsesLDAPv2Quoting(String dn) {
- char ESC = '\\';
- char Q = '"';
- boolean ret = false;
-
- // check dn for a even number (incl. 0) of ESC followed by Q
- if (dn == null)
- return ret;
-
- int p = dn.indexOf(Q);
- if (p >= 0)
- {
- int nESC = 0;
- for (--p; (p >= 0) && (dn.charAt(p) == ESC); --p)
- ++nESC;
- // the quote is unescaped if it is preceeded by an even
- // number of escape characters, including 0
- ret = ((nESC % 2) == 0);
- }
-
- return ret;
+ // attempt to invoke the method defined in LDAPUtil
+ // if not found, or some problem occurred, just fall through
+ // and use the default implementation of this method
+ if (DNUsesLDAPv2Quoting_meth != null) {
+ try {
+ return ((Boolean)DNUsesLDAPv2Quoting_meth.invoke(null, dn)).booleanValue();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ char ESC = '\\';
+ char Q = '"';
+ boolean ret = false;
+
+ // check dn for a even number (incl. 0) of ESC followed by Q
+ if (dn == null)
+ return ret;
+
+ int p = dn.indexOf(Q);
+ if (p >= 0)
+ {
+ int nESC = 0;
+ for (--p; (p >= 0) && (dn.charAt(p) == ESC); --p)
+ ++nESC;
+ // the quote is unescaped if it is preceeded by an even
+ // number of escape characters, including 0
+ ret = ((nESC % 2) == 0);
+ }
+
+ return ret;
}
static public void checkForLDAPv2Quoting(String dn, JFrame frame,
diff --git a/src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java b/src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java
index aff65a8..1d0193a 100644
--- a/src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java
+++ b/src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java
@@ -1492,6 +1492,18 @@ public class DSEntryPanel extends JPanel implements ActionListener,
typeWithValue = true;
break;
}
+ // note: current versions of the directory server
+ // use dn values as values of RDNs e.g.
+ // cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree, cn=config
+ // where dc\3Dexample\2Cdc\3Dcom is dc=example,dc=com
+ String unescval = DSUtil.unEscapeRDNVal(value);
+ if (DSUtil.isValidDN(unescval)) {
+ // compare as DNs
+ if (DSUtil.equalDNs(unescval, currentValue)) {
+ typeWithValue = true;
+ break;
+ }
+ }
}
if (typeWithValue) {
continue;
13 years, 12 months
console/src/com/netscape/management/client/ug ResourcePageObservable.java, 1.1.1.1, 1.2
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/console/src/com/netscape/management/client/ug
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv8170/src/com/netscape/management/client/ug
Modified Files:
ResourcePageObservable.java
Log Message:
Bug 586571 - DS Console shows escaped DNs
https://bugzilla.redhat.com/show_bug.cgi?id=586571
Resolves: bug 586571
Bug Description: DS Console shows escaped DNs
Reviewed by: nkinder (Thanks!)
Branch: HEAD
Fix Description: Was not working correctly in the property and advanced
editor for editing some DNs that contained other DNs as RDN values.
I also moved a lot of the DN handling code into the main console package
into the LDAPUtil class. This will allow the main console to handle DN
escapes as well. Unfortunately, if managing a new DS on a machine which
only has the old console framework, these methods will be missing.
So, use the new methods if available, otherwise, fallback on the DSUtil
implementation.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
Index: ResourcePageObservable.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/ug/ResourcePageObservable.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ResourcePageObservable.java 18 Jul 2005 00:34:24 -0000 1.1.1.1
+++ ResourcePageObservable.java 3 May 2010 20:37:56 -0000 1.2
@@ -24,7 +24,10 @@
import java.util.*;
import com.netscape.management.client.console.ConsoleInfo;
-import com.netscape.management.client.util.*;
+import com.netscape.management.client.util.Debug;
+import com.netscape.management.client.util.KingpinLDAPConnection;
+import com.netscape.management.client.util.LDAPUtil;
+import com.netscape.management.client.util.ResourceSet;
import netscape.ldap.*;
import netscape.ldap.util.*;
@@ -428,12 +431,15 @@
LDAPConnection ldapConnection = _info.getUserLDAPConnection();
try {
String DN = _entry.getDN();
+ String unescDN = LDAPUtil.unEscapeDN(DN);
+ boolean needesc = !unescDN.equals(DN);
String newRdnValue = get(_sIndexAttribute, 0);
if (newRdnValue == null || newRdnValue.trim().equals("")) {
_sIndexAttribute = "cn";
newRdnValue = get(_sIndexAttribute, 0);
- }
+ }
String newRDN = _sIndexAttribute + "=" + newRdnValue;
+ String newRDNEsc = _sIndexAttribute + "=" + LDAPUtil.escapeDNVal(newRdnValue);
//for a group there is no ou so we have to check
String[] rdns = LDAPDN.explodeDN(DN, false);
@@ -448,11 +454,18 @@
Debug.println(6, "ResourcePageObservable.save: RDN=" + RDN);
Debug.println(6, "ResourcePageObservable.save: newRDN=" + newRDN);
- if (DN.length() > 0 && (new RDN(newRDN)).equals(new RDN(RDN)) == false) {
+ Debug.println(6, "ResourcePageObservable.save: newRDNEsc=" + newRDNEsc);
+ if (DN.length() > 0 &&
+ ((new RDN(newRDN)).equals(new RDN(RDN)) == false) &&
+ ((new RDN(newRDNEsc)).equals(new RDN(RDN)) == false)) {
Debug.println("ResourcePageObservable.save: rename " + DN + " --> new rdn=" + newRDN);
ldapConnection.rename(DN, newRDN, true); // Cannot rename same RDN.
}
- sDN = newRDN + newBaseDN.toString();
+ if (needesc) {
+ sDN = newRDNEsc + newBaseDN.toString();
+ } else {
+ sDN = newRDN + newBaseDN.toString();
+ }
} else {
sDN = _entry.getDN();
}
13 years, 12 months
console/src/com/netscape/management/client/util LDAPUtil.java, 1.3, 1.4
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/console/src/com/netscape/management/client/util
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv8170/src/com/netscape/management/client/util
Modified Files:
LDAPUtil.java
Log Message:
Bug 586571 - DS Console shows escaped DNs
https://bugzilla.redhat.com/show_bug.cgi?id=586571
Resolves: bug 586571
Bug Description: DS Console shows escaped DNs
Reviewed by: nkinder (Thanks!)
Branch: HEAD
Fix Description: Was not working correctly in the property and advanced
editor for editing some DNs that contained other DNs as RDN values.
I also moved a lot of the DN handling code into the main console package
into the LDAPUtil class. This will allow the main console to handle DN
escapes as well. Unfortunately, if managing a new DS on a machine which
only has the old console framework, these methods will be missing.
So, use the new methods if available, otherwise, fallback on the DSUtil
implementation.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
Index: LDAPUtil.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/util/LDAPUtil.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LDAPUtil.java 12 Feb 2010 16:53:00 -0000 1.3
+++ LDAPUtil.java 3 May 2010 20:37:56 -0000 1.4
@@ -22,8 +22,11 @@
import java.util.*;
import java.text.*;
+
import netscape.ldap.*;
import netscape.ldap.util.DN;
+import netscape.ldap.util.RDN;
+
import com.netscape.management.client.console.*;
import com.netscape.management.client.util.UtilConsoleGlobals;
@@ -768,4 +771,253 @@
// DS ldbm database configuration root DN
final static String LDBM_PLUGIN_ROOT = "cn=ldbm database, cn=plugins, cn=config";
+
+ /**
+ * Check if the string is a valid dn
+ *
+ */
+ static public boolean isValidDN (String dn){
+ if (dn.equals (""))
+ return true;
+
+ if (!netscape.ldap.util.DN.isDN(dn))
+ return false;
+
+ int eq = dn.indexOf('=');
+
+ return (eq > 0 && eq < dn.length () -1 );
+ }
+
+ static public boolean equalDNs(String dn1, String dn2) {
+ boolean retVal = false;
+ if (isValidDN(dn1) && isValidDN(dn2)) {
+ retVal = equalDNs(new DN(dn1), new DN(dn2));
+ }
+ return retVal;
+ }
+
+ static public boolean equalDNs(DN dn1, DN dn2) {
+ boolean status = (dn1 == null || dn2 == null);
+ if (status) { // if at least one of the arguments is null
+ status = (dn1 == dn2); // true if both are null, false otherwise
+ return status; // short circuit
+ }
+
+ Vector thisRDNs = dn1.getRDNs();
+ Vector thatRDNs = dn2.getRDNs();
+ if (thisRDNs != null && thatRDNs != null &&
+ thisRDNs.size() == thatRDNs.size()) {
+ int ii;
+ for (ii = 0; ii < thisRDNs.size(); ++ii) {
+ RDN thisRDN = (RDN)thisRDNs.elementAt(ii);
+ RDN thatRDN = (RDN)thatRDNs.elementAt(ii);
+ if (!thisRDN.equals(thatRDN))
+ break;
+ }
+
+ // all RDNs were equal
+ if (ii == thisRDNs.size())
+ status = true;
+ }
+
+ return status;
+ }
+
+ /**
+ * Returns the RDN value after unescaping any escaped characters.
+ * Can be a simple escape - a \ followed by any character -
+ * this will just remove the \ and leave the character in the
+ * result unescaped.
+ * Can be a hex escape - a \ followed by two hex digits - the
+ * \ will be removed and the two hex digits converted to a single
+ * char in the string.
+ * Note that this is different than netscape.ldap.LDAPDN#unEscapeRDN(java.lang.String
+ * in that this function will handle hex escapes.
+ * If the rdn value is bogus or otherwise cannot be parsed correctly, the original
+ * rdn value will be returned, with escapes if it had them.
+ * <P>
+ *
+ * @param rdnval the RDN value to unescape
+ * @return the unescaped RDN value or the original RDN value if there were errors
+ * @see netscape.ldap.LDAPDN#escapeRDN(java.lang.String)
+ */
+ public static String unEscapeRDNVal(String rdnval) {
+ StringBuffer copy = new StringBuffer();
+ CharacterIterator it = new StringCharacterIterator(rdnval);
+ for (char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
+ if (ch == '\\') {
+ ch = it.next();
+ if (ch == CharacterIterator.DONE) {
+ // bogus - escape at end of string
+ return rdnval;
+ }
+ int val1 = Character.digit(ch, 16);
+ if ((val1 >= 0) && (val1 < 16)) {
+ val1 = val1 * 16;
+ ch = it.next();
+ if (ch == CharacterIterator.DONE) {
+ // bogus - escape followed by only 1 hex digit
+ return rdnval;
+ }
+ int val2 = Character.digit(ch, 16);
+ if ((val2 < 0) || (val2 > 15)) {
+ return rdnval;
+ }
+ // must be a two digit hex code if we got here
+ ch = (char)(val1 + val2);
+ }
+ }
+ copy.append(ch);
+ }
+ return copy.toString();
+ }
+
+ /**
+ * Returns the RDN after unescaping any escaped characters.
+ * Can be a simple escape - a \ followed by any character -
+ * this will just remove the \ and leave the character in the
+ * result unescaped.
+ * Can be a hex escape - a \ followed by two hex digits - the
+ * \ will be removed and the two hex digits converted to a single
+ * char in the string.
+ * Note that this is different than netscape.ldap.LDAPDN#unEscapeRDN(java.lang.String
+ * in that this function will handle hex escapes.
+ * If the rdn is bogus or otherwise cannot be parsed correctly, the original
+ * rdn value will be returned, with escapes if it had them.
+ * <P>
+ *
+ * @param rdn the RDN to unescape
+ * @return the unescaped RDN or the original RDN if there were errors
+ * @see netscape.ldap.LDAPDN#escapeRDN(java.lang.String)
+ */
+ public static String unEscapeRDN(String rdn) {
+ RDN name = new RDN(rdn);
+ String[] vals = name.getValues();
+ if ( (vals == null) || (vals.length < 1) ) {
+ return rdn;
+ }
+ String[] types = name.getTypes();
+
+ StringBuffer rdnbuf = new StringBuffer();
+ for (int ii = 0; ii < vals.length; ++ii) {
+ if (rdnbuf.length() > 0) {
+ rdnbuf.append("+");
+ }
+ rdnbuf.append(types[ii] + "=" + unEscapeRDNVal(vals[ii]));
+ }
+
+ return rdnbuf.toString();
+ }
+
+ /**
+ * Returns the DN after unescaping any escaped characters.
+ * Can be a simple escape - a \ followed by any character -
+ * this will just remove the \ and leave the character in the
+ * result unescaped.
+ * Can be a hex escape - a \ followed by two hex digits - the
+ * \ will be removed and the two hex digits converted to a single
+ * char in the string.
+ * If the dn is bogus or otherwise cannot be parsed correctly, the original
+ * dn value will be returned, with escapes if it had them.
+ * <P>
+ *
+ * @param dn the DN to unescape
+ * @return the unescaped DN or the original DN if there were errors
+ */
+ public static String unEscapeDN(String dn) {
+ if ((dn == null) || (dn.equals(""))) {
+ return dn;
+ }
+ String[] rdns = LDAPDN.explodeDN(dn, false);
+ if ((rdns == null) || (rdns.length < 1)) {
+ return dn;
+ }
+ StringBuffer retdn = new StringBuffer();
+ for (int ii = 0; ii < rdns.length; ++ii) {
+ if (retdn.length() > 0) {
+ retdn.append(",");
+ }
+ retdn.append(unEscapeRDN(rdns[ii]));
+ }
+
+ return retdn.toString();
+ }
+
+ public static boolean[] DN_ESCAPE_CHARS = null;
+ static {
+ // get max val of DN.ESCAPED_CHAR
+ char maxval = 0;
+ for (char ii = 0; ii < DN.ESCAPED_CHAR.length; ++ii) {
+ if (maxval < DN.ESCAPED_CHAR[ii]) {
+ maxval = DN.ESCAPED_CHAR[ii];
+ }
+ }
+ // add the '='
+ if (maxval < '=') {
+ maxval = '=';
+ }
+ // create an array large enough to hold spaces
+ // for all values up to maxval
+ DN_ESCAPE_CHARS = new boolean[maxval+1];
+ // set default value to false
+ for (char ii = 0; ii < (int)maxval; ++ii) {
+ DN_ESCAPE_CHARS[ii] = false;
+ }
+ // set escape char vals to true
+ for (char ii = 0; ii < DN.ESCAPED_CHAR.length; ++ii) {
+ DN_ESCAPE_CHARS[DN.ESCAPED_CHAR[ii]] = true;
+ }
+ // add the equals sign
+ DN_ESCAPE_CHARS['='] = true;
+ }
+ /**
+ * Escape the given DN string value for use as an RDN value. Uses
+ * the \XX hex escapes.
+ * @param dnval value to escape for use as an RDN value
+ * @return the escaped string
+ */
+ public static String escapeDNVal(String dnval) {
+ StringBuffer copy = new StringBuffer();
+ CharacterIterator it = new StringCharacterIterator(dnval);
+ for (char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
+ if ((ch > 0) && (ch < DN_ESCAPE_CHARS.length) && DN_ESCAPE_CHARS[ch]) {
+ copy.append('\\');
+ copy.append(Integer.toHexString((int)ch).toUpperCase());
+ } else {
+ copy.append(ch);
+ }
+ }
+ return copy.toString();
+ }
+
+ /**
+ * This function was stolen from dsalib_dn.c. It checks the string
+ * for LDAPv2 style quoting e.g. o="foo, bar", c=US, a format which
+ * is now deprecated.
+ *
+ * @param dn The DN to scan
+ * @return true if the given string contains LDAPv2 style quoting
+ */
+ static public boolean DNUsesLDAPv2Quoting(String dn) {
+ char ESC = '\\';
+ char Q = '"';
+ boolean ret = false;
+
+ // check dn for a even number (incl. 0) of ESC followed by Q
+ if (dn == null)
+ return ret;
+
+ int p = dn.indexOf(Q);
+ if (p >= 0)
+ {
+ int nESC = 0;
+ for (--p; (p >= 0) && (dn.charAt(p) == ESC); --p)
+ ++nESC;
+ // the quote is unescaped if it is preceded by an even
+ // number of escape characters, including 0
+ ret = ((nESC % 2) == 0);
+ }
+
+ return ret;
+ }
}
13 years, 12 months