Update to 22.08.8

This commit is contained in:
Leigh Scott 2022-08-27 15:32:18 +01:00
commit fb961e3877
4 changed files with 21 additions and 150 deletions

View file

@ -1,107 +0,0 @@
From c4048b11d205762c9cb61ead4c81ba5f49640520 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sun, 27 Jun 2021 21:06:15 +0000
Subject: [PATCH] act-user: Use stronger hashing methods in make_crypted() if
available.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
meson.build | 16 +++++++++++++++-
src/libaccountsservice/act-user.c | 31 ++++++++++++++++++++++++-------
2 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/meson.build b/meson.build
index 4465a26..1c42062 100644
--- a/meson.build
+++ b/meson.build
@@ -123,7 +123,21 @@ gio_unix_dep = dependency('gio-unix-2.0')
glib_dep = dependency('glib-2.0', version: '>= 2.44')
polkit_gobject_dep = dependency('polkit-gobject-1')
-crypt_dep = cc.find_library('crypt')
+# Using libxcrypt >= 4 we can be sure `crypt_gensalt (NULL, 0, NULL, 0)`
+# always returns a setting that is valid to use with `crypt (pw, setting)`.
+#
+# The setting returned will specify (depending on the system's
+# configuration of libxcrypt) in order of preferrence either
+# yescrypt "$y$", (gost-yescrypt "$gy$), bcrypt "$2b$" or sha512crypt "$6$"
+# as hash method, with a sufficient amount of cost or rounds and a random
+# salt drawn from secure system ressources with at least 128 bits.
+# (96 bits for sha512crypt, as more is not supported by this method, since
+# the effectively used maximum is 16 base64-encoded characters)
+crypt_dep = dependency('libxcrypt', required: false, version: '>= 4')
+config_h.set('HAVE_CRYPT_GENSALT', crypt_dep.found())
+if not crypt_dep.found()
+ crypt_dep = cc.find_library('crypt')
+endif
dbus_dep = dependency('dbus-1')
dbus_conf_dir = join_paths(dbus_dep.get_pkgconfig_variable('sysconfdir', define_variable: ['sysconfdir', act_sysconfdir]), 'dbus-1', 'system.d')
diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c
index e66acb1..5485cbe 100644
--- a/src/libaccountsservice/act-user.c
+++ b/src/libaccountsservice/act-user.c
@@ -1589,18 +1589,25 @@ act_user_set_account_type (ActUser *user,
}
}
-static gchar
+#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)
{
- gchar salt[] = "ABCDEFGHIJKLMNOPQRSTUVXYZ"
- "abcdefghijklmnopqrstuvxyz"
- "./0123456789";
+ const gchar salt[] = "ABCDEFGHIJKLMNOPQRSTUVXYZ"
+ "abcdefghijklmnopqrstuvxyz"
+ "./0123456789";
return salt[g_rand_int_range (rand, 0, G_N_ELEMENTS (salt))];
}
static gchar *
-make_crypted (const gchar *plain)
+generate_salt_for_crypt_hash (void)
{
g_autoptr(GString) salt = NULL;
g_autoptr(GRand) rand = NULL;
@@ -1609,14 +1616,24 @@ make_crypted (const gchar *plain)
rand = g_rand_new ();
salt = g_string_sized_new (21);
- /* SHA 256 */
+ /* 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, '$');
- return g_strdup (crypt (plain, salt->str));
+ 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));
}
/**
--
2.31.1

View file

@ -1,6 +1,6 @@
Name: accountsservice
Version: 0.6.55
Release: 11%{?dist}
Version: 22.08.8
Release: 1%{?dist}
Summary: D-Bus interfaces for querying and manipulating user account information
License: GPLv3+
URL: https://www.freedesktop.org/wiki/Software/AccountsService/
@ -8,11 +8,6 @@ URL: https://www.freedesktop.org/wiki/Software/AccountsService/
#VCS: git:git://git.freedesktop.org/accountsservice
Source0: http://www.freedesktop.org/software/accountsservice/accountsservice-%{version}.tar.xz
# https://gitlab.freedesktop.org/accountsservice/accountsservice/-/commit/c4048b11d205762c9cb61ead4c81ba5f49640520
Patch0: 0001-act-user-Use-stronger-hashing-methods-in-make_crypte.patch
# https://gitlab.freedesktop.org/accountsservice/accountsservice/-/commit/ac9b14f1c1bbca413987d0bbfeaad05804107e9a
Patch1: meson-0.60-build-fix.patch
BuildRequires: gettext-devel
BuildRequires: pkgconfig(dbus-1)
BuildRequires: glib2-devel
@ -23,6 +18,7 @@ BuildRequires: gobject-introspection-devel
BuildRequires: gtk-doc
BuildRequires: git
BuildRequires: meson
BuildRequires: vala
Requires: polkit
Requires: shadow-utils
@ -35,7 +31,7 @@ of these interfaces, based on the useradd, usermod and userdel commands.
%package libs
Summary: Client-side library to talk to accountsservice
Requires: %{name} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description libs
The accountsservice-libs package contains a library that can
@ -44,7 +40,7 @@ daemon.
%package devel
Summary: Development files for accountsservice-libs
Requires: %{name}-libs = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description devel
The accountsservice-devel package contains headers and other
@ -55,7 +51,9 @@ files needed to build applications that use accountsservice-libs.
%autosetup -S git
%build
%meson -Dgtk_doc=true -Dsystemd=true -Duser_heuristics=true
%meson \
-Dgtk_doc=true \
-Dadmin_group=wheel
%meson_build
%install
@ -79,32 +77,41 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/accountsservice/interfaces/
%files -f accounts-service.lang
%license COPYING
%doc README.md AUTHORS
%{_sysconfdir}/dbus-1/system.d/org.freedesktop.Accounts.conf
%{_libexecdir}/accounts-daemon
%dir %{_datadir}/accountsservice/
%dir %{_datadir}/accountsservice/interfaces/
%{_datadir}/accountsservice/user-templates/
%{_datadir}/dbus-1/interfaces/org.freedesktop.Accounts.xml
%{_datadir}/dbus-1/interfaces/org.freedesktop.Accounts.User.xml
%{_datadir}/dbus-1/system.d/org.freedesktop.Accounts.conf
%{_datadir}/dbus-1/system-services/org.freedesktop.Accounts.service
%{_datadir}/polkit-1/actions/org.freedesktop.accounts.policy
%dir %{_localstatedir}/lib/AccountsService/
%dir %{_localstatedir}/lib/AccountsService/users
%dir %{_localstatedir}/lib/AccountsService/icons
%dir %{_localstatedir}/lib/AccountsService/users/
%dir %{_localstatedir}/lib/AccountsService/icons/
%{_unitdir}/accounts-daemon.service
%files libs
%{_libdir}/libaccountsservice.so.*
%dir %{_libdir}/girepository-1.0/
%{_libdir}/girepository-1.0/AccountsService-1.0.typelib
%files devel
%{_includedir}/accountsservice-1.0
%{_libdir}/libaccountsservice.so
%{_libdir}/pkgconfig/accountsservice.pc
%dir %{_datadir}/gir-1.0/
%{_datadir}/gir-1.0/AccountsService-1.0.gir
%dir %{_datadir}/gtk-doc/html/libaccountsservice
%{_datadir}/gtk-doc/html/libaccountsservice/*
%dir %{_datadir}/vala/
%dir %{_datadir}/vala/vapi/
%{_datadir}/vala/vapi/accountsservice.*
%changelog
* Sat Aug 27 2022 Leigh Scott <leigh123linux@gmail.com> - 22.08.8-1
- Update to 22.08.8
* Tue Jul 26 2022 Tomas Popela <tpopela@redhat.com> - 0.6.55-11
- Fix the build with meson 0.60+

View file

@ -1,29 +0,0 @@
From ac9b14f1c1bbca413987d0bbfeaad05804107e9a Mon Sep 17 00:00:00 2001
From: Luca Boccassi <bluca@debian.org>
Date: Sun, 31 Oct 2021 12:29:14 +0000
Subject: [PATCH] Fix build with meson 0.60
Positional parameters to merge_file() were never allowed and always
ignored, so just drop it.
See: https://github.com/mesonbuild/meson/issues/9441
Fixes #97
---
data/meson.build | 1 -
1 file changed, 1 deletion(-)
diff --git a/data/meson.build b/data/meson.build
index 70edf89..9e80299 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -33,7 +33,6 @@ configure_file(
policy = act_namespace.to_lower() + '.policy'
i18n.merge_file(
- policy,
input: policy + '.in',
output: policy,
po_dir: po_dir,
--
GitLab

View file

@ -1 +1 @@
SHA512 (accountsservice-0.6.55.tar.xz) = c12e6a8e80f9b087f97238da4734d2d3a14a7c5cbd870a32a04b00116f176c818c39fb886f6dc72c3e93c136b0c2074ddf8f77e20431fa3bd54f138bea9d262d
SHA512 (accountsservice-22.08.8.tar.xz) = 2ca3ceb1b44338d9924b86788256d4eef7ec10e0c2197bfb8cc6c31ae224fab3051f03cb406a526f90057684965bef4ba0f2cc01b26198ec1fc6baec36ad3ff8