Ticket #2910: patchfs-symlink.patch

File patchfs-symlink.patch, 1.0 KB (added by andrew_b, 12 years ago)
  • src/vfs/extfs/helpers/patchfs.in

    diff --git a/src/vfs/extfs/helpers/patchfs.in b/src/vfs/extfs/helpers/patchfs.in
    index 264e857..44b26a8 100644
    a b sub copyin($$$) { 
    380380      or error "Can't write to archive"; 
    381381} 
    382382 
     383my $fin = $ARGV[1]; 
     384if (-l $fin) { 
     385    $fin = readlink $fin; 
     386} 
    383387 
    384388if ($ARGV[0] eq 'list') { 
    385     open I, myin($ARGV[1]).'|'; 
    386     list ($ARGV[1]); 
     389    open I, myin($fin).'|'; 
     390    list ($fin); 
    387391    exit 0; 
    388392} elsif ($ARGV[0] eq 'copyout') { 
    389     open I, myin($ARGV[1])."|"; 
     393    open I, myin($fin)."|"; 
    390394    copyout ($ARGV[2], $ARGV[3]); 
    391395    exit 0; 
    392396} elsif ($ARGV[0] eq 'rm') { 
    393     open I, myin($ARGV[1])."|"; 
    394     rm ($ARGV[1], $ARGV[2]); 
     397    open I, myin($fin)."|"; 
     398    rm ($fin, $ARGV[2]); 
    395399    exit 0; 
    396400} elsif ($ARGV[0] eq 'rmdir') { 
    397401    exit 0; 
    398402} elsif ($ARGV[0] eq 'mkdir') { 
    399403    exit 0; 
    400404} elsif ($ARGV[0] eq 'copyin') { 
    401     copyin ($ARGV[1], $ARGV[2], $ARGV[3]); 
     405    copyin ($fin, $ARGV[2], $ARGV[3]); 
    402406    exit 0; 
    403407} 
    404408exit 1;