[net.bugs.4bsd] Tar bug, runs out of files

salkind@cmcl2.UUCP (Lou Salkind) (12/13/83)

The 4.2 bsd version of tar has a similar (yet different) bug.  Here is
the fix:

*** /usr/src/bin/tar.c.dist	Sun Sep 25 21:05:06 1983
--- /usr/src/bin/tar.c	Mon Dec 12 16:46:52 1983
***************
*** 532,537
  		if (strlen(longname) >= NAMSIZ) {
  			fprintf(stderr, "tar: %s: file name too long\n",
  			    longname);
  			return;
  		}
  		strcpy(dblock.dbuf.name, longname);

--- 532,538 -----
  		if (strlen(longname) >= NAMSIZ) {
  			fprintf(stderr, "tar: %s: file name too long\n",
  			    longname);
+ 			close(infile);
  			return;
  		}
  		strcpy(dblock.dbuf.name, longname);