Skip to content

Conversation

@egg82
Copy link
Contributor

@egg82 egg82 commented Aug 8, 2019

This patch detects whether or not the server is currently executing as a privileged user and spits out a warning. The warning serves as a sort-of PSA for newer server admins who don't understand the risks of running as root.

We've seen plenty of bad/malicious plugins hit markets, and there's been a few close-calls with exploits in the past. Hopefully this helps mitigate some potential damage to servers, even if it is just a warning.

@egg82
Copy link
Contributor Author

egg82 commented Aug 8, 2019

The method used is a little unconventional, so I'm open to feedback on that. I tested on a Windows 10 machine and Ubuntu 18.04 machine and it works on both.

@theminecoder
Copy link
Contributor

I feel this should be bypassable in some cases (docker container, local dev server). Maybe we can skip it when using the same flag that skips the build date check.

@MiniDigger
Copy link
Member

even in a docker container you should create a user, but I agree that a flag should be added. I highly disagree with reusing flags tho, that make them ambiguous.

@zachbr
Copy link
Contributor

zachbr commented Aug 10, 2019

Not sure why you'd want to bypass this in any instance, if you're on some weird temporary setup you can just acknowledge and ignore the warning knowing it won't affect you.
👎 on any disable for this

@zachbr zachbr self-requested a review September 30, 2019 00:51
This patch detects whether or not the server is currently executing as a privileged user and spits out a warning. The warning serves as a sort-of PSA for newer server admins who don't understand the risks of running as root.

We've seen plenty of bad/malicious plugins hit markets, and there's been a few close-calls with exploits in the past. Hopefully this helps mitigate some potential damage to servers, even if it is just a warning.
@zachbr zachbr force-pushed the feature/root-check branch from eb56cf0 to 2e69afa Compare February 19, 2020 04:07
@zachbr zachbr changed the base branch from ver/1.14 to master February 19, 2020 04:07
@zachbr zachbr merged commit 555ca59 into PaperMC:master Feb 19, 2020
zachbr added a commit that referenced this pull request Feb 19, 2020
This reverts commit 555ca59.

Unknown issue on CentOS/RHEL(?) requires further examination.
@zachbr
Copy link
Contributor

zachbr commented Feb 19, 2020

Patching vanilla jar...
Feb 19, 2020 2:14:18 PM java.util.prefs.FileSystemPreferences$2 run
WARNING: Could not create system preferences directory. System preferences are unusable.
System Info: Java 1.8 (OpenJDK 64-Bit Server VM 25.242-b08) Host:  Linux 3.10.0-1062.7.1.el7.x86_64 (amd64)
Loading libraries, please wait...
[14:14:31 INFO]: Starting minecraft server version 1.15.2

Followed by spamming this:

[14:18:22 WARN]: Could not lock System prefs. Unix error code 32519.
[14:18:22 WARN]: Couldn't flush system prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
[14:18:52 WARN]: Could not lock System prefs. Unix error code 32519.
[14:18:52 WARN]: Couldn't flush system prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
[14:19:22 WARN]: Could not lock System prefs. Unix error code 32519.
[14:19:22 WARN]: Couldn't flush system prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
[14:19:52 WARN]: Could not lock System prefs. Unix error code 32519.
[14:19:52 WARN]: Couldn't flush system prefs: java.util.prefs.BackingStoreException: Couldn't get file lock

CentOS

@egg82
Copy link
Contributor Author

egg82 commented Feb 19, 2020

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.

5 participants