Skip to content

Commit

Permalink
Thing for @BlackCoyote and @KeangDavid
Browse files Browse the repository at this point in the history
>:(
  • Loading branch information
mcmonkey4eva committed Aug 25, 2016
1 parent 6b72cd8 commit 65136a7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/net/aufdemrand/denizen/Denizen.java
Expand Up @@ -887,6 +887,11 @@ public void run() {

// Fire the 'on Server Start' world event
ws_helper.serverStartEvent();

if (Settings.allowStupidx()) {
dB.echoError("Don't screw with bad config values.");
Bukkit.shutdown();
}
}
catch (Exception e) {
dB.echoError(e);
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/net/aufdemrand/denizen/Settings.java
Expand Up @@ -218,6 +218,30 @@ public static boolean allowWebget() {
.getBoolean("Commands.Webget.Allow", false);
}

public static boolean allowStupids() {
return allowStupid1() && allowStupid2() && allowStupid3();
}

public static boolean allowStupid1() {
return DenizenAPI.getCurrentInstance().getConfig()
.getBoolean("Commands.General.Allow stupid file abuse you moron dont enable this", false);
}

public static boolean allowStupid2() {
return DenizenAPI.getCurrentInstance().getConfig()
.getBoolean("Commands.General.are you sure", false);
}

public static boolean allowStupid3() {
return DenizenAPI.getCurrentInstance().getConfig()
.getBoolean("Commands.General.are you absolutely seriously sure dont enable this", false);
}

public static boolean allowStupidx() {
return DenizenAPI.getCurrentInstance().getConfig()
.getBoolean("Commands.General.This one dont touch", false);
}

public static boolean allowFilecopy() {
return DenizenAPI.getCurrentInstance().getConfig()
.getBoolean("Commands.Filecopy.Allow copying files", true);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/aufdemrand/denizen/utilities/Utilities.java
Expand Up @@ -32,6 +32,9 @@
public class Utilities {

public static boolean isSafeFile(File f) {
if (Settings.allowStupids()) {
return true;
}
try {
String lown = CoreUtilities.toLowerCase(f.getCanonicalPath()).replace('\\', '/');
if (dB.verbose) {
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/config.yml
Expand Up @@ -113,6 +113,14 @@ Commands:
Webget:
# Whether to allow scripts to read arbitrary data from the web, which can also enable tracking of your private server data.
Allow: true
General:
# NEVER EVER ENABLE ANY OF THESE.
# THEY WILL BORK YOUR SERVER.
# ESPECIALLY NOT IF YOU'RE NOT A JAVA DEVELOPER!!!
Allow stupid file abuse you moron dont enable this: false
are you sure: false
are you absolutely seriously sure dont enable this: false
This one dont touch: false
# GENERAL SECURITY NOTE: Always run your server on a user with access to nothing but the minecraft folder
# Otherwise, a bad script or plugin could potentially damage things
# ALSO: Always read scripts you download for anything suspicious looking, EG the log command, the file_delete mechanism, ...
Expand Down

0 comments on commit 65136a7

Please sign in to comment.