From d4804cd7416dd6d523d0bcbb7edf9c9a0b6f4217 Mon Sep 17 00:00:00 2001 From: Bastien Dejean Date: Sun, 26 Jul 2020 21:37:18 +0200 Subject: [PATCH] Catch descriptor-free incompatibilities in queries --- src/messages.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/messages.c b/src/messages.c index d843c85..9d9f467 100644 --- a/src/messages.c +++ b/src/messages.c @@ -1095,6 +1095,12 @@ void cmd_query(char **args, int num, FILE *rsp) goto end; } + if ((dom == DOMAIN_MONITOR && (desktop_sel != NULL || node_sel != NULL)) || + (dom == DOMAIN_DESKTOP && node_sel != NULL)) { + fail(rsp, "query -%c: Incompatible descriptor-free constraints.\n", dom == DOMAIN_MONITOR ? 'M' : 'D'); + goto end; + } + if (dom == DOMAIN_NODE) { if (query_node_ids(&ref, &trg, monitor_sel, desktop_sel, node_sel, rsp) < 1) { fail(rsp, "");