/[smeserver]/rpms/e-smith-backup/sme7/e-smith-backup-2.0.0-handle-dirs-using-DirHandle.patch
ViewVC logotype

Annotation of /rpms/e-smith-backup/sme7/e-smith-backup-2.0.0-handle-dirs-using-DirHandle.patch

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


Revision 1.3 - (hide annotations) (download)
Wed Apr 13 20:42:08 2011 UTC (13 years, 6 months ago) by snetram
Branch: MAIN
CVS Tags: e-smith-backup-2_0_0-36_el4_sme, e-smith-backup-2_0_0-38_el4_sme, e-smith-backup-2_0_0-35_el4_sme, e-smith-backup-2_0_0-37_el4_sme, HEAD
Changes since 1.2: +1 -1 lines
* Wed Apr 13 2011 Jonathan Martens <smeserver-contribs@snetram.nl> 2.2.0-35.sme
- Fix variable initialization [SME: 6512]

1 snetram 1.1 diff -up e-smith-backup-2.0.0/root/etc/e-smith/web/functions/backup.handle-dirs-using-DirHandle e-smith-backup-2.0.0/root/etc/e-smith/web/functions/backup
2     --- e-smith-backup-2.0.0/root/etc/e-smith/web/functions/backup.handle-dirs-using-DirHandle 2011-04-09 13:40:27.000000000 +0200
3     +++ e-smith-backup-2.0.0/root/etc/e-smith/web/functions/backup 2011-04-09 14:05:16.000000000 +0200
4     @@ -32,6 +32,7 @@ use esmith::cgi;
5     use esmith::util;
6     use esmith::lockfile;
7     use File::Find;
8     +use DirHandle;
9    
10     $File::Find::dont_use_nlink = 1; # fix for Windows shares
11    
12     @@ -1226,13 +1227,15 @@ sub WorkstnBackupConfig1
13     $q, undef, $fm->localise('CONFIGURE_WORKSTN_BACKUP'));
14    
15     if ( $VFSType eq 'usb' ) {
16     - my @usbdisklist;
17     - @usbdisklist = qx'ls /media';
18     - for (@usbdisklist) {
19     - next if /floppy/;
20     - next if /cdrom/;
21     - push @usbdisks, $_;
22     - }
23 snetram 1.3 + my $d = new DirHandle "/media/";
24 snetram 1.1 + if (defined $d) {
25     + while (defined($_ = $d->read)) {
26     + unless ($_ =~ m/(floppy|cdrom|\.\.|\.)/i) {
27 snetram 1.2 + push @usbdisks, $_;
28 snetram 1.1 + }
29     + }
30     + }
31     +
32     unless (scalar @usbdisks) {
33     esmith::cgi::genResult(
34     $fm->{cgi}, $fm->localise('ERR_NO_USB_DISK'));

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