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

Issue 903261 timeout not working on shell command when using elevation #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SubZer0MS
Copy link

When using ExcecuteShellCommand (or Script) with a specific Timeout, when using ElevationType sudo, the Timeout is ignored and does not work. This is because the monitoring thread checking the timeout, when trying to kill (killpg) the running process (that is executing the command/script) will fail with EPERM (access denied) because we are running (omiagent) with an unprivileged account, while the process that we are trying to kill is running as privileged as root due to the fact that when constructing the command, we will include SUDO. There is also another issue here that when this will actually throw an Exception (that is what is happening when EPERM will happen) the thread goes away and we swallow the exception without showing it or logging it anywhere.

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

Successfully merging this pull request may close these issues.

1 participant