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

Fix ability for unprivileged Windows to upgrade #4649

Merged

Conversation

blakerouse
Copy link
Contributor

What does this PR do?

Adds the SeCreateSymbolicLinkPrivilege to the created elastic-agent-user when installing in unprivileged mode.

Why is it important?

This privilege is required on the `elastic-agent-user. With out the privilege upgrade fails to update symlinks between the current and previous versions of Elastic Agent.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works integration tests
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Related issues

@blakerouse blakerouse added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog backport-v8.14.0 Automated backport with mergify labels May 1, 2024
@blakerouse blakerouse self-assigned this May 1, 2024
@blakerouse blakerouse requested a review from a team as a code owner May 1, 2024 14:02
@blakerouse blakerouse requested review from nchaulet and kaanyalti May 1, 2024 14:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@blakerouse
Copy link
Contributor Author

I was able to confirm that this does fix the issue. I have applied this change to #4642 and ran a single test of TestStandaloneUpgradeWithGPGFallback on Windows. That test specifically installs the build version and then upgrades to the snapshot version. That ensures that the user is created with this new permission and that an upgrade can succeed, the snapshot version doesn't need this change to upgrade to because the user is already created.

The tests that install with the snapshot first and then upgrade do need this change. That is why I separated this change from #4642.

@blakerouse blakerouse enabled auto-merge (squash) May 1, 2024 14:54
@blakerouse blakerouse merged commit 5fe8deb into elastic:main May 1, 2024
12 checks passed
mergify bot pushed a commit that referenced this pull request May 1, 2024
blakerouse added a commit that referenced this pull request May 2, 2024
(cherry picked from commit 5fe8deb)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.14.0 Automated backport with mergify skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to upgrade in unprivileged mode on Windows
3 participants