mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
glib-2.0: fix CVE-2019-13012
(From OE-Core rev: b7bc9c12219f5c48eb6698e4537f6c0be94ac06a) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e7649d187e
commit
a217ea667d
@@ -0,0 +1,40 @@
|
|||||||
|
From 9fd6b4b21891adc318784f6a141f40d767b0d73c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matthias Clasen <mclasen@redhat.com>
|
||||||
|
Date: Tue, 22 Jan 2019 13:26:31 -0500
|
||||||
|
Subject: [PATCH] keyfile settings: Use tighter permissions
|
||||||
|
|
||||||
|
When creating directories, create them with 700 permissions,
|
||||||
|
instead of 777.
|
||||||
|
|
||||||
|
Closes: #1658
|
||||||
|
CVE: CVE-2019-13012
|
||||||
|
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/commit/5e4da714f00f6bfb2ccd6d73d61329c6f3a08429]
|
||||||
|
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
|
||||||
|
|
||||||
|
---
|
||||||
|
gio/gkeyfilesettingsbackend.c | 5 +++--
|
||||||
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
|
||||||
|
index a37978e..580a0b0 100644
|
||||||
|
--- a/gio/gkeyfilesettingsbackend.c
|
||||||
|
+++ b/gio/gkeyfilesettingsbackend.c
|
||||||
|
@@ -89,7 +89,8 @@ g_keyfile_settings_backend_keyfile_write (GKeyfileSettingsBackend *kfsb)
|
||||||
|
|
||||||
|
contents = g_key_file_to_data (kfsb->keyfile, &length, NULL);
|
||||||
|
g_file_replace_contents (kfsb->file, contents, length, NULL, FALSE,
|
||||||
|
- G_FILE_CREATE_REPLACE_DESTINATION,
|
||||||
|
+ G_FILE_CREATE_REPLACE_DESTINATION |
|
||||||
|
+ G_FILE_CREATE_PRIVATE,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
|
compute_checksum (kfsb->digest, contents, length);
|
||||||
|
@@ -640,7 +641,7 @@ g_keyfile_settings_backend_new (const gchar *filename,
|
||||||
|
|
||||||
|
kfsb->file = g_file_new_for_path (filename);
|
||||||
|
kfsb->dir = g_file_get_parent (kfsb->file);
|
||||||
|
- g_file_make_directory_with_parents (kfsb->dir, NULL, NULL);
|
||||||
|
+ g_mkdir_with_parents (g_file_peek_path (kfsb->dir), 0700);
|
||||||
|
|
||||||
|
kfsb->file_monitor = g_file_monitor (kfsb->file, 0, NULL, NULL);
|
||||||
|
kfsb->dir_monitor = g_file_monitor (kfsb->dir, 0, NULL, NULL);
|
||||||
@@ -18,6 +18,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
|
|||||||
file://0001-meson.build-do-not-hardcode-linux-as-the-host-system.patch \
|
file://0001-meson.build-do-not-hardcode-linux-as-the-host-system.patch \
|
||||||
file://0001-meson-do-a-build-time-check-for-strlcpy-before-attem.patch \
|
file://0001-meson-do-a-build-time-check-for-strlcpy-before-attem.patch \
|
||||||
file://glib-meson.cross \
|
file://glib-meson.cross \
|
||||||
|
file://CVE-2019-13012.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI_append_class-native = " file://relocate-modules.patch"
|
SRC_URI_append_class-native = " file://relocate-modules.patch"
|
||||||
|
|||||||
Reference in New Issue
Block a user