[v2,1/7] dts: escape single quotes
Checks
Commit Message
When making any command a privileged one in a LinuxSession, there
currently is no consideration whether this command already includes single
quotes. Therefore escape the existing single quotes before making the
command.
Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
dts/framework/testbed_model/linux_session.py | 1 +
1 file changed, 1 insertion(+)
@@ -67,6 +67,7 @@ class LinuxSession(PosixSession):
@staticmethod
def _get_privileged_command(command: str) -> str:
+ command = command.replace(r"'", r"\'")
return f"sudo -- sh -c '{command}'"
def get_remote_cpus(self) -> list[LogicalCore]: