1 |
scarabeus 09/10/03 16:05:24 |
2 |
|
3 |
Added: 1.7.0-xkb-check-permissions-on-XKM_OUTPUT_DIR.patch |
4 |
Log: |
5 |
Version bump for xorg-server 1.7. |
6 |
(Portage version: 2.2_rc41/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 x11-base/xorg-server/files/1.7.0-xkb-check-permissions-on-XKM_OUTPUT_DIR.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/xorg-server/files/1.7.0-xkb-check-permissions-on-XKM_OUTPUT_DIR.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/xorg-server/files/1.7.0-xkb-check-permissions-on-XKM_OUTPUT_DIR.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: 1.7.0-xkb-check-permissions-on-XKM_OUTPUT_DIR.patch |
15 |
=================================================================== |
16 |
From 9bc7cbf9c02656982c2525836b5498993f708e02 Mon Sep 17 00:00:00 2001 |
17 |
From: Nirbheek Chauhan <nirbheek@g.o> |
18 |
Date: Tue, 29 Sep 2009 22:35:06 +0530 |
19 |
Subject: [PATCH 01/10] xkb: check permissions on XKM_OUTPUT_DIR |
20 |
MIME-Version: 1.0 |
21 |
Content-Type: text/plain; charset=UTF-8 |
22 |
Content-Transfer-Encoding: 8bit |
23 |
|
24 |
Checking just for root is insufficient since that does not guarantee write/read |
25 |
permissions in XKM_OUTPUT_DIR (for example with sandbox). |
26 |
|
27 |
Check if we can write a file, as well as read it later. Otherwise, invoke the |
28 |
fallback to /tmp |
29 |
|
30 |
Signed-off-by: Nirbheek Chauhan <nirbheek@g.o> |
31 |
Signed-off-by: Rémi Cardona <remi@g.o> |
32 |
Signed-off-by: Peter Hutterer <peter.hutterer@×××××.net> |
33 |
--- |
34 |
xkb/ddxLoad.c | 5 ++--- |
35 |
1 files changed, 2 insertions(+), 3 deletions(-) |
36 |
|
37 |
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c |
38 |
index 6954dd1..ba8d50b 100644 |
39 |
--- a/xkb/ddxLoad.c |
40 |
+++ b/xkb/ddxLoad.c |
41 |
@@ -158,10 +158,9 @@ OutputDirectory( |
42 |
size_t size) |
43 |
{ |
44 |
#ifndef WIN32 |
45 |
- if (getuid() == 0 && (strlen(XKM_OUTPUT_DIR) < size)) |
46 |
+ /* Can we write an xkm and then open it too? */ |
47 |
+ if (access(XKM_OUTPUT_DIR, W_OK | X_OK) == 0 && (strlen(XKM_OUTPUT_DIR) < size)) |
48 |
{ |
49 |
- /* if server running as root it *may* be able to write */ |
50 |
- /* FIXME: check whether directory is writable at all */ |
51 |
(void) strcpy (outdir, XKM_OUTPUT_DIR); |
52 |
} else |
53 |
#else |
54 |
-- |
55 |
1.6.5.rc1 |