Commit 8bf80d3e authored by Simon McVittie's avatar Simon McVittie

Imported Upstream version 1.8.18

parent 08e702f5
......@@ -123,8 +123,8 @@ DIST_COMMON = $(srcdir)/tools/lcov.am INSTALL NEWS README AUTHORS \
$(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in \
$(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in \
$(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in \
COPYING compile config.guess config.sub install-sh missing \
ltmain.sh
COPYING compile config.guess config.sub depcomp install-sh \
missing ltmain.sh
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
......@@ -328,6 +328,7 @@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL = @DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
......
D-Bus 1.8.18 (2015-05-14)
==
The “unicorn rifts” release.
Security hardening:
• On Unix platforms, change the default configuration for the session bus
to only allow EXTERNAL authentication (secure kernel-mediated
credentials-passing), as was already done for the system bus.
This avoids falling back to DBUS_COOKIE_SHA1, which relies on strongly
unpredictable pseudo-random numbers; under certain circumstances
(/dev/urandom unreadable or malloc() returns NULL), dbus could
fall back to using rand(), which does not have the desired unpredictability.
The fallback to rand() has not been changed in this stable-branch since
the necessary code changes for correct error-handling are rather intrusive.
If you are using D-Bus over the (unencrypted!) tcp: or nonce-tcp: transport,
in conjunction with DBUS_COOKIE_SHA1 and a shared home directory using
NFS or similar, you will need to reconfigure the session bus to accept
DBUS_COOKIE_SHA1 by commenting out the <auth> element. This configuration
is not recommended.
(fd.o #90414, Simon McVittie)
Other fixes:
• Add locking to DBusCounter's reference count and notify function
(fd.o #89297, Adrian Szyndela)
• Ensure that DBusTransport's reference count is protected by the
corresponding DBusConnection's lock (fd.o #90312, Adrian Szyndela)
• On Windows, listen on the same port for IPv4 and IPv6 (previously
broken by an endianness mistake), and fix a failure to bind TCP
sockets on approximately 1 attempt in 256 (fd.o #87999, Ralf Habacker)
• Correctly release DBusServer mutex before early-return if we run out
of memory while copying authentication mechanisms (fd.o #90004,
Ralf Habacker)
• Fix some missing \n in verbose (debug log) messages (fd.o #90004,
Ralf Habacker)
• Clean up some memory leaks in test code (fd.o #90004, Ralf Habacker)
D-Bus 1.8.16 (2015-02-09)
==
......
......@@ -356,6 +356,7 @@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL = @DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
......
......@@ -14,6 +14,16 @@
<listen>@DBUS_SESSION_BUS_LISTEN_ADDRESS@</listen>
<!-- On Unix systems, the most secure authentication mechanism is
EXTERNAL, which uses credential-passing over Unix sockets.
This authentication mechanism is not available on Windows,
is not suitable for use with the tcp: or nonce-tcp: transports,
and will not work on obscure flavours of Unix that do not have
a supported credentials-passing mechanism. On those platforms/transports,
comment out the <auth> element to allow fallback to DBUS_COOKIE_SHA1. -->
@DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL@
<standard_session_servicedirs />
<policy context="default">
......
......@@ -435,6 +435,7 @@ if (WIN32)
set (DBUS_SESSION_CONFIG_FILE "etc/dbus-1/session.conf")
# bus-test expects a non empty string
set (DBUS_USER "Administrator")
set (DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL "<!--<auth>EXTERNAL</auth>-->")
else (WIN32)
set (DBUS_SESSION_BUS_LISTEN_ADDRESS "unix:tmpdir=${DBUS_SESSION_SOCKET_DIR}" CACHE STRING "session bus default listening address")
set (DBUS_SESSION_BUS_CONNECT_ADDRESS "autolaunch:" CACHE STRING "session bus fallback address for clients")
......@@ -443,6 +444,9 @@ else (WIN32)
set (DBUS_SYSTEM_CONFIG_FILE ${configdir}/system.conf)
set (DBUS_SESSION_CONFIG_FILE ${configdir}/session.conf)
set (DBUS_USER "root")
# For best security, assume that all non-Windows platforms can do
# credentials-passing.
set (DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL "<auth>EXTERNAL</auth>")
endif (WIN32)
set (DBUS_DAEMON_NAME "dbus-daemon" CACHE STRING "The name of the dbus daemon executable")
......
......@@ -48,6 +48,10 @@ set (test-sleep-forever_SOURCES
${CMAKE_SOURCE_DIR}/../test/test-sleep-forever.c
)
set (manual-tcp_SOURCES
${CMAKE_SOURCE_DIR}/../test/manual-tcp.c
)
add_helper_executable(test-service ${test-service_SOURCES} dbus-testutils)
add_helper_executable(test-names ${test-names_SOURCES} dbus-testutils)
add_test_executable(test-shell ${test-shell_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
......@@ -57,6 +61,7 @@ add_helper_executable(test-spawn ${test-spawn_SOURCES} ${DBUS_INTERNAL_LIBRARIES
add_helper_executable(test-exit ${test-exit_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
add_helper_executable(test-segfault ${test-segfault_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
add_helper_executable(test-sleep-forever ${test-sleep-forever_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
add_test_executable(manual-tcp ${manual-tcp_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
if(DBUS_WITH_GLIB)
message(STATUS "with glib test apps")
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for dbus 1.8.16.
# Generated by GNU Autoconf 2.69 for dbus 1.8.18.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=dbus>.
#
......@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dbus'
PACKAGE_TARNAME='dbus'
PACKAGE_VERSION='1.8.16'
PACKAGE_STRING='dbus 1.8.16'
PACKAGE_VERSION='1.8.18'
PACKAGE_STRING='dbus 1.8.18'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=dbus'
PACKAGE_URL=''
......@@ -757,6 +757,7 @@ DBUS_WINCE_FALSE
DBUS_WINCE_TRUE
DBUS_WIN_FALSE
DBUS_WIN_TRUE
DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL
WINDRES
BUILD_FILEVERSION
BUILD_TIMESTAMP
......@@ -1513,7 +1514,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures dbus 1.8.16 to adapt to many kinds of systems.
\`configure' configures dbus 1.8.18 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1587,7 +1588,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of dbus 1.8.16:";;
short | recursive ) echo "Configuration of dbus 1.8.18:";;
esac
cat <<\_ACEOF
......@@ -1784,7 +1785,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
dbus configure 1.8.16
dbus configure 1.8.18
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2503,7 +2504,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by dbus $as_me 1.8.16, which was
It was created by dbus $as_me 1.8.18, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -3446,7 +3447,7 @@ fi
# Define the identity of the package.
PACKAGE='dbus'
VERSION='1.8.16'
VERSION='1.8.18'
cat >>confdefs.h <<_ACEOF
......@@ -3746,7 +3747,7 @@ LT_CURRENT=11
## increment any time the source changes; set to
## 0 if you increment CURRENT
LT_REVISION=11
LT_REVISION=12
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
......@@ -3759,8 +3760,8 @@ LT_AGE=8
DBUS_MAJOR_VERSION=1
DBUS_MINOR_VERSION=8
DBUS_MICRO_VERSION=16
DBUS_VERSION=1.8.16
DBUS_MICRO_VERSION=18
DBUS_VERSION=1.8.18
......@@ -16655,6 +16656,15 @@ $as_echo "#define DBUS_CYGWIN 1" >>confdefs.h
fi
# For best security, assume that all non-Windows platforms can do
# credentials-passing.
if test "$dbus_win" = yes; then :
DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL="<!--<auth>EXTERNAL</auth>-->"
else
DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL="<auth>EXTERNAL</auth>"
fi
if test "$dbus_win" = yes; then
DBUS_WIN_TRUE=
DBUS_WIN_FALSE='#'
......@@ -23428,7 +23438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by dbus $as_me 1.8.16, which was
This file was extended by dbus $as_me 1.8.18, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -23494,7 +23504,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
dbus config.status 1.8.16
dbus config.status 1.8.18
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -3,7 +3,7 @@ AC_PREREQ([2.63])
m4_define([dbus_major_version], [1])
m4_define([dbus_minor_version], [8])
m4_define([dbus_micro_version], [16])
m4_define([dbus_micro_version], [18])
m4_define([dbus_version],
[dbus_major_version.dbus_minor_version.dbus_micro_version])
AC_INIT([dbus],[dbus_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=dbus],[dbus])
......@@ -37,7 +37,7 @@ LT_CURRENT=11
## increment any time the source changes; set to
## 0 if you increment CURRENT
LT_REVISION=11
LT_REVISION=12
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
......@@ -122,6 +122,13 @@ if test "$dbus_cygwin" = yes; then
AC_DEFINE(DBUS_CYGWIN,1,[Defined if we run on a cygwin API based system])
fi
# For best security, assume that all non-Windows platforms can do
# credentials-passing.
AS_IF([test "$dbus_win" = yes],
[DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL="<!--<auth>EXTERNAL</auth>-->"],
[DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL="<auth>EXTERNAL</auth>"])
AC_SUBST([DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL])
AM_CONDITIONAL(DBUS_WIN, test "$dbus_win" = yes)
AM_CONDITIONAL(DBUS_WINCE, test "$dbus_wince" = yes)
AM_CONDITIONAL(DBUS_UNIX, test "$dbus_unix" = yes)
......
......@@ -502,6 +502,7 @@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL = @DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
......
......@@ -499,7 +499,7 @@ _dbus_trace_ref (const char *obj_name,
{
VALGRIND_PRINTF_BACKTRACE ("%s %p ref stolen (%s)",
obj_name, obj, why);
_dbus_verbose ("%s %p ref stolen (%s)",
_dbus_verbose ("%s %p ref stolen (%s)\n",
obj_name, obj, why);
}
else
......@@ -507,7 +507,7 @@ _dbus_trace_ref (const char *obj_name,
VALGRIND_PRINTF_BACKTRACE ("%s %p %d -> %d refs (%s)",
obj_name, obj,
old_refcount, new_refcount, why);
_dbus_verbose ("%s %p %d -> %d refs (%s)",
_dbus_verbose ("%s %p %d -> %d refs (%s)\n",
obj_name, obj, old_refcount, new_refcount, why);
}
}
......
......@@ -149,6 +149,7 @@ reader_init (DBusTypeReader *reader,
const DBusString *value_str,
int value_pos)
{
_DBUS_ZERO (*reader);
reader->byte_order = byte_order;
reader->finished = FALSE;
reader->type_str = type_str;
......@@ -736,11 +737,11 @@ _dbus_type_reader_init (DBusTypeReader *reader,
const DBusString *value_str,
int value_pos)
{
reader->klass = &body_reader_class;
reader_init (reader, byte_order, type_str, type_pos,
value_str, value_pos);
reader->klass = &body_reader_class;
#if RECURSIVE_MARSHAL_READ_TRACE
_dbus_verbose (" type reader %p init type_pos = %d value_pos = %d remaining sig '%s'\n",
reader, reader->type_pos, reader->value_pos,
......@@ -761,11 +762,11 @@ _dbus_type_reader_init_types_only (DBusTypeReader *reader,
const DBusString *type_str,
int type_pos)
{
reader->klass = &body_types_only_reader_class;
reader_init (reader, DBUS_COMPILER_BYTE_ORDER /* irrelevant */,
type_str, type_pos, NULL, _DBUS_INT_MAX /* crashes if we screw up */);
reader->klass = &body_types_only_reader_class;
#if RECURSIVE_MARSHAL_READ_TRACE
_dbus_verbose (" type reader %p init types only type_pos = %d remaining sig '%s'\n",
reader, reader->type_pos,
......@@ -988,6 +989,7 @@ void
_dbus_type_reader_recurse (DBusTypeReader *reader,
DBusTypeReader *sub)
{
const DBusTypeReaderClass *klass;
int t;
t = _dbus_first_type_in_signature (reader->type_str, reader->type_pos);
......@@ -996,27 +998,27 @@ _dbus_type_reader_recurse (DBusTypeReader *reader,
{
case DBUS_TYPE_STRUCT:
if (reader->klass->types_only)
sub->klass = &struct_types_only_reader_class;
klass = &struct_types_only_reader_class;
else
sub->klass = &struct_reader_class;
klass = &struct_reader_class;
break;
case DBUS_TYPE_DICT_ENTRY:
if (reader->klass->types_only)
sub->klass = &dict_entry_types_only_reader_class;
klass = &dict_entry_types_only_reader_class;
else
sub->klass = &dict_entry_reader_class;
klass = &dict_entry_reader_class;
break;
case DBUS_TYPE_ARRAY:
if (reader->klass->types_only)
sub->klass = &array_types_only_reader_class;
klass = &array_types_only_reader_class;
else
sub->klass = &array_reader_class;
klass = &array_reader_class;
break;
case DBUS_TYPE_VARIANT:
if (reader->klass->types_only)
_dbus_assert_not_reached ("can't recurse into variant typecode");
else
sub->klass = &variant_reader_class;
klass = &variant_reader_class;
break;
default:
_dbus_verbose ("recursing into type %s\n", _dbus_type_to_string (t));
......@@ -1028,9 +1030,10 @@ _dbus_type_reader_recurse (DBusTypeReader *reader,
_dbus_assert_not_reached ("don't yet handle recursing into this type");
}
_dbus_assert (sub->klass == all_reader_classes[sub->klass->id]);
_dbus_assert (klass == all_reader_classes[klass->id]);
(* sub->klass->recurse) (sub, reader);
(* klass->recurse) (sub, reader);
sub->klass = klass;
#if RECURSIVE_MARSHAL_READ_TRACE
_dbus_verbose (" type reader %p RECURSED type_pos = %d value_pos = %d remaining sig '%s'\n",
......
......@@ -4796,7 +4796,10 @@ dbus_message_demarshal (const char *str,
return NULL;
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_append_len (buffer, str, len);
if (!_dbus_string_append_len (buffer, str, len))
goto fail_oom;
_dbus_message_loader_return_buffer (loader, buffer);
if (!_dbus_message_loader_queue_messages (loader))
......
......@@ -74,7 +74,13 @@ do_check_nonce (int fd, const DBusString *nonce, DBusError *error)
}
else
{
_dbus_string_append_len(&buffer, _dbus_string_get_const_data (&p), n);
if (!_dbus_string_append_len (&buffer, _dbus_string_get_const_data (&p), n))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
_dbus_string_free (&p);
_dbus_string_free (&buffer);
return FALSE;
}
nleft -= n;
}
}
......
......@@ -69,6 +69,7 @@ struct DBusCounter
DBusCounterNotifyFunction notify_function; /**< notify function */
void *notify_data; /**< data for notify function */
dbus_bool_t notify_pending : 1; /**< TRUE if the guard value has been crossed */
DBusRMutex *mutex; /**< Lock on the entire DBusCounter */
};
/** @} */ /* end of resource limits internals docs */
......@@ -95,6 +96,13 @@ _dbus_counter_new (void)
counter->refcount = 1;
_dbus_rmutex_new_at_location (&counter->mutex);
if (counter->mutex == NULL)
{
dbus_free (counter);
counter = NULL;
}
return counter;
}
......@@ -107,10 +115,14 @@ _dbus_counter_new (void)
DBusCounter *
_dbus_counter_ref (DBusCounter *counter)
{
_dbus_rmutex_lock (counter->mutex);
_dbus_assert (counter->refcount > 0);
counter->refcount += 1;
_dbus_rmutex_unlock (counter->mutex);
return counter;
}
......@@ -123,13 +135,20 @@ _dbus_counter_ref (DBusCounter *counter)
void
_dbus_counter_unref (DBusCounter *counter)
{
dbus_bool_t last_ref = FALSE;
_dbus_rmutex_lock (counter->mutex);
_dbus_assert (counter->refcount > 0);
counter->refcount -= 1;
last_ref = (counter->refcount == 0);
_dbus_rmutex_unlock (counter->mutex);
if (counter->refcount == 0)
if (last_ref)
{
_dbus_rmutex_free_at_location (&counter->mutex);
dbus_free (counter);
}
}
......@@ -148,7 +167,11 @@ void
_dbus_counter_adjust_size (DBusCounter *counter,
long delta)
{
long old = counter->size_value;
long old = 0;
_dbus_rmutex_lock (counter->mutex);
old = counter->size_value;
counter->size_value += delta;
......@@ -168,6 +191,8 @@ _dbus_counter_adjust_size (DBusCounter *counter,
(old >= counter->notify_size_guard_value &&
counter->size_value < counter->notify_size_guard_value)))
counter->notify_pending = TRUE;
_dbus_rmutex_unlock (counter->mutex);
}
/**
......@@ -181,11 +206,20 @@ _dbus_counter_adjust_size (DBusCounter *counter,
void
_dbus_counter_notify (DBusCounter *counter)
{
DBusCounterNotifyFunction notify_function = NULL;
void *notify_data = NULL;
_dbus_rmutex_lock (counter->mutex);
if (counter->notify_pending)
{
counter->notify_pending = FALSE;
(* counter->notify_function) (counter, counter->notify_data);
notify_function = counter->notify_function;
notify_data = counter->notify_data;
}
_dbus_rmutex_unlock (counter->mutex);
if (notify_function != NULL)
(* notify_function) (counter, notify_data);
}
/**
......@@ -202,7 +236,11 @@ void
_dbus_counter_adjust_unix_fd (DBusCounter *counter,
long delta)
{
long old = counter->unix_fd_value;
long old = 0;
_dbus_rmutex_lock (counter->mutex);
old = counter->unix_fd_value;
counter->unix_fd_value += delta;
......@@ -222,6 +260,8 @@ _dbus_counter_adjust_unix_fd (DBusCounter *counter,
(old >= counter->notify_unix_fd_guard_value &&
counter->unix_fd_value < counter->notify_unix_fd_guard_value)))
counter->notify_pending = TRUE;
_dbus_rmutex_unlock (counter->mutex);
}
/**
......@@ -266,11 +306,13 @@ _dbus_counter_set_notify (DBusCounter *counter,
DBusCounterNotifyFunction function,
void *user_data)
{
_dbus_rmutex_lock (counter->mutex);
counter->notify_size_guard_value = size_guard_value;
counter->notify_unix_fd_guard_value = unix_fd_guard_value;
counter->notify_function = function;
counter->notify_data = user_data;
counter->notify_pending = FALSE;
_dbus_rmutex_unlock (counter->mutex);
}
#ifdef DBUS_ENABLE_STATS
......
......@@ -1043,7 +1043,10 @@ dbus_server_set_auth_mechanisms (DBusServer *server,
{
copy = _dbus_dup_string_array (mechanisms);
if (copy == NULL)
return FALSE;
{
SERVER_UNLOCK (server);
return FALSE;
}
}
else
copy = NULL;
......
......@@ -1714,10 +1714,19 @@ _dbus_listen_tcp_socket (const char *host,
if (bind (fd, (struct sockaddr*) tmp->ai_addr, tmp->ai_addrlen) == SOCKET_ERROR)
{
DBUS_SOCKET_SET_ERRNO ();
closesocket (fd);
if (errno == WSAEADDRINUSE)
{
/* Calling this function with port=0 tries to
* bind the same port twice, so we should
* ignore the second bind.
*/
tmp = tmp->ai_next;
continue;
}
dbus_set_error (error, _dbus_error_from_errno (errno),
"Failed to bind socket \"%s:%s\": %s",
host ? host : "*", port, _dbus_strerror_from_errno ());
closesocket (fd);
goto failed;
}
......@@ -1763,7 +1772,10 @@ _dbus_listen_tcp_socket (const char *host,
host ? host : "*", port, _dbus_strerror_from_errno());
goto failed;
}
snprintf( portbuf, sizeof( portbuf ) - 1, "%d", addr.AddressIn.sin_port );
if (addr.AddressIn.sin_family = AF_INET)
snprintf( portbuf, sizeof( portbuf ) - 1, "%d", ntohs(addr.AddressIn.sin_port) );
else
snprintf( portbuf, sizeof( portbuf ) - 1, "%d", ntohs(addr.AddressIn6.sin6_port) );
if (!_dbus_string_append(retport, portbuf))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
......
......@@ -63,6 +63,7 @@ live_messages_notify (DBusCounter *counter,
{
DBusTransport *transport = user_data;
_dbus_connection_lock (transport->connection);
_dbus_transport_ref (transport);
#if 0
......@@ -77,12 +78,11 @@ live_messages_notify (DBusCounter *counter,
*/
if (transport->vtable->live_messages_changed)
{
_dbus_connection_lock (transport->connection);
(* transport->vtable->live_messages_changed) (transport);
_dbus_connection_unlock (transport->connection);
}
_dbus_transport_unref (transport);
_dbus_connection_unlock (transport->connection);
}
/**
......
......@@ -198,6 +198,7 @@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL = @DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
......
......@@ -119,6 +119,10 @@ test_syslog_SOURCES = internals/syslog.c
test_syslog_CPPFLAGS = $(static_cppflags)
test_syslog_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
manual_tcp_SOURCES = manual-tcp.c
manual_tcp_CPPFLAGS = $(static_cppflags)
manual_tcp_LDADD = $(top_builddir)/dbus/libdbus-internal.la
EXTRA_DIST = dbus-test-runner
testexecdir = $(libdir)/dbus-1.0/test
......@@ -130,6 +134,7 @@ installable_tests = \
test-printf \
$(NULL)
installable_manual_tests = \
manual-tcp \
$(NULL)
if DBUS_WITH_GLIB
......
......@@ -169,7 +169,7 @@ libdbus_testutils_la_OBJECTS = $(am_libdbus_testutils_la_OBJECTS)
am__EXEEXT_3 = test-shell$(EXEEXT) test-printf$(EXEEXT) \
$(am__EXEEXT_2)
@DBUS_WITH_GLIB_TRUE@am__EXEEXT_4 = manual-authz$(EXEEXT)
am__EXEEXT_5 = $(am__EXEEXT_4)
am__EXEEXT_5 = manual-tcp$(EXEEXT) $(am__EXEEXT_4)
@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_6 = $(am__EXEEXT_3) \
@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@ $(am__EXEEXT_5)
@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_7 = $(am__EXEEXT_3) \
......@@ -180,6 +180,9 @@ am_manual_authz_OBJECTS = manual_authz-manual-authz.$(OBJEXT)
manual_authz_OBJECTS = $(am_manual_authz_OBJECTS)
manual_authz_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
$(am__DEPENDENCIES_1)
am_manual_tcp_OBJECTS = manual_tcp-manual-tcp.$(OBJEXT)
manual_tcp_OBJECTS = $(am_manual_tcp_OBJECTS)
manual_tcp_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
am_test_corrupt_OBJECTS = test_corrupt-corrupt.$(OBJEXT)
test_corrupt_OBJECTS = $(am_test_corrupt_OBJECTS)
test_corrupt_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
......@@ -282,7 +285,8 @@ am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libdbus_testutils_internal_la_SOURCES) \
$(libdbus_testutils_la_SOURCES) $(manual_authz_SOURCES) \
$(test_corrupt_SOURCES) $(test_dbus_daemon_SOURCES) \
$(manual_tcp_SOURCES) $(test_corrupt_SOURCES) \
$(test_dbus_daemon_SOURCES) \
$(test_dbus_daemon_eavesdrop_SOURCES) test-exit.c \
$(test_loopback_SOURCES) $(test_marshal_SOURCES) test-names.c \
$(test_printf_SOURCES) $(test_refs_SOURCES) \
......@@ -292,8 +296,8 @@ SOURCES = $(libdbus_testutils_internal_la_SOURCES) \
$(test_syntax_SOURCES) $(test_syslog_SOURCES)
DIST_SOURCES = $(libdbus_testutils_internal_la_SOURCES) \
$(am__libdbus_testutils_la_SOURCES_DIST) \
$(manual_authz_SOURCES) $(test_corrupt_SOURCES) \
$(test_dbus_daemon_SOURCES) \
$(manual_authz_SOURCES) $(manual_tcp_SOURCES) \
$(test_corrupt_SOURCES) $(test_dbus_daemon_SOURCES) \
$(test_dbus_daemon_eavesdrop_SOURCES) test-exit.c \
$(test_loopback_SOURCES) $(test_marshal_SOURCES) test-names.c \
$(test_printf_SOURCES) $(test_refs_SOURCES) \
......@@ -612,6 +616,7 @@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL = @DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
......@@ -860,10 +865,13 @@ test_refs_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
test_syslog_SOURCES = internals/syslog.c
test_syslog_CPPFLAGS = $(static_cppflags)
test_syslog_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
manual_tcp_SOURCES = manual-tcp.c
manual_tcp_CPPFLAGS = $(static_cppflags)
manual_tcp_LDADD = $(top_builddir)/dbus/libdbus-internal.la
EXTRA_DIST = dbus-test-runner $(in_data) $(static_data)
testexecdir = $(libdir)/dbus-1.0/test
installable_tests = test-shell test-printf $(NULL) $(am__append_3)
installable_manual_tests = $(NULL) $(am__append_4)
installable_manual_tests = manual-tcp $(NULL) $(am__append_4)
installcheck_tests = $(am__append_6)
installcheck_environment = \
XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR \
......@@ -1148,6 +1156,10 @@ manual-authz$(EXEEXT): $(manual_authz_OBJECTS) $(manual_authz_DEPENDENCIES) $(EX
@rm -f manual-authz$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(manual_authz_OBJECTS) $(manual_authz_LDADD) $(LIBS)
manual-tcp$(EXEEXT): $(manual_tcp_OBJECTS) $(manual_tcp_DEPENDENCIES) $(EXTRA_manual_tcp_DEPENDENCIES)
@rm -f manual-tcp$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(manual_tcp_OBJECTS) $(manual_tcp_LDADD) $(LIBS)
test-corrupt$(EXEEXT): $(test_corrupt_OBJECTS) $(test_corrupt_DEPENDENCIES) $(EXTRA_test_corrupt_DEPENDENCIES)
@rm -f test-corrupt$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_corrupt_OBJECTS) $(test_corrupt_LDADD) $(LIBS)
......@@ -1228,6 +1240,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_testutils_internal_la-test-utils.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manual_authz-manual-authz.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manual_tcp-manual-tcp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/marshal.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syntax.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-exit.Po@am__quote@
......@@ -1290,6 +1303,20 @@ manual_authz-manual-authz.obj: manual-authz.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(manual_authz_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o manual_authz-manual-authz.obj `if test -f 'manual-authz.c'; then $(CYGPATH_W) 'manual-authz.c'; else $(CYGPATH_W) '$(srcdir)/manual-authz.c'; fi`
manual_tcp-manual-tcp.o: manual-tcp.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(manual_tcp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT manual_tcp-manual-tcp.o -MD -MP -MF $(DEPDIR)/manual_tcp-manual-tcp.Tpo -c -o manual_tcp-manual-tcp.o `test -f 'manual-tcp.c' || echo '$(srcdir)/'`manual-tcp.c