diff --git a/TODO b/TODO index e28474b..73959d3 100644 --- a/TODO +++ b/TODO @@ -18,7 +18,6 @@ - Capture bad password - Capture failed command output -- Fix noisy mode diff --git a/x.py b/x.py index 37c414e..924e4f5 100755 --- a/x.py +++ b/x.py @@ -20,7 +20,7 @@ CMDINCL = PROGENV + "CMDS" HOSTINCL = PROGENV + "HOSTS" -CVSID = "$Id: x.py,v 1.1 2014/07/25 20:44:05 tundra Exp $" +CVSID = "$Id: x.py,v 1.2 2014/07/25 21:28:45 tundra Exp $" VERSION = CVSID.split()[2] CPRT = "(c)" DATE = "2011-2014" @@ -375,18 +375,26 @@ chan.send("%s\n" % sudopw) - results = [] + results = '' READMORE = True while READMORE: newresults = chan.recv(9999) if newresults: - results.append(newresults) + results += newresults else: READMORE = False - PrintReport([host + " (stdout)" + " [%s]" % command, "\n"] + results[:-1] + ["\n"]) + # Convert the result which is one big string into a list of strings on newline boundaries + + results = results.replace("\r", "") + listresults = results.split("logout")[0].split("\n") + listresults = [e + "\n" for e in listresults] + + PrintReport([host + " (stdout)" + " [%s]" % command, "\n"] + listresults + ["\n"]) + + # If all we see on stderr at this point is our original