/[gentoo-x86]/x11-base/xorg-server/files/1.7.0-xkb-check-permissions-on-XKM_OUTPUT_DIR.patch
Gentoo

Contents of /x11-base/xorg-server/files/1.7.0-xkb-check-permissions-on-XKM_OUTPUT_DIR.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Oct 14 12:22:55 2009 UTC (4 years, 11 months ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Version bup xorg-server 1.7. Remove old one.
(Portage version: 2.2_rc46/cvs/Linux x86_64)

1 From 9bc7cbf9c02656982c2525836b5498993f708e02 Mon Sep 17 00:00:00 2001
2 From: Nirbheek Chauhan <nirbheek@gentoo.org>
3 Date: Tue, 29 Sep 2009 22:35:06 +0530
4 Subject: [PATCH 01/10] xkb: check permissions on XKM_OUTPUT_DIR
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Checking just for root is insufficient since that does not guarantee write/read
10 permissions in XKM_OUTPUT_DIR (for example with sandbox).
11
12 Check if we can write a file, as well as read it later. Otherwise, invoke the
13 fallback to /tmp
14
15 Signed-off-by: Nirbheek Chauhan <nirbheek@gentoo.org>
16 Signed-off-by: RĂ©mi Cardona <remi@gentoo.org>
17 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
18 ---
19 xkb/ddxLoad.c | 5 ++---
20 1 files changed, 2 insertions(+), 3 deletions(-)
21
22 diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
23 index 6954dd1..ba8d50b 100644
24 --- a/xkb/ddxLoad.c
25 +++ b/xkb/ddxLoad.c
26 @@ -158,10 +158,9 @@ OutputDirectory(
27 size_t size)
28 {
29 #ifndef WIN32
30 - if (getuid() == 0 && (strlen(XKM_OUTPUT_DIR) < size))
31 + /* Can we write an xkm and then open it too? */
32 + if (access(XKM_OUTPUT_DIR, W_OK | X_OK) == 0 && (strlen(XKM_OUTPUT_DIR) < size))
33 {
34 - /* if server running as root it *may* be able to write */
35 - /* FIXME: check whether directory is writable at all */
36 (void) strcpy (outdir, XKM_OUTPUT_DIR);
37 } else
38 #else
39 --
40 1.6.5.rc1

  ViewVC Help
Powered by ViewVC 1.1.20