diff --git a/tsshbatch.py b/tsshbatch.py index dac813c..8af433f 100755 --- a/tsshbatch.py +++ b/tsshbatch.py @@ -17,7 +17,7 @@ PROGNAME = "tsshbatch.py" BASENAME = PROGNAME.split(".py")[0] PROGENV = BASENAME.upper() -CVSID = "$Id: tsshbatch.py,v 1.144 2013/10/22 18:47:06 tundra Exp $" +CVSID = "$Id: tsshbatch.py,v 1.145 2013/10/22 19:06:20 tundra Exp $" VERSION = CVSID.split()[2] CPRT = "(c)" @@ -222,7 +222,7 @@ # If this is a sudo run, force password to be read # from stdin thereby avoiding fiddling around with ptys. - if command.startswith(SUDO): + if command.startswith(SUDO + " "): command = command.replace(SUDO, "%s %s" % (SUDO, SUDOARGS), 1) @@ -230,7 +230,7 @@ # If doing a sudo command, send the password - if command.startswith(SUDO): + if command.startswith(SUDO + " "): stdin.write("%s\n" % pw) stdin.flush() @@ -476,7 +476,7 @@ SUDOPW = False for command in Commands: - if command.startswith(SUDO) and not PWORD: + if command.startswith(SUDO + " ") and not PWORD: SUDOPW = True if SUDOPW: