From: Matthias Kruk Date: Mon, 14 Jun 2021 21:23:02 +0000 (+0900) Subject: toolbox: Make have(), _try_include(), include() read-only X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=394e5ac616303b237a70a6ad9fc7c0e170c9c201;p=toolbox toolbox: Make have(), _try_include(), include() read-only Functions from toolbox.sh may be redeclared, causing all sorts of problems from simple bugs to security issues. This commit makes sure the functions are declared read-only when toolbox is loaded so the user can't shoot themself in the foot. --- diff --git a/toolbox.sh b/toolbox.sh index 6261219..f690b01 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -33,6 +33,10 @@ __toolbox_init() { declare -Axg __TOOLBOX_INCLUDED + readonly -f have + readonly -f _try_include + readonly -f include + return 0 }