Commit cd8ddc1c authored by Rocky Automation's avatar Rocky Automation 📺
Browse files

import accountsservice-0.6.55-1.el8

parent 31da56e7
8d59b9cdc4121b34748442ee653b92d60607f2cb SOURCES/accountsservice-0.6.50.tar.xz
bab4f37144196d8ba06195bc72b4a9937c62b9fd SOURCES/accountsservice-0.6.55.tar.xz
SOURCES/accountsservice-0.6.50.tar.xz
SOURCES/accountsservice-0.6.55.tar.xz
From 967603c6823180b055c6f1b5e76b05c377076eda Mon Sep 17 00:00:00 2001
From 54b207649979475ea7f1fa5eaaea94be31d20935 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Fri, 13 Dec 2019 15:16:06 -0500
Subject: [PATCH] daemon: if no local users, check if machine is enrolled in
......@@ -11,59 +11,14 @@ and shouldn't have a local user.
This commit detects that case, and avoids setting the HasNoUsers
property.
---
data/Makefile.am | 1 +
data/org.freedesktop.realmd.xml | 730 ++++++++++++++++++++++++++++++++
src/Makefile.am | 5 +
src/daemon.c | 61 ++-
src/daemon.c | 63 ++-
src/meson.build | 1 +
src/org.freedesktop.realmd.xml | 730 ++++++++++++++++++++++++++++++++
5 files changed, 1523 insertions(+), 4 deletions(-)
4 files changed, 1520 insertions(+), 4 deletions(-)
create mode 100644 data/org.freedesktop.realmd.xml
create mode 100644 src/org.freedesktop.realmd.xml
diff --git a/data/Makefile.am b/data/Makefile.am
index 521c6c2..6cf5e30 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -7,38 +7,39 @@ dbusif_DATA = \
dbusconfdir = $(sysconfdir)/dbus-1/system.d
dbusconf_DATA = org.freedesktop.Accounts.conf
servicedir = $(datadir)/dbus-1/system-services
service_in_files = org.freedesktop.Accounts.service.in
service_DATA = $(service_in_files:.service.in=.service)
$(service_DATA): $(service_in_files) Makefile
@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< >$@
policydir = $(datadir)/polkit-1/actions
policy_in_files = org.freedesktop.accounts.policy.in
policy_DATA = $(policy_in_files:.policy.in=.policy)
@INTLTOOL_POLICY_RULE@
if HAVE_SYSTEMD
systemdsystemunit_DATA = \
accounts-daemon.service
accounts-daemon.service: accounts-daemon.service.in
@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< >$@
endif
EXTRA_DIST = \
$(dbusif_DATA) \
$(dbusconf_DATA) \
$(service_in_files) \
$(policy_in_files) \
+ org.freedesktop.realmd.xml \
accounts-daemon.service.in
DISTCLEANFILES = \
$(service_DATA) \
$(policy_DATA)
CLEANFILES = \
accounts-daemon.service
diff --git a/data/org.freedesktop.realmd.xml b/data/org.freedesktop.realmd.xml
new file mode 100644
index 0000000..c34a47a
......@@ -800,77 +755,8 @@ index 0000000..c34a47a
+ </interface>
+
+</node>
diff --git a/src/Makefile.am b/src/Makefile.am
index f53e3e1..7a5b382 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,59 +1,64 @@
NULL =
BUILT_SOURCES =
SUBDIRS = . libaccountsservice
INCLUDES = \
-DLOCALSTATEDIR=\""$(localstatedir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DICONDIR=\"$(localstatedir)/lib/AccountsService/icons\" \
-DUSERDIR=\"$(localstatedir)/lib/AccountsService/users\" \
-I$(srcdir) \
-I$(builddir) \
$(ACCOUNTS_DAEMON_CFLAGS) \
$(WARN_CFLAGS)
noinst_LTLIBRARIES = libaccounts-generated.la
libaccounts_generated_la_SOURCES = \
accounts-generated.c \
accounts-generated.h \
accounts-user-generated.c \
accounts-user-generated.h \
+ realmd-generated.c \
+ realmd-generated.h \
$(NULL)
BUILT_SOURCES += $(libaccounts_generated_la_SOURCES)
accounts-generated.c accounts-generated.h: $(top_srcdir)/data/org.freedesktop.Accounts.xml Makefile
gdbus-codegen --generate-c-code accounts-generated --c-namespace Accounts --interface-prefix=org.freedesktop. $(top_srcdir)/data/org.freedesktop.Accounts.xml
accounts-user-generated.c accounts-user-generated.h: $(top_srcdir)/data/org.freedesktop.Accounts.User.xml Makefile
gdbus-codegen --generate-c-code accounts-user-generated --c-namespace Accounts --interface-prefix=org.freedesktop.Accounts. $(top_srcdir)/data/org.freedesktop.Accounts.User.xml
+realmd-generated.c realmd-generated.h: $(top_srcdir)/data/org.freedesktop.realmd.xml Makefile
+ gdbus-codegen --c-generate-autocleanup all --c-generate-object-manager --generate-c-code realmd-generated --c-namespace Accounts --interface-prefix=org.freedesktop. $(top_srcdir)/data/org.freedesktop.realmd.xml
+
libexec_PROGRAMS = accounts-daemon
accounts_daemon_SOURCES = \
$(enums_h_sources) \
types.h \
daemon.h \
daemon.c \
extensions.c \
user-classify.h \
user-classify.c \
user.h \
user.c \
util.h \
util.c \
wtmp-helper.h \
wtmp-helper.c \
main.c
accounts_daemon_LDADD = \
libaccounts-generated.la \
$(ACCOUNTS_DAEMON_LIBS)
EXTRA_DIST = \
fgetpwent.c \
$(NULL)
CLEANFILES = \
$(BUILT_SOURCES) \
*.gcda \
*.gcno \
diff --git a/src/daemon.c b/src/daemon.c
index 00dff51..23e60ce 100644
index c52bda3..5ce0216 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -20,60 +20,61 @@
......@@ -915,7 +801,7 @@ index 00dff51..23e60ce 100644
PROP_DAEMON_VERSION
};
struct DaemonPrivate {
typedef struct {
GDBusConnection *bus_connection;
GHashTable *users;
......@@ -930,12 +816,12 @@ index 00dff51..23e60ce 100644
GFileMonitor *gdm_monitor;
GFileMonitor *wtmp_monitor;
GQueue *pending_list_cached_users;
guint reload_id;
guint autologin_id;
PolkitAuthority *authority;
GHashTable *extension_ifaces;
@@ -414,109 +415,164 @@ load_entries (Daemon *daemon,
@@ -425,110 +426,167 @@ load_entries (Daemon *daemon,
} else {
g_object_ref (user);
}
......@@ -969,13 +855,14 @@ index 00dff51..23e60ce 100644
+static gboolean
+ensure_bus_connection (Daemon *daemon)
+{
+ DaemonPrivate *priv = daemon_get_instance_private (daemon);
+ g_autoptr (GError) error = NULL;
+
+ if (daemon->priv->bus_connection != NULL)
+ if (priv->bus_connection != NULL)
+ return TRUE;
+
+ daemon->priv->bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
+ if (daemon->priv->bus_connection == NULL) {
+ priv->bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
+ if (priv->bus_connection == NULL) {
+ if (error != NULL)
+ g_critical ("error getting system bus: %s", error->message);
+ return FALSE;
......@@ -987,6 +874,7 @@ index 00dff51..23e60ce 100644
+static gboolean
+has_network_realms (Daemon *daemon)
+{
+ DaemonPrivate *priv = daemon_get_instance_private (daemon);
+ g_autoptr (AccountsRealmdProvider) realmd_provider = NULL;
+ g_autoptr (GError) error = NULL;
+ const char *const *realms = NULL;
......@@ -995,7 +883,7 @@ index 00dff51..23e60ce 100644
+ return FALSE;
+ }
+
+ realmd_provider = accounts_realmd_provider_proxy_new_sync (daemon->priv->bus_connection,
+ realmd_provider = accounts_realmd_provider_proxy_new_sync (priv->bus_connection,
+ G_DBUS_PROXY_FLAGS_NONE,
+ "org.freedesktop.realmd",
+ "/org/freedesktop/realmd",
......@@ -1019,6 +907,7 @@ index 00dff51..23e60ce 100644
static void
reload_users (Daemon *daemon)
{
DaemonPrivate *priv = daemon_get_instance_private (daemon);
AccountsAccounts *accounts = ACCOUNTS_ACCOUNTS (daemon);
gboolean had_no_users, has_no_users, had_multiple_users, has_multiple_users;
GHashTable *users;
......@@ -1080,8 +969,8 @@ index 00dff51..23e60ce 100644
accounts_accounts_set_has_multiple_users (accounts, has_multiple_users);
/* Swap out the users */
old_users = daemon->priv->users;
daemon->priv->users = users;
old_users = priv->users;
priv->users = users;
/* Remove all the old users */
g_hash_table_iter_init (&iter, old_users);
......@@ -1100,21 +989,20 @@ index 00dff51..23e60ce 100644
/* Register all the new users */
g_hash_table_iter_init (&iter, users);
@@ -733,64 +789,61 @@ daemon_finalize (GObject *object)
Daemon *daemon;
g_return_if_fail (IS_DAEMON (object));
@@ -766,64 +824,61 @@ daemon_finalize (GObject *object)
priv = daemon_get_instance_private (daemon);
daemon = DAEMON (object);
if (priv->bus_connection != NULL)
g_object_unref (priv->bus_connection);
if (daemon->priv->bus_connection != NULL)
g_object_unref (daemon->priv->bus_connection);
g_queue_free_full (priv->pending_list_cached_users,
(GDestroyNotify) list_user_data_free);
g_list_free_full (daemon->priv->explicitly_requested_users, g_free);
g_list_free_full (priv->explicitly_requested_users, g_free);
g_hash_table_destroy (daemon->priv->users);
g_hash_table_destroy (priv->users);
g_hash_table_unref (daemon->priv->extension_ifaces);
g_hash_table_unref (priv->extension_ifaces);
G_OBJECT_CLASS (daemon_parent_class)->finalize (object);
}
......@@ -1122,17 +1010,18 @@ index 00dff51..23e60ce 100644
static gboolean
register_accounts_daemon (Daemon *daemon)
{
DaemonPrivate *priv = daemon_get_instance_private (daemon);
g_autoptr(GError) error = NULL;
daemon->priv->authority = polkit_authority_get_sync (NULL, &error);
if (daemon->priv->authority == NULL) {
priv->authority = polkit_authority_get_sync (NULL, &error);
if (priv->authority == NULL) {
if (error != NULL)
g_critical ("error getting polkit authority: %s", error->message);
return FALSE;
}
- daemon->priv->bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
- if (daemon->priv->bus_connection == NULL) {
- priv->bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
- if (priv->bus_connection == NULL) {
- if (error != NULL)
- g_critical ("error getting system bus: %s", error->message);
+ if (!ensure_bus_connection (daemon)) {
......@@ -1140,7 +1029,7 @@ index 00dff51..23e60ce 100644
}
if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (daemon),
daemon->priv->bus_connection,
priv->bus_connection,
"/org/freedesktop/Accounts",
&error)) {
if (error != NULL)
......@@ -1166,6 +1055,49 @@ index 00dff51..23e60ce 100644
}
static void
diff --git a/src/meson.build b/src/meson.build
index 20d5276..3970749 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,37 +1,38 @@
sources = []
gdbus_headers = []
ifaces = [
['accounts-generated', 'org.freedesktop.', 'Accounts'],
['accounts-user-generated', act_namespace + '.', 'User'],
+ ['realmd-generated', 'org.freedesktop.', 'realmd'],
]
foreach iface: ifaces
gdbus_sources = gnome.gdbus_codegen(
iface[0],
join_paths(data_dir, iface[1] + iface[2] + '.xml'),
interface_prefix: iface[1],
namespace: 'Accounts',
)
sources += gdbus_sources
gdbus_headers += gdbus_sources[1]
endforeach
deps = [
gio_dep,
gio_unix_dep,
]
cflags = [
'-DLOCALSTATEDIR="@0@"'.format(act_localstatedir),
'-DDATADIR="@0@"'.format(act_datadir),
'-DICONDIR="@0@"'.format(join_paths(act_localstatedir, 'lib', 'AccountsService', 'icons')),
'-DUSERDIR="@0@"'.format(join_paths(act_localstatedir, 'lib', 'AccountsService', 'users')),
]
libaccounts_generated = static_library(
'accounts-generated',
sources: sources,
include_directories: top_inc,
dependencies: deps,
diff --git a/src/org.freedesktop.realmd.xml b/src/org.freedesktop.realmd.xml
new file mode 100644
index 0000000..c34a47a
......@@ -1903,5 +1835,5 @@ index 0000000..c34a47a
+
+</node>
--
2.21.0
2.27.0
From b4f85d66280affcb52e998661f782c2ab4f806a7 Mon Sep 17 00:00:00 2001
From 50edc5e45bb984576506e7b2bfb4c267ac566099 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Thu, 9 May 2019 14:58:34 -0400
Subject: [PATCH] data: don't send change updates for login-history
......@@ -84,5 +84,5 @@ index 8d3fe1c..3b839a3 100644
<doc:description>
<doc:para>
--
2.21.0
2.27.0
%global _hardened_build 1
Name: accountsservice
Version: 0.6.50
Release: 8%{?dist}
Version: 0.6.55
Release: 1%{?dist}
Summary: D-Bus interfaces for querying and manipulating user account information
License: GPLv3+
URL: https://www.freedesktop.org/wiki/Software/AccountsService/
......@@ -10,32 +10,27 @@ 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
BuildRequires: gettext-devel
BuildRequires: pkgconfig(dbus-1)
BuildRequires: glib2-devel
BuildRequires: polkit-devel
BuildRequires: libtool, automake, autoconf, gettext-devel, intltool
BuildRequires: systemd
BuildRequires: systemd-devel
BuildRequires: gobject-introspection-devel
BuildRequires: gtk-doc
BuildRequires: git
Patch01: 0001-user-add-new-Session-SessionType-properties-to-repla.patch
Patch02: 0002-user-export-new-Saved-property.patch
Patch10: 0001-daemon-Fix-warnings-about-type-punning.patch
Patch20: 0001-lib-don-t-set-loaded-state-until-seat-is-fetched.patch
Patch30: 0001-data-don-t-send-change-updates-for-login-history.patch
Patch40: 0001-daemon-if-no-local-users-check-if-machine-is-enrolle.patch
Patch90: 0001-lib-save-os-when-creating-user.patch
BuildRequires: meson
Requires: polkit
Requires: shadow-utils
%{?systemd_requires}
Patch10001: 0001-data-don-t-send-change-updates-for-login-history.patch
Patch20001: 0001-daemon-if-no-local-users-check-if-machine-is-enrolle.patch
Patch30001: 0001-lib-save-os-when-creating-user.patch
%description
The accountsservice project provides a set of D-Bus interfaces for
querying and manipulating user account information and an implementation
......@@ -61,18 +56,15 @@ files needed to build applications that use accountsservice-libs.
%prep
%autosetup -S git
autoreconf -f -i
%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%configure --enable-user-heuristics
make %{?_smp_mflags}
%meson -Dgtk_doc=true -Dsystemd=true -Duser_heuristics=true
%meson_build
%install
make install DESTDIR=$RPM_BUILD_ROOT
rm $RPM_BUILD_ROOT%{_libdir}/*.la
rm $RPM_BUILD_ROOT%{_libdir}/*.a
%meson_install
%find_lang accounts-service
%ldconfig_scriptlets libs
......@@ -88,7 +80,7 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.a
%files -f accounts-service.lang
%license COPYING
%doc README AUTHORS
%doc README.md AUTHORS
%{_sysconfdir}/dbus-1/system.d/org.freedesktop.Accounts.conf
%{_libexecdir}/accounts-daemon
%{_datadir}/dbus-1/interfaces/org.freedesktop.Accounts.xml
......@@ -115,6 +107,10 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.a
%{_datadir}/gtk-doc/html/libaccountsservice/*
%changelog
* Fri Jan 15 2021 Ray Strode <rstrode@redhat.com> - 0.6.55-1
- Rebase to 0.6.55
Resolves: #1846376
* Sun Dec 15 2019 Ray Strode <rstrode@redhat.com> - 0.6.50-8
- Don't set HasNoUsers=true if realmd has providers
Related: #1750516
......@@ -279,7 +275,7 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.a
- Fixes CVE-2012-2737 - local file disclosure
Related: #832532
* Thu May 30 2012 Matthias Clasen <mclasen@redhatcom> 0.6.21-1
* Thu May 31 2012 Matthias Clasen <mclasen@redhat.com> 0.6.21-1
- Update to 0.6.21
* Fri May 04 2012 Ray Strode <rstrode@redhat.com> 0.6.20-1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment