From 49f6d2d2e6f16bbf979d696fe64016cafb30c28a Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Tue, 9 Jun 2020 12:16:23 -0400 Subject: [PATCH 1/2] Fix incorrect file ownership on artifact_info file Changelog: Title Signed-off-by: Drew Moseley --- mender-convert-modify | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mender-convert-modify b/mender-convert-modify index 7fb2446..5dba213 100755 --- a/mender-convert-modify +++ b/mender-convert-modify @@ -207,8 +207,8 @@ fi run_and_log_cmd "echo 'device_type=${device_type}' > work/device_type" run_and_log_cmd "sudo install -m 0444 work/device_type work/rootfs/data/mender/" -run_and_log_cmd "sudo echo 'artifact_name=${MENDER_ARTIFACT_NAME}' \ - > work/rootfs/etc/mender/artifact_info" +run_and_log_cmd "echo 'artifact_name=${MENDER_ARTIFACT_NAME}' \ + | sudo tee work/rootfs/etc/mender/artifact_info" log_info "Creating state scripts version file." case "${MENDER_CLIENT_VERSION}" in From 59774c95398f281a0b9f74dac8d823790e9a0b15 Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Tue, 9 Jun 2020 11:03:31 -0400 Subject: [PATCH 2/2] Extract debian package contents with sudo. This avoids user ID contamination in the target root filesystem. Changelog: Title Signed-off-by: Drew Moseley --- mender-convert-modify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mender-convert-modify b/mender-convert-modify index 5dba213..89e3b4c 100755 --- a/mender-convert-modify +++ b/mender-convert-modify @@ -94,7 +94,7 @@ run_and_log_cmd "wget -Nq ${MENDER_STORAGE_URL}/${MENDER_CLIENT_VERSION}/dist-pa cd work/mender-deb run_and_log_cmd "ar -xv ${deb_name}" -run_and_log_cmd "tar xJf data.tar.xz -C files" +run_and_log_cmd "sudo tar xJf data.tar.xz -C files" cd - > /dev/null 2>&1 run_and_log_cmd "sudo rsync --archive --keep-dirlinks --verbose work/mender-deb/files/ work/rootfs/"