projects/perl-Satcon/bin/satcon-deploy-tree.pl | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
New commits:
commit 562438e14066ff3bb86db22ce1574783aa73fa85
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Apr 21 12:06:46 2011 +0200
When creating the backup directory, do not leave them open for other, just owner and
group should be enough.
diff --git a/projects/perl-Satcon/bin/satcon-deploy-tree.pl
b/projects/perl-Satcon/bin/satcon-deploy-tree.pl
index 1e440c2..8e2207f 100755
--- a/projects/perl-Satcon/bin/satcon-deploy-tree.pl
+++ b/projects/perl-Satcon/bin/satcon-deploy-tree.pl
@@ -49,7 +49,7 @@ my $engine = new Satcon $open, $close;
$engine->load_conf_file($conf_file);
if ($backupdir){
- mkdir $backupdir;
+ mkdir $backupdir, 0770;
}
find( { no_chdir => 1, wanted => sub { process_file($engine, $sourcedir, $destdir)
} }, $sourcedir);
@@ -70,9 +70,9 @@ sub process_file {
if (-d "$sourcedir/$relative_path") {
if (-d "$destdir/$relative_path" && $backupdir) {
- mkdir "$backupdir/$destdir/$relative_path";
+ mkdir "$backupdir/$destdir/$relative_path", 0770;
} else {
- mkdir "$destdir/$relative_path";
+ mkdir "$destdir/$relative_path", 0770;
}
}
else {
commit b00b04a35f96b39fc0874b1b5ab1c363cfbb60b1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Apr 21 12:05:42 2011 +0200
Use cp -p instead of File::Copy::copy to preserve the access rights.
diff --git a/projects/perl-Satcon/bin/satcon-deploy-tree.pl
b/projects/perl-Satcon/bin/satcon-deploy-tree.pl
index 7f50673..1e440c2 100755
--- a/projects/perl-Satcon/bin/satcon-deploy-tree.pl
+++ b/projects/perl-Satcon/bin/satcon-deploy-tree.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# Copyright (c) 2008--2010 Red Hat, Inc.
+# Copyright (c) 2008--2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
@@ -17,7 +17,6 @@ use strict;
use Satcon;
use File::Find;
use File::Path;
-use File::Copy;
use Data::Dumper;
use Getopt::Long;
@@ -79,7 +78,7 @@ sub process_file {
else {
if (-e "$destdir/$relative_path" && $backupdir && ! -e
"$backupdir/$destdir/$relative_path") {
print " * Making backup of $destdir$relative_path to
$backupdir$destdir$relative_path\n";
- copy ("$destdir/$relative_path",
"$backupdir/$destdir/$relative_path")
+ system('/bin/cp', '-p', "$destdir/$relative_path",
"$backupdir/$destdir/$relative_path") == 0
or die "Cannot copy $destdir/$relative_path to
$backupdir/$destdir/$relative_path";
}
open IF, "<$sourcedir/$relative_path"
Show replies by date