]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix a D-BUS threading issue that caused the scheduler to crash (STR #4347)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 20 Feb 2014 16:09:55 +0000 (16:09 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 20 Feb 2014 16:09:55 +0000 (16:09 +0000)
Apparently D-BUS is not thread-safe by default...

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11626 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-1.7.txt
config-scripts/cups-common.m4
config.h.in
scheduler/main.c

index 25d3a227e567e316b9336ab50d13263d314a3667..21abc9d47d361c4b9fe29bb354008d56cdcbbde5 100644 (file)
@@ -5,6 +5,8 @@ CHANGES IN CUPS V1.7.2
 
        - Security: The scheduler now blocks URLs containing embedded HTML
          (STR #4356)
+       - Fixed a D-BUS threading issue that caused the scheduler to crash
+         (STR #4347)
        - The scheduler now automatically reconnects to Avahi as needed
          (STR #4370)
        - The scheduler did not handle GET requests for the log files properly
index 0b66ac467628fc80053e53d79462f9d64008a6a5..6318b77f70c981e66eee98bc6314cf40e39b0360 100644 (file)
@@ -3,7 +3,7 @@ dnl "$Id$"
 dnl
 dnl Common configuration stuff for CUPS.
 dnl
-dnl Copyright 2007-2013 by Apple Inc.
+dnl Copyright 2007-2014 by Apple Inc.
 dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
 dnl
 dnl These coded instructions, statements, and computer programs are the
@@ -304,16 +304,11 @@ fi
 LIBS="$SAVELIBS"
 
 dnl Check for DBUS support
-if test -d /etc/dbus-1; then
-       DBUSDIR="/etc/dbus-1"
-else
-       DBUSDIR=""
-fi
-
 AC_ARG_ENABLE(dbus, [  --disable-dbus           build without DBUS support])
 AC_ARG_WITH(dbusdir, [  --with-dbusdir          set DBUS configuration directory ],
        DBUSDIR="$withval")
 
+DBUSDIR=""
 DBUS_NOTIFIER=""
 DBUS_NOTIFIERLIBS=""
 
@@ -330,7 +325,12 @@ if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x; then
                LIBS="$LIBS $DBUS_NOTIFIERLIBS"
                AC_CHECK_FUNC(dbus_message_iter_init_append,
                              AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
+               AC_CHECK_FUNC(dbus_threads_init,
+                             AC_DEFINE(HAVE_DBUS_THREADS_INIT))
                LIBS="$SAVELIBS"
+               if test -d /etc/dbus-1; then
+                       DBUSDIR="/etc/dbus-1"
+               fi
        else
                AC_MSG_RESULT(no)
        fi
index 7c96248f862b3164fb7dd5b01d6a021a8112f94d..1b2df157ef584929cf3ac0723926eb3dc0290bb6 100644 (file)
 
 #undef HAVE_DBUS
 #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND
+#undef HAVE_DBUS_THREADS_INIT
 
 
 /*
index 7ed396d61e717f0810459a08f28114c7d6a1f7d8..f847e275c8ec7cd6976c9b9d5f1ac90594a3a659 100644 (file)
@@ -477,6 +477,14 @@ main(int  argc,                            /* I - Number of command-line args */
   setlocale(LC_TIME, "");
 #endif /* LC_TIME */
 
+#ifdef HAVE_DBUS_THREADS_INIT
+ /*
+  * Enable threading support for D-BUS...
+  */
+
+  dbus_threads_init();
+#endif /* HAVE_DBUS_THREADS_INIT */
+
  /*
   * Set the maximum number of files...
   */