aboutsummaryrefslogtreecommitdiff
path: root/security/pssh/files/patch-psshlib_psshutil.py
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2007-07-06 20:30:24 +0000
committerBrooks Davis <brooks@FreeBSD.org>2007-07-06 20:30:24 +0000
commita4694ad9134d41527fe7e1bd16a28f0e0c097b56 (patch)
tree5c867017fa9bafd1af805e6f9129d018739630ce /security/pssh/files/patch-psshlib_psshutil.py
parent6686ae02cc504d727dcaebf12fcea1dfcc84de48 (diff)
downloadports-a4694ad9134d41527fe7e1bd16a28f0e0c097b56.tar.gz
ports-a4694ad9134d41527fe7e1bd16a28f0e0c097b56.zip
Notes
Diffstat (limited to 'security/pssh/files/patch-psshlib_psshutil.py')
-rw-r--r--security/pssh/files/patch-psshlib_psshutil.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/security/pssh/files/patch-psshlib_psshutil.py b/security/pssh/files/patch-psshlib_psshutil.py
new file mode 100644
index 000000000000..a8d90a7dded8
--- /dev/null
+++ b/security/pssh/files/patch-psshlib_psshutil.py
@@ -0,0 +1,43 @@
+
+$FreeBSD$
+
+--- psshlib/psshutil.py.orig
++++ psshlib/psshutil.py
+@@ -1,22 +1,18 @@
+ import os, signal, sys
+
+-def reaper(signo, frame):
+- while 1:
+- try:
+- pid, status = os.waitpid(-1, os.WNOHANG)
+- except:
+- break
+- if not pid:
+- break
+-
+ def read_hosts(pathname):
+ """
+ Read hostfile with lines of the form: host[:port] [login]. Return
+ three arrays: hosts, ports, and users. These can be used directly
+ for all ssh-based commands (e.g., ssh, scp, rsync -e ssh, etc.)
++ Empty lines and lines where the first non-blank character is a
++ '#' character are ignored.
+ """
+ import re
+- f = open(pathname)
++ if pathname == "-":
++ f = open("/dev/stdin")
++ else:
++ f = open(pathname)
+ lines = f.readlines()
+ lines = map(lambda x: x.strip(), lines)
+ addrs = []
+@@ -24,7 +20,7 @@
+ ports = []
+ users = []
+ for line in lines:
+- if re.match("^\s+$", line) or len(line) == 0:
++ if re.match("^\s*(#|$)", line):
+ continue
+ fields = re.split("\s", line)
+ if len(fields) == 1: