Skip to content

Commit 9a1fccd

Browse files
committed
Prevent install via CLI / API / WebGUI via command v-update-sys-hestia package
Current script accepts all valid packages now limiited to hestia, hestia-nginx, hestia-php @numanturle
1 parent 32ef8a2 commit 9a1fccd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

bin/v-update-sys-hestia

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ source $HESTIA/conf/hestia.conf
3232

3333
# Checking arg number
3434
check_args '1' "$#" 'PACKAGE'
35+
is_hestia_package "hestia,hestia-nginx,hestia-php" "$package"
3536

3637
# Perform verification if read-only mode is enabled
3738
check_hestia_demo_mode

func/main.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,12 @@ multiphp_default_version() {
11541154
echo "$sys_phpversion"
11551155
}
11561156

1157+
is_hestia_package(){
1158+
if [ -z "$(echo $1 | grep -w $2)" ]; then
1159+
check_result $E_INVALID "$2 package is not controlled by hestiacp"
1160+
fi
1161+
}
1162+
11571163
# Run arbitrary cli commands with dropped privileges
11581164
# Note: setpriv --init-groups is not available on debian9 (util-linux 2.29.2)
11591165
# Input:

0 commit comments

Comments
 (0)