From 7a9daa86b0f4f304a083bdea2f36485f208995f2 Mon Sep 17 00:00:00 2001 From: Leonard den Ottolander Date: Thu, 9 Nov 2006 17:59:39 +0000 Subject: [PATCH] * vfs/fish.c (fish_file_store): Fix copy of file names with backticks to remote host. --- vfs/ChangeLog | 5 +++++ vfs/fish.c | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index a0522c7b6..a4be21561 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,8 @@ +2006-11-09 Jindrich Novy + + * fish.c (fish_file_store): Fix copy of file names with backticks to + remote host. + 2006-11-01 Jindrich Novy * extfs/rpm: Recognize CONFLICTS. diff --git a/vfs/fish.c b/vfs/fish.c index ef8755607..4fe36b777 100644 --- a/vfs/fish.c +++ b/vfs/fish.c @@ -532,40 +532,42 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc n = fish_command (me, super, WAIT_REPLY, "#STOR %lu /%s\n" "echo '### 001'\n" + "file=/%s\n" "res=`exec 3>&1\n" "(\n" "head -c %lu -q - || echo DD >&3\n" ") 2>/dev/null | (\n" - "cat > /%s\n" + "cat > \"$file\"\n" "cat > /dev/null\n" ")`; [ \"$res\" = DD ] && {\n" - "> /%s\n" + "> \"$file\"\n" "rest=%lu\n" "while [ $rest -gt 0 ]\n" "do\n" " cnt=`expr \\( $rest + 255 \\) / 256`\n" - " n=`dd bs=256 count=$cnt | tee -a /%s | wc -c`\n" + " n=`dd bs=256 count=$cnt | tee -a \"$file\" | wc -c`\n" " rest=`expr $rest - $n`\n" "done\n" "}; echo '### 200'\n", (unsigned long) s.st_size, name, - (unsigned long) s.st_size, quoted_name, - quoted_name, (unsigned long) s.st_size, quoted_name); + quoted_name, (unsigned long) s.st_size, + (unsigned long) s.st_size); else n = fish_command (me, super, WAIT_REPLY, "#STOR %lu /%s\n" "echo '### 001'\n" "{\n" + "file=/%s\n" "rest=%lu\n" "while [ $rest -gt 0 ]\n" "do\n" " cnt=`expr \\( $rest + 255 \\) / 256`\n" - " n=`dd bs=256 count=$cnt | tee -a /%s | wc -c`\n" + " n=`dd bs=256 count=$cnt | tee -a \"$file\" | wc -c`\n" " rest=`expr $rest - $n`\n" "done\n" "}; echo '### 200'\n", (unsigned long) s.st_size, name, - (unsigned long) s.st_size, quoted_name); + quoted_name, (unsigned long) s.st_size); g_free (quoted_name); if (n != PRELIM) {