-
Notifications
You must be signed in to change notification settings - Fork 90
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
Fix inspec detect on SLES #515
Conversation
Hello christian-wtd! Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
This is a fix for the broken remote execution of Inspec on SUSE SLES 12. More details can be found in inspec/inspec#4384 Basically the problem appears for non-root users with sudosh blocking OS detection without sudo and blocks any inspec run for remote operations. Neither the /etc/os-release file is readable nor the uname command is executable without sudo in such an environment. This has been verified working with Inspec CLI and also Inspec Library Runner Class. Signed-off-by: christian-wtd <[email protected]>
f63f23a
to
bd70c95
Compare
Hello, did anyone already had a chance to look at this? Best regards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @christian-wtd - Thanks for the contribution! You traced a problem across two software projects and found where to fix it, which is not easy - good work! Here's what I'd like to see to get this merged in:
- A refactor to move the conditional logic into one place
- If possible, try to read the sudo option from the
@backend
connection object rather than straight from@ARGV
. That's safer - for example, --sudo might be abbreviated on the command line, or passed differently on the Runner API.
A great start!
This should be the real fix for the sudo detect issue.
Reverted changes on this file.
This should be the real fix for the sudo detect issue. Signed-off-by: christian-wtd <[email protected]>
Ok. now I have fucked up GIT somehow :-( |
Signed-off-by: christian-wtd <[email protected]>
…ix detection Signed-off-by: christian-wtd <[email protected]>
Signed-off-by: christian-wtd <[email protected]>
Signed-off-by: christian-wtd <[email protected]>
Code Climate has analyzed commit 27187a5 and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
So having the different approach now in the correct file we should be good to go and also we no longer use ARGV. |
the reference I made was wrong, should have pointed to my other pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct to me - thanks!
Any ETA when this gets merged and released? |
@miah & @clintoncwolfe : |
Thank you very much! |
This PR might need to be rolled back as it is causing severe problems in other areas (eg #538) and it is too hard to debug. It should probably also have had a test added before it was merged. Further, I'm running sles 12 in a docker container and both Finally, given the 9 commits vs the final diff, this should have been squashed or interactive rebased and cleaned up. |
Causes regressions shown in #538 which I think is a bigger affected set of users. Until we can get this under test and reproducible, it needs to wait. Signed-off-by: Ryan Davis <[email protected]>
This has been addressed via #544. |
This is a fix for the broken remote execution of Inspec on SUSE SLES 12.
Description
More details can be found in inspec/inspec#4384
Basically the problem appears for non-root users with sudosh blocking OS detection without sudo and blocks any inspec run for remote operations. Neither the /etc/os-release file is readable nor the uname command is executable without sudo in such an environment.
This has been verified working with Inspec CLI and also Inspec Library Runner Class.
Related Issue
inspec/inspec#4384
Types of changes
Checklist: