فهرست منبع

Resolves: bug 237356
Description: Move DS Admin Code into Admin Server
Fix Description: The Resource class needs to support more than 1 resource file e.g. for ds-base and ds-admin.
The property dir should be under $datadir. Property files are data files, not really config files.
Added a shared_lib_suffix token
Fixed some wording errors in the resource file.
Platforms tested: RHEL4
Flag Day: no
Doc impact: No new doc impact from previous commits for this bug.

Rich Megginson 18 سال پیش
والد
کامیت
d9b8787008
6فایلهای تغییر یافته به همراه50 افزوده شده و 33 حذف شده
  1. 7 3
      Makefile.am
  2. 6 3
      Makefile.in
  3. 7 3
      configure
  4. 5 2
      configure.ac
  5. 23 20
      ldap/admin/src/scripts/Resource.pm
  6. 2 2
      ldap/admin/src/scripts/setup-ds.res.in

+ 7 - 3
Makefile.am

@@ -67,7 +67,7 @@ dberrstrs.h: Makefile
 #------------------------
 configdir = $(sysconfdir)@configdir@
 sampledatadir = $(datadir)@sampledatadir@
-propertydir = $(sysconfdir)@propertydir@
+propertydir = $(datadir)@propertydir@
 schemadir = $(sysconfdir)@schemadir@
 serverdir = $(libdir)@serverdir@
 serverplugindir = $(libdir)@serverplugindir@
@@ -76,6 +76,8 @@ initdir = $(sysconfdir)@initdir@
 instconfigdir = @instconfigdir@
 perldir = $(libdir)@perldir@
 
+shared_lib_suffix = @shared_lib_suffix@
+
 #------------------------
 # Build Products
 #------------------------
@@ -1016,7 +1018,8 @@ fixupcmd = sed \
 	-e 's,@brand\@,$(brand),g' \
 	-e 's,@capbrand\@,$(capbrand),g' \
 	-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
-	-e 's,@perldir\@,$(perldir),g'
+	-e 's,@perldir\@,$(perldir),g' \
+	-e 's,@shared_lib_suffix\@,$(shared_lib_suffix),g'
 else
 fixupcmd = sed \
 	-e 's,@bindir\@,$(bindir),g' \
@@ -1046,7 +1049,8 @@ fixupcmd = sed \
 	-e 's,@brand\@,$(brand),g' \
 	-e 's,@capbrand\@,$(capbrand),g' \
 	-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
-	-e 's,@perldir\@,$(perldir),g'
+	-e 's,@perldir\@,$(perldir),g' \
+	-e 's,@shared_lib_suffix\@,$(shared_lib_suffix),g'
 endif
 
 %: %.in

+ 6 - 3
Makefile.in

@@ -962,7 +962,7 @@ oldincludedir = @oldincludedir@
 perldir = $(libdir)@perldir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
-propertydir = $(sysconfdir)@propertydir@
+propertydir = $(datadir)@propertydir@
 sampledatadir = $(datadir)@sampledatadir@
 sasl_inc = @sasl_inc@
 sasl_lib = @sasl_lib@
@@ -972,6 +972,7 @@ schemadir = $(sysconfdir)@schemadir@
 scripttemplatedir = @scripttemplatedir@
 serverdir = $(libdir)@serverdir@
 serverplugindir = $(libdir)@serverplugindir@
+shared_lib_suffix = @shared_lib_suffix@
 sharedstatedir = @sharedstatedir@
 svrcore_inc = @svrcore_inc@
 svrcore_lib = @svrcore_lib@
@@ -1909,7 +1910,8 @@ rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBS
 @BUNDLE_FALSE@	-e 's,@brand\@,$(brand),g' \
 @BUNDLE_FALSE@	-e 's,@capbrand\@,$(capbrand),g' \
 @BUNDLE_FALSE@	-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
-@BUNDLE_FALSE@	-e 's,@perldir\@,$(perldir),g'
+@BUNDLE_FALSE@	-e 's,@perldir\@,$(perldir),g' \
+@BUNDLE_FALSE@	-e 's,@shared_lib_suffix\@,$(shared_lib_suffix),g'
 
 
 # these are for the config files and scripts that we need to generate and replace
@@ -1946,7 +1948,8 @@ rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBS
 @BUNDLE_TRUE@	-e 's,@brand\@,$(brand),g' \
 @BUNDLE_TRUE@	-e 's,@capbrand\@,$(capbrand),g' \
 @BUNDLE_TRUE@	-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
-@BUNDLE_TRUE@	-e 's,@perldir\@,$(perldir),g'
+@BUNDLE_TRUE@	-e 's,@perldir\@,$(perldir),g' \
+@BUNDLE_TRUE@	-e 's,@shared_lib_suffix\@,$(shared_lib_suffix),g'
 
 all: $(BUILT_SOURCES) config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am

