rpms/dbus/FC-6 dbus-1.0.1-fix-upgrade-mess.patch, NONE, 1.1 session.conf, NONE, 1.1 system.conf, NONE, 1.1 dbus.spec, 1.108, 1.109 dbus-1.0.0-dont-die-on-error.patch, 1.1, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Dec 15 17:39:09 UTC 2006


Author: rstrode

Update of /cvs/dist/rpms/dbus/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv11961

Modified Files:
	dbus.spec 
Added Files:
	dbus-1.0.1-fix-upgrade-mess.patch session.conf system.conf 
Removed Files:
	dbus-1.0.0-dont-die-on-error.patch 
Log Message:
- don't die when reloading config if config file gains new
  options that aren't understood. Move config file to new
  location and keep compatible, but obsolete config file in 
  old location (one last try at bug 218207).


dbus-1.0.1-fix-upgrade-mess.patch:
 Makefile.am     |    7 ++++---
 bus.c           |   18 ++++++++++--------
 main.c          |   36 ++++++++++++++++++++++++++++--------
 session.conf.in |    4 ++--
 system.conf.in  |   12 ++++++++----
 5 files changed, 52 insertions(+), 25 deletions(-)

--- NEW FILE dbus-1.0.1-fix-upgrade-mess.patch ---
--- dbus-1.0.1/bus/system.conf.in.fix-upgrade-mess	2006-08-03 16:34:36.000000000 -0400
+++ dbus-1.0.1/bus/system.conf.in	2006-12-15 12:12:04.000000000 -0500
@@ -1,5 +1,5 @@
 <!-- This configuration file controls the systemwide message bus.
-     Add a system-local.conf and edit that rather than changing this 
+     Add a /etc/dbus-1/system-local.conf and edit that rather than changing this 
      file directly. -->
 
 <!-- Note that there are any number of ways you can hose yourself
@@ -50,12 +50,16 @@
   </policy>
 
   <!-- Config files are placed here that among other things, punch 
-       holes in the above policy for specific services. -->
-  <includedir>system.d</includedir>
+       holes in the above policy for specific services. 
+       
+       FIXME: for Fedora 7 we should move this to
+       /usr/share/dbus-1
+  -->
+  <includedir>/etc/dbus-1/system.d</includedir>
 
   <!-- This is included last so local configuration can override what's 
        in this standard file -->
-  <include ignore_missing="yes">system-local.conf</include>
+  <include ignore_missing="yes">/etc/dbus-1/system-local.conf</include>
 
   <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
 
--- dbus-1.0.1/bus/Makefile.am.fix-upgrade-mess	2006-10-01 11:36:18.000000000 -0400
+++ dbus-1.0.1/bus/Makefile.am	2006-12-15 12:21:40.000000000 -0500
@@ -1,10 +1,11 @@
 
 configdir=$(sysconfdir)/dbus-1
+distropolicydir=$(datadir)/dbus-1
 
 INCLUDES=-I$(top_srcdir) $(DBUS_BUS_CFLAGS)				\
 	-DDAEMON_NAME=\"dbus-daemon\"  -DDBUS_COMPILATION		\
-	-DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\"	\
-	-DDBUS_SESSION_CONFIG_FILE=\""$(configdir)/session.conf"\"
+	-DDBUS_SYSTEM_CONFIG_FILE=\""$(distropolicydir)/system.conf"\"	\
+	-DDBUS_SESSION_CONFIG_FILE=\""$(distropolicydir)/session.conf"\"
 
 EFENCE=
 
@@ -12,7 +13,7 @@
 	session.conf.in				\
 	system.conf.in
 
-config_DATA=					\
+distropolicy_DATA=				\
 	session.conf				\
 	system.conf
 
--- dbus-1.0.1/bus/bus.c.fix-upgrade-mess	2006-11-06 11:02:19.000000000 -0500
+++ dbus-1.0.1/bus/bus.c	2006-12-15 12:12:04.000000000 -0500
@@ -402,6 +402,7 @@
 {
   DBusString full_address;
   DBusList *link;
+  BusActivation *new_activation;
   char *addr;
 
   dbus_bool_t retval;
@@ -467,19 +468,20 @@
     }
 
   /* Create activation subsystem */
-  
-  if (is_reload)
-    bus_activation_unref (context->activation);
-  
-  context->activation = bus_activation_new (context, &full_address,
-                                            bus_config_parser_get_service_dirs (parser),
-                                            error);
-  if (context->activation == NULL)
+  new_activation = bus_activation_new (context, &full_address,
+				       bus_config_parser_get_service_dirs (parser),
+				       error);
+  if (new_activation == NULL)
     {
       _DBUS_ASSERT_ERROR_IS_SET (error);
       goto failed;
     }
 
+  if (is_reload)
+    bus_activation_unref (context->activation);
+
+  context->activation = new_activation;
+
   /* Drop existing conf-dir watches (if applicable) */
 
   if (is_reload)
--- dbus-1.0.1/bus/main.c.fix-upgrade-mess	2006-09-16 11:34:34.000000000 -0400
+++ dbus-1.0.1/bus/main.c	2006-12-15 12:12:04.000000000 -0500
@@ -37,6 +37,7 @@
 #define RELOAD_READ_END 0
 #define RELOAD_WRITE_END 1
 
