Magellan Linux

Contents of /trunk/xf86dga/patches/xf86dga-1.0.1-setuid.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (show annotations) (download)
Tue May 8 20:52:56 2007 UTC (17 years ago) by niro
File size: 709 byte(s)
-import

1 Index: dga.c
2 ===================================================================
3 RCS file: /cvs/xorg/app/xf86dga/dga.c,v
4 retrieving revision 1.2
5 diff -u -r1.2 dga.c
6 --- dga.c 23 Apr 2004 19:54:47 -0000 1.2
7 +++ dga.c 19 Jun 2006 21:31:33 -0000
8 @@ -16,6 +16,7 @@
9 #include <X11/Xmd.h>
10 #include <X11/extensions/xf86dga.h>
11 #include <ctype.h>
12 +#include <errno.h>
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <signal.h>
16 @@ -141,7 +142,10 @@
17
18 #ifndef __UNIXOS2__
19 /* Give up root privs */
20 - setuid(getuid());
21 + if (setuid(getuid()) == -1) {
22 + fprintf(stderr, "Unable to change uid: %s\n", strerror(errno));
23 + exit(2);
24 + }
25 #endif
26
27 XF86DGASetViewPort(dis, DefaultScreen(dis), 0, 0);