summaryrefslogtreecommitdiff
path: root/dbus/dbus-connection-internal.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-03-11 22:35:16 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-03-12 16:38:56 +0000
commitf67f45979b48ce63fb82179a7ec261e5e3ec3395 (patch)
tree6beaf8fa5920f50d05c3246de45b550c7b931964 /dbus/dbus-connection-internal.h
parent1a4d710d67391c1d7be2d7db6313e6c118acc773 (diff)
downloaddbus-f67f45979b48ce63fb82179a7ec261e5e3ec3395.tar.gz
transport: add new unixexec transport on Unix
The "unixexec:" transport will create a local AF_UNIX socket with socketpair(), then fork and execute a binary on one side with STDIN and STDOUT connected to it and then use the other side. This is useful to implement D-Bus tunneling schemes, for example to get a D-Bus connection to the system bus on a different host, similar how udisks is already doing it. (udisks uses SSH TCP tunneling for this, which is a bit ugly and less secure than this solution). Suggested use is with connection strings like the following: unixexec:path=ssh,argv1=foobar,argv2=system-bus-bridge or: unixexec:path=pkexec,argv1=system-bus-bridge or even: unixexec:path=sudo,argv1=system-bus-bridge The first line would execute the binary 'system-bus-bridge' on host 'foobar' and then pass D-Bus traffic to it. This (hypothetical) bridge binary would then forward the information to the local system bus. The second and third line use this scheme locally to acquire a privileged connection through pkexec resp. sudo: instead of connecting directly to the bus, they use the same bridge binary which will forward all information to the system bus. The arguments of the protocol are 'path' for the first execlp() argument, and argv0, argv1, and so on for the following arguments. argv0 can be left out in which case path will be used. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35230 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'dbus/dbus-connection-internal.h')
-rw-r--r--dbus/dbus-connection-internal.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h
index ac4158e9..3d37f188 100644
--- a/dbus/dbus-connection-internal.h
+++ b/dbus/dbus-connection-internal.h
@@ -114,6 +114,10 @@ void _dbus_connection_get_stats (DBusConnection *connection,
dbus_uint32_t *out_peak_bytes,
dbus_uint32_t *out_peak_fds);
+
+/* if DBUS_BUILD_TESTS */
+const char* _dbus_connection_get_address (DBusConnection *connection);
+
/* This _dbus_bus_* stuff doesn't really belong here, but dbus-bus-internal.h seems
* silly for one function
*/