-
Notifications
You must be signed in to change notification settings - Fork 56
Description
ADBDeviceExt::shell_command accepts &[&str]
as command, which makes it seem that the user can pass distinct cli arguments to the invoked command, meaning the 0th element is the program to be invoked, the first element is the first cli argument, the second element is the second cli arg, etc.
This is not actually the case since the function just joins the elements with spaces, eg. passing &["touch","a b"]
would not touch the file "a b" but touch both "a" and "b". This problem manifests also in reverse eg. &["touch","\"", "hello", "world", "\""]
would touch " hello world ".
Since getting all the weirdness of shell escaping correct is very difficult I'd suggest just accepting &str
instead. Note that this would be breaking API so you'd need to bump the major version number or deprecate ADBDeviceExt::shell_command
and add a new function.