From: Alexander Barton Date: Mon, 29 Mar 2021 17:49:48 +0000 (+0200) Subject: axzshctl: Validate plugin names in EnablePlugin() X-Git-Url: https://arthur.barton.de/gitweb/?p=ax-zsh.git;a=commitdiff_plain;h=8e6af972532cf6bf7de911508c52397e9522ba9d axzshctl: Validate plugin names in EnablePlugin() --- diff --git a/bin/axzshctl b/bin/axzshctl index 70b3ff2..5b3f4bd 100755 --- a/bin/axzshctl +++ b/bin/axzshctl @@ -146,6 +146,9 @@ function EnablePlugin { return 0 fi echo "Trying to enable \"$1\" as plugin ..." + elif ! [[ "$1" =~ "^[[:alnum:]_.-]+$" ]]; then + ax_error "Invalid plugin name!" + return 1 fi for dname ( @@ -167,7 +170,7 @@ function EnablePlugin { ax_error "Failed to create link!" return 1 fi - ax_msg 0 "Plugin \"$plugin\" enabled." + ax_msg 0 "Plugin \"$1\" enabled." return 0 done