From e26378e8f9b39cb576b0dd1e9da7f1b5c8810025 Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Thu, 26 Nov 2020 13:24:28 +0100 Subject: [PATCH 1/4] move rm -fr to ynh_secure_remove --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 9b75307..64fdc00 100644 --- a/scripts/install +++ b/scripts/install @@ -97,7 +97,7 @@ ynh_app_setting_set "$app" language "$language" ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script ynh_script_progression --message="Remove Zabbix if already installed" -w 1 apt-get purge zabbix* -y -rm -fr /var/cache/apt/archives/zabbix-server-mysql* +ynh_secure_remove /var/cache/apt/archives/zabbix-server-mysql* ynh_script_progression --message="Install Zabbix repository" -w 3 install_zabbix_repo From a0391ebc1ce22e49b55bcca1ce35ced393c30338 Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Thu, 26 Nov 2020 13:26:01 +0100 Subject: [PATCH 2/4] move rm -fr to ynh_secure_remove --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index ce35dbc..eaf8e5f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -154,11 +154,11 @@ then ynh_print_info "Update zabbix via apt package" ynh_install_app_dependencies libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.2-0 ttf-dejavu-core php7.0-bcmath patch smistrip unzip wget fping libcap2-bin libiksemel3 libopenipmi0 libpam-cap libsnmp-base libsnmp30 snmptrapd snmpd libjs-prototype jq zabbix-server-mysql zabbix-agent zabbix-frontend-php - rm /usr/share/zabbix/conf/zabbix.conf.php + ynh_secure_remove /usr/share/zabbix/conf/zabbix.conf.php cp -rpf /tmp/zabbix /etc/ cp -pf /tmp/zabbix.conf.php /usr/share/zabbix/conf/ - rm -fr /tmp/zabbix* + ynh_secure_remove /tmp/zabbix* #If needed. yunohost service add snmpd -d "Management of SNMP Daemon" From 05a2badfee4cae3be1784596125555674fb8caaf Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Thu, 26 Nov 2020 13:27:13 +0100 Subject: [PATCH 3/4] move rm ynh_secure_remove --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 64fdc00..41fd488 100644 --- a/scripts/install +++ b/scripts/install @@ -111,7 +111,7 @@ ynh_replace_string --match_string="# fr_FR.UTF-8 UTF-8" --replace_string="fr_FR. locale-gen ln -s /usr/share/zabbix "$final_path" -rm "$final_path/conf/zabbix.conf.php" +ynh_secure_remove "$final_path/conf/zabbix.conf.php" #================================================= # CREATE A MYSQL DATABASE From 41a18db59c5e4b52ee71c1ae262568def35d8847 Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Thu, 26 Nov 2020 13:28:47 +0100 Subject: [PATCH 4/4] move rm to ynh_secure_remove --- scripts/restore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 4cb49ba..939df04 100644 --- a/scripts/restore +++ b/scripts/restore @@ -33,7 +33,7 @@ final_path="/var/www/zabbix" ### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". ### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" -rm -fr $final_path +ynh_secure_remove $final_path #================================================= # STORE SETTINGS FROM MANIFEST @@ -64,7 +64,7 @@ ynh_replace_string --match_string="# fr_FR.UTF-8 UTF-8" --replace_string="fr_FR. locale-gen ln -s /usr/share/zabbix /var/www/zabbix -rm $final_path/conf/zabbix.conf.php +ynh_secure_remove $final_path/conf/zabbix.conf.php ynh_app_setting_set $app final_path $final_path