1 $NetBSD: patch-ar,v 1.2 1999/04/20 15:09:44 mycroft Exp $
3 --- src/server.c.orig Thu Aug 6 20:46:38 1998
4 +++ src/server.c Wed Feb 23 01:18:51 2000
6 nothing. But for rsh, we need to do it now. */
7 parse_config (CVSroot_directory);
9 - path = xmalloc (strlen (CVSroot_directory)
10 - + sizeof (CVSROOTADM)
11 - + sizeof (CVSROOTADM_HISTORY)
13 - (void) sprintf (path, "%s/%s", CVSroot_directory, CVSROOTADM);
14 - if (!isaccessible (path, R_OK | X_OK))
17 - pending_error_text = malloc (80 + strlen (path));
18 - if (pending_error_text != NULL)
19 - sprintf (pending_error_text, "E Cannot access %s", path);
20 - pending_error = save_errno;
22 - (void) strcat (path, "/");
23 - (void) strcat (path, CVSROOTADM_HISTORY);
24 - if (isfile (path) && !isaccessible (path, R_OK | W_OK))
27 - pending_error_text = malloc (80 + strlen (path));
28 - if (pending_error_text != NULL)
29 - sprintf (pending_error_text, "E \
32 + path = xmalloc (strlen (CVSroot_directory)
33 + + sizeof (CVSROOTADM)
34 + + sizeof (CVSROOTADM_HISTORY)
36 + (void) sprintf (path, "%s/%s", CVSroot_directory, CVSROOTADM);
37 + if (!isaccessible (path, R_OK | X_OK))
40 + pending_error_text = malloc (80 + strlen (path));
41 + if (pending_error_text != NULL)
42 + sprintf (pending_error_text, "E Cannot access %s", path);
43 + pending_error = save_errno;
45 + (void) strcat (path, "/");
46 + (void) strcat (path, CVSROOTADM_HISTORY);
47 + if (isfile (path) && !isaccessible (path, R_OK | W_OK))
50 + pending_error_text = malloc (80 + strlen (path));
51 + if (pending_error_text != NULL)
52 + sprintf (pending_error_text, "E \
53 Sorry, you don't have read/write access to the history file %s", path);
54 - pending_error = save_errno;
55 + pending_error = save_errno;
62 env = malloc (strlen (CVSROOT_ENV) + strlen (CVSroot_directory) + 1 + 1);
72 @@ -4663,19 +4668,23 @@
73 #endif /* HAVE_INITGROUPS */
76 - /* honor the setgid bit iff set*/
77 + /* Honor the setgid bit iff set. */
78 if (getgid() != getegid())
89 - setuid (pw->pw_uid);
90 +#ifdef SETXID_SUPPORT
91 + /* Honor the setuid bit iff set. */
92 + if (getuid() != geteuid())
93 + setuid (geteuid ());
96 + setuid (pw->pw_uid);
99 /* We don't want our umask to change file modes. The modes should
100 be set by the modes used in the repository, and by the umask of