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 |
|
|
+ $d = new DirHandle "/media/"; |
24 |
|
|
+ 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')); |