From e0339effccb1dfc4c6410711f15b0d7dfb9ccbe6 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 27 Apr 2022 22:05:15 -0500 Subject: [PATCH] Cleanup: Controller program return codes should be more generalized. It turns out that when agetty returns on access denied while trying to login, it returns access denied to the controller program. The controller program has no way of distinguishing that this is access denied while trying execute the program to this is access denied because the program returned access denied. Change the error messages to be more generalized so that they are less misleading. --- level_3/controller/c/rule/private-rule_print.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/level_3/controller/c/rule/private-rule_print.c b/level_3/controller/c/rule/private-rule_print.c index a8a9088..eb36a42 100644 --- a/level_3/controller/c/rule/private-rule_print.c +++ b/level_3/controller/c/rule/private-rule_print.c @@ -110,10 +110,10 @@ extern "C" { const uint8_t code = WIFEXITED(process->result) ? WEXITSTATUS(process->result) : 0; if (code == F_execute_access) { - fl_print_format("%[' cannot be executed, access is denied.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); + fl_print_format("%[' failed, access is denied.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); } else if (code == F_execute_bad) { - fl_print_format("%[' cannot execute, unsupported format.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); + fl_print_format("%[' failed, unsupported format.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); } else if (code == F_execute_buffer) { fl_print_format("%[' invalid memory access in arguments buffer.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); @@ -137,7 +137,7 @@ extern "C" { fl_print_format("%[' failed during execution.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); } else if (code == F_execute_file_found_not) { - fl_print_format("%[' could not be executed, unable to find file.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); + fl_print_format("%[' failed, unable to find file.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); } else if (code == F_execute_file_type_directory) { fl_print_format("%[' ELF interpreter is a directory.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); -- 1.8.3.1