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

Added run_as_user to UserAgent #242

Merged
merged 2 commits into from
Aug 17, 2021
Merged

Conversation

jefchien
Copy link
Contributor

Description of the issue

Indicate if run_as_user is being used in the agent configuration.

Description of changes

Added a run_as_user tag to the input plugins in the UserAgent if the agent isn't running as root.

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

Updated info_test.go unit test to account for run_as_user in the input plugins.

@jefchien jefchien requested a review from haojhcwa July 15, 2021 18:29
@@ -19,6 +19,10 @@ const versionFilename = "CWAGENT_VERSION"
// We will fall back to a major version if no valid version file is found
const fallbackVersion = "1"

var isRunningAsRoot = func() bool {
return os.Getuid() == 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this account for the OS? I don't believe run_as_user is supported on windows hosts and isRunningAsRoot will always be false.

@jefchien jefchien added this to the v1.247348.1 milestone Jul 15, 2021
@jefchien jefchien requested review from ZhenyuTan-amz and removed request for haojhcwa August 17, 2021 14:52
@jefchien jefchien merged commit f84ce16 into aws:master Aug 17, 2021
@jefchien jefchien deleted the useragent-run-as-user branch August 17, 2021 18:06
sky333999 pushed a commit that referenced this pull request Jul 21, 2023
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.

2 participants