/[gentoo-x86]/x11-base/xorg-server/files/x11r7.0-setuid.diff
Gentoo

Contents of /x11-base/xorg-server/files/x11r7.0-setuid.diff

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Jan 24 06:34:22 2007 UTC (7 years, 6 months ago) by dberkholz
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -0 lines
File MIME type: text/plain
FILE REMOVED
Stop supporting Xorg 7.0.
(Portage version: 2.1.2)
 (Unsigned Manifest commit)

1 Index: xserver/xorg/hw/xfree86/common/xf86Init.c
2 ===================================================================
3 RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/common/xf86Init.c,v
4 retrieving revision 1.29
5 diff -u -u -r1.29 xf86Init.c
6 --- xserver/xorg/hw/xfree86/common/xf86Init.c 14 Dec 2005 20:11:16 -0000 1.29
7 +++ xserver/xorg/hw/xfree86/common/xf86Init.c 20 Jun 2006 07:58:44 -0000
8 @@ -1905,7 +1905,11 @@
9 FatalError("xf86RunVtInit: fork failed (%s)\n", strerror(errno));
10 break;
11 case 0: /* child */
12 - setuid(getuid());
13 + if (setuid(getuid()) == -1) {
14 + xf86Msg(X_ERROR, "xf86RunVtInit: setuid failed (%s)\n",
15 + strerror(errno));
16 + exit(255);
17 + }
18 /* set stdin, stdout to the consoleFd */
19 for (i = 0; i < 2; i++) {
20 if (xf86Info.consoleFd != i) {
21 Index: xserver/xorg/hw/xfree86/os-support/shared/libc_wrapper.c
22 ===================================================================
23 RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/os-support/shared/libc_wrapper.c,v
24 retrieving revision 1.9
25 diff -u -u -r1.9 libc_wrapper.c
26 --- xserver/xorg/hw/xfree86/os-support/shared/libc_wrapper.c 3 Jul 2005 08:53:48 -0000 1.9
27 +++ xserver/xorg/hw/xfree86/os-support/shared/libc_wrapper.c 20 Jun 2006 07:58:45 -0000
28 @@ -1270,7 +1270,10 @@
29 #ifndef SELF_CONTAINED_WRAPPER
30 xf86DisableIO();
31 #endif
32 - setuid(getuid());
33 + if (setuid(getuid()) == -1) {
34 + ErrorF("xf86Execl: setuid() failed: %s\n", strerror(errno));
35 + exit(255);
36 + }
37 #if !defined(SELF_CONTAINED_WRAPPER)
38 /* set stdin, stdout to the consoleFD, and leave stderr alone */
39 for (i = 0; i < 2; i++)
40 Index: xserver/xorg/hw/xfree86/parser/write.c
41 ===================================================================
42 RCS file: /cvs/xorg/xserver/xorg/hw/xfree86/parser/write.c,v
43 retrieving revision 1.3
44 diff -u -u -r1.3 write.c
45 --- xserver/xorg/hw/xfree86/parser/write.c 3 Jul 2005 07:01:37 -0000 1.3
46 +++ xserver/xorg/hw/xfree86/parser/write.c 20 Jun 2006 07:58:45 -0000
47 @@ -170,7 +170,10 @@
48 strerror(errno));
49 return 0;
50 case 0: /* child */
51 - setuid(getuid());
52 + if (setuid(getuid()) == -1)
53 + FatalError("xf86writeConfigFile(): "
54 + "setuid failed(%s)\n",
55 + strerror(errno));
56 ret = doWriteConfigFile(filename, cptr);
57 exit(ret);
58 break;
59 Index: xserver/xorg/os/utils.c
60 ===================================================================
61 RCS file: /cvs/xorg/xserver/xorg/os/utils.c,v
62 retrieving revision 1.21
63 diff -u -u -r1.21 utils.c
64 --- xserver/xorg/os/utils.c 8 Nov 2005 06:33:30 -0000 1.21
65 +++ xserver/xorg/os/utils.c 20 Jun 2006 07:58:47 -0000
66 @@ -1718,8 +1718,10 @@
67 case -1: /* error */
68 p = -1;
69 case 0: /* child */
70 - setgid(getgid());
71 - setuid(getuid());
72 + if (setgid(getgid()) == -1)
73 + _exit(127);
74 + if (setuid(getuid()) == -1)
75 + _exit(127);
76 execl("/bin/sh", "sh", "-c", command, (char *)NULL);
77 _exit(127);
78 default: /* parent */
79 @@ -1770,8 +1772,10 @@
80 xfree(cur);
81 return NULL;
82 case 0: /* child */
83 - setgid(getgid());
84 - setuid(getuid());
85 + if (setgid(getgid()) == -1)
86 + _exit(127);
87 + if (setuid(getuid()) == -1)
88 + _exit(127);
89 if (*type == 'r') {
90 if (pdes[1] != 1) {
91 /* stdout */
92 @@ -1845,8 +1849,10 @@
93 xfree(cur);
94 return NULL;
95 case 0: /* child */
96 - setgid(getgid());
97 - setuid(getuid());
98 + if (setgid(getgid()) == -1)
99 + _exit(127);
100 + if (setuid(getuid()) == -1)
101 + _exit(127);
102 if (*type == 'r') {
103 if (pdes[1] != 1) {
104 /* stdout */

  ViewVC Help
Powered by ViewVC 1.1.20