/[smeserver]/rpms/e-smith-backup/sme8/e-smith-backup-2.2.0-workstation-backup-spaces.patch
ViewVC logotype

Annotation of /rpms/e-smith-backup/sme8/e-smith-backup-2.2.0-workstation-backup-spaces.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sat Jul 6 19:43:57 2013 UTC (11 years, 4 months ago) by wellsi
Branch: MAIN
CVS Tags: e-smith-backup-2_2_0-72_el5_sme, e-smith-backup-2_2_0-66_el5_sme, e-smith-backup-2_2_0-65_el5_sme, e-smith-backup-2_2_0-80_el5_sme, e-smith-backup-2_2_0-83_el5_sme, e-smith-backup-2_2_0-82_el5_sme, e-smith-backup-2_2_0-88_el5_sme, e-smith-backup-2_2_0-74_el5_sme, e-smith-backup-2_2_0-84_el5_sme, e-smith-backup-2_2_0-87_el5_sme, e-smith-backup-2_2_0-81_el5_sme, e-smith-backup-2_2_0-68_el5_sme, e-smith-backup-2_2_0-86_el5_sme, e-smith-backup-2_2_0-71_el5_sme, e-smith-backup-2_2_0-78_el5_sme, e-smith-backup-2_2_0-73_el5_sme, e-smith-backup-2_2_0-79_el5_sme, e-smith-backup-2_2_0-75_el5_sme, e-smith-backup-2_2_0-76_el5_sme, e-smith-backup-2_2_0-67_el5_sme, e-smith-backup-2_2_0-70_el5_sme, e-smith-backup-2_2_0-77_el5_sme, e-smith-backup-2_2_0-85_el5_sme, e-smith-backup-2_2_0-69_el5_sme, HEAD
* Sat Jul 6 2013 Ian Wells <esmith@wellsi.com> 2.2.0-65.sme
- Workstation Backup, be compatible with USB drives that have spaces in their label [SME: 7159]

1 wellsi 1.1 diff -ruN e-smith-backup-2.2.0.old/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.2.0/root/etc/e-smith/events/actions/workstation-backup-dar
2     --- e-smith-backup-2.2.0.old/root/etc/e-smith/events/actions/workstation-backup-dar 2013-07-06 08:13:49.000000000 -0700
3     +++ e-smith-backup-2.2.0/root/etc/e-smith/events/actions/workstation-backup-dar 2013-07-06 08:19:35.000000000 -0700
4     @@ -29,6 +29,7 @@
5     use File::Path;
6     use File::Find;
7     use POSIX ":sys_wait_h";
8     +use File::Glob qw(bsd_glob);
9     use esmith::ConfigDB;
10    
11     sub ldie;
12     @@ -175,7 +176,7 @@
13     }
14     }
15    
16     - system("/bin/mkdir -p /$smbshare");
17     + system("/bin/mkdir", "-p", "/$smbshare");
18    
19     $err = qx(/bin/mount $device "/$smbshare" 2>&1);
20     if ($err) {ldie("Error while mounting $device /$smbshare : \n" . $err)};
21     @@ -193,6 +194,7 @@
22     open FD, '/proc/mounts';
23     while (<FD>)
24     {
25     + s/\\040/ /g; # /proc/mount returns spaces as \040 which causes problems in matching
26     next unless /\s$mntdir\s/;
27     $err++;
28     }
29     @@ -326,7 +328,7 @@
30    
31     $report .= "Moving backup files to target directory $setdirname \n";
32    
33     -foreach (<$tmpdir/$id/$bkname*>)
34     +foreach (bsd_glob("$tmpdir/$id/$bkname*"))
35     {
36     ldie("Error while moving backup file $_ from temporary dir $tmpdir/$id to $setdirname : $!")
37     unless move($_, $setdirname);
38     @@ -430,7 +432,7 @@
39     }
40    
41     # Check free disk space
42     -my $df = qx(/bin/df -Ph $mntdir);
43     +my $df = qx(/bin/df -Ph \"$mntdir\");
44     if ($df =~ /^\S+\s+(\S+)\s+(\S+)\s+(\S+)\s+(\d*%)/mi)
45     {
46     $report .= "Disk usage $2, $4 full, $3 available\n";
47     diff -ruN e-smith-backup-2.2.0.old/root/etc/e-smith/web/functions/backup e-smith-backup-2.2.0/root/etc/e-smith/web/functions/backup
48     --- e-smith-backup-2.2.0.old/root/etc/e-smith/web/functions/backup 2013-07-06 08:13:49.000000000 -0700
49     +++ e-smith-backup-2.2.0/root/etc/e-smith/web/functions/backup 2013-07-06 11:57:19.000000000 -0700
50     @@ -1783,7 +1783,7 @@
51    
52     # Finding existing backups
53    
54     - find { wanted => \&$setbackuplist, untaint => 1 }, $mntbkdir ;
55     + find { wanted => \&$setbackuplist, untaint => 1, untaint_pattern => qr|^([-+@\w\s./]+)$|}, $mntbkdir ;
56    
57     my %blabels = ();
58     my @blabels;
59     @@ -1936,7 +1936,7 @@
60     # find list of available backups and verify
61     # it contains all backups needed for full restore
62    
63     - find { wanted => \&$backupsetlist, untaint => 1 }, $set ;
64     + find { wanted => \&$backupsetlist, untaint => 1, untaint_pattern => qr|^([-+@\w\s./]+)$| }, $set ;
65    
66     my $key;
67     my $num = 0;
68     @@ -2185,7 +2185,7 @@
69    
70     # Finding existing backups
71    
72     - find { wanted => \&$setbackupflist, untaint => 1 }, $mntbkdir ;
73     + find { wanted => \&$setbackupflist, untaint => 1, untaint_pattern => qr|^([-+@\w\s./]+)$| }, $mntbkdir ;
74    
75     my %blabels = ();
76     my @blabels;
77     @@ -2343,7 +2343,7 @@
78     # finding list of available backups
79     # and verifying all needed backup files are available
80    
81     - find { wanted => \&$backupsetlist, untaint => 1 }, $set ;
82     + find { wanted => \&$backupsetlist, untaint => 1, untaint_pattern => qr|^([-+@\w\s./]+)$| }, $set ;
83    
84     my $key;
85     my $num = 0;
86     @@ -2985,11 +2985,11 @@
87    
88     if ($when)
89     {
90     - $restorerr = system ("/usr/bin/dar_manager -B $mntbkdir/dar-catalog -w $when -e '-N -R / -w' -r @restorelist");
91     + $restorerr = system ("/usr/bin/dar_manager -B \"$mntbkdir/dar-catalog\" -w $when -e '-N -R / -w' -r @restorelist");
92     }
93     else
94     {
95     - $restorerr = system ("/usr/bin/dar_manager -B $mntbkdir/dar-catalog -e '-N -R / -w' -r @restorelist");
96     + $restorerr = system ("/usr/bin/dar_manager -B \"$mntbkdir/dar-catalog\" -e '-N -R / -w' -r @restorelist");
97     }
98    
99     if ($mounted)

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed