Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pid is not extracted correctly in "attack_broker.py" file #3

Open
chandrakishorSingh opened this issue Feb 27, 2023 · 2 comments
Open

Comments

@chandrakishorSingh
Copy link

In the file "attack_broker.py" the following two lines(line 102-103) attempt to execute a subprocess and extracts its pid.

    child = subprocess.Popen('pgrep xterm', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, executable='/bin/bash')
    pid = int(child.communicate()[0].split('\n')[0])

However, this doesn't give the correct pid.

@chandrakishorSingh
Copy link
Author

I've raised the PR #4 which correctly extracts the pid. Please review it. Thanks.

@crond-jaist
Copy link
Collaborator

Hi,
Thank you for contacting us. From the pull request you submitted I noticed that you basically added "title().decode('utf-8')" before getting the pid. This makes me think that the error you encountered is caused by the fact that you use Unicode characters in your system. Note that we did not have such issue with our English language setup, so it may be an internationalization problem.
Unfortunately I don't currently have a setup for testing your code, so I cannot verify it immediately. Therefore I shall keep this issue open in case other people encounter a similar problem. Hopefully I'll be able to test the code at some point in the future and make the suggested changes.
Best wishes,
Razvan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant