I'veI'veI'veI've just come across a filename with an embedded backtick (`), and the decoding failed. Investigating the code, I discovered that convert
encloses in double quotes all filenames which will be used in system
calls and only escapes characters \ and $, so the system
calls will fail if the filenames have embedded ` and ". Investigating a little further, there were other system
calls which used filenames without any quoting at all.
You can reproduce this very easily: get any audio file, let's say a FLAC file, rename it to foo`"bar.flac and try to convert it. The conversion will fail. I'm not so sure how to provoke the failure in the other system calls, but surely they will fail with filenames which have not only embedded ` and ", but also \ and $, because they're not being quoted at all.
After reading this enlightening article, it seemed to me safer and cleaner to use method shell_quote
from module String::ShellQuote, which in Ubuntu comes in package libstring-shellquote-perl. All system
calls were carefully revised, and the double-quoted filenames used were all replaced by the result of shell_quote filename
.
I've attached a patch.
Diff:
I'm currently away from the keyboard but I'll get them done as soon as I can thanks for the inputimimim