+ 7 - 3
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 SED EGREP LN_S ECHO AR ac_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_bitwise_TRUE enable_bitwise_FALSE configdir sampledatadir propertydir schemadir serverdir serverplugindir scripttemplatedir perldir instconfigdir WINNT_TRUE WINNT_FALSE LIBSOCKET LIBNSL LIBDL LIBCSTD LIBCRUN initdir HPUX_TRUE HPUX_FALSE SOLARIS_TRUE SOLARIS_FALSE PKG_CONFIG ICU_CONFIG NETSNMP_CONFIG nspr_inc nspr_lib nspr_libdir nss_inc nss_lib nss_libdir ldapsdk_inc ldapsdk_lib ldapsdk_libdir ldapsdk_bindir db_inc db_incdir db_lib db_libdir db_bindir db_libver sasl_inc sasl_lib sasl_libdir svrcore_inc svrcore_lib icu_lib icu_inc icu_bin netsnmp_inc netsnmp_lib netsnmp_libdir netsnmp_link 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 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 SED EGREP LN_S ECHO AR ac_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_bitwise_TRUE enable_bitwise_FALSE configdir sampledatadir propertydir schemadir serverdir serverplugindir scripttemplatedir perldir instconfigdir WINNT_TRUE WINNT_FALSE LIBSOCKET LIBNSL LIBDL LIBCSTD LIBCRUN initdir shared_lib_suffix HPUX_TRUE HPUX_FALSE SOLARIS_TRUE SOLARIS_FALSE PKG_CONFIG ICU_CONFIG NETSNMP_CONFIG nspr_inc nspr_lib nspr_libdir nss_inc nss_lib nss_libdir ldapsdk_inc ldapsdk_lib ldapsdk_libdir ldapsdk_bindir db_inc db_incdir db_lib db_libdir db_bindir db_libver sasl_inc sasl_lib sasl_libdir svrcore_inc svrcore_lib icu_lib icu_inc icu_bin netsnmp_inc netsnmp_lib netsnmp_libdir netsnmp_link brand capbrand vendor LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -23177,8 +23177,8 @@ fi
 # Shared paths for all layouts
 # relative to sysconfdir
 configdir=/$PACKAGE_NAME/config
-# relative to sysconfdir
-propertydir=/$PACKAGE_NAME/property
+# location of property/resource files, relative to datadir
+propertydir=/$PACKAGE_NAME/properties
 # relative to sysconfdir
 schemadir=/$PACKAGE_NAME/schema
 # relative to libdir
@@ -23228,6 +23228,7 @@ else
 fi
 
 
+shared_lib_suffix=.so
 # Deal with platform dependent defines
 # relative to sysconfdir
 initdir=/rc.d
@@ -23361,6 +23362,7 @@ cat >>confdefs.h <<\_ACEOF
 #define _HPUX_SOURCE 1
 _ACEOF
 
+    shared_lib_suffix=.sl
     platform="hpux"
     ;;
   sparc-sun-solaris*)
@@ -23446,6 +23448,7 @@ esac
 
 
 
+
 if test "$platform" = "hpux"; then
   HPUX_TRUE=
   HPUX_FALSE='#'
@@ -25999,6 +26002,7 @@ s,@LIBDL@,$LIBDL,;t t
 s,@LIBCSTD@,$LIBCSTD,;t t
 s,@LIBCRUN@,$LIBCRUN,;t t
 s,@initdir@,$initdir,;t t
+s,@shared_lib_suffix@,$shared_lib_suffix,;t t
 s,@HPUX_TRUE@,$HPUX_TRUE,;t t
 s,@HPUX_FALSE@,$HPUX_FALSE,;t t
 s,@SOLARIS_TRUE@,$SOLARIS_TRUE,;t t

+ 5 - 2
configure.ac

@@ -186,8 +186,8 @@ fi
 # Shared paths for all layouts
 # relative to sysconfdir
 configdir=/$PACKAGE_NAME/config
-# relative to sysconfdir
-propertydir=/$PACKAGE_NAME/property
+# location of property/resource files, relative to datadir
+propertydir=/$PACKAGE_NAME/properties
 # relative to sysconfdir
 schemadir=/$PACKAGE_NAME/schema
 # relative to libdir
@@ -223,6 +223,7 @@ AC_SUBST(instconfigdir)
 # cygnus, mingw, or the like and using cmd.exe as the shell
 AM_CONDITIONAL([WINNT], false)
 
+shared_lib_suffix=.so
 # Deal with platform dependent defines
 # relative to sysconfdir
 initdir=/rc.d
@@ -260,6 +261,7 @@ case $host in
     AC_DEFINE([OS_hpux], [1], [OS HP-UX])
     AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
     AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
