[gnome-software/uajain/fix-ext-appstream-perms] external-appstream: Don't bother about permissions while copying



commit 343168b2da4b7737a80cfd86cd550703ef1497fd
Author: Umang Jain <umang endlessm com>
Date:   Fri Sep 20 11:40:00 2019 +0530

    external-appstream: Don't bother about permissions while copying
    
    Don't bother with permissions while copying the external appstream
    file from user's cache to APPSYSTEM_SYSTEM_DIR. This already has been
    now taken care of by the change introduced in [1].
    
    This reason this change is required, is because combination of [1]
    and G_FILE_COPY_TARGET_DEFAULT_PERMS ends up with permissions as:
    -rw------- 1 root root
    as G_FILE_COPY_TARGET_DEFAULT makes entire "unix::mode" attribute
    to be skipped while copying.
    
    Since, as per [1], G_FILE_CREATE_PRIVATE will setup appropriate
    permissions on the destination file itself, avoid injecting
    the G_FILE_COPY_TARGET_DEFAULT flag in g_file_copy() to complicate
    the matter.
    
    (Unfortunately, this requires a glib version bump for upstream)
    
    [1] https://gitlab.gnome.org/GNOME/glib/merge_requests/876
    
    https://phabricator.endlessm.com/T27828

 meson.build                                       | 2 +-
 plugins/external-appstream/gs-install-appstream.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index ac137e81..aa81bd0d 100644
--- a/meson.build
+++ b/meson.build
@@ -103,7 +103,7 @@ gio_unix = dependency('gio-unix-2.0', version : '>= 2.56.0')
 gmodule = dependency('gmodule-2.0')
 goa = dependency('goa-1.0')
 gtk = dependency('gtk+-3.0', version : '>= 3.22.4')
-glib = dependency('glib-2.0', version : '>= 2.55.0')
+glib = dependency('glib-2.0', version : '>= 2.60.4')
 json_glib = dependency('json-glib-1.0', version : '>= 1.2.0')
 libm = cc.find_library('m', required: false)
 libsoup = dependency('libsoup-2.4', version : '>= 2.52.0')
diff --git a/plugins/external-appstream/gs-install-appstream.c 
b/plugins/external-appstream/gs-install-appstream.c
index 7f5eb92d..3ede49ff 100644
--- a/plugins/external-appstream/gs-install-appstream.c
+++ b/plugins/external-appstream/gs-install-appstream.c
@@ -48,8 +48,7 @@ gs_install_appstream_copy_file (GFile *file, GError **error)
         * of the current process (so that should be -rw-r--r--) */
        return g_file_copy (file, cachefn_file,
                            G_FILE_COPY_OVERWRITE |
-                           G_FILE_COPY_NOFOLLOW_SYMLINKS |
-                           G_FILE_COPY_TARGET_DEFAULT_PERMS,
+                           G_FILE_COPY_NOFOLLOW_SYMLINKS,
                            NULL, NULL, NULL, error);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]