From 69048a92c4863d0949dad573dd44149dad4eaa7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Mon, 25 Nov 2013 14:36:12 +0100 Subject: [PATCH] fixed directory creation not checking capacity limit --- li/cil/oc/server/fs/Capacity.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/li/cil/oc/server/fs/Capacity.scala b/li/cil/oc/server/fs/Capacity.scala index 64a441f54..e60b7af33 100644 --- a/li/cil/oc/server/fs/Capacity.scala +++ b/li/cil/oc/server/fs/Capacity.scala @@ -27,12 +27,16 @@ trait Capacity extends OutputStreamFileSystem { else false } - override def makeDirectory(path: String) = + override def makeDirectory(path: String) = { + if (capacity - used < Config.fileCost) { + throw new io.IOException("not enough space") + } if (super.makeDirectory(path)) { used += Config.fileCost true } else false + } // ----------------------------------------------------------------------- //