On Tue, 18 Sep 2001, Ask Bjoern Hansen wrote:

> I am using the CVS that comes with the latest FreeBSD (--version
> says 1.11) plus the attached patch.
>
> Some users (3 out of 7) gets (once in a while) the first two
> characters of their username shopped out.
>
> The CVS_USER_NAME variable the patch sets is okay, but the username
> used in $Id:'s and such are borken. (See example below).

Grrh; the patch at http://www.cvshome.org/dev/patches/user is
broken.  The attached works better. (Robert Spier <[EMAIL PROTECTED]>
fixed it up).  I've also put it at
http://develooper.com/code/cvs/cvs.user.patch


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/         !try; do();
more than a billion impressions per week, http://valueclick.com
*** cvs.h~      Tue Oct 31 01:37:52 2000
--- cvs.h       Fri Sep 14 07:30:25 2001
***************
*** 277,282 ****
--- 277,285 ----
  #define       CVSUMASK_ENV    "CVSUMASK"      /* Effective umask for repository */
  /* #define    CVSUMASK_DFLT              Set by options.h */
  
+ /* Client user name for the server end of client/server mode */
+ #define CVS_USER_NAME_ENV "CVS_USER_NAME"
+ 
  /*
   * If the beginning of the Repository matches the following string, strip it
   * so that the output to the logfile does not contain a full pathname.
*** main.c~     Tue Oct 31 01:37:53 2000
--- main.c      Fri Sep 14 07:32:51 2001
***************
*** 776,781 ****
--- 776,796 ----
        server_active = strcmp (command_name, "server") == 0;
  #endif
  
+       /* Set up this environment variable so that the CVSROOT/*info
+          scripts on the server can know the client's identity.
+          This is done by setting the CVS_USER_NAME environment
+          for the environment of the client to match whatever name
+          was used by the client to get at CVS (as opposed to the 
+          user ID that CVS happens to be running under).  */
+ 
+       if (!getenv(CVS_USER_NAME_ENV)) {
+         char *user = getcaller();
+         char *env = xmalloc(strlen(user) + strlen(CVS_USER_NAME_ENV) +
+                                                   1 + 1);
+         (void) sprintf(env, "%s=%s", CVS_USER_NAME_ENV, user);
+         (void) putenv(env);
+       }
+ 
        /* This is only used for writing into the history file.  For
           remote connections, it might be nice to have hostname
           and/or remote path, on the other hand I'm not sure whether

Reply via email to