summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2009-11-14 18:39:00 +0100
committerKeith Packard <keithp@keithp.com>2009-11-17 12:55:44 -0800
commit30be7ceaf228497ac1ff0a1123c1b35e3aa1fc73 (patch)
tree121fe0c28a54547b28695ac3e12856a6cb8e9238
parentfb95090730360b6b7f5429c40937e8fc9dfe5c14 (diff)
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 <http://bugs.debian.org/555308> See also http://thread.gmane.org/gmane.comp.security.oss.general/2299 Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/xfree86/common/xf86Init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 2d682aaa9..30f0c8559 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1151,8 +1151,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