bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Warning message when reading partial blocks from stdin.


From: Joerg Schilling
Subject: Re: [Bug-tar] Warning message when reading partial blocks from stdin.
Date: Fri, 22 Apr 2005 16:46:52 +0200
User-agent: nail 11.2 8/15/04

Gunnar Ritter <address@hidden> wrote:

> Joerg Schilling <address@hidden> wrote:
>
> > If you follow the POSIX rules for _creating_ tar archives, you cannot
> > have archivesize % TBLOCK != 0
> >
> > As we do no longer live in the 1970s, it is obious to test for
> > impossible things and to warn.....
>
> One does not create a reliable software system by inserting checks for
> arbitrary "can't happen" conditions. But there is no need to discuss
> this further since the argument does not apply to this case anyway:
>
> $ gtar-1.15.1 cfb - 1 . | dd bs=1111 conv=sync | gtar-1.15.1 tvf - >/dev/null
> 1975+1 records in
> 1976+0 records out
> gtar-1.15.1: Read 3976 bytes from -
> $ gtar-1.15.1 cfb - 1 . | dd bs=1111 conv=sync | gtar-1.15.1 tvfb - 1 
> >/dev/null
> 1975+1 records in
> 1976+0 records out
> $ gtar-1.15.1 cfb - 1 . | dd bs=55555 conv=sync | gtar-1.15.1 tvf - >/dev/null
> 39+1 records in
> 40+0 records out
> $ 
>
> This is not a meaningful validity check. The program just complains
> if it cannot fill its input buffer completely; if the odd data is
> positioned beyond the last buffer read, no warning is printed. I
> still ask why the user should see the warning in the first case but
> not in the other ones.

Correct and the problem with the bad cpio archives from inside rpms
is related to the fact that an incompletely filled 512 byte buffer
contains valid and needed data. This is something completely different
that the case you test with your commands above.

Jörg

-- 
 EMail:address@hidden (home) Jörg Schilling D-13353 Berlin
       address@hidden           (uni)  
       address@hidden   (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily




reply via email to

[Prev in Thread] Current Thread [Next in Thread]