diff options
| author | Rich Megginson <rmeggins@redhat.com> | 2007-06-08 20:36:53 +0000 |
|---|---|---|
| committer | Rich Megginson <rmeggins@redhat.com> | 2007-06-08 20:36:53 +0000 |
| commit | d9b8787008e72e696b2b92f20e18b4c3f5f0a38c (patch) | |
| tree | 3fc399b0047f15c994515c4a5e3470512f747c25 /ldap/admin/src | |
| parent | 7f686305a98a4289f4ebb3f62441523950352280 (diff) | |
| download | ds-d9b8787008e72e696b2b92f20e18b4c3f5f0a38c.tar.gz ds-d9b8787008e72e696b2b92f20e18b4c3f5f0a38c.tar.xz ds-d9b8787008e72e696b2b92f20e18b4c3f5f0a38c.zip | |
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.
Diffstat (limited to 'ldap/admin/src')
| -rw-r--r-- | ldap/admin/src/scripts/Resource.pm | 43 | ||||
| -rw-r--r-- | ldap/admin/src/scripts/setup-ds.res.in | 4 |
2 files changed, 25 insertions, 22 deletions
diff --git a/ldap/admin/src/scripts/Resource.pm b/ldap/admin/src/scripts/Resource.pm index ba4ca83f..a8cb62a5 100644 --- a/ldap/admin/src/scripts/Resource.pm +++ b/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 diff --git a/ldap/admin/src/scripts/setup-ds.res.in b/ldap/admin/src/scripts/setup-ds.res.in index 246ecbdc..600b3ac3 100644 --- a/ldap/admin/src/scripts/setup-ds.res.in +++ b/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 |
