[The patch here is wrong (it breaks on Windows), but the diagnosis looks right. The fix probably is to clear noexec long enough to call unlink_file, and then restore it (see RCS_merge for an example). A possibly cleaner (presumably longer-term) fix would be to move the check for noexec from unlink_file to unlink_file's callers. A fix was checked in 20 Dec 1997. -kingdon] Date: Sun, 30 Nov 1997 12:49:16 +0900 (JST) To: bug-cvs@prep.ai.mit.edu Subject: basica test leaves three temporary files in /tmp. From: enami@but-b.or.jp >Submitter-Id: net >Originator: enami tsugutomo >Organization: net >Confidential: no >Synopsis: basica test leaves three temporary files in /tmp. >Severity: non-critical >Priority: medium >Category: cvs >Class: sw-bug >Release: cvs-1.9.21 >Environment: System: NetBSD bicky-holiday.enami.but-b.or.jp 1.3_ALPHA NetBSD 1.3_ALPHA (BICKY_HOLIDAY) #128: Sun Nov 23 16:09:52 JST 1997 enami@bicky-holiday.enami.but-b.or.jp:/a/netbsd/kernel/compile/BICKY_HOLIDAY i386 >Description: The basica test leaves three temporary files in /tmp. Actually, cvs -n admin -o 1.2::1.3 file leaves them. >How-To-Repeat: Script started on Sun Nov 30 12:44:26 1997 enami@cutie-honey% /tmp/cvs -v Concurrent Versions System (CVS) 1.9.21 (client/server) Copyright (c) 1989-1997 Brian Berliner, david d `zoo' zuhn, Jeff Polk, and other authors CVS may be copied only under the terms of the GNU General Public License, a copy of which can be found with the CVS distribution kit. Specify the --help option for further information about CVS enami@cutie-honey% pwd /tmp/y/x enami@cutie-honey% ls CVS file enami@cutie-honey% /tmp/cvs log cvs log: Logging . RCS file: /tmp/cvsroot/x/file,v Working file: file head: 1.3 branch: locks: strict access list: symbolic names: x-0: 1.1.1.1 X: 1.1.1 keyword substitution: o total revisions: 4; selected revisions: 4 description: ---------------------------- revision 1.3 date: 1997/11/30 12:13:12; author: enami; state: Exp; lines: +1 -0 Add version 1.3 ---------------------------- revision 1.2 date: 1997/11/30 12:12:38; author: enami; state: Exp; lines: +1 -0 Add version 2 ---------------------------- revision 1.1 date: 1997/11/30 03:11:04; author: enami; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 1997/11/30 03:11:04; author: enami; state: Exp; lines: +0 -0 this is x ============================================================================= enami@cutie-honey% ls -latr /tmp/ total 1913 -r--r--r-- 1 root wheel 11 Nov 29 19:45 .X0-lock drwxrwxrwx 2 root wheel 512 Nov 29 19:45 .X11-unix drwxr-xr-x 23 root wheel 1024 Nov 30 11:34 .. -rw-r--r-- 1 enami wheel 40585 Nov 30 12:00 out drwxr-xr-x 4 enami wheel 512 Nov 30 12:11 cvsroot drwxr-xr-x 4 enami wheel 512 Nov 30 12:11 y -rwxr-xr-x 1 enami wheel 1898277 Nov 30 12:31 cvs -rw-r--r-- 1 enami wheel 1461 Nov 30 12:41 cvs.bug drwxrwxrwt 6 root wheel 512 Nov 30 12:41 . drwxr-xr-x 2 enami wheel 512 Nov 30 12:44 x enami@cutie-honey% /tmp/cvs -n admin -o 1.2::1.3 file RCS file: /tmp/cvsroot/x/file,v done enami@cutie-honey% ls -latr /tmp/ total 1916 -r--r--r-- 1 root wheel 11 Nov 29 19:45 .X0-lock drwxrwxrwx 2 root wheel 512 Nov 29 19:45 .X11-unix drwxr-xr-x 23 root wheel 1024 Nov 30 11:34 .. -rw-r--r-- 1 enami wheel 40585 Nov 30 12:00 out drwxr-xr-x 4 enami wheel 512 Nov 30 12:11 cvsroot drwxr-xr-x 4 enami wheel 512 Nov 30 12:11 y -rwxr-xr-x 1 enami wheel 1898277 Nov 30 12:31 cvs -rw-r--r-- 1 enami wheel 1461 Nov 30 12:41 cvs.bug drwxr-xr-x 2 enami wheel 512 Nov 30 12:44 x -rw-r--r-- 1 enami wheel 40 Nov 30 12:45 cvs25882aa -rw-r--r-- 1 enami wheel 67 Nov 30 12:45 cvs25882ab -rw-r--r-- 1 enami wheel 5 Nov 30 12:45 cvs25882ac drwxrwxrwt 6 root wheel 512 Nov 30 12:45 . enami@cutie-honey% exit Script done on Sun Nov 30 12:45:23 1997 >Fix: Here is my fix. Calling CVS_UNLINK rather than unlink_file. 1997-11-30 enami tsugutomo * rcs.c (RCS_delete_revs): Remove temporary files using CVS_UNLINK rather than unlink_file, since these files are created even noexec is true. Index: rcs.c =================================================================== RCS file: /cvsroot/cvs/src/rcs.c,v retrieving revision 1.1.1.21 diff -c -r1.1.1.21 rcs.c *** rcs.c 1997/11/30 02:33:23 1.1.1.21 --- rcs.c 1997/11/30 03:39:33 *************** *** 4872,4890 **** free (after); if (beforefile != NULL) { ! if (unlink_file (beforefile) < 0) error (0, errno, "cannot remove %s", beforefile); free (beforefile); } if (afterfile != NULL) { ! if (unlink_file (afterfile) < 0) error (0, errno, "cannot remove %s", afterfile); free (afterfile); } if (outfile != NULL) { ! if (unlink_file (outfile) < 0) error (0, errno, "cannot remove %s", outfile); free (outfile); } --- 4872,4890 ---- free (after); if (beforefile != NULL) { ! if (CVS_UNLINK (beforefile) < 0) error (0, errno, "cannot remove %s", beforefile); free (beforefile); } if (afterfile != NULL) { ! if (CVS_UNLINK (afterfile) < 0) error (0, errno, "cannot remove %s", afterfile); free (afterfile); } if (outfile != NULL) { ! if (CVS_UNLINK (outfile) < 0) error (0, errno, "cannot remove %s", outfile); free (outfile); }