diff --git a/accountsservice-sysconfig.patch b/accountsservice-sysconfig.patch index 1a65ab3..2d7aa4e 100644 --- a/accountsservice-sysconfig.patch +++ b/accountsservice-sysconfig.patch @@ -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 @@ -143,6 +143,7 @@ Index: accountsservice-23.13.9/src/gdm-sysconfig.c +#include +#include +#include ++#include + +#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; +} + diff --git a/accountsservice.changes b/accountsservice.changes index 6942bef..85cfe19 100644 --- a/accountsservice.changes +++ b/accountsservice.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 19 01:14:06 UTC 2024 - Xiaoguang Wang + +- Update accountsservice-sysconfig.patch: work with SELinux policy + (bsc#1222978). + ------------------------------------------------------------------- Tue May 7 13:45:31 UTC 2024 - Dominique Leuenberger