From: ADNET G. <ga...@aq...> - 2008-02-04 08:50:39
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> <br> <blockquote cite="mid:aut...@at..." type="cite"> <pre wrap=""> Without modifying the code you can't do that. You could create two virtual hosts, one that can be direct restored and the other that can't. Craig </pre> </blockquote> <br> i was trying to change this file to add this:<br> <br> /usr/local/BackupPC/lib/BackupPC/Xfer/Rsync.pm<br> <br> in the sub start after :<br> <br> <blockquote>sub start<br> {<br> my($t) = @_;<br> my $bpc = $t->{bpc};<br> my $conf = $t->{conf};<br> my(@fileList, $rsyncClientCmd, $rsyncArgs, $logMsg,<br> $incrDate, $argList, $fioArgs);<br> <br> #<br> # We add a slash to the share name we pass to rsync<br> #<br> ($t->{shareNameSlash} = "$t->{shareName}/") =~ s{//+$}{/};<br> <br> if ( $t->{type} eq "restore" ) {<br> $rsyncClientCmd = $conf->{RsyncClientRestoreCmd};<br> $rsyncArgs = $conf->{RsyncRestoreArgs};<br> </blockquote> <br> i added this:<br> <br> <blockquote> <blockquote><tt> my $remoteDir = "$t->{shareName}/$t->{pathHdrDest}";</tt><br> <tt> $remoteDir =~ s#/\.\.#/#g;</tt><br> <tt> $remoteDir =~ s{//+}{/}g;</tt><br> <tt> </tt><br> <tt> if( defined @rsyncRestoreLimitToShare ){</tt><br> <tt> my $aqflag =0;</tt><br> <tt> foreach $aqshare ( @rsyncRestoreLimitToShare ){</tt><br> <tt> if ( $remoteDir =~ /^$aqshare.*/ ) {</tt><br> <tt> $aqflag = 1;</tt><br> <tt> }</tt><br> <tt> }</tt><br> <tt> if( $aqflag == 0 ){</tt><br> <tt> my $str = "Erreur vous devez restorer dans $rsyncRestoreLimitToShare uniquement ". ":$conf->{RsyncdClientPort}: $err\n";</tt><br> <tt> $t->{XferLOG}->write(\$str);</tt><br> <tt> $t->{hostError} = $err;</tt><br> <tt> return;</tt><br> <tt> }</tt><br> <tt> }</tt><br> </blockquote> </blockquote> <br> <br> but the code just fail and prevent the restoring in any case. Of course i am not a dev so my perl is an 'cut and paste from how-to' type :(<br> <br> Anyone would like to help ?<br> <br> the goal is to verify that the restoredir start by one of the share we want to limit to. The idea is to have in the config file:<br> <br> <tt> $rsyncRestoreLimitToShare = [ '/var','/etc']; so backuppc does not allow to restore anywere else.<br> <br> Anyone interested to help ?<br> </tt><br> <div class="moz-signature">-- <br> Cordialement,<br> Ghislain</div> </body> </html> |