From 2e8f977719ef3491e45c8cbeca68b0d868cfa17b Mon Sep 17 00:00:00 2001 From: poka Date: Mon, 13 Jul 2020 14:43:54 +0200 Subject: [PATCH] security patch --- src/shell/aide.sh | 2 +- src/shell/functions.sh | 3 +-- src/shell/g1-infos.sh | 2 +- src/shell/gbanque.sh | 4 +--- src/shell/helloasso.sh | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/shell/aide.sh b/src/shell/aide.sh index 6e4ea10..5136ce3 100755 --- a/src/shell/aide.sh +++ b/src/shell/aide.sh @@ -16,6 +16,6 @@ text() { cat src/inc/aide.txt } -$@ +[[ $(type $@ | grep "est une fonction") ]] && $@ || echo "Veuillez préciser votre commande" exit 0 diff --git a/src/shell/functions.sh b/src/shell/functions.sh index e6b5998..e4c2183 100755 --- a/src/shell/functions.sh +++ b/src/shell/functions.sh @@ -18,5 +18,4 @@ curl -s -H "X-Auth-Token: $API_TOKEN" \ -d "{ \"channel\": \"$chan\", \"text\": \"$msg\" }" > /dev/null 2>&1 } -$@ - +#[[ $(type $@ | grep "est une fonction") ]] && $@ || echo "Veuillez préciser votre commande" diff --git a/src/shell/g1-infos.sh b/src/shell/g1-infos.sh index 3cdf726..6d3a200 100755 --- a/src/shell/g1-infos.sh +++ b/src/shell/g1-infos.sh @@ -35,6 +35,6 @@ membres() { } -$@ +[[ $(type $@ | grep "est une fonction") ]] && $@ || echo "Veuillez préciser votre commande" exit 0 diff --git a/src/shell/gbanque.sh b/src/shell/gbanque.sh index 288368a..3754621 100755 --- a/src/shell/gbanque.sh +++ b/src/shell/gbanque.sh @@ -29,8 +29,6 @@ init() { } -$args - -[[ -z $args ]] && echo "Veuillez préciser votre commande" +[[ $(type $args | grep "est une fonction") ]] && $args || echo "Veuillez préciser votre commande" exit 0 diff --git a/src/shell/helloasso.sh b/src/shell/helloasso.sh index aed2c84..1e50050 100755 --- a/src/shell/helloasso.sh +++ b/src/shell/helloasso.sh @@ -20,6 +20,6 @@ cagnotte() { } -$@ +[[ $(type $@ | grep "est une fonction") ]] && $@ || echo "Veuillez préciser votre commande" exit 0