- Update accountsservice-sysconfig.patch: work with SELinux policy

(bsc#1222978).

OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/accountsservice?expand=0&rev=175
This commit is contained in:
Dominique Leuenberger 2024-06-19 09:27:00 +00:00 committed by Git OBS Bridge
parent d2b10f7ff3
commit eebf62c97e
2 changed files with 36 additions and 5 deletions

View File

@ -101,7 +101,7 @@ Index: accountsservice-23.13.9/src/gdm-sysconfig.c
===================================================================
--- /dev/null
+++ accountsservice-23.13.9/src/gdm-sysconfig.c
@@ -0,0 +1,484 @@
@@ -0,0 +1,509 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Hans Petter Jansson <hpj@novell.com>
@ -143,6 +143,7 @@ Index: accountsservice-23.13.9/src/gdm-sysconfig.c
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
+#include <gio/gio.h>
+
+#include "gdm-sysconfig.h"
+
@ -196,10 +197,17 @@ Index: accountsservice-23.13.9/src/gdm-sysconfig.c
+{
+ GIOStatus last_status = G_IO_STATUS_ERROR;
+ GIOChannel *channel = NULL;
+ gchar *temp_file_name;
+ g_autofree gchar *temp_file_name = NULL;
+ gint i;
+ gchar *path = NULL;
+ g_autofree char *template = NULL;
+
+ temp_file_name = g_strdup_printf ("%s.new.%u", file_name, g_random_int ());
+ template = g_strdup_printf ("/run/sysconfig.XXXXXX");
+ path = g_mkdtemp (template);
+ if (path == NULL)
+ goto out;
+
+ temp_file_name = g_strdup_printf ("%s/%s.new",path, g_path_get_basename(file_name));
+
+ channel = g_io_channel_new_file (temp_file_name, "w", NULL);
+ if (!channel)
@ -232,10 +240,27 @@ Index: accountsservice-23.13.9/src/gdm-sysconfig.c
+ g_io_channel_unref (channel);
+ }
+
+ if (last_status == G_IO_STATUS_NORMAL && g_rename (temp_file_name, file_name) != 0)
+ gboolean result = FALSE;
+ if (last_status == G_IO_STATUS_NORMAL && temp_file_name) {
+ g_autoptr (GFile) old_file = g_file_new_for_path(temp_file_name);
+ g_autoptr (GFile) new_file = g_file_new_for_path(file_name);
+ g_remove(file_name);
+ result = g_file_move (old_file,
+ new_file,
+ G_FILE_COPY_OVERWRITE,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+ }
+
+ if (last_status == G_IO_STATUS_NORMAL && !result)
+ last_status = G_IO_STATUS_ERROR;
+
+ g_free (temp_file_name);
+ if (path) {
+ g_rmdir(path);
+ }
+
+ return last_status == G_IO_STATUS_NORMAL ? TRUE : FALSE;
+}
+

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 19 01:14:06 UTC 2024 - Xiaoguang Wang <xiaoguang.wang@suse.com>
- Update accountsservice-sysconfig.patch: work with SELinux policy
(bsc#1222978).
-------------------------------------------------------------------
Tue May 7 13:45:31 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>