From 118682ce5cd8492ecc554c1356567d7b6628c01e Mon Sep 17 00:00:00 2001 From: feildmaster Date: Fri, 21 Dec 2012 15:21:34 -0600 Subject: [PATCH] Don't save server properties when it's read only. Fixes BUKKIT-3250 --- src/main/java/net/minecraft/server/PropertyManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java index 30c4dcf86a..cc5ddc71fb 100644 --- a/src/main/java/net/minecraft/server/PropertyManager.java +++ b/src/main/java/net/minecraft/server/PropertyManager.java @@ -69,6 +69,11 @@ public class PropertyManager { FileOutputStream fileoutputstream = null; try { + // CraftBukkit start - Don't attempt writing to file if it's read only + if (!this.c.canWrite()) { + return; + } + // CraftBukkit end fileoutputstream = new FileOutputStream(this.c); this.properties.store(fileoutputstream, "Minecraft server properties"); } catch (Exception exception) {