Package: 389-ds-base / 1.4.0.21-1

perl-use-move-instead-of-rename.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--- a/ldap/admin/src/scripts/60upgradeconfigfiles.pl
+++ b/ldap/admin/src/scripts/60upgradeconfigfiles.pl
@@ -31,7 +31,7 @@ sub runinst {
         next if (! -f $oldname); # does not exist - skip - already (re)moved
         my $newname = "$bakdir/$file";
         $! = 0; # clear
-        rename $oldname, $newname;
+        copy $oldname, $newname;
         if ($!) {
             push @errs, ["error_renaming_config", $oldname, $newname, $!];
         }
@@ -57,7 +57,7 @@ sub runinst {
             next if (! -f $oldname); # does not exist - not backed up
             my $newname = $inf->{slapd}->{config_dir} . "/" . $file;
             next if (-f $newname); # not removed
-            rename $oldname, $newname;
+            move $oldname, $newname;
         }
         return @errs;
     }
--- a/ldap/admin/src/scripts/60upgradeschemafiles.pl
+++ b/ldap/admin/src/scripts/60upgradeschemafiles.pl
@@ -1,4 +1,4 @@
-
+use File::Copy;
 use Mozilla::LDAP::LDIF;
 use DSCreate qw(installSchema);
 
@@ -39,7 +39,7 @@ sub runinst {
         next if (! -f $oldname); # does not exist - skip - already (re)moved
         my $newname = "$bakdir/$file";
         $! = 0; # clear
-        rename $oldname, $newname;
+        copy $oldname, $newname;
         if ($!) {
             push @errs, ["error_renaming_schema", $oldname, $newname, $!];
         }
@@ -140,7 +140,7 @@ sub runinst {
 
     # Backup the original 99user.ldif
     $! = 0; # clear
-    rename $inf->{slapd}->{schema_dir} . "/99user.ldif", "$bakdir/99user.ldif";
+    copy $inf->{slapd}->{schema_dir} . "/99user.ldif", "$bakdir/99user.ldif";
     if ($!) {
         push @errs, ["error_renaming_schema", $inf->{slapd}->{schema_dir} . "/99user.ldif", "$bakdir/99user.ldif", $!];
     }
@@ -171,13 +171,13 @@ sub runinst {
             next if (! -f $oldname); # does not exist - not backed up
             my $newname = $inf->{slapd}->{schema_dir} . "/" . $file;
             next if (-f $newname); # not removed
-            rename $oldname, $newname;
+            move $oldname, $newname;
         }
 
         # Restore 99user.ldif. We overwrite whatever is there since
         # it is possible that we have modified it.
         if (-f "$bakdir/99user.ldif") {
-                rename "$bakdir/99user.ldif", $inf->{slapd}->{schema_dir} . "/99user.ldif";
+                move "$bakdir/99user.ldif", $inf->{slapd}->{schema_dir} . "/99user.ldif";
         }
 
         return @errs;