[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
99/108: gnu: gnome-font-viewer: Update to 3.34.0.
From: |
guix-commits |
Subject: |
99/108: gnu: gnome-font-viewer: Update to 3.34.0. |
Date: |
Sat, 25 Apr 2020 15:23:05 -0400 (EDT) |
kkebreau pushed a commit to branch wip-gnome3.36
in repository guix.
commit ee7371b50f132328eaafd5b385cde1c7087b11a4
Author: Kei Kebreau <address@hidden>
AuthorDate: Thu Apr 23 19:03:38 2020 -0400
gnu: gnome-font-viewer: Update to 3.34.0.
* gnu/packages/gnome.scm (gnome-font-viewer): Update to 3.34.0.
[source]: Add patch.
* gnu/packages/patches/gnome-font-viewer-CVE-2019-19308.patch: New file.
---
gnu/packages/gnome.scm | 6 +-
.../patches/gnome-font-viewer-CVE-2019-19308.patch | 150 +++++++++++++++++++++
2 files changed, 154 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 6422de6..482a2d9 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -1394,7 +1394,7 @@ and keep up to date translations of documentation.")
(define-public gnome-font-viewer
(package
(name "gnome-font-viewer")
- (version "3.30.0")
+ (version "3.34.0")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnome/sources/gnome-font-viewer/"
@@ -1402,7 +1402,9 @@ and keep up to date translations of documentation.")
"/gnome-font-viewer-" version ".tar.xz"))
(sha256
(base32
- "1wwnx2zrlbd2d6np7m9s78alx6j6ranrnh1g2z6zrv9qcj8rpzz5"))))
+ "12xrsqwmvid7hksiw4zhj4jd1qwxn8w0czskbq4yqfprwn1havxa"))
+ (patches
+ (search-patches "gnome-font-viewer-CVE-2019-19308.patch"))))
(build-system meson-build-system)
(arguments
'(#:phases
diff --git a/gnu/packages/patches/gnome-font-viewer-CVE-2019-19308.patch
b/gnu/packages/patches/gnome-font-viewer-CVE-2019-19308.patch
new file mode 100644
index 0000000..5222893
--- /dev/null
+++ b/gnu/packages/patches/gnome-font-viewer-CVE-2019-19308.patch
@@ -0,0 +1,150 @@
+Source:
https://sources.debian.org/patches/gnome-font-viewer/3.34.0-2/git_cve_fix.patch/
+
+diff --git a/src/font-model.c b/src/font-model.c
+index 658cba8..e66c401 100644
+--- a/src/font-model.c
++++ b/src/font-model.c
+@@ -33,6 +33,7 @@
+
+ #include "font-model.h"
+ #include "font-utils.h"
++#include "sushi-font-loader.h"
+
+ struct _FontViewModel
+ {
+@@ -137,7 +138,7 @@ font_view_model_has_face (FontViewModel *self,
+ g_autofree gchar *match_name = NULL;
+
+ n_items = g_list_model_get_n_items (G_LIST_MODEL (self->model));
+- match_name = font_utils_get_font_name (face);
++ match_name = sushi_get_font_name (face, TRUE);
+
+ for (idx = 0; idx < n_items; idx++) {
+ FontViewModelItem *item = g_list_model_get_item (G_LIST_MODEL
(self->model), idx);
+diff --git a/src/font-utils.c b/src/font-utils.c
+index 5a75fb3..6a41d26 100644
+--- a/src/font-utils.c
++++ b/src/font-utils.c
+@@ -23,15 +23,6 @@
+ #include "sushi-font-loader.h"
+
+ gchar *
+-font_utils_get_font_name (FT_Face face)
+-{
+- if (g_strcmp0 (face->style_name, "Regular") == 0)
+- return g_strdup (face->family_name);
+-
+- return g_strconcat (face->family_name, ", ", face->style_name, NULL);
+-}
+-
+-gchar *
+ font_utils_get_font_name_for_file (FT_Library library,
+ GFile *file,
+ gint face_index)
+@@ -49,7 +40,7 @@ font_utils_get_font_name_for_file (FT_Library library,
+ return NULL;
+ }
+
+- name = font_utils_get_font_name (face);
++ name = sushi_get_font_name (face, TRUE);
+ FT_Done_Face (face);
+
+ return name;
+diff --git a/src/font-utils.h b/src/font-utils.h
+index 6f73bb4..1787bbb 100644
+--- a/src/font-utils.h
++++ b/src/font-utils.h
+@@ -25,7 +25,6 @@
+ #include FT_FREETYPE_H
+ #include <gio/gio.h>
+
+-gchar * font_utils_get_font_name (FT_Face face);
+ gchar * font_utils_get_font_name_for_file (FT_Library library,
+ GFile *file,
+ gint face_index);
+diff --git a/src/sushi-font-loader.c b/src/sushi-font-loader.c
+index f7cf1de..df28c1a 100644
+--- a/src/sushi-font-loader.c
++++ b/src/sushi-font-loader.c
+@@ -67,6 +67,13 @@ font_load_job_free (FontLoadJob *job)
+
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC (FontLoadJob, font_load_job_free)
+
++static void
++face_data_finalizer (void *object)
++{
++ FT_Face face = object;
++ g_clear_object (&face->generic.data);
++}
++
+ static FT_Face
+ create_face_from_contents (FontLoadJob *job,
+ gchar **contents,
+@@ -88,6 +95,9 @@ create_face_from_contents (FontLoadJob *job,
+ return NULL;
+ }
+
++ retval->generic.data = g_object_ref (job->file);
++ retval->generic.finalizer = face_data_finalizer;
++
+ *contents = g_steal_pointer (&job->face_contents);
+ return retval;
+ }
+@@ -172,3 +182,31 @@ sushi_new_ft_face_from_uri_finish (GAsyncResult *result,
+
+ return create_face_from_contents (job, contents, error);
+ }
++
++/**
++ * sushi_get_font_name: (skip)
++ *
++ */
++gchar *
++sushi_get_font_name (FT_Face face,
++ gboolean short_form)
++{
++ const char *style_name = face->style_name;
++ const char *family_name = face->family_name;
++
++ if (family_name == NULL) {
++ /* Try to get the basename of the file this was loaded from */
++ GFile *file = face->generic.data;
++ if (G_IS_FILE (file))
++ return g_file_get_basename (file);
++
++ /* Use an empty string as the last fallback */
++ return g_strdup ("");
++ }
++
++ if (style_name == NULL ||
++ (short_form && g_strcmp0 (style_name, "Regular") == 0))
++ return g_strdup (family_name);
++
++ return g_strconcat (family_name, ", ", style_name, NULL);
++}
+diff --git a/src/sushi-font-loader.h b/src/sushi-font-loader.h
+index 82aab03..b078e4a 100644
+--- a/src/sushi-font-loader.h
++++ b/src/sushi-font-loader.h
+@@ -46,4 +46,7 @@ FT_Face sushi_new_ft_face_from_uri_finish (GAsyncResult
*result,
+ gchar **contents,
+ GError **error);
+
++gchar * sushi_get_font_name (FT_Face face,
++ gboolean short_form);
++
+ #endif /* __SUSHI_FONT_LOADER_H__ */
+diff --git a/src/sushi-font-widget.c b/src/sushi-font-widget.c
+index 144a3d6..ac1fcd4 100644
+--- a/src/sushi-font-widget.c
++++ b/src/sushi-font-widget.c
+@@ -378,8 +378,7 @@ build_strings_for_face (SushiFontWidget *self)
+ self->sample_string = random_string_from_available_chars (self->face, 36);
+
+ g_free (self->font_name);
+- self->font_name = g_strconcat (self->face->family_name, " ",
+- self->face->style_name, NULL);
++ self->font_name = sushi_get_font_name (self->face, FALSE);
+ }
+
+ static gint *
- 79/108: gnu: glade: Update to 3.22.2., (continued)
- 79/108: gnu: glade: Update to 3.22.2., guix-commits, 2020/04/25
- 83/108: gnu: gnome-boxes: Update to 3.36.3., guix-commits, 2020/04/25
- 84/108: gnu: devhelp: Update to 3.36.1., guix-commits, 2020/04/25
- 86/108: gnu: libgnome-games-support: Update to 1.6.1., guix-commits, 2020/04/25
- 88/108: gnu: libxml++: Update to 3.2.0., guix-commits, 2020/04/25
- 95/108: gnu: gnome-system-monitor: Update to 3.36.0., guix-commits, 2020/04/25
- 101/108: gnu: gnome-characters: Update to 3.34.0., guix-commits, 2020/04/25
- 103/108: gnu: gnome-clocks: Update to 3.36.0., guix-commits, 2020/04/25
- 96/108: gnu: gnome-contacts: Update to 3.36.1., guix-commits, 2020/04/25
- 97/108: gnu: five-or-more: Update to 3.32.2., guix-commits, 2020/04/25
- 99/108: gnu: gnome-font-viewer: Update to 3.34.0.,
guix-commits <=
- 104/108: gnu: sushi: Update to 3.34.0., guix-commits, 2020/04/25
- 105/108: gnu: gnome-klotski: Update to 3.36.0., guix-commits, 2020/04/25
- 107/108: gnu: grilo: Update to 0.3.12., guix-commits, 2020/04/25
- 73/108: gnu: gnome-terminal: Update to 3.36.1.1., guix-commits, 2020/04/25
- 76/108: gnu: simple-scan: Update to 3.36.1., guix-commits, 2020/04/25
- 80/108: gnu: libpeas: Update to 1.26.0., guix-commits, 2020/04/25
- 82/108: gnu: gedit: Update to 3.36.1., guix-commits, 2020/04/25
- 71/108: gnu: gom: Update to 0.4., guix-commits, 2020/04/25
- 77/108: gnu: orca: Update to 3.36.2., guix-commits, 2020/04/25
- 81/108: gnu: Add tepl., guix-commits, 2020/04/25