Remove matches when dereferencing DBus connection
This commit is contained in:
parent
24980f9281
commit
a3d8e00b2b
81
ypbind-mt-1.31-matches.patch
Normal file
81
ypbind-mt-1.31-matches.patch
Normal file
@ -0,0 +1,81 @@
|
||||
diff -up ypbind-mt-1.20.4/src/ypbind_dbus_nm.c.matches ypbind-mt-1.20.4/src/ypbind_dbus_nm.c
|
||||
--- ypbind-mt-1.20.4/src/ypbind_dbus_nm.c.matches 2010-06-22 19:52:43.732020839 +0200
|
||||
+++ ypbind-mt-1.20.4/src/ypbind_dbus_nm.c 2010-06-22 20:10:55.040016349 +0200
|
||||
@@ -51,6 +51,17 @@ typedef enum NMState {
|
||||
|
||||
#endif
|
||||
|
||||
+#define DBUS_MESSAGE_MATCH \
|
||||
+ "type='signal'," \
|
||||
+ "interface='" DBUS_INTERFACE_DBUS "'," \
|
||||
+ "sender='" DBUS_SERVICE_DBUS "'"
|
||||
+
|
||||
+#define NM_MESSAGE_MATCH \
|
||||
+ "type='signal'," \
|
||||
+ "interface='" NM_DBUS_INTERFACE "'," \
|
||||
+ "sender='" NM_DBUS_SERVICE "'," \
|
||||
+ "path='" NM_DBUS_PATH "'"
|
||||
+
|
||||
#include "ypbind.h"
|
||||
#include "log_msg.h"
|
||||
#include "local.h"
|
||||
@@ -276,10 +287,7 @@ dbus_init (void)
|
||||
if (!dbus_connection_add_filter (connection, dbus_filter, NULL, NULL))
|
||||
goto out;
|
||||
|
||||
- dbus_bus_add_match (connection, "type='signal',"
|
||||
- "interface='" DBUS_INTERFACE_DBUS "',"
|
||||
- "sender='" DBUS_SERVICE_DBUS "'",
|
||||
- &error);
|
||||
+ dbus_bus_add_match (connection, DBUS_MESSAGE_MATCH, &error);
|
||||
if (dbus_error_is_set (&error))
|
||||
{
|
||||
log_msg (LOG_ERR, "Error adding match, %s: %s",
|
||||
@@ -291,16 +299,17 @@ dbus_init (void)
|
||||
goto out;
|
||||
}
|
||||
|
||||
- dbus_bus_add_match (connection,
|
||||
- "type='signal',"
|
||||
- "interface='" NM_DBUS_INTERFACE "',"
|
||||
- "sender='" NM_DBUS_SERVICE "',"
|
||||
- "path='" NM_DBUS_PATH "'", &error);
|
||||
+ dbus_bus_add_match (connection, NM_MESSAGE_MATCH, &error);
|
||||
if (dbus_error_is_set (&error))
|
||||
{
|
||||
log_msg (LOG_ERR, "Error adding match, %s: %s",
|
||||
error.name, error.message);
|
||||
dbus_error_free (&error);
|
||||
+
|
||||
+ dbus_bus_remove_match (connection, DBUS_MESSAGE_MATCH, &error);
|
||||
+ if (dbus_error_is_set (&error)) /* ignore the error */
|
||||
+ dbus_error_free (&error);
|
||||
+
|
||||
dbus_connection_unref (connection);
|
||||
connection = NULL;
|
||||
goto out;
|
||||
@@ -314,6 +323,24 @@ dbus_init (void)
|
||||
if (!check_for_nm (connection))
|
||||
{
|
||||
/* NetworkManager not in use. */
|
||||
+
|
||||
+ /* The matches must be removed here. When dbus_init() is
|
||||
+ called repeatedly without removing matches, it starts to
|
||||
+ report errors:
|
||||
+ Error adding match, org.freedesktop.DBus.Error.LimitsExceeded:
|
||||
+ Connection ":1.0" is not allowed to add more match rules
|
||||
+ */
|
||||
+ dbus_bus_remove_match (connection, DBUS_MESSAGE_MATCH, &error);
|
||||
+ if (dbus_error_is_set (&error))
|
||||
+ {
|
||||
+ /* ignore the error, most likely it is MatchRuleNotFound. */
|
||||
+ dbus_error_free (&error);
|
||||
+ }
|
||||
+
|
||||
+ dbus_bus_remove_match (connection, NM_MESSAGE_MATCH, &error);
|
||||
+ if (dbus_error_is_set (&error))
|
||||
+ dbus_error_free (&error);
|
||||
+
|
||||
dbus_connection_unref (connection);
|
||||
is_online = 1;
|
||||
return 0;
|
@ -1,7 +1,7 @@
|
||||
Summary: The NIS daemon which binds NIS clients to an NIS domain
|
||||
Name: ypbind
|
||||
Version: 1.31
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
License: GPLv2
|
||||
Group: System Environment/Daemons
|
||||
Source0: ftp://ftp.us.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{version}.tar.bz2
|
||||
@ -9,6 +9,8 @@ Url: http://www.linux-nis.org/nis/ypbind-mt/index.html
|
||||
Source1: ypbind.init
|
||||
Source2: nis.sh
|
||||
Patch1: ypbind-1.11-gettextdomain.patch
|
||||
# Sent to upstream.
|
||||
Patch2: ypbind-mt-1.31-matches.patch
|
||||
Requires(post): chkconfig
|
||||
Requires(preun): chkconfig
|
||||
# This is for /sbin/service
|
||||
@ -38,6 +40,7 @@ also need to install the ypserv package to a machine on your network.
|
||||
%prep
|
||||
%setup -q -n ypbind-mt-%{version}
|
||||
%patch1 -p1 -b .gettextdomain
|
||||
%patch2 -p1 -b .matches
|
||||
|
||||
%build
|
||||
%configure --enable-dbus-nm
|
||||
@ -79,6 +82,10 @@ fi
|
||||
%doc README NEWS COPYING
|
||||
|
||||
%changelog
|
||||
* Wed Jun 23 2010 Karel Klic <kklic@redhat.com> - 3:1.31-7
|
||||
- Added -matches.patch removing matches when dereferencing
|
||||
DBus connection.
|
||||
|
||||
* Tue Jun 8 2010 Karel Klic <kklic@redhat.com> - 3:1.31-6
|
||||
- ypbind.init: take the first domainname in yp.conf and use
|
||||
only that (rhbz#601296)
|
||||
|
Loading…
Reference in New Issue
Block a user