Added check for nonexistent directories in tar-mode

This commit is contained in:
Sebastian Lohff 2012-04-27 03:54:55 +02:00
parent fba7b2e117
commit 4bfb5b92f8
1 changed files with 2 additions and 0 deletions

View File

@ -540,6 +540,8 @@ class ServeFile():
raise ServeFileException("Error: Could not open file!") raise ServeFileException("Error: Could not open file!")
handler = FileHandler handler = FileHandler
elif self.serveMode == self.MODE_SINGLETAR: elif self.serveMode == self.MODE_SINGLETAR:
if not os.path.exists(self.target):
raise ServeFileException("Error: Could not open file or directory")
TarFileHandler.target = self.target TarFileHandler.target = self.target
TarFileHandler.fileName = os.path.basename(self.target.rstrip("/")) TarFileHandler.fileName = os.path.basename(self.target.rstrip("/"))