From f594f4536c27192993dcc22716fa712ed1b10927fba9711a81ae0e920ed7cdd5 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Wed, 7 Aug 2019 08:33:25 +0000 Subject: [PATCH] Accepting request 721395 from home:JonathanKang:branches:GNOME:Factory - Add as-glib-fix-broken-appstream-files-permission.patch: Do not preserve restrictive permissions when installing AppStream files (gh#hughsie/appstream-glib#312). OBS-URL: https://build.opensuse.org/request/show/721395 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/appstream-glib?expand=0&rev=134 --- appstream-glib.changes | 7 ++++ appstream-glib.spec | 7 +++- ...ix-broken-appstream-files-permission.patch | 42 +++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 as-glib-fix-broken-appstream-files-permission.patch diff --git a/appstream-glib.changes b/appstream-glib.changes index 0377e37..ec11916 100644 --- a/appstream-glib.changes +++ b/appstream-glib.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Aug 7 01:02:48 UTC 2019 - Jonathan Kang + +- Add as-glib-fix-broken-appstream-files-permission.patch: Do not + preserve restrictive permissions when installing AppStream files + (gh#hughsie/appstream-glib#312). + ------------------------------------------------------------------- Tue Oct 23 11:12:12 UTC 2018 - bjorn.lie@gmail.com diff --git a/appstream-glib.spec b/appstream-glib.spec index 69583a5..29b5c60 100644 --- a/appstream-glib.spec +++ b/appstream-glib.spec @@ -1,7 +1,7 @@ # # spec file for package appstream-glib # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2014 Dominique Leuenberger, Amsterdam, The Netherlands # # All modifications and additions to the file contributed by third parties @@ -13,7 +13,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # @@ -26,6 +26,8 @@ Group: System/Libraries URL: http://people.freedesktop.org/~hughsient/appstream-glib/ Source0: %{name}-%{version}.tar.xz Source1: openSUSE-appstream-process +#PATCH-FIX-UPSTREAM as-glib-fix-broken-appstream-files-permission.patch gh#hughsie/appstream-glib#312 sckang@suse.com -- Do not preserve restrictive permissions when installing AppStream files. +Patch0: as-glib-fix-broken-appstream-files-permission.patch BuildRequires: docbook-xsl-stylesheets BuildRequires: gcab >= 0.6 BuildRequires: gobject-introspection-devel @@ -150,6 +152,7 @@ for the repositories to be published %prep %setup -q +%patch0 -p1 %build %meson \ diff --git a/as-glib-fix-broken-appstream-files-permission.patch b/as-glib-fix-broken-appstream-files-permission.patch new file mode 100644 index 0000000..a27d4d6 --- /dev/null +++ b/as-glib-fix-broken-appstream-files-permission.patch @@ -0,0 +1,42 @@ +From cce510312389efbe3819de0fa53f9004e6e04399 Mon Sep 17 00:00:00 2001 +From: Richard Hughes +Date: Mon, 5 Aug 2019 09:39:29 +0100 +Subject: [PATCH] Do not preserve restrictive permissions when installing + AppStream files + +Fixes https://github.com/hughsie/appstream-glib/issues/312 +--- + libappstream-glib/as-store.c | 2 +- + libappstream-glib/as-utils.c | 3 +-- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c +index e435340..3e6502a 100644 +--- a/libappstream-glib/as-store.c ++++ b/libappstream-glib/as-store.c +@@ -2561,7 +2561,7 @@ as_store_to_file (AsStore *store, + if (!g_file_replace_contents (file, xml->str, xml->len, + NULL, + FALSE, +- G_FILE_CREATE_NONE, ++ G_FILE_CREATE_REPLACE_DESTINATION, + NULL, + cancellable, + &error_local)) { +diff --git a/libappstream-glib/as-utils.c b/libappstream-glib/as-utils.c +index 366bff9..10da362 100644 +--- a/libappstream-glib/as-utils.c ++++ b/libappstream-glib/as-utils.c +@@ -1182,8 +1182,7 @@ as_utils_install_xml (const gchar *filename, + /* actually copy file */ + file_dest = g_file_new_for_path (path_dest); + if (!g_file_copy (file_src, file_dest, +- G_FILE_COPY_OVERWRITE | +- G_FILE_COPY_TARGET_DEFAULT_PERMS, ++ G_FILE_COPY_OVERWRITE, + NULL, NULL, NULL, error)) + return FALSE; + +-- +2.21.0 +