More friendly error message for makeDir("").
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 17 Oct 2013 17:48:00 +0000 (19:48 +0200)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 17 Oct 2013 17:48:00 +0000 (19:48 +0200)
src/VfsNs.cpp

index 26793dd..c7c6b92 100644 (file)
@@ -673,6 +673,9 @@ void VfsCatalog::makeDir(const std::string& path, mode_t mode) throw (DmExceptio
 {
   std::string parentPath, name;
 
+  if (path.empty())
+    vfsThrow(EINVAL, "empty directory name");
+
   ExtendedStat parent = this->getParent(path, &parentPath, &name);
 
   if (checkPermissions(this->secCtx_, parent.acl, parent.stat, S_IEXEC) != 0)