summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-transport-socket.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'fd-passing'Thiago Macieira2009-07-161-24/+85
|\ | | | | | | | | | | | | Conflicts: dbus/dbus-connection.c dbus/dbus-message-util.c dbus/dbus-sysdeps-unix.c
| * unix-fd: add logic to count unix fds the same way as allocated memoryLennart Poettering2009-05-201-1/+2
| | | | | | | | This make all counters count both bytes of memory and unix fds.
| * auth: add fd passing negotiation supportLennart Poettering2009-05-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * cloexec: set all sockets that are created with SOCK_CLOEXECLennart Poettering2009-05-201-2/+0
| | | | | | | | | | | | 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.
| * unix-fd: add message encoding/decoding for unix fdsLennart Poettering2009-05-201-21/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Bug 896 - Avoid race conditions reading message from exited processColin Walters2009-07-131-8/+28
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Bug 21161 - Update the FSF addressTobias Mueller2009-07-101-1/+1
|/ | | | | | No comment. Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 19567 - Make marshaling code usable without DBusConnectionWilliam Lachance2009-04-211-1/+1
| | | | | | | | | | 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>
* return message loader buffer in case of OOM (FDO Bug#12666)John (J5) Palmieri2008-01-141-0/+4
| | | | | | | | | 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)
* Use DBUS_ERROR_INIT instead of dbus_error_init wherever it's clearly equivalentSimon McVittie2007-10-111-2/+1
|
* Add support for compacting DBusStrings to release wasted memory.Ryan Lortie2007-09-201-0/+2
| | | | | | | | | | | | | | | | | 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.
* Switch over to using getaddrinfo for TCP clients & servers to enable IPv6Daniel P. Berrange2007-07-251-24/+21
|
* 2007-07-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-141-1/+1
| | | | * Add indent-tabs-mode: nil to all file headers.
* 2007-06-18 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-181-1/+7
| | | | | | | | * 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.
* 2007-06-18 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-181-1/+1
| | | | | | | | | * 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
* 2007-06-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-151-16/+12
| | | | | | | | | | | | | | * 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)
* 2007-06-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-091-10/+21
| | | | | | | | | | | | | | | | | | | * 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
* 2006-10-19 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-201-0/+8
| | | | * Fix a pile of Doxygen warnings and missing docs
* * dbus-transport-socket.c (exchange_credentials):John (J5) Palmieri2006-10-131-4/+11
| | | | | | Print out more detailed errors if reading or sending credentials fail (Patch from Julio M. Merino Vidal <jmmv at NetBSD dot org>)
* 2006-09-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-09-161-0/+54
| | | | | | | | | * 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
* voc Pennington <hp@redhat.com>Havoc Pennington2006-09-161-0/+1255
* 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