Skip to content

Commit f3e6092

Browse files
committed
Clarify output for denied write access
1 parent d72b18b commit f3e6092

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

source/client_a.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ static void box_async_runner(const void *)
5656
while (1) {
5757
uint32_t ret;
5858
int status = rpc_fncall_wait(result, UVISOR_WAIT_FOREVER, &ret);
59-
uvisor_ctx->pc->printf("%c: %s '0x%08x'\r\n", (char) uvisor_box_id_self() + '0', (ret == 0) ? "Wrote" : "Failed to write", (unsigned int) number);
59+
uvisor_ctx->pc->printf("%c: %s '0x%08x'\r\n",
60+
(char) uvisor_box_id_self() + '0',
61+
(ret == 0) ? "Wrote" :
62+
"Permission denied. This client cannot write the secure number",
63+
(unsigned int) number);
6064
/* FIXME: Add better error handling. */
6165
if (!status) {
6266
break;

source/client_b.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ static void client_b_main(const void *)
6565
while (1) {
6666
uint32_t ret;
6767
int status = rpc_fncall_wait(result, UVISOR_WAIT_FOREVER, &ret);
68-
uvisor_ctx->pc->printf("%c: %s '0x%08x'\r\n", (char) uvisor_box_id_self() + '0', (ret == 0) ? "Wrote" : "Failed to write", (unsigned int) number);
68+
uvisor_ctx->pc->printf("%c: %s '0x%08x'\r\n",
69+
(char) uvisor_box_id_self() + '0',
70+
(ret == 0) ? "Wrote" :
71+
"Permission denied. This client cannot write the secure number",
72+
(unsigned int) number);
6973
if (!status) {
7074
break;
7175
}

source/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ static void main_async_runner(const void *)
6161
/* TODO typesafe return codes */
6262
uint32_t ret;
6363
status = rpc_fncall_wait(result, UVISOR_WAIT_FOREVER, &ret);
64-
printf("%c: %s '0x%08x'\r\n", (char) uvisor_box_id_self() + '0', (ret == 0) ? "Wrote" : "Failed to write", (unsigned int) number);
64+
printf("%c: %s '0x%08x'\r\n",
65+
(char) uvisor_box_id_self() + '0',
66+
(ret == 0) ? "Wrote" :
67+
"Permission denied. This client cannot write the secure number",
68+
(unsigned int) number);
6569
if (!status) {
6670
break;
6771
}

0 commit comments

Comments
 (0)