mirror of
https://github.com/aljazceru/cowrie.git
synced 2026-01-31 20:14:27 +01:00
New command: rmdir
git-svn-id: https://kippo.googlecode.com/svn/trunk@25 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
@@ -72,9 +72,26 @@ class command_mkdir(HoneyPotCommand):
|
||||
if f in [x[A_NAME] for x in dir]:
|
||||
self.writeln(
|
||||
'mkdir: cannot create directory `test\': File exists')
|
||||
return
|
||||
continue
|
||||
dir.append([f, T_DIR, 0, 0, 4096, 16877, time.time(), [], None])
|
||||
|
||||
class command_rmdir(HoneyPotCommand):
|
||||
def call(self, args):
|
||||
for f in args.split(' '):
|
||||
path = self.fs.resolve_path(f, self.honeypot.cwd)
|
||||
try:
|
||||
dir = self.fs.get_path('/'.join(path.split('/')[:-1]))
|
||||
except IndexError:
|
||||
dir = None
|
||||
if not dir or f not in [x[A_NAME] for x in dir]:
|
||||
self.writeln(
|
||||
'rmdir: failed to remove `%s\': ' % f + \
|
||||
'No such file or directory')
|
||||
continue
|
||||
for i in dir[:]:
|
||||
if i[A_NAME] == f:
|
||||
dir.remove(i)
|
||||
|
||||
class command_uptime(HoneyPotCommand):
|
||||
def call(self, args):
|
||||
self.writeln(
|
||||
|
||||
Reference in New Issue
Block a user