From 161741d59cb612e98afc1e4938e12898e35e9f2b Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Mon, 2 Jan 2023 01:41:31 +0200 Subject: [PATCH] add stub for "GetConnectionUnixProcessID" --- server.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/server.c b/server.c index 20ee29c..0eb4d0b 100644 --- a/server.c +++ b/server.c @@ -365,9 +365,7 @@ int jb_server_client_process_message(struct jb_server *s, int i, uint8_t *data, return -1; } - char *name_str = TRYPTR(string_dup(name)); - - struct jb_client *target = jb_server_name_find_client(s, name_str); + struct jb_client *target = jb_server_name_find_client(s, name); if (!target || target->unique_name_index < 0) { _reply_error("org.freedesktop.DBus.Error.NameHasNoOwner"); return 0; @@ -383,9 +381,7 @@ int jb_server_client_process_message(struct jb_server *s, int i, uint8_t *data, return -1; } - char *name_str = TRYPTR(string_dup(name)); - - struct jb_client *target = jb_server_name_find_client(s, name_str); + struct jb_client *target = jb_server_name_find_client(s, name); _reply_begin("b") { TRYPTR(wire_set_u32(&reply_ctx, target ? 1 : 0)); @@ -436,6 +432,17 @@ int jb_server_client_process_message(struct jb_server *s, int i, uint8_t *data, _reply_begin("u") { TRYPTR(wire_set_u32(&reply_ctx, 1)); } _reply_end() + } else if (strcmp(member, "GetConnectionUnixProcessID") == 0) { + // TODO: stub (returns an error) + char *name = TRYPTR(wire_get_string(&ctx)); + int name_len = strlen(name); + if (name_len < 1 || name_len > 256) { + return -1; + } + + printf("FIXME: STUB: GetConnectionUnixProcessID: %s\n", name); + + _reply_error("xyz.hippoz.jitterbug.NotImplemented"); } else if (strcmp(member, "AddMatch") == 0) { char *match = TRYPTR(wire_get_string(&ctx)); int match_len = strlen(match);