Bug 25173 - commits fail in cvs-1.11-2.src.rpm
Summary: commits fail in cvs-1.11-2.src.rpm
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: cvs   
(Show other bugs)
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
: 25995 26994 27447 34872 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-01-29 09:11 UTC by Need Real Name
Modified: 2007-04-18 16:30 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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. ***


Note You need to log in before you can comment on or make changes to this bug.