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

Attempt to fix --sudo. #576

Merged
merged 3 commits into from
Mar 2, 2020
Merged

Attempt to fix --sudo. #576

merged 3 commits into from
Mar 2, 2020

Conversation

skpaterson
Copy link

@skpaterson skpaterson commented Feb 27, 2020

Signed-off-by: Stuart Paterson [email protected]

EDIT: this is a proposed fix for inspec/inspec#4826

Signed-off-by: Stuart Paterson <[email protected]>
@skpaterson skpaterson requested a review from a team as a code owner February 27, 2020 17:00
@chef-expeditor
Copy link
Contributor

Hello skpaterson! Thanks for the pull request!

Here is what will happen next:

  1. Your PR will be reviewed by the maintainers.
  2. Possible Outcomes
    a. If everything looks good, one of them will approve it, and your PR will be merged.
    b. The maintainer may request follow-on work (e.g. code fix, linting, etc). We would encourage you to address this work in 2-3 business days to keep the conversation going and to get your contribution in sooner.
    c. Cases exist where a PR is neither aligned to Chef InSpec's product roadmap, or something the team can own or maintain long-term. In these cases, the maintainer will provide justification and close out the PR.

Thank you for contributing!

@tas50
Copy link
Contributor

tas50 commented Feb 27, 2020

We'll want to test this with Chef Infra bootstrapping too since it's using the same code I believe.

Signed-off-by: Stuart Paterson <[email protected]>
@clintoncwolfe
Copy link
Contributor

clintoncwolfe commented Feb 28, 2020

I've performed manual testing against an ubuntu 16.04 vagrant box, and this worked well.

I'm now going to test a freebsd11 machine.

Works on freebsd11 with the caveat that base64 needs to be installed (see #445)

Now testing knife bootstrap.

@mp and I tested it with knife bootstrap and verified the fix (fixes chef/chef#9404)

tyler-ball added a commit to chef/chef-workstation that referenced this pull request Feb 28, 2020
The latest Inspec release (4.18.97) contains some bugs. We are going to
temporaryly rollback while we are in the middle of hotfixing Chef
Workstation.

inspec/inspec#4899
inspec/train#576
inspec/inspec#4934
inspec/inspec#4932

Signed-off-by: tyler-ball <[email protected]>
tyler-ball added a commit to chef/chef-workstation that referenced this pull request Feb 28, 2020
The latest Inspec release (4.18.97) contains some bugs. We are going to
temporaryly rollback while we are in the middle of hotfixing Chef
Workstation.

inspec/inspec#4899
inspec/train#576
inspec/inspec#4934
inspec/inspec#4932

Signed-off-by: tyler-ball <[email protected]>
@clintoncwolfe
Copy link
Contributor

After working with this a bit and discussing with @mp, we noted that running run(-h) (which would typically expand to sh -c sudo -h would only verify that you had sudo (or your alternate sudo command) installed and that it accepted the -h (likely usage help) option. That's a semantic change from the previous -v, which would cause it to validate the credentials.

I've now tried it with run(echo) - basically "portably do nothing and succeed" on ubuntu16, freebsd11 on inspec, and both of those using knife bootstrap. That seems to work well.

@clintoncwolfe clintoncwolfe requested a review from zenspider March 2, 2020 19:10
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.

4 participants