aboutsummaryrefslogtreecommitdiffstats
path: root/unix/xorg-7.5-patches/0001-Add-xkbcompdir-param.patch
blob: f7f358b49cd669d8073fdc3648232ea45315d315 (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
From 5e6e99eaef3ca346c78a3e520ed58ec8b8100b41 Mon Sep 17 00:00:00 2001
From: Adam Tkac <atkac@redhat.com>
Date: Thu, 2 Sep 2010 17:24:38 +0200
Subject: [PATCH] Add -xkbcompdir parameter to modify "xkbcomp" path from commandline.

Signed-off-by: Adam Tkac <atkac@redhat.com>
---
 xkb/xkbInit.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index fbf8f14..29fb33e 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -742,7 +742,28 @@ XkbProcessArguments(int argc,char *argv[],int i)
 	    }
 	}
 	return j;
+    } else if (strncmp(argv[i], "-xkbcompdir", 11)==0) {
+	if (++i < argc) {
+#if !defined(WIN32) && !defined(__CYGWIN__)
+            if (getuid() != geteuid()) {
+                LogMessage(X_WARNING, "-xkbdir is not available for setuid X servers\n");
+                return -1;
+            } else
+#endif
+	    {
+		if (strlen(argv[i]) < PATH_MAX) {
+		    XkbBinDirectory = argv[i];
+		    return 2;
+		} else {
+		    LogMessage(X_ERROR, "-xkbcompdir pathname too long\n");
+		    return -1;
+		}
+	    }
+	} else {
+	    return -1;
+	}
     }
+
     if ((strcmp(argv[i], "-ardelay") == 0) ||
         (strcmp (argv[i], "-ar1") == 0)) {	/* -ardelay int */
 	if (++i >= argc) UseMsg ();
-- 
1.7.2.3