From bebf7b1a342eaa37849a5b373bd1a507052233a8 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 14 Nov 2009 18:39:00 +0100 Subject: xfree86: set a sane umask before opening the log Xorg creates its log file following the umask of the user running startx, which may result in a world-writable log. Set umask to 022 to prevent this. Debian bug#555308 See also http://thread.gmane.org/gmane.comp.security.oss.general/2299 Signed-off-by: Julien Cristau Reviewed-by: Adam Jackson Signed-off-by: Keith Packard (cherry picked from commit 30be7ceaf228497ac1ff0a1123c1b35e3aa1fc73) --- hw/xfree86/common/xf86Init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index c9baff3ef..d3de6701c 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1142,8 +1142,10 @@ OsVendorInit(void) signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ #endif - if (!beenHere) + if (!beenHere) { + umask(022); xf86LogInit(); + } /* Set stderr to non-blocking. */ #ifndef O_NONBLOCK -- cgit v1.2.3