Subject: Re: userid & group id
To: Jukka Marin <jmarin@pyy.jmp.fi>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: port-i386
Date: 04/24/1997 08:41:05
> On Thu, Apr 24, 1997 at 02:26:41AM -0400, Charles M. Hannum wrote:
> > I've added code to truncate the IDs to 65535.
> Uh.  Can't ar be fixed instead?

Only if you don't care about writing ar files that other systems can read.

The format is defined to have 6 characters for UID and GID, one of which
must be a NUL byte.  (I suppose you could go up to 99999, at the risk of
loony behavior on systems with 16 bit variables for uid and gid; I would
assume that System V ar *does* use the uid and gid on extraction, since
System V allows changing the uid and gid of files that you own.)

cpio has 8 byte NUL-terminated UID and GID fields for the ASCII format,
but the binary format uses a 16-bit field (and the GNU cpio program uses
16-bit integers internally regardless of which format it's interpreting).

tar has 7 octal digit UID and GID fields, plus the name fields in the GNU
tar format.  It is probably your best bet if you want UIDs outside the 16-bit
portable range; tar is careful not to blow out the fixed width fields (but
don't trust the results, needless to say!).