Y
Hacker News
new
|
ask
|
show
|
jobs
by
idealmedtech
1273 days ago
That'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.
2 comments
horstschneider
1273 days ago
That is how psmisc does it:
https://gitlab.com/psmisc/psmisc/-/blob/master/src/pstree.c#...
link
qwertox
1273 days ago
These comments here need more visibility.
link
https://gitlab.com/psmisc/psmisc/-/blob/master/src/pstree.c#...