aboutsummaryrefslogtreecommitdiff
path: root/doc/nx-X11_vs_XOrg69_patches/NXextension.c.NX.patch
blob: 84c5b130a8beacdfce77ded7f1825f749e5f177b (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
--- ./nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.X.original	2015-02-13 14:03:44.744441510 +0100
+++ ./nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c	2015-02-10 19:13:13.804685886 +0100
@@ -1,3 +1,20 @@
+/**************************************************************************/
+/*                                                                        */
+/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
+/*                                                                        */
+/* NXAGENT, NX protocol compression and NX extensions to this software    */
+/* are copyright of NoMachine. Redistribution and use of the present      */
+/* software is allowed according to terms specified in the file LICENSE   */
+/* which comes in the source distribution.                                */
+/*                                                                        */
+/* Check http://www.nomachine.com/licensing.html for applicability.       */
+/*                                                                        */
+/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
+/*                                                                        */
+/* All rights reserved.                                                   */
+/*                                                                        */
+/**************************************************************************/
+
 /* $XFree86: xc/programs/Xserver/dix/extension.c,v 3.11 2001/12/14 19:59:31 dawes Exp $ */
 /***********************************************************
 
@@ -60,7 +77,7 @@
 #include "extnsionst.h"
 #include "gcstruct.h"
 #include "scrnintstr.h"
-#include "dispatch.h"
+#include "../../dix/dispatch.h"
 #ifdef XCSECURITY
 #define _SECURITY_SERVER
 #include <X11/extensions/security.h>
@@ -69,6 +86,8 @@
 #include "lbxserve.h"
 #endif
 
+#include "Trap.h"
+
 #define EXTENSION_BASE  128
 #define EXTENSION_EVENT_BASE  64
 #define LAST_EVENT  128
@@ -324,6 +343,13 @@
     {
 	i = FindExtension((char *)&stuff[1], stuff->nbytes);
         if (i < 0
+
+            /*
+             * Hide RENDER if our implementation
+             * is faulty.
+             */
+
+            || (nxagentRenderTrap && strcmp(extensions[i]->name, "RENDER") == 0)
 #ifdef XCSECURITY
 	    /* don't show insecure extensions to untrusted clients */
 	    || (client->trustLevel == XSecurityClientUntrusted &&
@@ -370,6 +396,14 @@
 		!extensions[i]->secure)
 		continue;
 #endif
+            /*
+             * Hide RENDER if our implementation
+             * is faulty.
+             */
+
+            if (nxagentRenderTrap && strcmp(extensions[i]->name, "RENDER") == 0)
+                continue;
+
 	    total_length += strlen(extensions[i]->name) + 1;
 	    reply.nExtensions += 1 + extensions[i]->num_aliases;
 	    for (j = extensions[i]->num_aliases; --j >= 0;)