Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!decvax!genrad!panda!talcott!harvard!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.bugs.usg Subject: SVR2 tar bug Message-ID: <9683@brl-tgr.ARPA> Date: Mon, 1-Apr-85 19:22:34 EST Article-I.D.: brl-tgr.9683 Posted: Mon Apr 1 19:22:34 1985 Date-Received: Sun, 7-Apr-85 10:44:36 EST Distribution: net Organization: Ballistic Research Lab Lines: 34 The UNIX System V Release 2.0 "tar" has introduced a new bug as a side-effect of attempting to handle both old and new styles of magtape device names. The bug shows up when creating an ordinary archive file that does not already exist; "tar" attempts to open the magtape drive! The two lines below involving `usefil1' and `NULL' are my kludge to avoid the problem: /* @(#)tar.c 1.7 */ ... main(argc, argv) ... switch(*cp) { case 'f': usefile = *argv++; usefil1 = NULL; /* DAG -- part of bug fix (added) */ if (nblock == 1) nblock = 0; break; ... if (rflag) { ... if (strcmp(usefile, "-") == 0) { ... } else if ((mt = open(usefile,2)) < 0 && /* DAG -- bug fix: */ (usefil1 == NULL || (mt = open(usefil1,2)) < 0)) { if (cflag == 0 || (mt = creat(usefile, 0666)) < 0) { fprintf(stderr, "tar: cannot open %s\n", usefile); done(1); } } ...