From 3f5532857807d628a5dadaf5c30a384f873878ea Mon Sep 17 00:00:00 2001 From: dusoleil Date: Sun, 2 Apr 2023 17:25:59 -0400 Subject: comm: Fix bug where readline thinks pipe is broken We should strip the newline from the data after checking if we got an empty string returned. Signed-off-by: dusoleil --- sploit/comm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sploit/comm.py b/sploit/comm.py index 8078c9f..522d540 100644 --- a/sploit/comm.py +++ b/sploit/comm.py @@ -39,10 +39,10 @@ class Comm: def readline(self): data = self.back.stdin.readline() - if data.endswith(b'\n'): - data = data[:-1] if(data == b''): raise BrokenPipeError('Tried to read on broken pipe') + if data.endswith(b'\n'): + data = data[:-1] if self.logonread : ilog(data, file=sys.stdout, color=NORMAL) self.last = data return data -- cgit v1.2.3