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

🐛 use system path on default when root user is used #1809

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

chris-rock
Copy link
Member

This change handle the special case where we run cnquery inside of a container. When root (uid-0) is used we want to use the system path as default. While we handled the case for home path detection we have not incorporated that when we install a plugin. Now we determine the default path, this allows us to run well in container land:

docker run -it cnspec-alpine /bin/sh
/ # cnquery shell local
! can't find any paths for providers, none are configured system-path=/opt/mondoo/providers
→ installing provider 'os' version=9.0.0
→ successfully installed os provider path=/opt/mondoo/providers/os version=9.0.0
→ no Mondoo configuration file provided, using defaults
→ connected to Alpine Linux v3.15
  ___ _ __   __ _ _   _  ___ _ __ _   _ 
 / __| '_ \ / _` | | | |/ _ \ '__| | | |
| (__| | | | (_| | |_| |  __/ |  | |_| |
 \___|_| |_|\__, |\__,_|\___|_|   \__, |
  mondoo™      |_|                |___/  interactive shell

cnquery> 

In addition, I added code that DEBUG=1 is also respected for global logging before the commands are injected

@chris-rock chris-rock requested a review from arlimus September 20, 2023 10:11
Copy link
Member

@arlimus arlimus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, so this fixes that home is detected as "".

@arlimus arlimus merged commit 5c41cee into main Sep 20, 2023
@arlimus arlimus deleted the chris-rock/providers-container branch September 20, 2023 18:00
@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants