RexOps / RexOps/Rex

sudo TRUE; - code gets stuck

Open
#466 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug easy-to-fix
Dominant language
Perl
Stars
737
Forks
214
PR merge metrics
No merged PRs in 30d

Description

When I set sudo TRUE; running rex got stuck. Using -d I fund that the problem is this command

sudo  -p '' -S sh -c "LC_ALL=C ; export LC_ALL; which perl "

being stuck. (It does not even ask for password, probably because of the -p '')

All this because I was trying to restrict the command the user can execute using sudo.
I can, of course, add sudo to the individual commands I execute, but I am not sure if this behaviour is correct. shouldn't sudo TRUE; mean every user-generated command is executed with sudo?
Why are the internal Rex-commands executed with sudo?

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 reproducing the hang with sudo TRUE; and the reported sudo -p '' -S sh -c "LC_ALL=C ; export LC_ALL; which perl " command, using Rex's -d option. Trace how the sudo setting is applied to user-generated and internal commands, then define and test the intended behavior for restricted sudo execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl, shell
Domain
cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.