<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to bugs</title><link href="https://sourceforge.net/p/pyssh/bugs/" rel="alternate"/><link href="https://sourceforge.net/p/pyssh/bugs/feed.atom" rel="self"/><id>https://sourceforge.net/p/pyssh/bugs/</id><updated>2007-08-02T15:30:01Z</updated><subtitle>Recent changes to bugs</subtitle><entry><title>File Descriptor Leak on /dev/pmtx</title><link href="https://sourceforge.net/p/pyssh/bugs/3/" rel="alternate"/><published>2007-08-02T15:30:01Z</published><updated>2007-08-02T15:30:01Z</updated><author><name>Danny Verstraeten</name><uri>https://sourceforge.net/u/divvy/</uri></author><id>https://sourceforge.nete41b45dea258bbba49c40547db9855212c6fee0b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;For each SSH session one file descriptor is leaked:&lt;/p&gt;
&lt;p&gt;# python&lt;br /&gt;
Python 2.2.3 (#1, Jun 12 2003, 09:31:58)&lt;br /&gt;
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2&lt;br /&gt;
Type "help", "copyright", "credits" or "license" for more information.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import pyssh&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; s=pyssh.Ssh()&lt;/p&gt;
&lt;p&gt;--- switching to terminal 2&lt;/p&gt;
&lt;p&gt;# ps -ef | grep python&lt;br /&gt;
root     12737 12730  0 10:59 pts/2    00:00:08 python /usr/lib/python2.2/site-packages/mpcsim/main.py&lt;br /&gt;
root     13592 13078  0 17:21 pts/6    00:00:00 python&lt;br /&gt;
root     13595 13137  0 17:21 pts/7    00:00:00 grep python&lt;br /&gt;
# lsof -p 13592 | grep ptmx | wc -l&lt;br /&gt;
0&lt;/p&gt;
&lt;p&gt;--- switching back to terminal 1&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; for i in range(10):&lt;br /&gt;
...     s.login()&lt;br /&gt;
...     s.logout()&lt;br /&gt;
...&lt;br /&gt;
User input required for ssh connection.&lt;br /&gt;
(login/logout spam)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;--- switching back to terminal 2&lt;/p&gt;
&lt;p&gt;# lsof -p 13592 | grep ptmx | wc -l&lt;br /&gt;
10&lt;/p&gt;
&lt;p&gt;Following patch fixes this:&lt;/p&gt;
&lt;p&gt;--- ptyext.orig.py      2007-08-02 17:27:13.000000000 +0200&lt;br /&gt;
+++ ptyext.py   2007-08-02 17:27:53.000000000 +0200&lt;br /&gt;
@@ -161,6 +161,8 @@&lt;br /&gt;
os.close(stdin_fd)&lt;br /&gt;
if stdout_fd &amp;gt; STDERR_FILENO:&lt;br /&gt;
os.close(stdout_fd)&lt;br /&gt;
+        if master_fd &amp;gt; STDERR_FILENO:&lt;br /&gt;
+            os.close(master_fd)&lt;/p&gt;
&lt;p&gt;def spawn(argv, master_read=_read, stdin_read=_read, stdin_fd=STDIN_FILENO,&lt;br /&gt;
stdout_fd=STDOUT_FILENO):&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>blocks forever in Ssh.close() if two or more instances used</title><link href="https://sourceforge.net/p/pyssh/bugs/2/" rel="alternate"/><published>2007-01-24T16:18:11Z</published><updated>2007-01-24T16:18:11Z</updated><author><name>Norbert Buchmüller</name><uri>https://sourceforge.net/u/userid-1700532/</uri></author><id>https://sourceforge.net21bb027536ce63b27891cfe01e7bf8a9b4aa10a2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;If you create more than one instances of pyssh,Ssh in the same process, then the process hangs when you close() any of them.&lt;/p&gt;
&lt;p&gt;The problem is that each instance registers a signal handler to handle SIGCHLD, so each of them sees the signal, and each of them calls a blocking os.waitpid() on the pid its own SSH process. When the first SIGCHLD arrives, all the instances call a blocking os.waitpid(), even those which do not expect their SSH subprocess to exit.&lt;/p&gt;
&lt;p&gt;The solution is to use a nonblocking os.waitpid() call.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>fssa.py tries to stat everything in /tmp</title><link href="https://sourceforge.net/p/pyssh/bugs/1/" rel="alternate"/><published>2006-09-22T16:52:14Z</published><updated>2006-09-22T16:52:14Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net2bbc000bead9c5ca3bfd45329a38ce05280d316f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Basically, fssa.py fails occassionaly when it tries to&lt;br /&gt;
stat things that it shouldn't. The following patch is a&lt;br /&gt;
fix.&lt;/p&gt;
&lt;p&gt;13a14,15&lt;br /&gt;
&amp;gt; import glob&lt;br /&gt;
&amp;gt;&lt;br /&gt;
31,36c35,39&lt;br /&gt;
&amp;lt;         for filename in os.listdir('/tmp'):&lt;br /&gt;
&amp;lt;             file_stat = os.stat("/tmp/%s" % (filename))&lt;br /&gt;
&amp;lt;             if file_stat[stat.ST_UID] == os.getuid() \
&amp;lt;             and stat.S_ISDIR(file_stat[stat.ST_MODE]) \
&amp;lt;             and filename.find('ssh-') == 0:&lt;br /&gt;
&amp;lt;                 candidate_dirs.append("/tmp/%s" %&lt;br /&gt;
filename)&lt;br /&gt;
---&lt;br /&gt;
&amp;gt;         for filename in glob.glob('/tmp/ssh-*'):&lt;br /&gt;
&amp;gt;             file_stat = os.stat(filename)&lt;br /&gt;
&amp;gt;             if (file_stat[stat.ST_UID] == os.getuid() and&lt;br /&gt;
&amp;gt;                 stat.S_ISDIR(file_stat[stat.ST_MODE])):&lt;br /&gt;
&amp;gt;                 candidate_dirs.append(filename)&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>