From cfbe748bcf3d2e2a2903737ff3834bad05c96998 Mon Sep 17 00:00:00 2001 From: Nathan Kinder Date: Wed, 16 Jan 2013 14:20:14 -0800 Subject: [PATCH] Ticket 556 - Don't overwrite certmap.conf during upgrade The certmap.conf config files were being overwritten with the default template during upgrade. We need to skip writing the certmap.conf files if they already exist so config changes are not lost. (cherry picked from commit e63ad6840e4a9a62f3ffae27eaba1091653a1c50) --- ldap/admin/src/scripts/DSCreate.pm.in | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in index 1d5e71a..0acd74f 100644 --- a/ldap/admin/src/scripts/DSCreate.pm.in +++ b/ldap/admin/src/scripts/DSCreate.pm.in @@ -482,12 +482,16 @@ sub makeOtherConfigFiles { my $src = "$inf->{General}->{prefix}@configdir@/certmap.conf"; my $dest = "$inf->{slapd}->{config_dir}/certmap.conf"; $! = 0; # clear errno - copy($src, $dest); - if ($!) { - return ('error_copying_file', $src, $dest, $!); - } - if (@errs = changeOwnerMode($inf, 4, $dest)) { - return @errs; + + #in skip mode, skip files that already exist + unless ($skip and -f $dest) { + copy($src, $dest); + if ($!) { + return ('error_copying_file', $src, $dest, $!); + } + if (@errs = changeOwnerMode($inf, 4, $dest)) { + return @errs; + } } $src = "$inf->{General}->{prefix}@configdir@/slapd-collations.conf"; -- 1.7.7.6