[RFC v2 09/10] kdb: Improve usability of help text when running in kiosk mode
From: Daniel Thompson
Date: Wed Apr 02 2014 - 11:45:09 EST
Currently 'help' in kiosk mode results in help text being issued for many
commands the user cannot actually run. Filter the help list when kiosk
mode is engaged to ensure help is fully relevant.
Filtering the list is also greatly simplifies scanning for commands that
may have been accidentally classified as safe.
Signed-off-by: Daniel Thompson <daniel.thompson@xxxxxxxxxx>
---
kernel/debug/kdb/kdb_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 808bf55..77b6e61 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -2401,6 +2401,9 @@ static int kdb_help(int argc, const char **argv)
return 0;
if (!kt->cmd_name)
continue;
+ if (kdb_kiosk &&
+ !(kt->cmd_flags & (KDB_SAFE | KDB_SAFE_NO_ARGS)))
+ continue;
if (strlen(kt->cmd_usage) > 20)
space = "\n ";
kdb_printf("%-15.15s %-20s%s%s\n", kt->cmd_name,
--
1.9.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/