-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
Add root/admin user warning #693
base: master
Are you sure you want to change the base?
Conversation
+ private static final boolean RUNNING_AS_ROOT_OR_ADMIN; | ||
+ | ||
+ static { | ||
+ boolean isWindows = System.getProperty("os.name").startsWith("Windows"); |
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.
tabs 😢
Does this implement the fixed check from the new PR?
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.
Java 8 (or at least in Waterfall's setup) doesn't seem to like the NTSystem/UnixSystem classes, so I used the "running a command" method from the start, so this isn't affected by the OpenJDK bug.
I think this is useless, since most people don't have access to SSH, and those who do have access already have some experience, it seems to me that adding a warning for that is redundant. |
It is not redundant. I believe many people running a server network do have a vserver/vps or root server rented, because they're often cheaper compared to multiple single mc servers. |
I dont like the way you doing it i would use io.netty.util.internal.PlatformDependent#maybeSuperUser() instead if your reg check and creating processes, this should be enought |
This PR ports the root detection introduced in PaperMC/Paper#2432 (and re-added in PaperMC/Paper#6593) to Waterfall. The implementation used in PaperMC/Paper#6593 doesn't seem to work on Java 8, so I've used a slightly different check.
Tested on macOS and Windows 10.