Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 25173

Summary: commits fail in cvs-1.11-2.src.rpm
Product: [Retired] Red Hat Raw Hide Reporter: Need Real Name <ehl>
Component: cvsAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-29 09:11:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-01-29 09:11:50 UTC
Commits failed for me when using a cvs built from cvs-1.11-2.src.rpm.  The problem was that the last security patch added an extra unlink(), but it didn't check if the error was ENOENT before failing.  The ENOENT should be fine in this case.

Please see below for a patch.  I also changed the sense of another existence_error() test that seemed obviously wrong from my eyeballing the code.  I didn't test that change, however.

----------------------

--- cvs-1.11/src/rcs.c.unlink   Sun Jan 28 23:27:24 2001
+++ cvs-1.11/src/rcs.c  Sun Jan 28 23:58:02 2001
@@ -4317,7 +4317,7 @@
 
        /* Unlink `dest', just in case.  It's okay if this provokes a
           ENOENT error. */
-       if (unlink (dest) < 0 && existence_error (errno))
+       if (unlink (dest) < 0 && !existence_error (errno))
            error (1, errno, "cannot remove %s", dest);
        if (mknod (dest, special_file, devnum) < 0)
            error (1, errno, "could not create special file %s",
@@ -4340,7 +4340,7 @@
            {
                /* Unconditionally remove the old file, so that safe_fopen
                 * can succeed */
-               if (unlink_file (sout) < 0)
+               if (unlink_file (sout) < 0 && !existence_error (errno))
                    error (1, errno, "cannot remove %s", sout);
                ofp = CVS_SAFE_FOPEN (sout, expand == KFLAG_B ? "wb" : "w");
                if (ofp == NULL)

Comment 1 Nalin Dahyabhai 2001-01-29 20:59:17 UTC
This should be fixed in cvs-1.11-3.  (The first instance even conflicts with the
comment which precedes it, so I'm pretty sure you're correct about it being
wrong.)

Comment 2 Nalin Dahyabhai 2001-02-06 19:05:32 UTC
*** Bug 25995 has been marked as a duplicate of this bug. ***

Comment 3 Jeremy Katz 2001-02-11 00:01:35 UTC
*** Bug 26994 has been marked as a duplicate of this bug. ***

Comment 4 Jeremy Katz 2001-02-14 01:32:45 UTC
*** Bug 27447 has been marked as a duplicate of this bug. ***

Comment 5 Nalin Dahyabhai 2001-04-05 18:18:13 UTC
*** Bug 34872 has been marked as a duplicate of this bug. ***