summaryrefslogtreecommitdiff
path: root/devel/cvs/patches/patch-ar
blob: 385ebf103d579171f9229aed6c5506f540194574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
$NetBSD: patch-ar,v 1.8 2003/01/21 09:57:50 wiz Exp $

--- src/server.c.orig	Tue Jan 21 10:46:47 2003
+++ src/server.c
@@ -772,6 +772,7 @@ E Protocol error: Root says \"%s\" but p
        nothing.  But for rsh, we need to do it now.  */
     parse_config (current_parsed_root->directory);
 
+    if (!nolock) {
     path = xmalloc (strlen (current_parsed_root->directory)
 		   + sizeof (CVSROOTADM)
 		   + 2);
@@ -789,6 +790,7 @@ E Protocol error: Root says \"%s\" but p
 	pending_error = save_errno;
     }
     free (path);
+    }
 
 #ifdef HAVE_PUTENV
     env = xmalloc (strlen (CVSROOT_ENV) + strlen (current_parsed_root->directory) + 2);
@@ -2174,6 +2176,8 @@ serve_global_option (arg)
     {
 	case 'n':
 	    noexec = 1;
+	case 'u':
+	    nolock = 1;
 	    break;
 	case 'q':
 	    quiet = 1;
@@ -4745,8 +4749,13 @@ struct request requests[] =
   REQ_LINE("Max-dotdot", serve_max_dotdot, 0),
   REQ_LINE("Static-directory", serve_static_directory, 0),
   REQ_LINE("Sticky", serve_sticky, 0),
+#ifdef notdef
   REQ_LINE("Checkin-prog", serve_checkin_prog, 0),
   REQ_LINE("Update-prog", serve_update_prog, 0),
+#else
+  REQ_LINE("Checkin-prog", serve_noop, 0),
+  REQ_LINE("Update-prog", serve_noop, 0),
+#endif
   REQ_LINE("Entry", serve_entry, RQ_ESSENTIAL),
   REQ_LINE("Kopt", serve_kopt, 0),
   REQ_LINE("Checkin-time", serve_checkin_time, 0),
@@ -5237,6 +5246,7 @@ switch_to_user (username)
     const char *username;
 {
     struct passwd *pw;
+    int rc;
 
     pw = getpwnam (username);
     if (pw == NULL)
@@ -5296,7 +5306,15 @@ error 0 %s: no such user\n", username);
 	}
     }
 
-    if (setuid (pw->pw_uid) < 0)
+#ifdef SETXID_SUPPORT
+    /* Honor the setuid bit iff set. */
+    if (getuid() != geteuid())
+        rc = setuid (geteuid ());
+    else 
+#else
+        rc = setuid (pw->pw_uid);
+#endif 
+    if (rc < 0)
     {
 	/* Note that this means that if run as a non-root user,
 	   CVSROOT/passwd must contain the user we are running as