mirror of
https://github.com/aljazceru/cowrie.git
synced 2026-01-09 09:14:27 +01:00
prevent rmdir of non-empty directories
git-svn-id: https://kippo.googlecode.com/svn/trunk@38 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
@@ -93,6 +93,10 @@ class command_rmdir(HoneyPotCommand):
|
||||
def call(self):
|
||||
for f in self.args:
|
||||
path = self.fs.resolve_path(f, self.honeypot.cwd)
|
||||
if len(self.fs.get_path(path)):
|
||||
self.writeln(
|
||||
'rmdir: failed to remove `%s\': Directory not empty' % f)
|
||||
continue
|
||||
try:
|
||||
dir = self.fs.get_path('/'.join(path.split('/')[:-1]))
|
||||
except IndexError:
|
||||
|
||||
Reference in New Issue
Block a user