ar bug

salkind%nyu at sri-unix.UUCP salkind%nyu at sri-unix.UUCP
Sat Feb 11 02:07:44 AEST 1984


From:  Lou Salkind <salkind at nyu>

Subject: ar bug
Index:	bin/ar.c 4.2BSD

Description:
	If you try to archive a file with a uid or gid greater than
	32K, ar will fail when you try to read the archive back in.
	You will get the message "Malformed archive."
Repeat-By:
	mkdir f
	chgrp 50000 f
	cd f
	cp /etc/passwd f
	ar r f.a passwd
	ar t f.a
Fix:
	When the file header is written out, cast the uid and gid to an
	unsigned short.  "diff ar.c.dist ar.c" follows:
510,511c510,511
< 	   stbuf.st_uid,
< 	   stbuf.st_gid,
---
> 	   (u_short)stbuf.st_uid,
> 	   (u_short)stbuf.st_gid,



More information about the Comp.unix.wizards mailing list