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

Contents 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.2 - (show annotations) (download)
Sat Apr 9 12:18:45 2011 UTC (13 years, 7 months ago) by snetram
Branch: MAIN
CVS Tags: e-smith-backup-2_0_0-33_el4_sme, e-smith-backup-2_0_0-34_el4_sme
Changes since 1.1: +1 -1 lines
Copy-paste error

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 + $d = new DirHandle "/media/";
24 + if (defined $d) {
25 + while (defined($_ = $d->read)) {
26 + unless ($_ =~ m/(floppy|cdrom|\.\.|\.)/i) {
27 + push @usbdisks, $_;
28 + }
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