mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-17 22:14:19 +01:00
tweak chmod code style
This commit is contained in:
@@ -293,16 +293,16 @@ commands['/usr/bin/yes'] = command_yes
|
|||||||
|
|
||||||
class command_chmod(HoneyPotCommand):
|
class command_chmod(HoneyPotCommand):
|
||||||
def call(self):
|
def call(self):
|
||||||
if len(self.args) and len(self.args) >= 2:
|
if len(self.args) < 2:
|
||||||
for arg in self.args[1:]:
|
|
||||||
path = self.fs.resolve_path(arg, self.honeypot.cwd)
|
|
||||||
if self.fs.exists(path):
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
self.writeln('chmod: cannot access %s: No such file or directory' % (arg,))
|
|
||||||
else:
|
|
||||||
self.writeln('chmod: missing operand')
|
self.writeln('chmod: missing operand')
|
||||||
self.writeln('Try chmod --help for more information.')
|
self.writeln('Try chmod --help for more information.')
|
||||||
|
return
|
||||||
|
for arg in self.args[1:]:
|
||||||
|
path = self.fs.resolve_path(arg, self.honeypot.cwd)
|
||||||
|
if not self.fs.exists(path):
|
||||||
|
self.writeln(
|
||||||
|
'chmod: cannot access %s: No such file or directory' % \
|
||||||
|
(arg,))
|
||||||
commands['/bin/chmod'] = command_chmod
|
commands['/bin/chmod'] = command_chmod
|
||||||
|
|
||||||
class command_nop(HoneyPotCommand):
|
class command_nop(HoneyPotCommand):
|
||||||
|
|||||||
Reference in New Issue
Block a user