From 074194328228128fa30388ad8187213fa292d834 Mon Sep 17 00:00:00 2001 From: Gerard Wagener Date: Tue, 26 Oct 2010 14:24:22 +0200 Subject: [PATCH] AHA captures now insults typed by a user The ihook.sh must be set in the global bash.rc The hook is needed to pass invalid commands already fetched by bash to kernel space which are then transfered to the daemon --- aha/ihook.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ aha/user_insult.c | 8 ++++++++ 2 files changed, 52 insertions(+) create mode 100644 aha/ihook.sh create mode 100644 aha/user_insult.c diff --git a/aha/ihook.sh b/aha/ihook.sh new file mode 100644 index 00000000000..16477f5f5df --- /dev/null +++ b/aha/ihook.sh @@ -0,0 +1,44 @@ +command_not_found_handle() { + echo $1 + ARGS="" + if [ ! -z "$1" ]; then + ARGS="$ARGS$1" + fi + + if [ ! -z "$2" ]; then + ARGS="$ARGS $2" + fi + + if [ ! -z "$3" ]; then + ARGS="$ARGS $3" + fi + + if [ ! -z "$4" ]; then + ARGS="$ARGS $4" + fi + + + if [ ! -z "$5" ]; then + ARGS="$ARGS $5" + fi + + if [ ! -z "$6" ]; then + ARGS="$ARGS $6" + fi + + if [ ! -z "$7" ]; then + ARGS="$ARGS $7" + fi + + if [ ! -z "$8" ]; then + ARGS="$ARGS $8" + fi + + if [ ! -z "$9" ]; then + ARGS="$ARGS $9" + fi + + + + /sbin/user_insult $ARGS +} diff --git a/aha/user_insult.c b/aha/user_insult.c new file mode 100644 index 00000000000..6d2179b7b4b --- /dev/null +++ b/aha/user_insult.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc,char* argv[]) +{ + + return 0; +}