/[BackupPC]/trunk/lib/BackupPC/CGI/RestoreFile.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/BackupPC/CGI/RestoreFile.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 315 by dpavlin, Wed Jun 22 19:12:42 2005 UTC revision 316 by dpavlin, Mon Jan 30 13:37:17 2006 UTC
# Line 28  Line 28 
28  #  #
29  #========================================================================  #========================================================================
30  #  #
31  # Version 2.1.0, released 20 Jun 2004.  # Version 2.1.2, released 5 Sep 2005.
32  #  #
33  # See http://backuppc.sourceforge.net.  # See http://backuppc.sourceforge.net.
34  #  #
# Line 150  sub restoreFile Line 150  sub restoreFile
150      my $view = BackupPC::View->new($bpc, $host, \@Backups);      my $view = BackupPC::View->new($bpc, $host, \@Backups);
151      my $a = $view->fileAttrib($num, $share, $dir);      my $a = $view->fileAttrib($num, $share, $dir);
152      if ( $dir =~ m{(^|/)\.\.(/|$)} || !defined($a) ) {      if ( $dir =~ m{(^|/)\.\.(/|$)} || !defined($a) ) {
153          ErrorExit("Can't restore bad file ${EscHTML($dir)}");          ErrorExit("Can't restore bad file ${EscHTML($dir)} ($num, $share, $dir)");
154      }      }
155      my $f = BackupPC::FileZIO->open($a->{fullPath}, 0, $a->{compress});      my $f = BackupPC::FileZIO->open($a->{fullPath}, 0, $a->{compress});
156      my $data;      my $data;
# Line 164  sub restoreFile Line 164  sub restoreFile
164          }          }
165          $f->close;          $f->close;
166          $linkName =~ s/^\.\///;          $linkName =~ s/^\.\///;
         my $share = $1 if ( $dir =~ /^\/?(.*?)\// );  
167          restoreFile($host, $num, $share, $linkName, 1, $dir);          restoreFile($host, $num, $share, $linkName, 1, $dir);
168          return;          return;
169      }      }

Legend:
Removed from v.315  
changed lines
  Added in v.316

  ViewVC Help
Powered by ViewVC 1.1.26