summaryrefslogtreecommitdiff
path: root/x11/xorg-libs/patches/patch-cm
blob: fc6ffa9bdff465167ebe2aa6592f68d30aa45f9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$NetBSD: patch-cm,v 1.1 2006/09/14 16:52:54 joerg Exp $

--- programs/xdm/xdmshell.c.orig	2005-07-15 00:58:25.000000000 +0200
+++ programs/xdm/xdmshell.c
@@ -183,7 +183,11 @@ main (
 #endif
 
     /* make xdm run in a non-setuid environment */
-    setuid (geteuid());
+    if (setuid (geteuid()) == -1) {
+	fprintf(stderr, "%s: cannot setuid (error %d, %s)\r\n",
+		ProgramName, errno, strerror(errno));
+	exit(1);
+    }
 
     /*
      * exec /usr/bin/X11/xdm -nodaemon -udpPort 0