Sync from SUSE:SLFO:Main accountsservice revision 01c460210f63a089e8745c1119c5edd9

This commit is contained in:
Adrian Schröter 2024-11-12 12:05:49 +01:00
parent 7c70bbe816
commit 5222218318
9 changed files with 212 additions and 148 deletions

BIN
accountsservice-22.08.8.tar.xz (Stored with Git LFS)

Binary file not shown.

BIN
accountsservice-23.13.9.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,9 +1,9 @@
diff -Nur accountsservice-22.08.8/src/user-classify.c new/src/user-classify.c
--- accountsservice-22.08.8/src/user-classify.c 2022-02-23 16:27:48.000000000 +0100
+++ new/src/user-classify.c 2022-04-30 22:33:44.148344188 +0200
@@ -52,7 +52,13 @@
"at",
diff -Nur old/src/user-classify.c new/src/user-classify.c
--- old/src/user-classify.c 2023-06-21 16:19:26.984665518 +0200
+++ new/src/user-classify.c 2023-06-21 16:19:33.793285366 +0200
@@ -53,7 +53,13 @@
"gdm",
"lightdm",
"gnome-initial-setup",
- "git"
+ "git",

View File

@ -0,0 +1,13 @@
Index: accountsservice-23.13.9/subprojects/mocklibc.wrap
===================================================================
--- accountsservice-23.13.9.orig/subprojects/mocklibc.wrap
+++ accountsservice-23.13.9/subprojects/mocklibc.wrap
@@ -3,7 +3,7 @@ directory = mocklibc-1.0
source_url = https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mocklibc/mocklibc-1.0.tar.gz
source_filename = mocklibc-1.0.tar.gz
-source_hash = b2236a6af1028414783e9734a46ea051916ec226479d6a55a3bb823bff68f120
+source_hash = 48966f7a5d3f2139ffdc1e700de7deb9390f852cd4f2a7b97e55029c14097c6e
patch_url = https://wrapdb.mesonbuild.com/v1/projects/mocklibc/1.0/2/get_zip
patch_filename = mocklibc-1.0-2-wrap.zip

View File

