[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] do_editor needs to mind access method

From: darkness
Subject: [PATCH] do_editor needs to mind access method
Date: Tue, 14 Aug 2001 19:31:37 -0400
User-agent: Mutt/1.2.5i


        When running "cvs import" with
CVSROOT=:pserver:foo@localhost:/path/to/cvsroot I would get the error:

cvs import: cannot open /path/to/cvsroot/CVSROOT/rcsinfo: Permission denied

        I believe I've tracked this down to logmsg.c:do_editor.  It
doesn't bother to check the access method (CVSroot_method) before
trying to read $CVSROOT/CVSROOT/rcsinfo.  I'm not sure that I've fixed
it the right way, but it seemed to make the most sense (and was quick
:) ).  Patch is attached against SuSE cvs-1.11-87 (looks pretty
vanilla).  A brief examination of import.c and logmsg.c in 1.11.1p1
doesn't show anything that resembles this change.

        Note that parseinfo.c:Parse_Info actually generates the above
error as near as I can tell, and because of checks it does it doesn't
complain if the fopen failed because the file doesn't exist.  In my
case, though, I was running the client and server on the same machine
and the client couldn't read $CVSROOT because of permissions; thus
I would get the error.

        Please feel free to contact me directly (I'm not subscribed to
bug-cvs) for information/berating.


----------8<----------Cut Here----------8<----------
--- src/logmsg.c.orig   Tue Aug 14 18:55:55 2001
+++ src/logmsg.c        Tue Aug 14 19:00:23 2001
@@ -165,8 +165,11 @@
  * editor on the file.  The header garbage in the resultant file is then
  * stripped and the log message is stored in the "message" argument.
- * If REPOSITORY is non-NULL, process rcsinfo for that repository; if it
- * is NULL, use the CVSADM_TEMPLATE file instead.
+ * If REPOSITORY is non-NULL and CVSroot_method is local_method or
+ * server_method, process rcsinfo for that repository; if it
+ * is NULL, use the CVSADM_TEMPLATE file instead.  Note that we have to
+ * check CVSroot_method to make sure that we can locally fiddle with the
+ * repository.
 do_editor (dir, messagep, repository, changes)
@@ -212,7 +215,8 @@
        (void) fprintf (fp, "\n");
-    if (repository != NULL)
+    if ((repository != NULL) && ((CVSroot_method == local_method)
+                                 || (CVSroot_method == server_method)))
        /* tack templates on if necessary */
        (void) Parse_Info (CVSROOTADM_RCSINFO, repository, rcsinfo_proc, 1);
----------8<----------Cut Here----------8<----------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]