Age | Commit message (Collapse) | Author | Files | Lines |
|
The argument bytes_read of _dbus_auth_return_buffer() function isn't
used at all, so remove it.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71477
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70218
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
|
|
Historically, _dbus_transport_get_is_authenticated() has had the
side-effect of trying to advance the authentication state machine (if
there's enough buffered input to do so). This seems an inappropriate
activity for what looks like a simple getter.
Split it into _dbus_transport_try_to_authenticate (which does what it
always used to do) and _dbus_transport_peek_is_authenticated (which
is the simple getter version).
To minimize the difference in behaviour for the stable branch of D-Bus,
I've only used _dbus_transport_peek_is_authenticated where it was used
in an assertion, which should clearly not have side effects (and I've
checked that the asserting function cannot be called until both
authentication and authorization have completed). Replacing most of the
calls to get_is_authenticated with try_to_authenticate is a possible
piece of future work.
Based on patches from Cosimo Alfarano, who noticed this
assertion-with-side-effects.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
https://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.com>
|
|
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65755
|
|
Ralf pointed out that the address doesn't round-trip correctly.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45896
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
|
|
It's called with the connection's lock held.
Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
|
|
This should mean we don't get invalid fds in the main loop.
The BSD (kqueue) and Windows code paths are untested, but follow the same
patterns as the tested Linux/generic Unix versions.
DBusTransportSocket was already OK (it called free_watches() before
_dbus_close_socket, and that did the remove, invalidate, unref dance).
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
|
|
printed by default.
|
|
|
|
Conflicts:
bus/bus.c
configure.in
|
|
Signed-off-by: Thiago Macieira <thiago@kde.org>
|
|
Cherry-picked from commit f9bc0f4bd036f6ede5d9850fb0f8587178c85f44 in
the dbus4win repository, slightly massaged to apply by tml@iki.fi.
|
|
Cherry-picked from commit e7a070db22ed4a84dc04a062255356c9f6c4c9c5 in
the dbus4win repository, trailing whitespace issues corrected by
tml@iki.fi.
|
|
Merged and cleaned up patch from my [Frank Osterfeld's] local work
branch.
Cherry-picked from commit e2801eca57b2d9e09afd662ed5ef6fc83be73afc and
edited by tml@iki.fi to make it apply, and fixing whitespace issues.
|
|
Conflicts:
dbus/dbus-connection.c
dbus/dbus-message-util.c
dbus/dbus-sysdeps-unix.c
|
|
Patch based on extensive work from Michael Meeks <michael.meeks@novell.com>,
thanks to Dafydd Harries <dafydd.harries@collabora.co.uk>,
Kimmo Hämäläinen <kimmo.hamalainen@nokia.com> and others.
The basic idea with this bug is that we effectively ignore errors
on write. Only when we're done reading from a connection do we
close down a connection. This avoids a race condition where
if a process (such as dbus-send) exited while we still had
data to read in the buffer, we'd miss that data.
(cherry picked from commit 0e36cdd54964c4012acec2bb8e598b85e82d2846)
|
|
No comment.
Signed-off-by: Colin Walters <walters@verbum.org>
(cherry picked from commit 5baf2f856a9c6625993234855b07680da1c8916f)
|
|
Patch based on extensive work from Michael Meeks <michael.meeks@novell.com>,
thanks to Dafydd Harries <dafydd.harries@collabora.co.uk>,
Kimmo Hämäläinen <kimmo.hamalainen@nokia.com> and others.
The basic idea with this bug is that we effectively ignore errors
on write. Only when we're done reading from a connection do we
close down a connection. This avoids a race condition where
if a process (such as dbus-send) exited while we still had
data to read in the buffer, we'd miss that data.
|
|
No comment.
Signed-off-by: Colin Walters <walters@verbum.org>
|
|
This make all counters count both bytes of memory and unix fds.
|
|
This adds two new directives to the auth protocol:
NEGOTIATE_UNIX_FD is sent by the client after the authentication was
sucessful, i.e. OK was received.
AGREE_UNIX_FD is then sent by the server if it can do unix fd passing as
well.
ERROR is returned when the server cannot or is unwilling to do unix fd
passing.
This should be compatible with existing D-Bus implementations which will
naturally return ERROR on NEGOTIATE_UNIX_FD.
|
|
Since all socket users enable FD_CLOEXEC anyway we can just do that in
_dbus_open_socket() and be done with it for all cases. By side effect
this allows us to use SOCK_CLOEXEC and hence close the CLOEXEC race.
|
|
When appending unix fds to the message a new entry in the fd array will
be allocated and the index to it will be written to the message payload.
When parsing unix fds from the message the index will be read from the
payload and then looked up in the fd array.
When we read fds we put them in a queue first. Since each message knows
how many fds are attached to it we will then pop enough fds from this
queue each time we decode a message from the stream.
This should make sending and receiving more portable since we don't make
any strong requirements on the exact semantics of the SCM_RIGHTS
implementation: as long as fds are recieved in order, none or lost and
the arrive at the same time as at least one byte from the actual message
dat we should be able to handle them correctly.
|
|
Some projects want to reuse the DBus message format, without
actually going through a DBusConnection. This set of changes
makes a few functions from DBusMessage public, and adds a new
function to determine the number of bytes needed to demarshal
a message.
Signed-off-by: Colin Walters <walters@verbum.org>
|
|
Some projects want to reuse the DBus message format, without
actually going through a DBusConnection. This set of changes
makes a few functions from DBusMessage public, and adds a new
function to determine the number of bytes needed to demarshal
a message.
Signed-off-by: Colin Walters <walters@verbum.org>
|
|
2008-01-14 John (J5) Palmieri <johnp@redhat.com>
* patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
* dbus/dbus-transport-socket.c(do_reading): return message
loader buffer in case of OOM (FDO Bug#12666)
|
|
|
|
2007-09-19 Ryan Lortie <desrt@desrt.ca>
* dbus/dbus-string.[ch] (compact, _dbus_string_compact,
_dbus_string_lock): new compact function to free up allocated memory
that is no longer used.
* dbus/dbus-message.c (load_message): call _dbus_string_compact on the
message loader buffer.
* dbus/dbus-transport-socket.c (do_reading, do_writing): call
_dbus_string_compact on the incoming/outgoing "encoded" buffers.
* dbus/dbus-string-util.c (_dbus_string_test): add a few tests for
string compacting.
|
|
|
|
* Add indent-tabs-mode: nil to all file headers.
|
|
* dbus/dbus-sysdeps-unix.c (_dbus_read_credentials_socket): clean
this up a little bit, to try and understand why telnet'ing to a
server and sending a non-nul byte didn't disconnect immediately;
now it seems that it does disconnect immediately as it should,
though I don't understand what has changed.
|
|
* dbus/dbus-watch.c (dbus_watch_get_socket)
(dbus_watch_get_unix_fd): new API to match DBusConnection
(dbus_watch_get_fd): deprecate this
Throughout: just s/dbus_watch_get_fd/dbus_watch_get_socket/g for
now since all the transports use sockets anyway
|
|
* dbus/dbus-sysdeps.c (_dbus_set_errno_to_zero)
(_dbus_get_is_errno_nonzero, _dbus_get_is_errno_eintr)
(_dbus_strerror_from_errno): family of functions to abstract
errno, though these are somewhat bogus (really we should make our
socket wrappers not use errno probably - the issue is that any
usage of errno that isn't socket-related probably is not
cross-platform, so should either be in a unix-only file that can
use errno directly, or is a bug - these general errno wrappers
hide issues of this nature in non-socket code, while
socket-specific API changes would not since sockets are allowed
cross-platform)
|
|
* bus/dispatch.c (check_get_connection_unix_process_id): adapt
since sysdeps-unix.h stuff isn't included anymore
* bus/bus.c (bus_context_new): use more abstract functions to
change user, so they can be no-ops on Windows
* dbus/dbus-credentials.c, dbus/dbus-credentials.h,
dbus/dbus-credentials-util.c: new files containing a fully opaque
DBusCredentials data type to replace the old not opaque one.
* configure.in (DBUS_UNIX): define DBUS_UNIX to match DBUS_WIN on
windows
* dbus/dbus-userdb.h: prohibit on Windows, next step is to clean
up the uses of it in bus/*.c and factor out the parts of
cookie auth that depend on it
|
|
* Fix a pile of Doxygen warnings and missing docs
|
|
Print out more detailed errors if reading or sending
credentials fail (Patch from Julio M. Merino Vidal
<jmmv at NetBSD dot org>)
|
|
* dbus/dbus-transport.c (_dbus_transport_open): modify to delegate
to _dbus_transport_open_platform_specific,
_dbus_transport_open_socket,
and _dbus_transport_open_debug_pipe
* dbus/dbus-transport-protected.h: add _dbus_transport_open_platform_specific
|
|
* dbus/dbus-server.c (dbus_server_listen): change how this works
to be able to delegate to a set of handlers that can succeed,
fail, or choose not to handle. Allows us to have
dbus_server_listen_platform_specific.
* dbus/dbus-server-socket.c (_dbus_server_new_for_tcp_socket):
factor out the tcp socket stuff to be used on windows, leaving
unix domain socket only in dbus-socket-unix.c
* dbus/dbus-transport-socket.c
(_dbus_transport_new_for_tcp_socket): factor out the tcp socket
stuff to be used on windows, leaving unix domain socket only
in dbus-transport-unix.c
* dbus/dbus-connection.c (dbus_connection_get_unix_user): insert
temporary hack to be sure this fails on windows
(dbus_connection_get_unix_process_id): ditto
|