From 03bfd9f77965a82837450239644da86711f10dc6 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 26 Aug 2021 00:41:43 +0200 Subject: [PATCH] autoupdater: avoid additional shell process --- admin/autoupdater/src/autoupdater.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/autoupdater/src/autoupdater.c b/admin/autoupdater/src/autoupdater.c index dcf8829..8d8bc74 100644 --- a/admin/autoupdater/src/autoupdater.c +++ b/admin/autoupdater/src/autoupdater.c @@ -380,10 +380,12 @@ static bool autoupdate(const char *mirror, struct settings *s, int lock_fd) { /* Test the image upgrade (issue #193) */ { + static const char *const exec_builtin = "exec "; static const char *const test_option = " --test "; - char buf[strlen(sysupgrade_path) + strlen(test_option) + strlen(firmware_path) + 1]; - strcpy(buf, sysupgrade_path); + char buf[strlen(exec_builtin) + strlen(sysupgrade_path) + strlen(test_option) + strlen(firmware_path) + 1]; + strcpy(buf, exec_builtin); + strcat(buf, sysupgrade_path); strcat(buf, test_option); strcat(buf, firmware_path);