diff options
author | Mary Ruthven <mruthven@chromium.org> | 2022-11-07 10:13:09 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-11-07 20:29:41 +0000 |
commit | bd931142b838be17046ffa091ecb7abe26226552 (patch) | |
tree | 56803883f569f403c4a7bd45adb741e82ac032dd | |
parent | e4cf6678ef70819323473e55df0e0bd5bdfffe2b (diff) | |
download | chrome-ec-bd931142b838be17046ffa091ecb7abe26226552.tar.gz |
rddkeepalive: return EC_ERROR_ACCESS_DENIED if the console is locked
If the console is locked, return EC_ERROR_ACCESS_DENIED instead of
EC_ERROR_PARAM1, so the behavior is consistent with other commands.
BUG=b:251207798
TEST=run rddkeepalive enable when the console is locked.
Change-Id: I65e210052afc197899873f3e1079c7dc5b791c58
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4009999
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | chip/g/rdd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chip/g/rdd.c b/chip/g/rdd.c index 7620e55a49..c121a232a8 100644 --- a/chip/g/rdd.c +++ b/chip/g/rdd.c @@ -227,7 +227,9 @@ static int command_rdd_keepalive(int argc, char **argv) return EC_SUCCESS; } - if (console_is_restricted() || !parse_bool(argv[1], &force_detected)) + if (console_is_restricted()) + return EC_ERROR_ACCESS_DENIED; + if (!parse_bool(argv[1], &force_detected)) return EC_ERROR_PARAM1; if (force_detected) { |