diff --git a/SOURCES/0001-pam-Fix-eventfd-leak.patch b/SOURCES/0001-pam-Fix-eventfd-leak.patch new file mode 100644 index 0000000..b8421f9 --- /dev/null +++ b/SOURCES/0001-pam-Fix-eventfd-leak.patch @@ -0,0 +1,54 @@ +From 7e4630ced2be4b7ecdfb9d60cfe0e0d3de594411 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Mon, 27 Jan 2014 12:24:14 +0100 +Subject: [PATCH] pam: Fix eventfd leak + +When we create our own GMainContext, we need to be the ones +disposing of it as well, as GMainLoop won't take ownership of it. + +From https://bugzilla.redhat.com/show_bug.cgi?id=1050827 +--- + pam/pam_fprintd.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/pam/pam_fprintd.c b/pam/pam_fprintd.c +index 0f5e5a4..07302a1 100644 +--- a/pam/pam_fprintd.c ++++ b/pam/pam_fprintd.c +@@ -170,6 +170,17 @@ static void close_and_unref (DBusGConnection *connection) + dbus_g_connection_unref (connection); + } + ++static void unref_loop (GMainLoop *loop) ++{ ++ GMainContext *ctx; ++ ++ /* The main context was created separately, so ++ * we'll need to unref it ourselves */ ++ ctx = g_main_loop_get_context (loop); ++ g_main_loop_unref (loop); ++ g_main_context_unref (ctx); ++} ++ + #define DBUS_TYPE_G_OBJECT_PATH_ARRAY (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH)) + + static DBusGProxy *open_device(pam_handle_t *pamh, DBusGConnection *connection, DBusGProxy *manager, const char *username, gboolean *has_multiple_devices) +@@ -397,13 +408,13 @@ static int do_auth(pam_handle_t *pamh, const char *username) + dev = open_device(pamh, connection, manager, username, &has_multiple_devices); + g_object_unref (manager); + if (!dev) { +- g_main_loop_unref (loop); ++ unref_loop (loop); + close_and_unref (connection); + return PAM_AUTHINFO_UNAVAIL; + } + ret = do_verify(loop, pamh, dev, has_multiple_devices); + +- g_main_loop_unref (loop); ++ unref_loop (loop); + release_device(pamh, dev); + g_object_unref (dev); + close_and_unref (connection); +-- +1.9.0 + diff --git a/SPECS/fprintd.spec b/SPECS/fprintd.spec index b254c8d..703a475 100644 --- a/SPECS/fprintd.spec +++ b/SPECS/fprintd.spec @@ -1,6 +1,6 @@ Name: fprintd Version: 0.5.0 -Release: 3%{?dist} +Release: 4.0%{?dist} Summary: D-Bus service for Fingerprint reader access Group: System Environment/Daemons @@ -20,6 +20,7 @@ BuildRequires: autoconf automake libtool BuildRequires: perl-podlators Patch0: 0001-data-Fix-syntax-error-in-fprintd.pod.patch +Patch1: 0001-pam-Fix-eventfd-leak.patch %description D-Bus service to access fingerprint readers. @@ -53,6 +54,7 @@ fingerprint readers access. %prep %setup -q -n %{name}-%{version} %patch0 -p1 +%patch1 -p1 %build %configure --libdir=/%{_lib}/ --enable-gtk-doc --enable-pam @@ -97,6 +99,14 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/dbus-1/interfaces/net.reactivated.Fprint.Manager.xml %changelog +* Mon May 12 2014 Bastien Nocera 0.5.0-4.0 +- Bump revision +Resolves: #1050827 + +* Mon May 12 2014 Bastien Nocera 0.5.0-4 +- Fix single eventfd leak for each iteration +Resolves: #1050827 + * Mon Jan 06 2014 Bastien Nocera 0.5.0-3 - Fix build with strict pod2man Resolves: #1048858