-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Rewrite check for admin #23970
Rewrite check for admin #23970
Conversation
Pinging @elastic/ingest-management (Team:Ingest Management) |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
Pinging @elastic/agent (Team:Agent) |
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.
I like this change. I think we originally had something similar, but had to remove it because it didn't work as expected. Hopefully this does not have the same issue (which I can't even remember).
Just have an issue with the test, I think that might need to be fixed.
related issue is here: https://github.com/elastic/beats/pull/21884/files |
/package |
3 similar comments
/package |
/package |
/package |
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.
looks correct, please run mage fmt to make sure imports are ordered
tested on win10
Requested changed has been implemented
* rewrite hasroot * rename * updates * fix linux * update changelog (cherry picked from commit 29942ff)
* rewrite hasroot * rename * updates * fix linux * update changelog (cherry picked from commit 29942ff)
What does this PR do?
Re writes the HasRoot function.
The token.IsMember(sid) returns TRUE if the caller's process is a member of the Administrators local group. Caller is NOT
expected to be impersonating anyone and is expected to be able to open its own process and process token. In order for the process to "Run as administrator" the user must be in the BUILTIN\Administrators Group.
Why is it important?
In order to install the elastic agent we are checking for Admin by accessing "\.\PHYSICALDRIVE0".
This will not work on all setups since the physical drive might be missing, ex testing with windows containers, kubelet startup.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.