+static void close_reload_pipe (void);
 
 static void
 signal_handler (int sig)
@@ -51,11 +52,12 @@
 #endif /* DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX  */
     case SIGHUP:
       _dbus_string_init_const (&str, "foo");
-      if (!_dbus_write_socket (reload_pipe[RELOAD_WRITE_END], &str, 0, 1))
-	{
-	  _dbus_warn ("Unable to write to reload pipe.\n");
-	  exit (1);
-	}
+      if ((reload_pipe[RELOAD_WRITE_END] > 0) && 
+          !_dbus_write_socket (reload_pipe[RELOAD_WRITE_END], &str, 0, 1))
+        {
+          _dbus_warn ("Unable to write to reload pipe.\n");
+          close_reload_pipe ();
+        }
       break;
 
     case SIGTERM:
@@ -150,20 +152,28 @@
   DBusError error;
   DBusString str;
   _dbus_string_init (&str);
-  if (_dbus_read_socket (reload_pipe[RELOAD_READ_END], &str, 1) != 1)
+  if ((reload_pipe[RELOAD_READ_END] > 0) &&
+      _dbus_read_socket (reload_pipe[RELOAD_READ_END], &str, 1) != 1)
     {
       _dbus_warn ("Couldn't read from reload pipe.\n");
-      exit (1);
+      close_reload_pipe ();
+      return TRUE;
     }
   _dbus_string_free (&str);
 
+  /* this can only fail if we don't understand the config file
+   * or OOM.  Either way we should just stick with the currently
+   * loaded config.
+   */
   dbus_error_init (&error);
   if (! bus_context_reload_config (context, &error))
     {
+      _DBUS_ASSERT_ERROR_IS_SET (&error);
+      _dbus_assert (dbus_error_has_name (&error, DBUS_ERROR_FAILED) ||
+		    dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY));
       _dbus_warn ("Unable to reload configuration: %s\n",
 		  error.message);
       dbus_error_free (&error);
-      exit (1);
     }
   return TRUE;
 }
@@ -219,6 +229,16 @@
 
 }
 
