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
|
$NetBSD: patch-ar,v 1.4 2013/10/14 06:51:02 adam Exp $
--- src/server.c.orig 2005-09-28 15:25:59.000000000 +0000
+++ src/server.c
@@ -982,6 +982,7 @@ error ENOMEM Virtual memory exhausted.\n
config->MaxCompressionLevel);
}
+ if (!nolock) {
path = xmalloc (strlen (current_parsed_root->directory)
+ sizeof (CVSROOTADM)
+ 2);
@@ -999,6 +1000,7 @@ error ENOMEM Virtual memory exhausted.\n
pending_error = save_errno;
}
free (path);
+ }
setenv (CVSROOT_ENV, current_parsed_root->directory, 1);
}
@@ -3073,8 +3075,12 @@ serve_global_option (char *arg)
break;
case 'n':
noexec = 1;
+ nolock = 1;
logoff = 1;
break;
+ case 'u':
+ nolock = 1;
+ break;
case 'q':
quiet = 1;
break;
@@ -6523,6 +6529,7 @@ static void
switch_to_user (const char *cvs_username, const char *username)
{
struct passwd *pw;
+ int rc;
#ifdef HAVE_PAM
int retval;
char *pam_stage = "open session";
@@ -6629,7 +6636,15 @@ error 0 %s: no such system user\n", user
}
}
- 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
|