From 2b947830aadcd9b1513449aaabbf6a7fbe95c085 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 16 Mar 2021 16:27:51 +0100 Subject: [PATCH 1/4] remove src_filename --- data/helpers.d/utils | 1 + 1 file changed, 1 insertion(+) diff --git a/data/helpers.d/utils b/data/helpers.d/utils index c5ebdcb96..89821f7c2 100644 --- a/data/helpers.d/utils +++ b/data/helpers.d/utils @@ -194,6 +194,7 @@ ynh_setup_source () { else ynh_die --message="Archive format unrecognized." fi + ynh_secure_remove --file="$src_filename" fi # Apply patches From 3c3e8711ed25236a2019410e7f2ccc5d6dd33b4b Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 16 Mar 2021 16:28:12 +0100 Subject: [PATCH 2/4] fix _patch_legacy_helpers --- src/yunohost/app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index fadc16b6e..5ad2e4021 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -1761,7 +1761,7 @@ def app_action_run(operation_logger, app, action, args=None): if action_declaration.get("cwd"): cwd = action_declaration["cwd"].replace("$app", app) else: - cwd = "/etc/yunohost/apps/" + app + cwd = os.path.join(APPS_SETTING_PATH, app) retcode = hook_exec( path, @@ -3636,7 +3636,11 @@ def _patch_legacy_helpers(app_folder): if not os.path.isfile(filename): continue - content = read_file(filename) + try: + content = read_file(filename) + except Exception: + continue + replaced_stuff = False show_warning = False From f23982b460d65337ffc02aec40fdcfc993c01453 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Thu, 15 Apr 2021 19:33:12 +0200 Subject: [PATCH 3/4] [fix] Remove zip from /etc/yunohost/apps/*/scripts --- data/helpers.d/utils | 1 + 1 file changed, 1 insertion(+) diff --git a/data/helpers.d/utils b/data/helpers.d/utils index 89821f7c2..6336999eb 100644 --- a/data/helpers.d/utils +++ b/data/helpers.d/utils @@ -176,6 +176,7 @@ ynh_setup_source () { else unzip -quo $src_filename -d "$dest_dir" fi + ynh_secure_remove --file="$src_filename" else local strip="" if [ "$src_in_subdir" != "false" ] From 9d64e850b88d488e3a15957040ee570fac1518e4 Mon Sep 17 00:00:00 2001 From: Kayou Date: Fri, 16 Apr 2021 01:03:34 +0200 Subject: [PATCH 4/4] Update src/yunohost/app.py Co-authored-by: ljf (zamentur) --- src/yunohost/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 5ad2e4021..129f18c67 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -3638,7 +3638,7 @@ def _patch_legacy_helpers(app_folder): try: content = read_file(filename) - except Exception: + except MoulinetteError: continue replaced_stuff = False