From eac44b6af9ace18b81f2cb8ea4a006fece464764 Mon Sep 17 00:00:00 2001 From: tymwitko Date: Thu, 24 Jul 2025 19:52:12 +0200 Subject: [PATCH] bugfix: input sanitization for new folders and files --- lib/data/services/sftp_service.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/data/services/sftp_service.dart b/lib/data/services/sftp_service.dart index c96056f..2465b71 100644 --- a/lib/data/services/sftp_service.dart +++ b/lib/data/services/sftp_service.dart @@ -281,7 +281,7 @@ class SftpService { Future createFile(String path) async { _ensureConnected(); try { - final command = 'touch $path'; + final command = 'touch "$path"'; final result = await _sshClient!.run(command); if (result.isNotEmpty) throw Exception(utf8.decode(result)); } @@ -294,7 +294,7 @@ class SftpService { Future createFolder(String path) async { _ensureConnected(); try { - final command = 'mkdir -p $path'; + final command = 'mkdir -p "$path"'; final result = await _sshClient!.run(command); if (result.isNotEmpty) throw Exception(utf8.decode(result)); }