summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2008-07-14 23:16:47 +0000
committerRich Megginson <rmeggins@redhat.com>2008-07-14 23:16:47 +0000
commit023a1e62b5892578e2d7173fefa38d5de28cbe0b (patch)
treee749841051e0dc871dc208b3fbef89f77031fdef
parent02408829027b18328a2ee3001129a1db978099f6 (diff)
downloadds-023a1e62b5892578e2d7173fefa38d5de28cbe0b.tar.gz
ds-023a1e62b5892578e2d7173fefa38d5de28cbe0b.tar.xz
ds-023a1e62b5892578e2d7173fefa38d5de28cbe0b.zip
Resolves: bug 435774
Bug Description: Unhandled error during setup: Could not import LDIF file Reviewed by: nkinder (Thanks!) Branch: HEAD Fix Description: This doesn't allow you to re-prompt for the file, but this will at least cause setup to output a sensible error message if it detects that the given LDIF file is not readable. Platforms tested: Fedora 8, Fedora 9 Flag Day: no Doc impact: no
-rw-r--r--ldap/admin/src/scripts/DSCreate.pm.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in
index e57dc3d0..45d5329c 100644
--- a/ldap/admin/src/scripts/DSCreate.pm.in
+++ b/ldap/admin/src/scripts/DSCreate.pm.in
@@ -467,8 +467,11 @@ sub initDatabase {
if ($ldiffile =~ /none/i) {
debug(1, "No ldif file or org entries specified - no initial database will be created\n");
return ();
- } elsif ($ldiffile && -f $ldiffile) {
+ } elsif ($ldiffile && ($ldiffile !~ /suggest/i)) {
debug(1, "Loading initial ldif file $ldiffile\n");
+ if (! -r $ldiffile) {
+ return ('error_opening_init_ldif', $ldiffile);
+ }
} elsif (($inf->{slapd}->{Suffix} =~ /^(.*?)=/) && $suffixTable{$1}) {
my @errs;
my $template = $inf->{General}->{prefix} . $suffixTable{$1};