Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions shuffle-tools/1.2.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2633,14 +2633,10 @@ def run_ssh_command(self, host, port, user_name, private_key_file_id, password,
try:
stdin, stdout, stderr = ssh_client.exec_command(str(command))

stderr_ouput = stderr.read().decode(errors='ignore')

if stderr_ouput:
return {"success": "true", "message": stderr_ouput}
except Exception as e:
return {"success":"false","message":str(e)}

return {"success":"true","output": stdout.read().decode(errors='ignore')}
return {"success":"true","output": stdout.read().decode(errors='ignore'), "error_log": stderr.read().decode(errors='ignore')}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't stderr.read() and stdout.read() be try-caught? Those can easily crash. The decode as well.


def cleanup_ioc_data(self, input_data):
# Remove unecessary parts like { and }, quotes etc
Expand Down
Loading