diff -urNp cvs-1.11.17.org/src/server.c cvs-1.11.17/src/server.c
--- cvs-1.11.17.org/src/server.c 2006-09-13 17:35:21.000000000 +0900
+++ cvs-1.11.17/src/server.c 2006-09-13 18:07:24.000000000 +0900
@@ -5785,7 +5785,56 @@ handle_return:
It might or might not be the same as host_user. */
CVS_Username = xmalloc (strlen (username) + 1);
strcpy (CVS_Username, username);
- }
+
+ if ( ! strcmp (username, host_user) ) {
+ char filename[256] = { 0, };
+ FILE *op;
+ int userlen = strlen (username);
+ char *linebuf = NULL;
+ size_t linebuf_len;
+ struct stat mapfile;
+ sprintf (filename, "%s/%s/usermap", repository, CVSROOTADM);
+
+ //syslog (LOG_DAEMON | LOG_NOTICE, "oops: %s", filename);
+
+ if ( CVS_STAT (filename, &mapfile) > -1 ) {
+ if ( (op = CVS_FOPEN (filename, "r")) != NULL ) {
+ while ( getline (&linebuf, &linebuf_len, op) >= 0 ) {
+ if ( (strncmp (linebuf, username, userlen) == 0)
+ && (linebuf[userlen] == ':') ) {
+ char *mapuser = NULL;
+ char *ws = NULL;
+ char mapuserlen = 0;
+
+ mapuser = strchr (linebuf, ':');
+ if ( (ws = strchr (mapuser, ' ')) )
+ mapuser[ws - mapuser] = 0;
+ else if ( (ws = strchr (mapuser, '\t')) )
+ mapuser[ws - mapuser] = 0;
+ else if ( (ws = strchr (mapuser, '\r')) )
+ mapuser[ws - mapuser] = 0;
+ else if ( (ws = strchr (mapuser, '\n')) )
+ mapuser[ws - mapuser] = 0;
+
+ mapuserlen = strlen (mapuser) - 1;
+ if ( mapuserlen > 0 ) {
+ free (host_user);
+ host_user = xstrdup (mapuser + 1);
+ }
+ break;
+ }
+ }
+ }
+ if (linebuf) free (linebuf);
+
+ if ( ferror (op) )
+ error (0, errno, "cannot read %s", filename);
+
+ if ( fclose (op) < 0 )
+ error (0, errno, "cannot close %s", filename);
+ }
+ }
+ }
return host_user;
}