Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 189321 Details for
Bug 281631
Pass in schema and config LDIF files to setup
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
diffs
cvsdiffs (text/plain), 6.59 KB, created by
Rich Megginson
on 2007-09-06 23:01:16 UTC
(
hide
)
Description:
diffs
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2007-09-06 23:01:16 UTC
Size:
6.59 KB
patch
obsolete
>Index: ldapserver/ldap/admin/src/scripts/DSCreate.pm.in >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/DSCreate.pm.in,v >retrieving revision 1.5 >diff -u -8 -r1.5 DSCreate.pm.in >--- ldapserver/ldap/admin/src/scripts/DSCreate.pm.in 7 Aug 2007 23:28:03 -0000 1.5 >+++ ldapserver/ldap/admin/src/scripts/DSCreate.pm.in 6 Sep 2007 22:57:54 -0000 >@@ -301,16 +301,25 @@ > } > if ("@enable_bitwise@") { > push @ldiffiles, "$inf->{General}->{prefix}@templatedir@/template-bitwise.ldif"; > } > if ("@enable_dna@") { > push @ldiffiles, "$inf->{General}->{prefix}@templatedir@/template-dnaplugin.ldif"; > } > >+ # additional configuration LDIF files >+ if (exists($inf->{slapd}->{ConfigFile})) { >+ if (ref($inf->{slapd}->{ConfigFile})) { >+ push @ldiffiles, @{$inf->{slapd}->{ConfigFile}}; >+ } else { >+ push @ldiffiles, $inf->{slapd}->{ConfigFile}; >+ } >+ } >+ > getMappedEntries($mapper, \@ldiffiles, \@errs, \&check_and_add_entry, > [$conn]); > > if (@errs) { > $conn->close(); > return @errs; > } > >@@ -402,16 +411,25 @@ > my @errs; > my @schemafiles = (); > if (!defined($inf->{slapd}->{install_full_schema}) or > $inf->{slapd}->{install_full_schema}) { > push @schemafiles, glob("$inf->{General}->{prefix}@schemadir@/*"); > } else { > push @schemafiles, "$inf->{General}->{prefix}@schemadir@/00core.ldif"; > } >+ >+ # additional schema files >+ if (exists($inf->{slapd}->{SchemaFile})) { >+ if (ref($inf->{slapd}->{SchemaFile})) { >+ push @schemafiles, @{$inf->{slapd}->{SchemaFile}}; >+ } else { >+ push @schemafiles, $inf->{slapd}->{SchemaFile}; >+ } >+ } > for (@schemafiles) { > my $src = $_; > my $basename = basename($src); > my $dest = "$inf->{slapd}->{schema_dir}/$basename"; > $! = 0; # clear errno > copy($src, $dest); > if ($!) { > return ('error_copying_file', $src, $dest, $!); >Index: ldapserver/ldap/admin/src/scripts/Inf.pm >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/Inf.pm,v >retrieving revision 1.4 >diff -u -8 -r1.4 Inf.pm >--- ldapserver/ldap/admin/src/scripts/Inf.pm 13 Jul 2007 19:51:48 -0000 1.4 >+++ ldapserver/ldap/admin/src/scripts/Inf.pm 6 Sep 2007 22:57:54 -0000 >@@ -72,16 +72,17 @@ > if ($filename) { > $self->{filename} = $filename; > } else { > $filename = $self->{filename}; > } > > my $incontinuation = 0; > my $curkey; >+ my $curval; > my $inffh; > if ($filename eq "-") { > $inffh = \*STDIN; > } else { > open INF, $filename or die "Error: could not open inf file $filename: $!"; > $inffh = \*INF; > } > while (<$inffh>) { >@@ -95,22 +96,42 @@ > $incontinuation = 0; > next; > } > if (/\\$/) { # line ends in \ - continued on next line > chop; > $iscontinuation = 1; > } > if ($incontinuation) { >- $self->{$curSection}->{$curkey} .= "\n" . $_; # add line in entirety to current value >+ if ($curval) { >+ $self->{$curSection}->{$curkey}->[$curval] .= "\n" . $_; # add line in entirety to current value >+ } else { >+ $self->{$curSection}->{$curkey} .= "\n" . $_; # add line in entirety to current value >+ } > } elsif (/^\[(.*?)\]/) { # e.g. [General] > $curSection = $1; >+ $iscontinuation = 0; # disallow section continuations > } elsif (/^\s*(.*?)\s*=\s*(.*?)\s*$/) { # key = value > $curkey = $1; >- $self->{$curSection}->{$curkey} = $2; >+ # a single value is just a single scalar >+ # multiple values are represented by an array ref >+ if (exists($self->{$curSection}->{$curkey})) { >+ if (!ref($self->{$curSection}->{$curkey})) { >+ # convert single scalar to array ref >+ my $ary = [$self->{$curSection}->{$curkey}]; >+ $self->{$curSection}->{$curkey} = $ary; >+ } >+ # just push the new value >+ push @{$self->{$curSection}->{$curkey}}, $2; >+ $curval = @{$self->{$curSection}->{$curkey}} - 1; # curval is index of last item >+ } else { >+ # single value >+ $self->{$curSection}->{$curkey} = $2; >+ $curval = 0; # only 1 value >+ } > } > if ($iscontinuation) { # if line ends with a backslash, continue the data on the next line > $incontinuation = 1; > } else { > $incontinuation = 0; > } > } > if ($inffh ne \*STDIN) { >Index: ldapserver/ldap/admin/src/scripts/Setup.pm.in >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/Setup.pm.in,v >retrieving revision 1.9 >diff -u -8 -r1.9 Setup.pm.in >--- ldapserver/ldap/admin/src/scripts/Setup.pm.in 18 Jul 2007 20:37:11 -0000 1.9 >+++ ldapserver/ldap/admin/src/scripts/Setup.pm.in 6 Sep 2007 22:57:54 -0000 >@@ -156,17 +156,33 @@ > DIR => File::Spec->tmpdir); > $self->{inf}->{filename} = $self->{inffile}; > > # see if user passed in default inf values - also, command line > # arguments override those passed in via an inf file - this > # allows the reuse of .inf files with some parameters overridden > for (@ARGV) { > if (/^([\w_-]+)\.([\w_-]+)=(.*)$/) { # e.g. section.param=value >- $self->{inf}->{$1}->{$2} = $3; >+ my $sec = $1; >+ my $parm = $2; >+ my $val = $3; >+ # a single value is just a single scalar >+ # multiple values are represented by an array ref >+ if (exists($self->{inf}->{$sec}->{$parm})) { >+ if (!ref($self->{inf}->{$sec}->{$parm})) { >+ # convert single scalar to array ref >+ my $ary = [$self->{inf}->{$sec}->{$parm}]; >+ $self->{inf}->{$sec}->{$parm} = $ary; >+ } >+ # just push the new value >+ push @{$self->{inf}->{$sec}->{$parm}}, $val; >+ } else { >+ # single value >+ $self->{inf}->{$sec}->{$parm} = $val; >+ } > } else { # error > print STDERR "Error: unknown command line option $_\n"; > usage(); > exit 1; > } > } > > # this is the base config directory - the directory containing
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 281631
: 189321 |
190001