bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] octal reading in spec


From: Joerg Schilling
Subject: Re: [Bug-tar] octal reading in spec
Date: Fri, 11 Aug 2006 11:05:06 +0200
User-agent: nail 11.2 8/15/04

Paul Eggert <address@hidden> wrote:

> > According to the POSIX specs all numeric fields are leading zero-filled
> > octal numbers.
>
> Yes, but the fields must be "terminated by one or more <space> or NUL
> characters."

This is POSIX.1-1992
The original Text from 1988 was a bit different and has been modified to
allow 7 octal digits.


> >     Fill in the checksum field.  It's formatted differently from the
> >     other fields: it has [6] digits, a null, then a space -- rather
> >     than digits, then a null.
> >
> > Whoever wrote it must have had some reasons to do so. However, in my
> > understanding, it is a mis-feature.
> >
> > Paul, could you shed some light on it?
>
> No doubt GNU tar was mimicking 7th Edition Unix 'tar' here.
> 7th Edition Unix 'tar' first set the entire checksum area to spaces;
> then it calculated the checksum using the spaces (as POSIX requires);
> then it used sprintf(checksum field, "%6o", checksum value); hence it
> always had 6 octal digits, then a null byte, then the space left over
> from the checksum calculation.

This is what John Gilmore implemented for his PDtar/SUGtar in 1987.
As he was uncertain about the correctness of his implementation, he
did compare the output of tar with the outpout of his code. Star never 
implemented this bug....even not in 1984.

> This behavior no longer survives in Solaris 8 through 10 tar; it
> generates 7 octal digits followed by a null byte.

As a result of a bugreport from me and a hint to Sun to use my POSIX.1-1988
tar format verifyer.

> As far as I can tell, both behaviors fully conform to the standard,
> since once you see a space or a NUL you're supposed to stop scanning.

The POSIX.1-1988 text for 8 byte fields was from my 
memory: "... a space and a NUL".

So this behavoir is not compliant with POSIX.1-1988.

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]