Merge pull request #2696 from flatcar/dongsu/wa-linux-agent-4152

overlay wa-linux-agent: apply patch to fix ssh public key override issue (stable, beta)
This commit is contained in:
Dongsu Park 2025-02-28 15:13:24 +01:00 committed by GitHub
commit 3728bbd4b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1 @@
- Fix issue of wa-linux-agent overriding ssh public key from ignition configuration during provisioning ([flatcar/Flatcar#1661](https://github.com/flatcar/Flatcar/issues/1661))

View File

@ -0,0 +1,26 @@
From 0c8db73c3567039e50ffa7447bb093ca812dedf6 Mon Sep 17 00:00:00 2001
Message-Id: <0c8db73c3567039e50ffa7447bb093ca812dedf6.1740577844.git.dpark@linux.microsoft.com>
From: Peyton Robertson <93797227+peytonr18@users.noreply.github.com>
Date: Tue, 28 Jan 2025 14:17:43 -0800
Subject: [PATCH] Applying patch to prevent ssh public key override (#3309)
---
azurelinuxagent/common/osutil/default.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/azurelinuxagent/common/osutil/default.py b/azurelinuxagent/common/osutil/default.py
index 584515dc..746c4363 100644
--- a/azurelinuxagent/common/osutil/default.py
+++ b/azurelinuxagent/common/osutil/default.py
@@ -346,7 +346,7 @@ GEN2_DEVICE_ID = 'f8b3781a-1e82-4818-a1c3-63d806ec15bb'
raise OSUtilError("Bad public key: {0}".format(value))
if not value.endswith("\n"):
value += "\n"
- fileutil.write_file(path, value)
+ fileutil.write_file(path, value, append=True)
elif thumbprint is not None:
lib_dir = conf.get_lib_dir()
crt_path = os.path.join(lib_dir, thumbprint + '.crt')
--
2.39.5

View File

@ -30,4 +30,5 @@ S="${WORKDIR}/WALinuxAgent-${PV}"
PATCHES=(
"${FILESDIR}/0001-flatcar-changes.patch"
"${FILESDIR}/0002-prevent-ssh-public-key-override.patch"
)