3 ms·
We are pixie.io ran into exact problem, we fixed that by parsing the braces, ugly but seems working https://github.com/pixie-io/pixie/blob/bd82bb48ef4da7d6b05f
by bigcat12345678 4y ago
We are pixie.io ran into exact problem, we fixed that by parsing the braces, ugly but seems working
https://github.com/pixie-io/pixie/blob/bd82bb48ef4da7d6b05f27fe7728dfff6687a5c6/src/common/system/proc_parser.cc#L227 https://github.com/pixie-io/pixie/blob/bd82bb48ef4da7d6b05f2...
- idealmedtech 4y agoThat's exactly how it should be done! Also subtle but important that you find the last closing parentheses, as an attacker could just include a paren in their process name to terminate your parse early.
- horstschneider 4y agoThat is how psmisc does it: https://gitlab.com/psmisc/psmisc/-/blob/master/src/pstree.c#L1145 https://gitlab.com/psmisc/psmisc/-/blob/master/src/pstree.c#...
- qwertox 4y agoThese comments here need more visibility.
- jwilk 4y ago> if (std::getline(ifs, line)) { But what if comm contains newlines?
- jwilk 4y agoReported this, and a few more parsing bugs: https://github.com/pixie-io/pixie/issues/678 https://github.com/pixie-io/pixie/issues/678