Open devster31 opened 5 years ago
Qt actually already seems to have some of these functions: https://code.qt.io/cgit/qt/qtbase.git/tree/qmake/library/qmakebuiltins.cpp#n1206 and reference the original bit https://code.qt.io/cgit/qt/qtbase.git/tree/qmake/library/ioutils.cpp#n136 onwards for quoting shell arguments, and simpler https://code.qt.io/cgit/qt/qtbase.git/tree/qmake/library/qmakebuiltins.cpp#n1183 for shell paths
What is the problem
running external command relies on correctly escaping the parameters in the
qBittorrent.conf file
, for example like so:I believe this is very prone to errors and breakable upon edge cases.
What is the expected behavior
I would propose incorporating a function to automatically escape these arguments based on the correct shell. PHP has a such a function (
escapeshellargs
), written in C, which could serve as a basis. https://github.com/php/php-src/blob/73a59eff52e92b1c8ede73df3de3eb602f65f14f/ext/standard/exec.c#L392-L475 This would eliminate the need for manual escaping.qBittorrent version and Operating System
deb package from official launchpad repository
running inside
docker
container.