chef / chef/mixlib-shellout

Reaper doesn't like sudo'd processes

Open
#145 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Bug
Dominant language
Ruby
Stars
133
Forks
73
Avg merge
8h 20m
Merged PRs (30d)
2

Description

In the case where the process doing shell-out-ing is an unpriv'd user, and the command being run either directly or indirectly ends up with elevated perms, we can end up with a situation where the kill() call in reap_errant_child fails with EPERM.

We should probably just ignore it like we do with ESRCH, maybe with a warning that reaping failed due to process permissions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating reap_errant_child and the kill() call that currently handles ESRCH. Check how the project tests child reaping and process errors, then verify that EPERM is handled as requested, with a warning if appropriate; done means sudo-induced permission failures no longer leave reaping unsuccessful without notice.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.