* vfs/fish.c (fish_file_store): Fix copy of file names with backticks to

remote host.
This commit is contained in:
Leonard den Ottolander 2006-11-09 17:59:39 +00:00
parent 4c9ca90e8a
commit 7a9daa86b0
2 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2006-11-09 Jindrich Novy <jnovy@redhat.com>
* fish.c (fish_file_store): Fix copy of file names with backticks to
remote host.
2006-11-01 Jindrich Novy <jnovy@redhat.com> 2006-11-01 Jindrich Novy <jnovy@redhat.com>
* extfs/rpm: Recognize CONFLICTS. * extfs/rpm: Recognize CONFLICTS.

View File

@ -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, n = fish_command (me, super, WAIT_REPLY,
"#STOR %lu /%s\n" "#STOR %lu /%s\n"
"echo '### 001'\n" "echo '### 001'\n"
"file=/%s\n"
"res=`exec 3>&1\n" "res=`exec 3>&1\n"
"(\n" "(\n"
"head -c %lu -q - || echo DD >&3\n" "head -c %lu -q - || echo DD >&3\n"
") 2>/dev/null | (\n" ") 2>/dev/null | (\n"
"cat > /%s\n" "cat > \"$file\"\n"
"cat > /dev/null\n" "cat > /dev/null\n"
")`; [ \"$res\" = DD ] && {\n" ")`; [ \"$res\" = DD ] && {\n"
"> /%s\n" "> \"$file\"\n"
"rest=%lu\n" "rest=%lu\n"
"while [ $rest -gt 0 ]\n" "while [ $rest -gt 0 ]\n"
"do\n" "do\n"
" cnt=`expr \\( $rest + 255 \\) / 256`\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" " rest=`expr $rest - $n`\n"
"done\n" "done\n"
"}; echo '### 200'\n", "}; echo '### 200'\n",
(unsigned long) s.st_size, name, (unsigned long) s.st_size, name,
(unsigned long) s.st_size, quoted_name, quoted_name, (unsigned long) s.st_size,
quoted_name, (unsigned long) s.st_size, quoted_name); (unsigned long) s.st_size);
else else
n = fish_command (me, super, WAIT_REPLY, n = fish_command (me, super, WAIT_REPLY,
"#STOR %lu /%s\n" "#STOR %lu /%s\n"
"echo '### 001'\n" "echo '### 001'\n"
"{\n" "{\n"
"file=/%s\n"
"rest=%lu\n" "rest=%lu\n"
"while [ $rest -gt 0 ]\n" "while [ $rest -gt 0 ]\n"
"do\n" "do\n"
" cnt=`expr \\( $rest + 255 \\) / 256`\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" " rest=`expr $rest - $n`\n"
"done\n" "done\n"
"}; echo '### 200'\n", "}; echo '### 200'\n",
(unsigned long) s.st_size, name, (unsigned long) s.st_size, name,
(unsigned long) s.st_size, quoted_name); quoted_name, (unsigned long) s.st_size);
g_free (quoted_name); g_free (quoted_name);
if (n != PRELIM) { if (n != PRELIM) {