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