- log_error("Failed to seal gdm reply: %s", strerror(-r));
- return r;
- }
-
- r = sd_bus_send(b, n, NULL);
- if (r < 0) {
- log_error("Failed to send gdm reply: %s", strerror(-r));
- return r;
- }
-
- return 1;
-}
-
-static int process_hello(sd_bus *a, sd_bus *b, sd_bus_message *m, bool *got_hello) {
- _cleanup_bus_message_unref_ sd_bus_message *n = NULL;
- bool is_hello;
- int r;
-
- assert(a);
- assert(b);
- assert(m);
- assert(got_hello);
-
- /* As reaction to hello we need to respond with two messages:
- * the callback reply and the NameAcquired for the unique
- * name, since hello is otherwise obsolete on kdbus. */
-
- is_hello =
- sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "Hello") &&
- streq_ptr(m->destination, "org.freedesktop.DBus");
-
- if (!is_hello) {
-
- if (*got_hello)
- return 0;
-
- log_error("First packet isn't hello (it's %s.%s), aborting.", m->interface, m->member);
- return -EIO;
- }
-
- if (*got_hello) {
- log_error("Got duplicate hello, aborting.");
- return -EIO;
- }
-
- *got_hello = true;
-
- if (!a->is_kernel)
- return 0;
-
- r = sd_bus_message_new_method_return(m, &n);
- if (r < 0) {
- log_error("Failed to generate HELLO reply: %s", strerror(-r));
- return r;
- }
-
- r = sd_bus_message_append(n, "s", a->unique_name);
- if (r < 0) {
- log_error("Failed to append unique name to HELLO reply: %s", strerror(-r));
- return r;
- }
-
- r = bus_message_append_sender(n, "org.freedesktop.DBus");
- if (r < 0) {
- log_error("Failed to append sender to HELLO reply: %s", strerror(-r));
- return r;