diff -ruN e-smith-backup-2.4.0.p37/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.4.0/root/etc/e-smith/events/actions/workstation-backup-dar --- e-smith-backup-2.4.0.p37/root/etc/e-smith/events/actions/workstation-backup-dar 2014-04-26 20:19:08.000000000 -0700 +++ e-smith-backup-2.4.0/root/etc/e-smith/events/actions/workstation-backup-dar 2014-04-26 20:22:48.000000000 -0700 @@ -330,7 +330,6 @@ } elsif ($VFSType eq 'usb') { - $_[2] = "/" . $share; my $device = ""; my $blkdev = ""; my $vollbl = ""; diff -ruN e-smith-backup-2.4.0.p37/root/etc/e-smith/web/functions/backup e-smith-backup-2.4.0/root/etc/e-smith/web/functions/backup --- e-smith-backup-2.4.0.p37/root/etc/e-smith/web/functions/backup 2014-04-26 20:19:08.000000000 -0700 +++ e-smith-backup-2.4.0/root/etc/e-smith/web/functions/backup 2014-04-26 21:35:24.000000000 -0700 @@ -32,6 +32,7 @@ use esmith::util; use esmith::lockfile; use File::Find; +use File::Path qw(make_path remove_tree); $File::Find::dont_use_nlink = 1; # fix for Windows shares @@ -1759,6 +1760,7 @@ my $smbshare = $rec->prop('SmbShare'); my $VFSType = $rec->prop('VFSType') || 'cifs'; my $err; + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); my $setbackuplist = sub { if ( $_ =~ /\.dar/ ) { @@ -1892,6 +1894,7 @@ my $err; my $VFSType = $backupwkrec->prop('VFSType') || 'cifs'; my $verifyref = $q->param ('backupset'); + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); # Mounting backup shared folder $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType); @@ -2124,6 +2127,7 @@ my $smbhost = $rec->prop('SmbHost'); my $smbshare = $rec->prop('SmbShare'); my $err; + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); my $setbackupflist = sub { if ( $_ =~ /\.dar/ ) @@ -2271,6 +2275,7 @@ my $VFSType = $backupwkrec->prop('VFSType') || 'cifs'; my $smbhost = $backupwkrec->prop('SmbHost'); my $smbshare = $backupwkrec->prop('SmbShare'); + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); my $err; my $error_message; @@ -2500,6 +2505,7 @@ my $VFSType = $rec->prop('VFSType') || 'cifs'; my $smbhost = $rec->prop('SmbHost'); my $smbshare = $rec->prop('SmbShare'); + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); my $err; my $error_message; @@ -2656,6 +2662,7 @@ my $VFSType = $backupwkrec->prop('VFSType') || 'cifs'; my $err; my $error_message; + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); my $backupkey = $q->param ('backupset'); if ($backupkey =~ /^(.*)$/) @@ -2819,6 +2826,7 @@ my $smbshare = $backupwkrec->prop('SmbShare'); my $err; my $error_message; + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); # Mounting backup shared folder $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType); @@ -3079,7 +3087,6 @@ } elsif ($VFSType eq 'usb') { - $_[2] = "/" . $share; my $device = ""; my $blkdev = ""; my $vollbl = ""; @@ -3138,10 +3145,11 @@ } # create the directory mount point if it does not exist - createTree ($mntdir); - + my $err = createTree ($mntdir); + return ($fm->localise('ERR_MOUNTING_SMBSHARE') . "\n" . $err) if $err; + # mount the backup directory - my $err = dmount($host,$share,$mntdir,'','',$VFSType); + $err = dmount($host,$share,$mntdir,'','',$VFSType); return ($fm->localise('ERR_MOUNTING_SMBSHARE') . "\n" . $err) if $err; # verify $mntdir is mounted @@ -3187,6 +3195,17 @@ return @mntout; } +sub createTree +{ + my $tree = shift; + if (! -d "$tree") + { + eval {make_path("$tree")}; + return ("Error while creating $tree : $@. Maybe insufficient rights directory.\n") if $@; + } + return; +} + __DATA__