[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts Resource.pm, 1.1, 1.2 setup-ds.res.in, 1.1, 1.2

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Fri Jun 8 20:36:55 UTC 2007


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25137/ldapserver/ldap/admin/src/scripts

Modified Files:
	Resource.pm setup-ds.res.in 
Log Message:
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.



Index: Resource.pm
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/Resource.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Resource.pm	8 Jun 2007 01:09:16 -0000	1.1
+++ Resource.pm	8 Jun 2007 20:36:53 -0000	1.2
@@ -51,41 +51,44 @@
     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};
-    }
-
-    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;
+    while (@_) {
+        push @{$self->{filenames}}, shift;
+    }
+
+    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


Index: setup-ds.res.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/setup-ds.res.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- setup-ds.res.in	8 Jun 2007 01:09:16 -0000	1.1
+++ setup-ds.res.in	8 Jun 2007 20:36:53 -0000	1.2
@@ -34,12 +34,12 @@
 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




More information about the Fedora-directory-commits mailing list