+static void
+close_reload_pipe (void)
+{
+    _dbus_close_socket (reload_pipe[RELOAD_READ_END], NULL);
+    reload_pipe[RELOAD_READ_END] = -1;
+
+    _dbus_close_socket (reload_pipe[RELOAD_WRITE_END], NULL);
+    reload_pipe[RELOAD_WRITE_END] = -1;
+}
+
 int
 main (int argc, char **argv)
 {
--- dbus-1.0.1/bus/session.conf.in.fix-upgrade-mess	2006-11-01 18:30:46.000000000 -0500
+++ dbus-1.0.1/bus/session.conf.in	2006-12-15 12:12:04.000000000 -0500
@@ -1,5 +1,5 @@
 <!-- This configuration file controls the per-user-login-session message bus.
-     Add a session-local.conf and edit that rather than changing this 
+     Add a /etc/dbus-1/session-local.conf and edit that rather than changing this 
      file directly. -->
 
 <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
@@ -23,7 +23,7 @@
 
   <!-- This is included last so local configuration can override what's 
        in this standard file -->
-  <include ignore_missing="yes">session-local.conf</include>
+  <include ignore_missing="yes">/etc/dbus-1/session-local.conf</include>
 
   <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
 


--- NEW FILE session.conf ---
<!-- 
     ** WARNING **
     
     This file is obsolete and changes to it will be ignored.

     It was installed to address a bad upgrade bug where Fedora
     Core 6 users would get logged out during a yum update
     transaction.

     See
     https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218207
     for more information.

     Normally, you should not need to adjust the dbus bus daemon
     policy.  If for some reason you do, though, create
     /etc/dbus-1/session-local.conf, and put your changes there.
-->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><busconfig><type>session</type><listen>unix:tmpdir=/tmp</listen><servicedir>/usr/share/dbus-1/services</servicedir><policy context="default"><allow send_destination="*"/><allow eavesdrop="true"/><allow own="*"/></policy><include ignore_missing="yes">session-local.conf</include><include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include></busconfig>


--- NEW FILE system.conf ---
<!--
     ** WARNING **

     This file is obsolete and changes to it will be ignored.

     It was installed to address a bad upgrade bug where Fedora
     Core 6 users would get logged out during a yum update
     transaction.

     See
     https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218207
     for more information.

     Normally, you should not need to adjust the dbus bus daemon
     policy.  If for some reason you do, though, create
     /etc/dbus-1/system-local.conf, and put your changes there.

     Note that there are any number of ways you can hose yourself
     security-wise by screwing up the system bus policy; in
     particular, you probably don't want to listen on any more
     addresses, add any more auth mechanisms, run as a different
     user, etc.
-->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><busconfig><type>system</type><user>81</user><fork/><pidfile>/var/run/messagebus.pid</pidfile><auth>EXTERNAL</auth><listen>unix:path=/var/run/dbus/system_bus_socket</listen><policy context="default"><deny send_interface="*"/><deny receive_interface="*"/><deny own="*"/><allow user="*"/><allow send_destination="org.freedesktop.DBus"/><allow receive_sender="org.freedesktop.DBus"/><allow send_requested_reply="true"/><allow receive_requested_reply="true"/></policy><includedir>system.d</includedir><include ignore_missing="yes">system-local.conf</include><include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include></busconfig>


Index: dbus.spec
===================================================================
RCS file: /cvs/dist/rpms/dbus/FC-6/dbus.spec,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -r1.108 -r1.109
--- dbus.spec	15 Dec 2006 01:09:40 -0000	1.108
+++ dbus.spec	15 Dec 2006 17:39:07 -0000	1.109
@@ -8,14 +8,15 @@
 Summary: D-BUS message bus
 Name: dbus
 Version: 1.0.1 
-Release: 4%{?dist}
+Release: 5%{?dist}
 URL: http://www.freedesktop.org/software/dbus/
 Source0: %{name}-%{version}.tar.gz
+Source1: session.conf
+Source2: system.conf
 License: AFL/GPL
 Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-root
 PreReq: /usr/sbin/useradd
-PreReq: selinux-policy-targeted >= 2.4.6-7.fc6
 Requires: chkconfig >= 1.3.26
 BuildPreReq: libtool
 #BuildRequires: redhat-release 
@@ -35,7 +36,8 @@
 Patch4: dbus-0.92-audit-system.patch
 Patch6: dbus-1.0.0-no_fatal_checks.patch
 Patch7: dbus-1.0.1-pthread-holder-fix.patch
-Patch8: dbus-1.0.0-dont-die-on-error.patch
+# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218207
+Patch8: dbus-1.0.1-fix-upgrade-mess.patch
 
 %description
 
@@ -71,7 +73,7 @@
 %patch4 -p1 -b .audit_system
 %patch6 -p1 -b .no_fatal_checks
 %patch7 -p1 -b .pthread-holder-fix
-%patch8 -p1 -b .dont-die-on-error
+%patch8 -p1 -b .fix-upgrade-mess
 
 autoreconf -f -i
 
@@ -106,6 +108,12 @@
 
 mkdir -p $RPM_BUILD_ROOT/%{_libdir}/pkgconfig
 
+install -m444 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1
+install -m444 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1
+
+chmod 444 $RPM_BUILD_ROOT%{_datadir}/dbus-1/session.conf
+chmod 444 $RPM_BUILD_ROOT%{_datadir}/dbus-1/system.conf
+
 #change the arch-deps.h include directory to /usr/lib[64] instead of /lib[64]
 sed -e 's at -I${libdir}@-I${prefix}/%{_lib}@' $RPM_BUILD_ROOT/%{_lib}/pkgconfig/dbus-1.pc > $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/dbus-1.pc
 rm -f $RPM_BUILD_ROOT/%{_lib}/pkgconfig/dbus-1.pc
@@ -147,7 +155,6 @@
 %doc COPYING ChangeLog NEWS
 
 %dir %{_sysconfdir}/dbus-1
-%config %{_sysconfdir}/dbus-1/*.conf
 %config %{_sysconfdir}/rc.d/init.d/*
 %dir %{_sysconfdir}/dbus-1/system.d
 %dir %{_localstatedir}/run/dbus
@@ -161,6 +168,8 @@
 /%{_lib}/*dbus-1*.so.*
 %{_datadir}/man/man*/*
 %{_datadir}/dbus-1/services
+%{_datadir}/dbus-1/*.conf
+%{_sysconfdir}/dbus-1/*.conf
 
 %files x11
 %defattr(-,root,root)
@@ -176,13 +185,23 @@
 %{_includedir}/*
 
 %changelog
+* Thu Dec 14 2006 Ray Strode <rstrode at redhat.com> - 1.0.1-5
+- don't die when reloading config if config file gains new
+  options that aren't understood. Move config file to new
+  location and keep compatible, but obsolete config file in 
+  old location (one last try at bug 218207).
+
 * Thu Dec 14 2006 Ray Strode <rstrode at redhat.com> - 1.0.1-4
-- don't die when reloading config, if config file gains new
-  options that aren't understood (one more try at bug 218207)
+- don't die when reloading config if config file gains new
+  options that aren't understood. Add a PreReq:
+  selinux-policy-targeted >= version to create ordering
+  constraints during transaction (one more try at bug 218207)
 
 * Thu Dec 14 2006 Ray Strode <rstrode at redhat.com> - 1.0.1-3
-- don't die when reloading config, if config file gains new
-  options that aren't understood (bug 218207)
+- don't die when reloading config if config file gains new
+  options that aren't understood. Add a conflicts:
+  selinux-policy-targeted < version to create ordering constraints 
+  during transaction (bug 218207)
 
 * Fri Dec 01 2006 John (J5) Palmieri <johnp at redhat.com> - 1.0.1-2
 - Make sure we own the /var/lib/dbus directory so that it is created on install


--- dbus-1.0.0-dont-die-on-error.patch DELETED ---




More information about the fedora-cvs-commits mailing list