Bug 198819
Summary: | [regression] bluetoothctl commands containing newlines are no longer parsed and executed | ||
---|---|---|---|
Product: | Drivers | Reporter: | Daniel van Vugt (daniel.van.vugt) |
Component: | Bluetooth | Assignee: | linux-bluetooth (linux-bluetooth) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | luiz.dentz |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://launchpad.net/bugs/1750308 | ||
Kernel Version: | 4.13.0 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
fix-198819-v1.patch
Don't process HUP cond before others |
Description
Daniel van Vugt
2018-02-19 10:15:33 UTC
This might be cause by the use of wordexp: 'The string argument Since the expansion is the same as the expansion by the shell (see sh(1)) of the parameters to a command, the string s must not contain characters that would be illegal in shell command parameters. In particular, there must not be any unescaped newline or |, &, ;, <, >, (, ), {, } characters outside a command substitution or parameter substitution context.' Though that should have caused the whole input to be invalid so I wonder if just the string split not working with ^M for some reason, either way in the long term we are planning to have proper support for non-interactive mode to make it easier to interface bluetoothctl with other tools. This probably doesn't help much, but I've now bisected the regression for completeness: 70b8b754f8e6f9abe9211c686b279dbef16bf666 is the first bad commit commit 70b8b754f8e6f9abe9211c686b279dbef16bf666 Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Thu Nov 9 16:29:39 2017 +0200 client: Make use of bt_shell Use bt_shell instead of readline directly. :040000 040000 1cf4f1d590b6cf0ad0736d81f1c94a8c21e49c42 787d8c928eb0a06971293deb48195531fa300ccc M client Created attachment 274259 [details]
fix-198819-v1.patch
Here's a fix.
Created attachment 274277 [details]
Don't process HUP cond before others
Let me know if this works as well.
Yes that seems to work too. Fixed in commit 1bf0336942fd093a0f8fa890eb026e1dc379f35f on master. |