Annotation of /trunk/xinit/patches/xinit-1.0.1-setuid.patch
Parent Directory | Revision Log
Revision 153 -
(hide annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 544 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 544 byte(s)
-import
1 | niro | 153 | Index: xinit.c |
2 | =================================================================== | ||
3 | RCS file: /cvs/xorg/app/xinit/xinit.c,v | ||
4 | retrieving revision 1.4 | ||
5 | diff -u -r1.4 xinit.c | ||
6 | --- xinit.c 4 Oct 2005 01:27:34 -0000 1.4 | ||
7 | +++ xinit.c 19 Jun 2006 21:31:58 -0000 | ||
8 | @@ -692,7 +692,10 @@ | ||
9 | startClient(char *client[]) | ||
10 | { | ||
11 | if ((clientpid = vfork()) == 0) { | ||
12 | - setuid(getuid()); | ||
13 | + if (setuid(getuid()) == -1) { | ||
14 | + Error("cannot change uid: %s\n", strerror(errno)); | ||
15 | + _exit(ERR_EXIT); | ||
16 | + } | ||
17 | setpgrp(0, getpid()); | ||
18 | environ = newenviron; | ||
19 | #ifdef __UNIXOS2__ |