Merge pull request #16219 from Rmys/master

accountsservice ver. bump
This commit is contained in:
Rmys
2025-02-24 19:21:53 +03:00
committed by GitHub
9 changed files with 525 additions and 1 deletions
@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Sun, 23 Jun 2024 03:29:43 +0200
Subject: [PATCH] tests: Drop check-format test
It modifies the Git tree and prevents patches from being applied
correctly.
This really should be part of a pre-commit check, not a Meson test. The
source directory should not be modified.
---
tests/meson.build | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/meson.build b/tests/meson.build
index ff9004d6ad75..178a2f09f1aa 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,4 +1,3 @@
-test('check-format', find_program('check-format.sh'))
libmocklibc = subproject('mocklibc').get_variable('libmocklibc')
@@ -0,0 +1,50 @@
https://bugs.gentoo.org/930715
https://gitlab.freedesktop.org/accountsservice/accountsservice/-/commit/da65bee12d9118fe1a49c8718d428fe61d232339
From da65bee12d9118fe1a49c8718d428fe61d232339 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 11 Apr 2023 10:09:07 -0400
Subject: [PATCH] mocklibc: Fix compiler warning
print_indent is defined in one file and used in another without a
forward declaration. That leads to a compiler warning/error.
This commit fixes that.
---
subprojects/mocklibc.wrap | 2 ++
subprojects/packagefiles/mocklibc-print-indent.diff | 13 +++++++++++++
2 files changed, 15 insertions(+)
create mode 100644 subprojects/packagefiles/mocklibc-print-indent.diff
diff --git a/subprojects/mocklibc.wrap b/subprojects/mocklibc.wrap
index af82298..539ee83 100644
--- a/subprojects/mocklibc.wrap
+++ b/subprojects/mocklibc.wrap
@@ -8,3 +8,5 @@ source_hash = b2236a6af1028414783e9734a46ea051916ec226479d6a55a3bb823bff68f120
patch_url = https://wrapdb.mesonbuild.com/v1/projects/mocklibc/1.0/2/get_zip
patch_filename = mocklibc-1.0-2-wrap.zip
patch_hash = 0280f96a2eeb3c023e5acf4e00cef03d362868218d4a85347ea45137c0ef6c56
+
+diff_files = mocklibc-print-indent.diff
diff --git a/subprojects/packagefiles/mocklibc-print-indent.diff b/subprojects/packagefiles/mocklibc-print-indent.diff
new file mode 100644
index 0000000..4aaed40
--- /dev/null
+++ b/subprojects/packagefiles/mocklibc-print-indent.diff
@@ -0,0 +1,13 @@
+diff -up mocklibc-1.0/src/netgroup-debug.c.print-indent mocklibc-1.0/src/netgroup-debug.c
+--- mocklibc-1.0/src/netgroup-debug.c.print-indent 2023-04-11 10:20:53.717381559 -0400
++++ mocklibc-1.0/src/netgroup-debug.c 2023-04-11 10:21:02.296270333 -0400
+@@ -21,6 +21,9 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+
++void print_indent (FILE *stream,
++ unsigned int indent);
++
+ void netgroup_debug_print_entry(struct entry *entry, FILE *stream, unsigned int indent) {
+ print_indent(stream, indent);
+
--
GitLab
@@ -0,0 +1,30 @@
https://bugs.gentoo.org/905770
https://gitlab.freedesktop.org/accountsservice/accountsservice/-/merge_requests/136
https://gitlab.freedesktop.org/accountsservice/accountsservice/-/commit/c9c16b3c47e13e90bb2213141f6f309e2d474396
From c9c16b3c47e13e90bb2213141f6f309e2d474396 Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Fri, 5 May 2023 07:43:48 -0700
Subject: [PATCH] generate-version.sh: fix script inside of a tarball
---
generate-version.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/generate-version.sh b/generate-version.sh
index 3f88bff..8375c86 100755
--- a/generate-version.sh
+++ b/generate-version.sh
@@ -4,11 +4,10 @@ exec 3>&2 2> /dev/null
SRCDIR=$(dirname "$0")
cd "$SRCDIR"
CWD=$(realpath "$PWD")
-TOPLEVEL_WORKING_DIR=$(realpath "$(git rev-parse --show-toplevel)")
exec 2>&3
# If it's not from a git checkout, assume it's from a tarball
-if [ "$TOPLEVEL_WORKING_DIR" != "$CWD" ]; then
+if ! git rev-parse --is-inside-git-dir > /dev/null 2>&1; then
VERSION_FROM_DIR_NAME=$(basename "$CWD" | sed -n 's/^accountsservice-\([^-]*\)$/\1/p')
if [ -n "$VERSION_FROM_DIR_NAME" ]; then
@@ -0,0 +1,52 @@
From 962a66aa12932c7899cda78c4cbda0f581947285 Mon Sep 17 00:00:00 2001
From: germ <germtoo@outlook.com>
Date: Mon, 30 Oct 2023 06:16:16 -0400
Subject: [PATCH 1/1] This applies two apatches to sys-apps/accountsserice
https://gitlab.alpinelinux.org/alpine/aports/-/raw/75528d8dc4206a74501799f6a6042be20b80801d/community/accountsservice/musl-fgetspent_r.patch
https://gitlab.alpinelinux.org/alpine/aports/-/raw/75528d8dc4206a74501799f6a6042be20b80801d/community/accountsservice/musl-wtmp.patch
--- a/meson.build
+++ b/meson.build
@@ -103,8 +103,7 @@ elif cc.has_header_symbol('paths.h', '_PATH_WTMPX')
config_h.set('PATH_WTMP', '_PATH_WTMPX')
else
- path_wtmp = '/var/log/utx.log'
- assert(run_command('test', '-e', path_wtmp, check: false).returncode() == 0, 'Do not know which filename to watch for wtmp changes')
+ path_wtmp = '/var/log/wtmp'
config_h.set_quoted('PATH_WTMP', path_wtmp)
endif
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -215,6 +215,27 @@ remove_cache_files (const gchar *user_name)
g_remove (icon_filename);
}
+#ifndef __GLIBC__
+/* Musl libc does not support fgetspent_r(), write own
+* wrapper
+*/
+static int fgetspent_r(FILE *fp, struct spwd *spbuf, char *buf, size_t buflen, struct spwd **spbufp) {
+ struct spwd *shadow_entry = fgetspent(fp);
+ if(!shadow_entry)
+ return -1;
+ size_t namplen = strlen(shadow_entry->sp_namp);
+ size_t pwdplen = strlen(shadow_entry->sp_pwdp);
+
+ if(namplen + pwdplen + 2 > buflen)
+ return -1;
+ *spbufp = memcpy(spbuf, shadow_entry, sizeof(struct spwd));
+ spbuf->sp_namp = strncpy(buf, shadow_entry->sp_namp, namplen + 1);
+ spbuf->sp_pwdp = strncpy(buf + namplen + 1, shadow_entry->sp_pwdp, pwdplen + 1);
+
+ return 0;
+}
+#endif
+
static struct passwd *
entry_generator_fgetpwent (Daemon *daemon,
GHashTable *users,
--
2.42.0
@@ -0,0 +1,41 @@
https://gitlab.freedesktop.org/accountsservice/accountsservice/-/commit/ad0365b77b583da06bcd1e8da4c1bed74129895a
From ad0365b77b583da06bcd1e8da4c1bed74129895a Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Thu, 28 Sep 2023 09:29:07 -0400
Subject: [PATCH] tests: s/assertEquals/assertEqual/
CI is currently failing with:
Traceback (most recent call last):
File "/home/user/accountsservice/_build/../tests/test-libaccountsservice.py", line 118, in test_multiple_inflight_get_user_by_id_calls
self.assertEquals(user.get_user_name(), 'pizza')
^^^^^^^^^^^^^^^^^
AttributeError: 'TestAccountsServicePreExistingUser' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?
I have no idea if assertEquals was dropped, or if CI has been failing
all this time or what.
This commit makes the suggested change.
---
tests/test-libaccountsservice.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test-libaccountsservice.py b/tests/test-libaccountsservice.py
index f0261b1..f2fcbc2 100644
--- a/tests/test-libaccountsservice.py
+++ b/tests/test-libaccountsservice.py
@@ -115,8 +115,8 @@ class TestAccountsServicePreExistingUser(AccountsServiceTestBase):
self.assertTrue(user_objects[instance].is_loaded())
for user in user_objects:
- self.assertEquals(user.get_user_name(), 'pizza')
- self.assertEquals(user.get_uid(), 2001)
+ self.assertEqual(user.get_user_name(), 'pizza')
+ self.assertEqual(user.get_uid(), 2001)
@unittest.skipUnless(have_accounts_service,
'AccountsService gi introspection not available')
--
GitLab
@@ -0,0 +1,54 @@
From da65bee12d9118fe1a49c8718d428fe61d232339 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 11 Apr 2023 10:09:07 -0400
Subject: [PATCH 1/2] mocklibc: Fix compiler warning
print_indent is defined in one file and used in another without a
forward declaration. That leads to a compiler warning/error.
This commit fixes that.
---
subprojects/mocklibc.wrap | 2 ++
subprojects/packagefiles/mocklibc-print-indent.diff | 13 +++++++++++++
2 files changed, 15 insertions(+)
create mode 100644 subprojects/packagefiles/mocklibc-print-indent.diff
diff --git a/subprojects/mocklibc.wrap b/subprojects/mocklibc.wrap
index af82298..539ee83 100644
--- a/subprojects/mocklibc.wrap
+++ b/subprojects/mocklibc.wrap
@@ -1,10 +1,12 @@
[wrap-file]
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
patch_url = https://wrapdb.mesonbuild.com/v1/projects/mocklibc/1.0/2/get_zip
patch_filename = mocklibc-1.0-2-wrap.zip
patch_hash = 0280f96a2eeb3c023e5acf4e00cef03d362868218d4a85347ea45137c0ef6c56
+
+diff_files = mocklibc-print-indent.diff
diff --git a/subprojects/packagefiles/mocklibc-print-indent.diff b/subprojects/packagefiles/mocklibc-print-indent.diff
new file mode 100644
index 0000000..4aaed40
--- /dev/null
+++ b/subprojects/packagefiles/mocklibc-print-indent.diff
@@ -0,0 +1,13 @@
+diff -up mocklibc-1.0/src/netgroup-debug.c.print-indent mocklibc-1.0/src/netgroup-debug.c
+--- mocklibc-1.0/src/netgroup-debug.c.print-indent 2023-04-11 10:20:53.717381559 -0400
++++ mocklibc-1.0/src/netgroup-debug.c 2023-04-11 10:21:02.296270333 -0400
+@@ -21,6 +21,9 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+
++void print_indent (FILE *stream,
++ unsigned int indent);
++
+ void netgroup_debug_print_entry(struct entry *entry, FILE *stream, unsigned int indent) {
+ print_indent(stream, indent);
+
--
2.39.2
@@ -0,0 +1,145 @@
From 99aa57bfa59e2578c4ef47e84338f7de85c6f61b Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 11 Apr 2023 10:11:05 -0400
Subject: [PATCH 2/2] user-manager: Fix another compiler warning
-Wswitch-enum apparently complains about missing entries even if there
is a default:.
This commit ensures ACT_USER_MANAGER_SEAT_STATE_UNLOADED is added to the
default case to fix that warning.
---
src/libaccountsservice/act-user-manager.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/libaccountsservice/act-user-manager.c b/src/libaccountsservice/act-user-manager.c
index 61b4da5..3bbd480 100644
--- a/src/libaccountsservice/act-user-manager.c
+++ b/src/libaccountsservice/act-user-manager.c
@@ -1727,60 +1727,61 @@ unload_seat (ActUserManager *manager)
{
ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager);
priv->seat.state = ACT_USER_MANAGER_SEAT_STATE_UNLOADED;
g_free (priv->seat.id);
priv->seat.id = NULL;
g_free (priv->seat.session_id);
priv->seat.session_id = NULL;
g_debug ("ActUserManager: seat unloaded, so trying to set loaded property");
maybe_set_is_loaded (manager);
}
static void
load_new_session_incrementally (ActUserManagerNewSession *new_session)
{
switch (new_session->state) {
case ACT_USER_MANAGER_NEW_SESSION_STATE_GET_UID:
get_uid_for_new_session (new_session);
break;
case ACT_USER_MANAGER_NEW_SESSION_STATE_GET_X11_DISPLAY:
get_x11_display_for_new_session (new_session);
break;
case ACT_USER_MANAGER_NEW_SESSION_STATE_MAYBE_ADD:
maybe_add_new_session (new_session);
break;
case ACT_USER_MANAGER_NEW_SESSION_STATE_LOADED:
break;
+ case ACT_USER_MANAGER_NEW_SESSION_STATE_UNLOADED:
default:
g_assert_not_reached ();
}
}
static void
free_fetch_user_request (ActUserManagerFetchUserRequest *request)
{
ActUserManager *manager = request->manager;
ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager);
if (request->user != NULL) {
g_object_set_data (G_OBJECT (request->user), "fetch-user-request", NULL);
g_object_weak_unref (G_OBJECT (request->user), (GWeakNotify) on_user_destroyed, manager);
}
priv->fetch_user_requests = g_slist_remove (priv->fetch_user_requests, request);
if (request->type == ACT_USER_MANAGER_FETCH_USER_FROM_USERNAME_REQUEST) {
g_free (request->username);
}
g_free (request->object_path);
g_free (request->description);
g_cancellable_cancel (request->cancellable);
g_object_unref (request->cancellable);
g_debug ("ActUserManager: unrefing manager owned by fetch user request");
g_object_unref (manager);
@@ -2243,60 +2244,61 @@ load_users (ActUserManager *manager)
return;
}
load_user_paths (manager, (const char * const *) user_paths);
load_included_usernames (manager);
priv->list_cached_users_done = TRUE;
}
static gboolean
load_seat_incrementally (ActUserManager *manager)
{
ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager);
priv->seat.load_idle_id = 0;
switch (priv->seat.state) {
case ACT_USER_MANAGER_SEAT_STATE_GET_SESSION_ID:
get_current_session_id (manager);
break;
case ACT_USER_MANAGER_SEAT_STATE_GET_ID:
get_seat_id_for_current_session (manager);
break;
case ACT_USER_MANAGER_SEAT_STATE_GET_SEAT_PROXY:
get_seat_proxy (manager);
break;
case ACT_USER_MANAGER_SEAT_STATE_LOADED:
g_debug ("ActUserManager: Seat loading sequence complete");
break;
+ case ACT_USER_MANAGER_NEW_SESSION_STATE_UNLOADED:
default:
g_assert_not_reached ();
}
if (priv->seat.state == ACT_USER_MANAGER_SEAT_STATE_LOADED) {
load_sessions (manager);
}
maybe_set_is_loaded (manager);
return FALSE;
}
static gboolean
load_idle (ActUserManager *manager)
{
ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager);
priv->seat.state = ACT_USER_MANAGER_SEAT_STATE_UNLOADED + 1;
load_seat_incrementally (manager);
priv->load_id = 0;
return FALSE;
}
static void
queue_load_seat (ActUserManager *manager)
{
ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager);
--
2.39.2
@@ -0,0 +1,111 @@
From e050e4aa99818f7559ab48568ea6662dc4104317 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Thu, 30 Jan 2025 12:36:21 +0100
Subject: [PATCH 3/3] act-user: Use the reentrant interfaces of
crypt{,_gensalt}(3)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The crypt(3) function is known to clobber its static allocated internal
buffer when called multiple times consecutively or (especially) when
called in parallel (e.g. from independently operation threads), and
should generally not be used if a reentrant implementation exists.
The reentrant interface, named crypt_rn(3), operates in the same way as
the well known crypt(3) function, but takes an extra parameter of
'struct crypt_data' which includes space for its result (among other
things), so applications can utilize the reentrant interface, in a way
each invocation of the crypt_rn(3) function will freely operate on their
own dedicated memory areas when hashing passphrases.
The same applies for the crypt_gensalt(3) function, to which libxcrypt
offers a variety of reentrant interfaces as well.
Also ensure the buffers in use are properly zeroized.
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
src/libaccountsservice/act-user.c | 53 ++++++++-----------------------
1 file changed, 13 insertions(+), 40 deletions(-)
diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c
index 77b7b2f..4fd2c62 100644
--- a/src/libaccountsservice/act-user.c
+++ b/src/libaccountsservice/act-user.c
@@ -1748,51 +1748,22 @@ act_user_set_account_type (ActUser *user,
}
}
-#ifdef HAVE_CRYPT_GENSALT
static gchar *
-generate_salt_for_crypt_hash (void)
-{
- return g_strdup (crypt_gensalt (NULL, 0, NULL, 0));
-}
-#else
-static const gchar
-salt_char (GRand *rand)
+make_crypted (const gchar *plain)
{
- const gchar salt[] = "ABCDEFGHIJKLMNOPQRSTUVXYZ"
- "abcdefghijklmnopqrstuvxyz"
- "./0123456789";
-
- return salt[g_rand_int_range (rand, 0, G_N_ELEMENTS (salt))];
-}
+ gchar *crypted = NULL;
+ g_autofree struct crypt_data *cd = NULL;
-static gchar *
-generate_salt_for_crypt_hash (void)
-{
- g_autoptr (GString) salt = NULL;
- g_autoptr (GRand) rand = NULL;
- gint i;
+ cd = g_malloc0 (sizeof (struct crypt_data));
- rand = g_rand_new ();
- salt = g_string_sized_new (21);
+ crypt_gensalt_rn (NULL, 0, NULL, 0,
+ cd->input, sizeof (cd->input));
+ crypted = g_strdup (crypt_rn (plain, cd->input,
+ cd, sizeof (struct crypt_data)));
- /* sha512crypt */
- g_string_append (salt, "$6$");
- for (i = 0; i < 16; i++) {
- g_string_append_c (salt, salt_char (rand));
- }
- g_string_append_c (salt, '$');
+ explicit_bzero (cd, sizeof (struct crypt_data));
- return g_strdup (salt->str);
-}
-#endif
-
-static gchar *
-make_crypted (const gchar *plain)
-{
- g_autofree char *salt = NULL;
-
- salt = generate_salt_for_crypt_hash ();
- return g_strdup (crypt (plain, salt));
+ return crypted;
}
/**
@@ -1828,7 +1799,9 @@ act_user_set_password (ActUser *user,
&error)) {
g_warning ("SetPassword call failed: %s", error->message);
}
- memset (crypted, 0, strlen (crypted));
+ if (crypted) {
+ explicit_bzero (crypted, strlen (crypted));
+ }
}
/**
--
2.48.1
+19 -1
View File
@@ -12,7 +12,7 @@
<IsA>library</IsA>
<Summary>D-Bus Service to Manipulate User Account Information</Summary>
<Description>accountsservice server provides a set of D-Bus interfaces for querying and manipulating user account information.</Description>
<Archive sha1sum="d38b1ff51d31cbd49344509f19cc0c75977a4f1f" type="tarxz">https://www.freedesktop.org/software/accountsservice/accountsservice-22.08.8.tar.xz</Archive>
<Archive sha1sum="78419e5fa8fbb485f6b939e180fe26f2efc3c103" type="tarxz">https://www.freedesktop.org/software/accountsservice/accountsservice-23.13.9.tar.xz</Archive>
<BuildDependencies>
<Dependency>meson</Dependency>
<Dependency>xmlto</Dependency>
@@ -29,6 +29,17 @@
<Dependency>gettext-devel</Dependency>
<Dependency>gobject-introspection-devel</Dependency>
</BuildDependencies>
<Patches>
<Patch>0001-tests-Drop-check-format-test.patch</Patch>
<Patch>fedora/0001-mocklibc-Fix-compiler-warning.patch</Patch>
<Patch>fedora/0002-user-manager-Fix-another-compiler-warning.patch</Patch>
<Patch>fedora/0003-act-user-Use-the-reentrant-interfaces-of-crypt-_gens.patch</Patch>
<!--Patch>0001-tests-Drop-check-format-test.patch</Patch>
<Patch>accountsservice-23.13.9-test-fix.patch</Patch>
<Patch>accountsservice-23.13.9-generate-version.patch</Patch>
<Patch>accountsservice-23.13.9-musl-fixes.patch</Patch>
<Patch>accountsservice-23.13.9-c99-fixes.patch</Patch-->
</Patches>
</Source>
<Package>
@@ -77,6 +88,13 @@
</Package>
<History>
<Update release="10">
<Date>2025-02-05</Date>
<Version>23.13.9</Version>
<Comment>Version bump.</Comment>
<Name>Pisi Linux Community</Name>
<Email>admin@pisilinux.org</Email>
</Update>
<Update release="9">
<Date>2022-08-01</Date>
<Version>22.08.8</Version>