Bug 25173 - commits fail in cvs-1.11-2.src.rpm
commits fail in cvs-1.11-2.src.rpm
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: cvs (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
David Lawrence
:
: 25995 26994 27447 34872 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-01-29 04:11 EST by Need Real Name
Modified: 2007-04-18 12:30 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-29 04:11:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2001-01-29 04:11:50 EST
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 15:59:17 EST
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 14:05:32 EST
*** Bug 25995 has been marked as a duplicate of this bug. ***
Comment 3 Jeremy Katz 2001-02-10 19:01:35 EST
*** Bug 26994 has been marked as a duplicate of this bug. ***
Comment 4 Jeremy Katz 2001-02-13 20:32:45 EST
*** Bug 27447 has been marked as a duplicate of this bug. ***
Comment 5 Nalin Dahyabhai 2001-04-05 14:18:13 EDT
*** 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.