d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina Pavel Březina <pbrezina@redhat.com>
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina Copyright (C) 2014 Red Hat
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina This program is free software; you can redistribute it and/or modify
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina it under the terms of the GNU General Public License as published by
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina the Free Software Foundation; either version 3 of the License, or
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina (at your option) any later version.
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina This program is distributed in the hope that it will be useful,
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina but WITHOUT ANY WARRANTY; without even the implied warranty of
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina GNU General Public License for more details.
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina You should have received a copy of the GNU General Public License
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina along with this program. If not, see <http://www.gnu.org/licenses/>.
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březinasbus_iface_list_lookup(struct sbus_interface_list *list,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina if (strcmp(item->interface->vtable->meta->name, iface) == 0) {
21e05273eed8cc914871938061554589883e67cePavel Březina item->interface->vtable->meta->name) != NULL) {
21e05273eed8cc914871938061554589883e67cePavel Březina /* already in list */
21e05273eed8cc914871938061554589883e67cePavel Březina new_item = talloc_zero(list_ctx, struct sbus_interface_list);
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březina * Object paths that represent all objects under the path:
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březina * /org/object/path/~* (without tilda)
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březinastatic bool sbus_opath_is_subtree(const char *path)
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březina return false;
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březina return path[len - 2] == '/' && path[len - 1] == '*';
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březina * If the path represents a subtree object path, this function will
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březina * remove /~* from the end.
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březinastatic char *sbus_opath_get_base_path(TALLOC_CTX *mem_ctx,
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březina tree_path = talloc_strdup(mem_ctx, object_path);
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březina /* replace / only if it is not a root path (only slash) */
894f09f146f0c9cda9e0f7dfe1916519d73dde72Pavel Březina tree_path[len - 2] = (len - 2 != 0) ? '\0' : '/';
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březinastatic char *sbus_opath_parent_subtree(TALLOC_CTX *mem_ctx,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* first remove /~* from the end, stop when we have reached the root i.e.
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * subtree == "/" */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina subtree = sbus_opath_get_base_path(mem_ctx, path);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* Find the first separator and replace the part with asterisk. */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* we cannot continue up */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* this object path is invalid since it cannot end with slash */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina DEBUG(SSSDBG_CRIT_FAILURE, "Invalid object path '%s'?\n", path);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* because object path cannot end with / there is enough space for
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * asterisk and terminating zero */
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina * The following path related functions are based on similar code in
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina * storaged, just tailored to use talloc instead of glib
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina /* The path must be valid */
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina /* Special case for an empty string */
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina /* the for loop would just fall through */
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina safe_path = talloc_asprintf_append_buffer(safe_path, "_");
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina for (n = 0; object_path_part[n]; n++) {
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina /* D-Bus spec says:
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina * * Each element must only contain the ASCII characters
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina * "[A-Z][a-z][0-9]_"
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina safe_path = talloc_asprintf_append_buffer(safe_path, "%c", c);
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina safe_path = talloc_asprintf_append_buffer(safe_path, "_%02x", c);
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina return c - '0';
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina const char *p;
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina /* Special case for the empty string */
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina for (p = object_path_part; *p; p++) {
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina if (*p == '_') {
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina /* There must be at least two more chars after underscore */
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina /* Invalid escape code, let's take it literal then */
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina c = ((a << 4) | b);
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina safe_path = talloc_asprintf_append_buffer(safe_path, "%c", c);
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina const char *part, ...)
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina DEBUG(SSSDBG_OP_FAILURE, "Wrong object path base!\n");
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina safe_part = sbus_opath_escape_part(mem_ctx, part);
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina DEBUG(SSSDBG_OP_FAILURE, "Could not add [%s] to objpath\n", part);
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina path = talloc_asprintf_append(path, "/%s", safe_part);
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina /* Strip prefix from the path. */
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina path = sbus_opath_strip_prefix(object_path, prefix);
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina /* Split the string using / as delimiter. */
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina split_on_separator(tmp_ctx, path, '/', true, true, &decomposed, &len);
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina /* Unescape parts. */
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina unescaped = talloc_zero_array(tmp_ctx, char *, len + 1);
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina for (i = 0; i < len; i++) {
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina unescaped[i] = sbus_opath_unescape_part(unescaped, decomposed[i]);
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina *_components = talloc_steal(mem_ctx, unescaped);
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březinasbus_opath_decompose_exact(TALLOC_CTX *mem_ctx,
10a28f461c25d788ff4dcffefa881e7aa724a25dPavel Březina ret = sbus_opath_decompose(mem_ctx, object_path, prefix,
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březinasbus_opath_strip_prefix(const char *object_path,
3a8f6b575f4019f21c9425a26f1b346c08a197aePavel Březina if (strncmp(object_path, prefix, strlen(prefix)) == 0) {
ca6dd8e7ac91c7f8e3b4d55206d4f39791ab7149Pavel Březinasbus_opath_get_object_name(TALLOC_CTX *mem_ctx,
ca6dd8e7ac91c7f8e3b4d55206d4f39791ab7149Pavel Březina name = sbus_opath_strip_prefix(object_path, base_path);
ca6dd8e7ac91c7f8e3b4d55206d4f39791ab7149Pavel Březina /* if base_path did not end with / */
ca6dd8e7ac91c7f8e3b4d55206d4f39791ab7149Pavel Březina return sbus_opath_unescape_part(mem_ctx, name);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina conn = talloc_get_type(pvt, struct sbus_connection);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina path = sbus_opath_get_base_path(NULL, item->key.str);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina dbus_connection_unregister_object_path(conn->dbus.conn, path);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina return sss_hash_create_ex(mem_ctx, 10, _table, 0, 0, 0, 0,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina const char *iface_name = iface->vtable->meta->name;
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina DEBUG(SSSDBG_TRACE_FUNC, "Registering interface %s with path %s\n",
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* create new list item */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina item = talloc_zero(tmp_ctx, struct sbus_interface_list);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* first lookup existing list in hash table */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina key.str = talloc_strdup(tmp_ctx, object_path);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* This object path has already some interface registered. We will
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * check for existence of the interface currently being added and
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * add it if missing. */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina list = talloc_get_type(value.ptr, struct sbus_interface_list);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina if (sbus_iface_list_lookup(list, iface_name) != NULL) {
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina DEBUG(SSSDBG_MINOR_FAILURE, "Trying to register the same interface"
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina " twice: iface=%s, opath=%s\n", iface_name, object_path);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina DLIST_ADD_END(list, item, struct sbus_interface_list *);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina } else if (hret != HASH_ERROR_KEY_NOT_FOUND) {
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* otherwise create new hash entry and new list */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * First @object_path is looked up in @table, if it is not found it steps up
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * in the path hierarchy and try to lookup the parent node. This continues
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * until the root is reached.
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březinasbus_opath_hash_lookup_iface(hash_table_t *table,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina lookup_path = talloc_strdup(tmp_ctx, object_path);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina list = talloc_get_type(value.ptr, struct sbus_interface_list);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina iface = sbus_iface_list_lookup(list, iface_name);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina } else if (hret != HASH_ERROR_KEY_NOT_FOUND) {
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina "Unable to search hash table: hret=%d\n", hret);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* we will not free lookup path since it is freed with tmp_ctx
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * and the object paths are supposed to be small */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina lookup_path = sbus_opath_parent_subtree(tmp_ctx, lookup_path);
21e05273eed8cc914871938061554589883e67cePavel Březina * Acquire list of all interfaces that are supported on given object path.
21e05273eed8cc914871938061554589883e67cePavel Březinasbus_opath_hash_lookup_supported(TALLOC_CTX *mem_ctx,
21e05273eed8cc914871938061554589883e67cePavel Březina lookup_path = talloc_strdup(tmp_ctx, object_path);
21e05273eed8cc914871938061554589883e67cePavel Březina ret = sbus_iface_list_copy(list_ctx, value.ptr, ©);
21e05273eed8cc914871938061554589883e67cePavel Březina DLIST_CONCATENATE(list, copy, struct sbus_interface_list *);
21e05273eed8cc914871938061554589883e67cePavel Březina } else if (hret != HASH_ERROR_KEY_NOT_FOUND) {
21e05273eed8cc914871938061554589883e67cePavel Březina "Unable to search hash table: hret=%d\n", hret);
21e05273eed8cc914871938061554589883e67cePavel Březina /* we will not free lookup path since it is freed with tmp_ctx
21e05273eed8cc914871938061554589883e67cePavel Březina * and the object paths are supposed to be small */
21e05273eed8cc914871938061554589883e67cePavel Březina lookup_path = sbus_opath_parent_subtree(tmp_ctx, lookup_path);
f7adbb15dbdcb79e291f7cf361a400ce25f7b382Pavel Březina return sss_hash_create_ex(mem_ctx, 10, _table, 0, 0, 0, 0,
f7adbb15dbdcb79e291f7cf361a400ce25f7b382Pavel Březina key.str = talloc_strdup(tmp_ctx, object_path);
f7adbb15dbdcb79e291f7cf361a400ce25f7b382Pavel Březina data = talloc_zero(tmp_ctx, struct sbus_nodes_data);
f7adbb15dbdcb79e291f7cf361a400ce25f7b382Pavel Březina "Unable to search hash table: hret=%d\n", hret);
f7adbb15dbdcb79e291f7cf361a400ce25f7b382Pavel Březina data = talloc_get_type(value.ptr, struct sbus_nodes_data);
f7adbb15dbdcb79e291f7cf361a400ce25f7b382Pavel Březina return data->nodes_fn(mem_ctx, object_path, data->handler_data);
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina intf = talloc_zero(mem_ctx, struct sbus_interface);
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina DEBUG(SSSDBG_FATAL_FAILURE, "Cannot allocate a new sbus_interface.\n");
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina intf->path = talloc_strdup(intf, object_path);
d87e960c17d7598781cf032d06ba03a3ecadbfa2Pavel Březina DEBUG(SSSDBG_FATAL_FAILURE, "Cannot duplicate object path.\n");
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březinasbus_message_handler(DBusConnection *dbus_conn,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březinasbus_conn_register_path(struct sbus_connection *conn,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina static DBusObjectPathVTable vtable = {NULL, sbus_message_handler,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina DEBUG(SSSDBG_TRACE_FUNC, "Registering object path %s with D-Bus "
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina reg_path = sbus_opath_get_base_path(conn, path);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* D-Bus does not allow to have both object path and fallback
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * registered. Since we handle the real message handlers ourselves
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * we will register fallback only in this case. */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina if (sbus_opath_hash_has_path(conn->managed_paths, reg_path)) {
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina dbus_connection_unregister_object_path(conn->dbus.conn, reg_path);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina dbret = dbus_connection_register_fallback(conn->dbus.conn, reg_path,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina dbret = dbus_connection_try_register_object_path(conn->dbus.conn, path,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina strcmp(error.name, DBUS_ERROR_OBJECT_PATH_IN_USE) == 0) {
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* A fallback is probably already registered. Just return. */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina DEBUG(SSSDBG_FATAL_FAILURE, "Unable to register object path "
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březinasbus_conn_register_iface(struct sbus_connection *conn,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina if (conn == NULL || iface_vtable == NULL || object_path == NULL) {
66277b21179d95f6e96abed01a20ccbccf27ce99Pavel Březina iface = sbus_new_interface(conn, object_path, iface_vtable, handler_data);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina ret = sbus_opath_hash_add_iface(conn->managed_paths, object_path, iface,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* this object path is already registered */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* if ret != EOK we will still leave iface in the table, since
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina * we probably don't have enough memory to remove it correctly anyway */
80d0bd38268c02fd32f62b02ae59f19229ca1a79Pavel Březina ret = sbus_conn_register_path(conn, object_path);
80d0bd38268c02fd32f62b02ae59f19229ca1a79Pavel Březina /* register standard interfaces with this object path as well */
b742179ac0790068380618ab72a06af18544f09cPavel Březina ret = sbus_conn_register_iface(conn, sbus_properties_vtable(),
80d0bd38268c02fd32f62b02ae59f19229ca1a79Pavel Březina ret = sbus_conn_register_iface(conn, sbus_introspect_vtable(),
397bc52dd09a8c032abc7ea47a6d81dba5957464Pavel Březinasbus_conn_register_iface_map(struct sbus_connection *conn,
397bc52dd09a8c032abc7ea47a6d81dba5957464Pavel Březina ret = sbus_conn_register_iface(conn, map[i].vtable, map[i].path, pvt);
f7adbb15dbdcb79e291f7cf361a400ce25f7b382Pavel Březinasbus_conn_register_nodes(struct sbus_connection *conn,
f7adbb15dbdcb79e291f7cf361a400ce25f7b382Pavel Březina ret = sbus_nodes_hash_add(conn->nodes_fns, path, nodes_fn, data);
f7adbb15dbdcb79e291f7cf361a400ce25f7b382Pavel Březina DEBUG(SSSDBG_MINOR_FAILURE, "Unable to register node function with "
f7adbb15dbdcb79e291f7cf361a400ce25f7b382Pavel Březina "%s. Introspection may not work correctly.\n", path);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březinasbus_conn_reregister_paths(struct sbus_connection *conn)
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina unsigned long i;
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina hret = hash_keys(conn->managed_paths, &count, &keys);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina for (i = 0; i < count; i++) {
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina ret = sbus_conn_register_path(conn, keys[i].str);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březinasbus_message_handler_got_caller_id(struct tevent_req *req);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březinasbus_message_handler(DBusConnection *dbus_conn,
66277b21179d95f6e96abed01a20ccbccf27ce99Pavel Březina conn = talloc_get_type(handler_data, struct sbus_connection);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* header information */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina iface_name = dbus_message_get_interface(message);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina method_name = dbus_message_get_member(message);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina DEBUG(SSSDBG_TRACE_INTERNAL, "Received SBUS method %s.%s on path %s\n",
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* try to find the interface */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina iface = sbus_opath_hash_lookup_iface(conn->managed_paths,
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina method = sbus_meta_find_method(iface->vtable->meta, method_name);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina if (method == NULL || method->vtable_offset == 0) {
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* we have a valid handler, create D-Bus request */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina sbus_req = sbus_new_request(conn, iface, message);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina /* now get the sender ID */
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina req = sbus_get_sender_id_send(sbus_req, conn->ev, conn, sender);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina tevent_req_set_callback(req, sbus_message_handler_got_caller_id, sbus_req);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina DEBUG(SSSDBG_CRIT_FAILURE, "No matching handler found for method %s.%s "
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina "on path %s\n", iface_name, method_name, path);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina reply = dbus_message_new_error(message, DBUS_ERROR_UNKNOWN_METHOD, NULL);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březinasbus_message_handler_got_caller_id(struct tevent_req *req)
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina sbus_req = tevent_req_callback_data(req, struct sbus_request);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina ret = sbus_get_sender_id_recv(req, &sbus_req->client);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina error = sbus_error_new(sbus_req, DBUS_ERROR_FAILED, "Failed to "
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina "resolve caller's ID: %s\n", sss_strerror(ret));
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina sbus_request_fail_and_finish(sbus_req, error);
46ee931314e6a5517f5c6b6b14f759364be119ccPavel Březina handler = VTABLE_FUNC(sbus_req->intf->vtable, method->vtable_offset);