add stub for "GetConnectionUnixProcessID"

This commit is contained in:
hippoz 2023-01-02 01:41:31 +02:00
parent 8d5a5bec49
commit 161741d59c
Signed by: hippoz
GPG key ID: 56C4E02A85F2FBED

View file

@ -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);