Hello,

can anyone confirm my observations with the attached test script?

pax corrupts files if they contain more than 57 holes in it.

I just found out today by accident after copying a large backup file. I was able to reproduce the bug on Solaris 10 and snv133, on UFS and ZFS.

Is pax in the closed bins? I couldn't find its source code.



Daniel
#!/bin/perl -w

use Fcntl;
use Fcntl 'SEEK_CUR';

# 57 = Ok
# 58 = Error
$count = 58;

$file = "testfile-$count";
$cpdir = "n";


$holesize = 2**20;
$rand = 2**16;

sysopen(F, $file, O_RDWR|O_CREAT|O_TRUNC) or die "sysopen: $!";
foreach (1..$count)
{
  $o = $holesize + rand($rand);
  sysseek(F, $o, SEEK_CUR);
  syswrite(F, "the quick brown fox jumps over the lazy dog");
}
close(F);

-d $cpdir or mkdir($cpdir, 0777);

system("pax -rw $file $cpdir");
system("md5sum $file");
system("md5sum $cpdir/$file");
unlink $file;
unlink "$cpdir/$file";
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to