A few additional readonly checks, GitHub issue 5736 from gmkbenjamin at

hotmail dot com.
This commit is contained in:
nicm
2026-10-15 07:25:07 +00:00
committed by tmux update bot
parent cf8c6ec235
commit 610bf01351
5 changed files with 49 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: cmd-queue.c,v 1.124 2026/09/22 06:46:50 nicm Exp $ */
/* $OpenBSD: cmd-queue.c,v 1.125 2026/10/15 07:25:07 nicm Exp $ */
/*
* Copyright (c) 2013 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -595,6 +595,15 @@ cmdq_fire_command(struct cmdq_item *item)
flags = !!(state->flags & CMDQ_STATE_CONTROL);
cmdq_guard(item, "begin", flags);
if (flags &&
saved != NULL &&
(saved->flags & CLIENT_READONLY) &&
(~entry->flags & CMD_READONLY)) {
cmdq_error(item, "client is read-only");
retval = CMD_RETURN_ERROR;
goto out;
}
if (item->client == NULL)
item->client = cmd_find_client(item, NULL, 1);