mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-06 19:00:12 +01:00
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>
(cherry picked from commit 30be7ceaf2)
This commit is contained in:
parent
e6872c89bc
commit
bebf7b1a34
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue