summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2021-04-01 07:48:53 +1100
committerCommit Bot <commit-bot@chromium.org>2021-04-01 21:32:12 +0000
commit27c3bf4011f017b296fe3c49ae35ff6d9960b962 (patch)
tree2eb29a9d2d84d2bb8629d480862083cd4e26c239
parent8adbe7927badca7c3a6eb46479333dd754e9bf79 (diff)
downloadchrome-ec-27c3bf4011f017b296fe3c49ae35ff6d9960b962.tar.gz
make rddkeepalive read-only when console is locked
Print the Rdd state when the console is locked. Don't allow setting it. BUG=none TEST=manual > ccd lock CCD locked. > rddkeepalive Rdd: connected > rddkeepalive enable Parameter 1 invalid Usage: rddkeepalive [BOOLEAN] > ccd testlab open > ccd State: Opened ... > rddkeepalive enable Forcing Rdd detect keepalive > Change-Id: Ie309e42e7ef295bb0d7e7208d4bd6c17ce799e98 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799440 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
-rw-r--r--chip/g/rdd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/chip/g/rdd.c b/chip/g/rdd.c
index c58dce4806..4e17cab29a 100644
--- a/chip/g/rdd.c
+++ b/chip/g/rdd.c
@@ -214,7 +214,7 @@ static int command_rdd_keepalive(int argc, char **argv)
return EC_SUCCESS;
}
- if (!parse_bool(argv[1], &force_detected))
+ if (console_is_restricted() || !parse_bool(argv[1], &force_detected))
return EC_ERROR_PARAM1;
if (force_detected) {
@@ -228,6 +228,6 @@ static int command_rdd_keepalive(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(rddkeepalive, command_rdd_keepalive,
- "[BOOLEAN]",
- "Get Rdd state or force keepalive");
+DECLARE_SAFE_CONSOLE_COMMAND(rddkeepalive, command_rdd_keepalive,
+ "[BOOLEAN]",
+ "Get Rdd state or force keepalive");