SOURCES: cvs-cvspass.patch - quit if unable to create .cvspass (av...

adamg adamg at pld-linux.org
Fri Jan 13 23:20:37 CET 2006


Author: adamg                        Date: Fri Jan 13 22:20:37 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- quit if unable to create .cvspass (avoids segfaults)

---- Files affected:
SOURCES:
   cvs-cvspass.patch (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/cvs-cvspass.patch
diff -u SOURCES/cvs-cvspass.patch:1.4 SOURCES/cvs-cvspass.patch:1.5
--- SOURCES/cvs-cvspass.patch:1.4	Fri May 17 12:33:05 2002
+++ SOURCES/cvs-cvspass.patch	Fri Jan 13 23:20:32 2006
@@ -1,23 +1,29 @@
---- cvs-1.11.1p1/src/login.c.bero	Tue Jul 31 18:12:58 2001
-+++ cvs-1.11.1p1/src/login.c	Tue Jul 31 18:17:32 2001
-@@ -322,8 +322,18 @@
+diff -burN cvs-1.11.21.orig/src/login.c cvs-1.11.21/src/login.c
+--- cvs-1.11.21.orig/src/login.c	2006-01-13 23:13:53.072883256 +0100
++++ cvs-1.11.21/src/login.c	2006-01-13 23:15:29.033295056 +0100
+@@ -313,9 +313,25 @@
      fp = CVS_FOPEN (passfile, "r");
      if (fp == NULL)
      {
--	error (0, errno, "warning: failed to open %s for reading", passfile);
--	goto process;
 +         /* The password file doesn't exist yet - probably because it's
 +         * the first time someone uses cvs login. Create it.
 +         */
 +        fp = CVS_FOPEN (passfile, "w");
++	if (fp == NULL)
++	{
++            /* Creating the password file didn't work. Bail out. */
++	    error(0, errno, "warning: failed to open %s for writing", passfile);
++	    goto process;
++	}
 +        fclose (fp);
 +        fp = CVS_FOPEN (passfile, "r");
 +        if (fp == NULL)
 +        {
-+            /* Creating the password file didn't work. Bail out. */
-+            error (0, errno, "warning: failed to open %s for reading", passfile);
-+            goto process;
-+        }
++            /* Opening the password file didn't work. Bail out. */
+ 	error (0, errno, "warning: failed to open %s for reading", passfile);
+ 	goto process;
      }
++    }
  
-     cvsroot_canonical = normalize_cvsroot (root);
+     /* Check each line to see if we have this entry already. */
+     line = 0;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/cvs-cvspass.patch?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list