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

Set SystemDrive env var on osquery command #1960

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

RebeccaMahany
Copy link
Contributor

We need the SystemDrive environment variable to be set on the osquery command to ensure paths can be resolved appropriately.

@RebeccaMahany RebeccaMahany added the bug-fixes Bug Fixes label Nov 18, 2024
@RebeccaMahany RebeccaMahany marked this pull request as ready for review November 18, 2024 21:10
@RebeccaMahany RebeccaMahany added this pull request to the merge queue Nov 18, 2024
Merged via the queue into kolide:main with commit e347130 Nov 18, 2024
32 checks passed
@RebeccaMahany RebeccaMahany deleted the becca/systemdrive branch November 18, 2024 22:10
"github.com/stretchr/testify/require"
)

func TestCreateOsqueryCommandEnvVars(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this test adds much, but I don't feel that strongly

// On Windows, we want the `SystemDrive` environment variable to be set to ensure paths can be resolved appropriately.
// The cmd handles setting `SystemRoot` for us.
if runtime.GOOS == "windows" {
if systemDrive, found := os.LookupEnv("SystemDrive"); found {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we probably need to think hard about the !found case. It might be better to set this to "" than to leave it unset.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@directionless I tested and confirmed setting SystemDrive= helps, so I made that change in this follow-up PR: #1961

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fixes Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants