[gnome-software/wip/kalev/umask-022] Enforce a more permissive umask



commit 91841867772bf8dac15d76eb9e74c7e7aa21429b
Author: Kalev Lember <klember redhat com>
Date:   Thu Apr 25 10:29:41 2019 +0200

    Enforce a more permissive umask
    
    Override the umask to 022 to make it possible to share files between the
    gnome-software process and flatpak system helper process. Ideally this
    should be set when needed in the flatpak plugin, but umask is
    thread-unsafe so there is really no local way to fix this.
    
    This matches flatpak PR https://github.com/flatpak/flatpak/pull/2856

 src/gs-main.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/gs-main.c b/src/gs-main.c
index 2cd43634..913e625a 100644
--- a/src/gs-main.c
+++ b/src/gs-main.c
@@ -14,6 +14,7 @@
 #include <gio/gdesktopappinfo.h>
 #include <gtk/gtk.h>
 #include <locale.h>
+#include <sys/stat.h>
 
 #include "gs-application.h"
 #include "gs-debug.h"
@@ -32,6 +33,13 @@ main (int argc, char **argv)
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
        textdomain (GETTEXT_PACKAGE);
 
+       /* Override the umask to 022 to make it possible to share files between
+        * the gnome-software process and flatpak system helper process.
+        * Ideally this should be set when needed in the flatpak plugin, but
+        * umask is thread-unsafe so there is really no local way to fix this.
+        */
+       umask(022);
+
        /* redirect logs */
        application = gs_application_new ();
        appinfo = g_desktop_app_info_new ("org.gnome.Software.desktop");


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