@ -5,28 +5,20 @@ Date: Wed Jul 20 16:48:41 2011 +0200
Use autologin configuration from sysconfig (SUSE-ism)
diff -Nur accountsservice-22.08.8/src/daemon.c new/src/daemon.c
--- accountsservice-22.08.8/src/daemon.c 2022-02-23 16:27:48.000000000 +0100
+++ new/src/daemon.c 2022-04-30 22:23:22.228315678 +0200
@@ -50,6 +50,7 @@
Index: accountsservice-23.13.9/src/daemon.c
===================================================================
--- accountsservice-23.13.9.orig/src/daemon.c
+++ accountsservice-23.13.9/src/daemon.c
@@ -51,6 +51,7 @@
#include "util.h"
#include "user.h"
#include "accounts-user-generated.h"
+#include "gdm-sysconfig.h"
#define PATH_PASSWD "/etc/passwd"
#define PATH_SHADOW "/etc/shadow"
@@ -581,7 +582,7 @@
priv->autologin_id = 0;
if (!load_autologin (daemon, &name, &enabled, &error)) {
- g_debug ("failed to load gdms custom.conf: %s", error->message);
+ g_debug ("failed to load autologin config: %s", error->message);
return FALSE;
}
@@ -1508,6 +1509,43 @@
g_object_unref (subject);
#define PATH_PASSWD "passwd"
#define PATH_SHADOW "shadow"
@@ -1789,6 +1790,43 @@ load_autologin_lightdm (Daemon *daemon
return TRUE;
}
+#define SYSCONFIG_FILE "/etc/sysconfig/displaymanager"
@ -69,28 +61,47 @@ diff -Nur accountsservice-22.08.8/src/daemon.c new/src/daemon.c
gboolean
load_autologin (Daemon *daemon,
gchar **name,
@@ -1518,6 +1556,8 @@
GError *local_error = NULL;
g_autofree gchar *string = NULL;
@@ -1797,6 +1835,8 @@ load_autologin (Daemon *daemon,
{
DisplayManagerType dm_type;
+ return load_autologin_suse (daemon, name, enabled, error);
+
keyfile = g_key_file_new ();
if (!g_key_file_load_from_file (keyfile,
PATH_GDM_CUSTOM,
@@ -1558,6 +1598,8 @@
dm_type = get_current_system_dm_type ();
if (dm_type == DISPLAY_MANAGER_TYPE_LIGHTDM)
return load_autologin_lightdm (daemon, name, enabled, error);
@@ -1819,6 +1859,8 @@ save_autologin_gdm (Daemon *daemon,
gboolean result;
g_autoptr(GError) local_error = NULL;
g_autoptr (GError) local_error = NULL;
+ return save_autologin_suse (daemon, name, enabled, error);
+
keyfile = g_key_file_new ();
if (!g_key_file_load_from_file (keyfile,
PATH_GDM_CUSTOM,
diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.c new/src/gdm-sysconfig.c
--- accountsservice-22.08.8/src/gdm-sysconfig.c 1970-01-01 01:00:00.000000000 +0100
+++ new/src/gdm-sysconfig.c 2022-04-30 22:22:54.876314424 +0200
@@ -0,0 +1,484 @@
@@ -1851,6 +1893,8 @@ save_autologin_lightdm (Daemon *dae
gboolean result;
g_autoptr (GError) local_error = NULL;
+ return save_autologin_suse (daemon, name, enabled, error);
+
keyfile = g_key_file_new ();
if (!g_key_file_load_from_file (keyfile,
PATH_LIGHTDM_CONF,
@@ -1879,6 +1923,8 @@ save_autologin (Daemon *daemon,
{
DisplayManagerType dm_type;
+ return save_autologin_suse (daemon, name, enabled, error);
+
dm_type = get_current_system_dm_type ();
if (dm_type == DISPLAY_MANAGER_TYPE_LIGHTDM)
return save_autologin_lightdm (daemon, name, enabled, error);
Index: accountsservice-23.13.9/src/gdm-sysconfig.c
===================================================================
--- /dev/null
+++ accountsservice-23.13.9/src/gdm-sysconfig.c
@@ -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>
@ -132,6 +143,7 @@ diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.c new/src/gdm-sysconfig.c
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
+#include <gio/gio.h>
+
+#include "gdm-sysconfig.h"
+
@ -185,10 +197,17 @@ diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.c new/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)
@ -221,10 +240,27 @@ diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.c new/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;
+}
+
@ -361,7 +397,7 @@ diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.c new/src/gdm-sysconfig.c
+}
+
+static gchar *
+get_value (const gchar **lines, const gchar *key)
+get_value (gchar **lines, const gchar *key)
+{
+ gchar *value = NULL;
+ gchar *key_normal;
@ -472,7 +508,7 @@ diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.c new/src/gdm-sysconfig.c
+ g_return_val_if_fail (file_name != NULL, FALSE);
+ g_return_val_if_fail (sysconfig != NULL, FALSE);
+
+ return save_settings_file (file_name, sysconfig);
+ return save_settings_file (file_name, (gchar **)sysconfig);
+}
+
+gchar *
@ -481,7 +517,7 @@ diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.c new/src/gdm-sysconfig.c
+ g_return_val_if_fail (sysconfig != NULL, NULL);
+ g_return_val_if_fail (key != NULL, NULL);
+
+ return get_value (sysconfig, key);
+ return get_value ((gchar **)sysconfig, key);
+}
+
+gboolean
@ -503,7 +539,7 @@ diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.c new/src/gdm-sysconfig.c
+ g_return_val_if_fail (sysconfig != NULL, FALSE);
+ g_return_val_if_fail (key != NULL, FALSE);
+
+ val = get_value (sysconfig, key);
+ val = get_value ((gchar **)sysconfig, key);
+ if (val == NULL) {
+ return FALSE;
+ }
@ -575,9 +611,10 @@ diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.c new/src/gdm-sysconfig.c
+ g_strfreev (lines);
+ return result;
+}
diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.h new/src/gdm-sysconfig.h
--- accountsservice-22.08.8/src/gdm-sysconfig.h 1970-01-01 01:00:00.000000000 +0100
+++ new/src/gdm-sysconfig.h 2022-04-30 22:22:54.876314424 +0200
Index: accountsservice-23.13.9/src/gdm-sysconfig.h
===================================================================
--- /dev/null
+++ accountsservice-23.13.9/src/gdm-sysconfig.h
@@ -0,0 +1,43 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
@ -622,10 +659,11 @@ diff -Nur accountsservice-22.08.8/src/gdm-sysconfig.h new/src/gdm-sysconfig.h
+G_END_DECLS
+
+#endif /* __GDM_SYSCONFIG_H */
diff -Nur accountsservice-22.08.8/src/meson.build new/src/meson.build
--- accountsservice-22.08.8/src/meson.build 2022-02-23 16:27:48.000000000 +0100
+++ new/src/meson.build 2022-04-30 22:22:54.876314424 +0200
@@ -48,6 +48,8 @@
Index: accountsservice-23.13.9/src/meson.build
===================================================================
--- accountsservice-23.13.9.orig/src/meson.build
+++ accountsservice-23.13.9/src/meson.build
@@ -48,6 +48,8 @@ libaccounts_generated_dep = declare_depe
)
sources = files(

View File

@ -1,3 +1,89 @@
-------------------------------------------------------------------
Mon Aug 12 17:48:05 UTC 2024 - Michael Gorse <mgorse@suse.com>
- Drop as-fate318433-prevent-same-account-multi-logins.patch.
Gnome-shell now has similar functionality upstream.
-------------------------------------------------------------------
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>
- Keep en and en_GB 'translations' in the main package: do not
force -lang packages onto all users.
-------------------------------------------------------------------
Tue Feb 27 06:23:31 UTC 2024 - xiaoguang wang <xiaoguang.wang@suse.com>
- Rebase accountsservice-sysconfig.patch: to fix build with GCC 14
(bsc#1219909).
-------------------------------------------------------------------
Wed Feb 14 10:39:36 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- First part to fix build with GCC 14:
+ Inject patched mocklibc-1.0.tar.gz: only some header
modifications to address implicit declaration of print_indent.
+ Add accountsservice-mocklib-gcc14.patch: patch meson'
subproject definition to validate the injected tarball.
-------------------------------------------------------------------
Tue Nov 28 11:56:40 UTC 2023 - Dominique Leuenberger <dimstar@opensuse.org>
- Use %patch -p N instead of deprecated %patchN.
-------------------------------------------------------------------
Wed Aug 9 01:27:12 UTC 2023 - Xiaoguang Wang <xiaoguang.wang@suse.com>
- Rebase as-fate318433-prevent-same-account-multi-logins.patch:
(bsc#1213884).
-------------------------------------------------------------------
Wed Jul 5 03:07:00 UTC 2023 - Xiaoguang Wang <xiaoguang.wang@suse.com>
- Rebase accountsservice-sysconfig.patch: (boo#1212675 boo#1212973).
- Remove accountsservice-assume-gdm.patch: Fixed by new rebasing
of accountsservice-sysconfig.patch.
-------------------------------------------------------------------
Sat Jun 24 10:36:17 UTC 2023 - Dominique Leuenberger <dimstar@opensuse.org>
- Add accountsservice-assume-gdm.patch: assume gdm when not being
able to detect the used display manager. This is basically the
same as was in place before we gained support for multiple DMs
(boo#1212675).
-------------------------------------------------------------------
Wed Jun 21 14:07:07 UTC 2023 - Ferdinand Thiessen <rpm@fthiessen.de>
- Update to version 23.13.9:
+ daemon: Fix boot delay
+ user-manager:
- Add cancellable to fetch user requests
- Track non-existent users
- Changes from version 23.11.69:
+ Add lightdm autologin support
+ user:
- Return an error when setting invalid language
- Throw a warning for invalid locales
- Support new LocalAccount property in cache file
- Replace usermod -p with chpasswd -e
+ main:
- Use new overridable USERDIR
- Use new overridable ICONDIR
- Use new overridable sysconfdir
+ daemon:
- Add GetUsersLanguages() function
- Don't crash if /etc/shadow doesn't exist
+ Updated translations.
- Rebase patches:
+ accountsservice-sysconfig.patch
+ accountsservice-filter-suse-accounts.patch
-------------------------------------------------------------------
Mon Aug 1 12:01:59 UTC 2022 - Matthias Gerstner <matthias.gerstner@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package accountsservice
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -20,25 +20,25 @@
%bcond_without vala
Name: accountsservice
Version: 22.08.8
Version: 23.13.9
Release: 0
Summary: D-Bus Service to Manipulate User Account Information
License: GPL-3.0-or-later
Group: System/Daemons
URL: https://www.freedesktop.org/wiki/Software/AccountsService/
Source0: https://www.freedesktop.org/software/accountsservice/%{name}-%{version}.tar.xz
# Patched mocklibc source to fix build with GCC 14
Source1: mocklibc-1.0.tar.gz
# PATCH-FIX-UPSTREAM accountsservice-mocklib-gcc14.patch -- Fix meson checksum to accept patched tarball
Patch0: accountsservice-mocklib-gcc14.patch
# WARNING: do not remove/significantly change patch0 without updating the relevant patch in gdm too
# WARNING: do not remove/significantly change patch1 without updating the relevant patch in gdm too
# PATCH-FIX-OPENSUSE accountsservice-sysconfig.patch bnc#688071 vuntz@opensuse.org -- Read/write autologin configuration from sysconfig, like gdm (see gdm-sysconfig-settings.patch) WAS PATCH-FIX-OPENSUSE
Patch0: accountsservice-sysconfig.patch
Patch1: accountsservice-sysconfig.patch
# PATCH-FIX-OPENSUSE accountsservice-filter-suse-accounts.patch vuntz@opensuse.org -- Filter out some system users that are specific to openSUSE
Patch1: accountsservice-filter-suse-accounts.patch
Patch2: accountsservice-filter-suse-accounts.patch
# PATCH-FIX-OPENSUSE harden_accounts-daemon.service.patch jsegitz@suse.com -- For details please see https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
Patch2: harden_accounts-daemon.service.patch
## SLE and Leap only patches start at 1000
# PATCH-FEATURE-SLE as-fate318433-prevent-same-account-multi-logins.patch fate#318433 cxiong@suse.com -- prevent multiple simultaneous login.
Patch1000: as-fate318433-prevent-same-account-multi-logins.patch
Patch3: harden_accounts-daemon.service.patch
BuildRequires: gtk-doc
BuildRequires: meson
@ -97,9 +97,9 @@ querying and manipulating user account information.
%package vala
Summary: Vala bindings for accountsservice
Group: Development/Libraries/C and C++
BuildRequires: vala
Requires: libaccountsservice0 = %{version}
Requires: typelib-1_0-AccountsService-1_0 = %{version}
BuildRequires: vala
%description vala
The accountsservice server provides a set of D-Bus interfaces for
@ -112,14 +112,9 @@ This package contains the Vala bindings for accountservice.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
# SLE and Leap patches start at 1000
%if 0%{?sle_version}
%patch1000 -p1
%endif
# inject patched mocklibc tarball into package cache
cp %{SOURCE1} subprojects/packagecache/
%autopatch -p1
%build
%meson \
@ -169,6 +164,8 @@ This package contains the Vala bindings for accountservice.
%dir %{_localstatedir}/lib/AccountsService
%dir %{_localstatedir}/lib/AccountsService/users
%dir %{_localstatedir}/lib/AccountsService/icons
%{_datadir}/locale/en/LC_MESSAGES/accounts-service.mo
%{_datadir}/locale/en_GB/LC_MESSAGES/accounts-service.mo
%files -n libaccountsservice0
%{_libdir}/*.so.0*
@ -192,5 +189,7 @@ This package contains the Vala bindings for accountservice.
%endif
%files lang -f accounts-service.lang
%exclude %{_datadir}/locale/en/LC_MESSAGES/accounts-service.mo
%exclude %{_datadir}/locale/en_GB/LC_MESSAGES/accounts-service.mo
%changelog

View File

@ -1,75 +0,0 @@
diff -Nur accountsservice-22.08.8/src/libaccountsservice/act-user.c new/src/libaccountsservice/act-user.c
--- accountsservice-22.08.8/src/libaccountsservice/act-user.c 2022-02-23 16:27:48.000000000 +0100
+++ new/src/libaccountsservice/act-user.c 2022-04-30 22:34:42.160346848 +0200
@@ -878,6 +878,8 @@
* (Currently, this function is only implemented for systemd-logind.
* For ConsoleKit, it is equivalent to act_user_is_logged_in.)
*
+ * (SLE-12 SP2: 'other_sessions' have been modified to contain only X sessions)
+ *
* Returns: %TRUE or %FALSE
*/
gboolean
@@ -906,6 +908,24 @@
}
/**
+ * act_user_is_x_logged_in_remotely:
+ * @user: a #ActUser
+ *
+ * Returns whether or not #ActUser is currently graphically logged in on a
+ * different seat or no seat.
+ *
+ * (For SLE12-SP2: fate#318433)
+ *
+ * Returns: %TRUE or %FALSE
+ */
+gboolean
+act_user_is_x_logged_in_remotely (ActUser *user)
+{
+ /* return user->remote_x_sessions; */
+ return (user->other_sessions != NULL);
+}
+
+/**
* act_user_get_locked:
* @user: a #ActUser
*
diff -Nur accountsservice-22.08.8/src/libaccountsservice/act-user.h new/src/libaccountsservice/act-user.h
--- accountsservice-22.08.8/src/libaccountsservice/act-user.h 2022-02-23 16:27:48.000000000 +0100
+++ new/src/libaccountsservice/act-user.h 2022-04-30 22:34:42.164346848 +0200
@@ -61,6 +61,7 @@
guint act_user_get_num_sessions_anywhere (ActUser *user);
gboolean act_user_is_logged_in (ActUser *user);
gboolean act_user_is_logged_in_anywhere (ActUser *user);
+gboolean act_user_is_x_logged_in_remotely (ActUser *user);
int act_user_get_login_frequency (ActUser *user);
gint64 act_user_get_login_time (ActUser *user);
const GVariant*act_user_get_login_history (ActUser *user);
diff -Nur accountsservice-22.08.8/src/libaccountsservice/act-user-manager.c new/src/libaccountsservice/act-user-manager.c
--- accountsservice-22.08.8/src/libaccountsservice/act-user-manager.c 2022-02-23 16:27:48.000000000 +0100
+++ new/src/libaccountsservice/act-user-manager.c 2022-04-30 22:34:42.160346848 +0200
@@ -1366,12 +1366,22 @@
if (new_session->x11_display == NULL) {
g_debug ("AcUserManager: (mostly) ignoring session '%s' since it's not graphical",
new_session->id);
- is_ours = FALSE;
+ /* SLE: ignore non-graphical session completely */
+ /* see `act_user_is_logged_in_anywhere` */
+ unload_new_session (new_session);
+ return;
} else if (session_is_login_window (manager, new_session->id)) {
new_session->state = ACT_USER_MANAGER_NEW_SESSION_STATE_LOADED;
unload_new_session (new_session);
return;
} else if (!session_is_on_our_seat (manager, new_session->id)) {
+ /**
+ * NOTE: if `manager->priv->seat.id` or `new_session->id` is
+ * either NULL, it's not on our seat: this is reasonable, as
+ * non-seat session is not switchable and thus no need to be
+ * ours. However, this nondiscrimination for all non-seated
+ * sessions is possibly a source for bugs.
+ */
is_ours = FALSE;
}

BIN
mocklibc-1.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.