Tar bug, runs out of files

wescott at ncrcae.UUCP wescott at ncrcae.UUCP
Thu Dec 8 07:47:30 AEST 1983



Forgive me if this one has been reported before (I'd be
surprised if it hadn't).  Tar stops processing files
after coming across a number of non S_IFREG files.
It doesn't close the open file after opening and fstat'ing
it.  Hence tar can run out of file descriptors.

The bug has been seen in every version we've looked at
(v7, III, 4.1, 5.0) If this is supposed to be a feature
let me know.

In the meantime our fix is to add a close in putfile():

	putfile(longname, shortname)
	char *longname;
	char *shortname;
	{
		.
		.
		.
		infile = open(shortname, 0);
		.
		.
		.
		if ((stbuf.st_mode & S_IFMT) != S_IFREG) {
			fprintf(stderr, "tar: %s is not a file. Not dumped\n", longname);
			close(infile); /**********bug fix************/
			return;
		}
		.
		.
		.
	}

===========================
Michael Wescott
NCR Corp., West Columbia, SC 29169
...duke!mcnc!ncsu!ncrcae!wescott



More information about the Net.bugs mailing list