From: Kevin Day Date: Thu, 28 Apr 2022 03:05:15 +0000 (-0500) Subject: Cleanup: Controller program return codes should be more generalized. X-Git-Tag: 0.5.10~177 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=e0339effccb1dfc4c6410711f15b0d7dfb9ccbe6;p=fll 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. --- 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);