summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-transport.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-06-04 05:20:20 +0000
committerHavoc Pennington <hp@redhat.com>2003-06-04 05:20:20 +0000
commita70b042f0dcebb10689975c65a2c45b52b7a4437 (patch)
tree46a45a6933e1f9fbf6ac30cc819e96f60536342f /dbus/dbus-transport.c
parent0e024fc53a5effadedd56427ffe261c417e45222 (diff)
2003-06-04 Havoc Pennington <hp@pobox.com>
* dbus/dbus-server.c (dbus_server_listen): allow abstract sockets using unix:abstract=/foo, and when listening in a tmpdir i.e. unix:tmpdir=/tmp, always use abstract sockets if we can. * dbus/dbus-transport.c (_dbus_transport_open): support unix:abstract=/foo * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket): support abstract sockets * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket): support abstract sockets * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket): add "abstract" toggle as an argument, implement abstract namespace support (_dbus_listen_unix_socket): ditto * configure.in: add --enable-abstract-sockets and implement a configure check for autodetection of the right value.
Diffstat (limited to 'dbus/dbus-transport.c')
-rw-r--r--dbus/dbus-transport.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c
index af1cb421..59ec6ea1 100644
--- a/dbus/dbus-transport.c
+++ b/dbus/dbus-transport.c
@@ -243,21 +243,33 @@ _dbus_transport_open (const char *address,
{
const char *path = dbus_address_entry_get_value (entries[i], "path");
const char *tmpdir = dbus_address_entry_get_value (entries[i], "tmpdir");
-
+ const char *abstract = dbus_address_entry_get_value (entries[i], "abstract");
+
if (tmpdir != NULL)
{
address_problem_other = "cannot use the \"tmpdir\" option for an address to connect to, only in an address to listen on";
goto bad_address;
}
- if (path == NULL)
+ if (path == NULL && abstract == NULL)
{
address_problem_type = "unix";
- address_problem_field = "path";
+ address_problem_field = "path or abstract";
goto bad_address;
}
- transport = _dbus_transport_new_for_domain_socket (path, &tmp_error);
+ if (path != NULL && abstract != NULL)
+ {
+ address_problem_other = "can't specify both \"path\" and \"abstract\" options in an address";
+ goto bad_address;
+ }
+
+ if (path)
+ transport = _dbus_transport_new_for_domain_socket (path, FALSE,
+ &tmp_error);
+ else
+ transport = _dbus_transport_new_for_domain_socket (abstract, TRUE,
+ &tmp_error);
}
else if (strcmp (method, "tcp") == 0)
{