Allow console-reading host commands on locked systems

We allow reading the EC console via case-closed debugging on locked
systems, so we should also allow reading it via host command.  The
original reason for denying this (EC printing keystrokes) no longer
exists; we don't print keyboard matrix changes by default anymore.

BUG=chromium:479223
BRANCH=none (well, could apply this anywhere...)
TEST=on a system with both hard and soft WP enabled in the EC,
     'ectool console' works instead of failing with access denied.

Change-Id: Ie111bc130dd3f17cd4b658718d00d299786e3434
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/266701
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
This commit is contained in:
Randall Spangler
2015-04-21 10:49:57 -07:00
committed by ChromeOS Commit Bot
parent 94baa433bc
commit 2e0cc436b1

View File

@@ -342,13 +342,6 @@ DECLARE_HOOK(HOOK_INIT, uart_rx_dma_init, HOOK_PRIO_DEFAULT);
static int host_command_console_snapshot(struct host_cmd_handler_args *args)
{
/*
* Only allowed on unlocked system, since console output contains
* keystroke data.
*/
if (system_is_locked())
return EC_ERROR_ACCESS_DENIED;
/* Assume the whole circular buffer is full */
tx_snapshot_head = tx_buf_head;
tx_snapshot_tail = TX_BUF_NEXT(tx_snapshot_head);
@@ -379,13 +372,6 @@ static int host_command_console_read(struct host_cmd_handler_args *args)
{
char *dest = (char *)args->response;
/*
* Only allowed on unlocked system, since console output contains
* keystroke data.
*/
if (system_is_locked())
return EC_ERROR_ACCESS_DENIED;
/* If no snapshot data, return empty response */
if (tx_snapshot_head == tx_snapshot_tail)
return EC_RES_SUCCESS;