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
  

i was trying to change this file to add this:

/usr/local/BackupPC/lib/BackupPC/Xfer/Rsync.pm

in the sub start after :

sub start
{
    my($t) = @_;
    my $bpc = $t->{bpc};
    my $conf = $t->{conf};
    my(@fileList, $rsyncClientCmd, $rsyncArgs, $logMsg,
       $incrDate, $argList, $fioArgs);

    #
    # We add a slash to the share name we pass to rsync
    #
    ($t->{shareNameSlash} = "$t->{shareName}/") =~ s{//+$}{/};

    if ( $t->{type} eq "restore" ) {
        $rsyncClientCmd = $conf->{RsyncClientRestoreCmd};
        $rsyncArgs = $conf->{RsyncRestoreArgs};

i added this:

    my $remoteDir = "$t->{shareName}/$t->{pathHdrDest}";
    $remoteDir    =~ s#/\.\.#/#g;
    $remoteDir    =~ s{//+}{/}g;
   
    if( defined @rsyncRestoreLimitToShare ){
        my $aqflag =0;
        foreach $aqshare ( @rsyncRestoreLimitToShare ){
            if ( $remoteDir  =~ /^$aqshare.*/ ) {
                $aqflag = 1;
            }
        }
        if( $aqflag == 0 ){
            my $str = "Erreur vous devez restorer dans  $rsyncRestoreLimitToShare uniquement ". ":$conf->{RsyncdClientPort}: $err\n";
            $t->{XferLOG}->write(\$str);
            $t->{hostError} = $err;
            return;
        }
    }


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 :(

Anyone would like to help ?

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:

$rsyncRestoreLimitToShare = [ '/var','/etc'];  so backuppc does not allow to restore anywere else.

Anyone interested to help ?

--
Cordialement,
Ghislain

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

Reply via email to