diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-04-24 04:38:27 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-05-20 02:09:31 +0200 |
commit | c200e0304d6f53a0fd47f524386b02b27c0c45f6 (patch) | |
tree | 2d78c7bb46d1ce81538c7c36cce948f170d933b1 /dbus/dbus-transport-socket.c | |
parent | 89318bbeb4076d8d9de9831d69621fc1411760d3 (diff) |
auth: add fd passing negotiation support
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.
Diffstat (limited to 'dbus/dbus-transport-socket.c')
-rw-r--r-- | dbus/dbus-transport-socket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dbus/dbus-transport-socket.c b/dbus/dbus-transport-socket.c index cc49c851..76699506 100644 --- a/dbus/dbus-transport-socket.c +++ b/dbus/dbus-transport-socket.c @@ -594,7 +594,7 @@ do_writing (DBusTransport *transport) #endif #ifdef HAVE_UNIX_FD_PASSING - if (socket_transport->message_bytes_written <= 0 && transport->can_pass_unix_fd) + if (socket_transport->message_bytes_written <= 0 && DBUS_TRANSPORT_CAN_SEND_UNIX_FD(transport)) { /* Send the fds along with the first byte of the message */ const int *unix_fds; @@ -777,7 +777,7 @@ do_reading (DBusTransport *transport) &buffer); #ifdef HAVE_UNIX_FD_PASSING - if (transport->can_pass_unix_fd) + if (DBUS_TRANSPORT_CAN_SEND_UNIX_FD(transport)) { int *fds, n_fds; @@ -1244,7 +1244,7 @@ _dbus_transport_new_for_socket (int fd, goto failed_4; #ifdef HAVE_UNIX_FD_PASSING - socket_transport->base.can_pass_unix_fd = _dbus_socket_can_pass_unix_fd(fd); + _dbus_auth_set_unix_fd_possible(socket_transport->base.auth, _dbus_socket_can_pass_unix_fd(fd)); #endif socket_transport->fd = fd; |