+    shared_lib_suffix=.sl
     platform="hpux"
     ;;
   sparc-sun-solaris*)
@@ -295,6 +297,7 @@ dnl Cstd and Crun are required to link any C++ related code
     ;;
 esac
 AC_SUBST(initdir)
+AC_SUBST(shared_lib_suffix)
 
 AM_CONDITIONAL(HPUX,test "$platform" = "hpux")
 AM_CONDITIONAL(SOLARIS,test "$platform" = "solaris")

+ 23 - 20
ldap/admin/src/scripts/Resource.pm

@@ -51,41 +51,44 @@ sub new {
     my $type = shift;
     my $self = {};
 
-    $self->{filename} = shift;
+    while (@_) {
+        push @{$self->{filenames}}, shift;
+    }
 
     $self = bless $self, $type;
 
-    if ($self->{filename}) {
+    if (@{$self->{filenames}}) {
         $self->read();
     }
 
     return $self;
 }
 
+# the resource files are read in order given.  Definitions from
+# later files override the same definitions in earlier files.
 sub read {
     my $self = shift;
-    my $filename = shift;
 
-    if ($filename) {
-        $self->{filename} = $filename;
-    } else {
-        $filename = $self->{filename};
+    while (@_) {
+        push @{$self->{filenames}}, shift;
     }
 
-    open RES, $filename or die "Error: could not open resource file $filename: $!";
-    while (<RES>) {
-        next if (/^\s*$/); # skip blank lines
-        next if (/^\s*\#/); # skip comment lines
-        # read name = value pairs like this
-        # bol whitespace* name whitespace* '=' whitespace* value eol
-        # the value will include any trailing whitespace
-        if (/^\s*(.*?)\s*=\s*(.*?)$/) {
-            $self->{res}->{$1} = $2;
-            # replace \n with real newline
-            $self->{res}->{$1} =~ s/\\n/\n/g;
+    for my $filename (@{$self->{filenames}}) {
+        open RES, $filename or die "Error: could not open resource file $filename: $!";
+        while (<RES>) {
+            next if (/^\s*$/); # skip blank lines
+            next if (/^\s*\#/); # skip comment lines
+            # read name = value pairs like this
+            # bol whitespace* name whitespace* '=' whitespace* value eol
+            # the value will include any trailing whitespace
+            if (/^\s*(.*?)\s*=\s*(.*?)$/) {
+                $self->{res}->{$1} = $2;
+                # replace \n with real newline
+                $self->{res}->{$1} =~ s/\\n/\n/g;
+            }
         }
-	}
-    close RES;
+        close RES;
+    }
 }
 
 # given a resource key and optional args, return the value

+ 2 - 2
ldap/admin/src/scripts/setup-ds.res.in

@@ -34,12 +34,12 @@ dialog_hostname_prompt = Computer name
 dialog_hostname_warning = The hostname %s does not look like a\nfully qualified host and domain name.\nIf you feel you have made a mistake,\nplease go back to this dialog and enter another name.\n\n
 
 # ----------- SSUser Dialog Resource  ----------------
-dialog_ssuser_text = The server must run as a specific user in a specific group.\nIt is strongly recommended that this user should have no privileges\non the computer (i.e. a non-root user).  The Administration Server\nwill give this user/group some permissions in specific paths/files\nto perform server-specific operations.\n\nIf you have not yet created a user and group for the server,\ncreate this user and group using your native operating\nsystem utilities.\n\n
+dialog_ssuser_text = The server must run as a specific user in a specific group.\nIt is strongly recommended that this user should have no privileges\non the computer (i.e. a non-root user).  The setup procedure\nwill give this user/group some permissions in specific paths/files\nto perform server-specific operations.\n\nIf you have not yet created a user and group for the server,\ncreate this user and group using your native operating\nsystem utilities.\n\n
 
 dialog_ssuser_prompt = System User
 dialog_ssuser_error = The user '%s' is invalid.\n\n
 dialog_ssuser_must_be_same = Since you are not running setup as root, the System User must be the same as your userid '%s'.\n\n
-dialog_ssuser_root_warning = You are strongly discouraged to use a non-root user for the server uid.\nIf you feel you have made a mistake,\nplease go back to this dialog and enter another system user.\n\n
+dialog_ssuser_root_warning = You are strongly encouraged to use a non-root user for the server uid.\nIf you feel you have made a mistake,\nplease go back to this dialog and enter another system user.\n\n
 dialog_ssgroup_prompt = System Group
 dialog_ssgroup_error = The group '%s' is invalid.\n\n
 dialog_ssgroup_no_match = The system user '%s' does not belong to the group '%s'.\n\nThis is the list of users of the given group: %s\n\n