Commit Graph

929 Commits

Author SHA1 Message Date
Jeff Forcier 777d1576ca Bump dev version 2013-04-28 19:01:40 -07:00
Jeff Forcier d0c7a5d884 Merge branch 'master' of github.com:paramiko/paramiko 2013-04-28 18:50:37 -07:00
Jeff Forcier b33d9c7bca Merge branch '1.10' 2013-04-28 18:41:15 -07:00
Jeff Forcier b2b8d5d0a6 Add explicit link to updated API docs. Fixes #160 2013-04-28 18:41:10 -07:00
Jeff Forcier 0b9393b063 Merge pull request #155 from Baconator507/patch-1
Update demo.py
2013-04-28 18:38:27 -07:00
Jeff Forcier f00f87c9be Merge branch '1.10' 2013-04-28 18:10:15 -07:00
Ethan Glasser-Camp 8c7f120c2c Warn on parse failure when reading known_hosts 2013-04-28 18:10:02 -07:00
Jeff Forcier 675d79d743 Merge pull request #153 from glasserc/log_bad_hostkeys
Warn on parse failure when reading known_hosts
2013-04-28 18:08:55 -07:00
Ethan Glasser-Camp aee2355d24 Warn on parse failure when reading known_hosts 2013-04-28 14:21:05 -04:00
Jeff Forcier a1fa1ba9cc Merge branch '1.10'
Conflicts:
	NEWS
2013-04-27 22:15:07 -07:00
Jeff Forcier 3966ac103c Changelog re #146 (also start 10.10.2 section) 2013-04-27 22:12:24 -07:00
Abhinav Upadhyay e6c23f23f4 Fix indentation at few places. 2013-04-27 22:08:50 -07:00
Jeff Forcier f861c2ff48 Back out broken but non-required hostname hash change 2013-04-27 20:55:50 -07:00
Jeff Forcier 6747d9944a Changelog re #87 2013-04-27 20:50:29 -07:00
Mike Gabriel 1b928df15e do not write ,,garbage'' to known_hosts file(s) 2013-04-27 20:36:45 -07:00
Mike Gabriel 81f87f1d5e Load host entries from the known_hosts file(s) before writing the file from RAM to disk. Avoids loss of host entries in case other SSH clients have written to the known_hosts file(s) meanwhile. 2013-04-27 20:36:45 -07:00
Mike Gabriel 080bece258 Assure that host entries in known_hosts files do not duplicate endlessly if keys from known_hosts are loaded via HostKeys.load() more than once (e.g. for refreshing the list of known hosts during runtime). 2013-04-27 20:36:45 -07:00
Mike Gabriel 4f481a57a2 Store hostname hashes in memory rathen than the non-hashed host entries. Also assures that the host entries in known_hosts get saved in hashed format as it is currently standard in OpenSSH. 2013-04-27 20:36:45 -07:00
Steven Noonan 5c124cb136 un-break Python 2.5 compatibility by using isAlive() instead of is_alive()
Python's documentation has a bug[1], in that it doesn't correctly annotate
is_alive as being a function introduced in Python 2.6.

[1] http://bugs.python.org/issue15126

Signed-off-by: Steven Noonan <snoonan@amazon.com>
2013-04-11 16:27:49 -07:00
Frank Arnold 068bf63cf0 transport: Wait for thread termination before closing the socket
Make sure the Thread.run() method has terminated before closing the
socket. Currently, the socket is closed through Packetizer.close(),
which happens too early. Move the socket.close() into Transport.close()
and after the Thread.join() call.

While at it, modify the stop_thread() method and use it in
Transport.close() to avoid code duplication. Use join() with a timeout
to make it possible to terminate the main thread with KeyboardInterrupt.
Also, remove the now obsolete socket.close() from Transport.atfork().

This fixes a potential infinite loop if paramiko.SSHClient is connected
through a paramiko.Channel instead of a regular socket (tunneling).

Details:

Using a debug patch to dump the current stack of the thread every
couple of seconds while trying to close it, I've seen the following
over and over again:

Thread could not be stopped, still running.
Current traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 524, in __bootstrap
    self.__bootstrap_inner()
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File ".../paramiko/transport.py", line 1564, in run
    self._channel_handler_table[ptype](chan, m)
  File ".../paramiko/channel.py", line 1102, in _handle_close
    self.transport._send_user_message(m)
  File ".../paramiko/transport.py", line 1418, in _send_user_message
    self._send_message(data)
  File ".../paramiko/transport.py", line 1398, in _send_message
    self.packetizer.send_message(data)
  File ".../paramiko/packet.py", line 319, in send_message
    self.write_all(out)
  File ".../paramiko/packet.py", line 248, in write_all
    n = self.__socket.send(out)
  File ".../paramiko/channel.py", line 732, in send
    self.lock.release()

The thread was running Packetizer.write_all() in an endless loop:

while len(out) > 0:
    ...
    n = Channel.send(out) # n == 0 because channel got closed
    ...
    out = out[n:]         # essentially out = out

Signed-off-by: Frank Arnold <farnold@amazon.com>
2013-04-11 16:14:21 -07:00
Ivan Barria b96e7e4132 Update demo.py
why import threading?
2013-04-09 02:14:51 -03:00
Jeff Forcier b329512636 Merge branch '1.10'
Conflicts:
	NEWS
2013-04-05 13:02:11 -07:00
Jeff Forcier 02d071be07 Bump version to 1.10.1 2013-04-05 13:00:19 -07:00
Jeff Forcier 1d494eb0db Changelog re #154 2013-04-05 12:58:44 -07:00
Kevin Tegtmeier 2e2a915807 Fix bug that leaves fds in select after EOF received 2013-04-05 11:54:48 -07:00
Jeff Forcier 73a0d03bdc Merge branch '1.10'
Conflicts:
	NEWS
2013-04-05 11:51:47 -07:00
Jeff Forcier 17ba0d5b61 Dumb format tweak to NEWS 2013-04-05 11:51:19 -07:00
Jeff Forcier 2a774d1e8a Merge branch '1.10' into 143-int 2013-04-05 11:41:33 -07:00
Jeff Forcier 9695747875 Merge branch '1.10' 2013-04-05 10:10:06 -07:00
Jeff Forcier 5c9aa3dcdc Merge branch '1.9' into 1.10 2013-04-05 10:10:02 -07:00
Jeff Forcier 2e069824ed Remove pointless & outdated version/release crap from README 2013-04-05 10:09:58 -07:00
Ethan Glasser-Camp ebdbfae5b1 Hook up ECDSA to hostkeys
More sophisticated key negotiation is still necessary in the case
where we have an ECDSA key for the server and it offers us both RSA
and ECDSA. In this case, we will pick RSA and fail because we don't
have it. Instead, we should pick ECDSA. Still, this works if you tell
your server to only offer ECDSA keys :)
2013-03-25 12:19:29 -04:00
Ethan Glasser-Camp 632129c427 Introduce ECDSA
This just adds tests; hooking this up with paramiko comes in the next
commit.
2013-03-25 12:19:21 -04:00
Jeff Forcier 0392e3df8f Shuffle changelog 2013-03-19 13:37:55 -07:00
Jeff Forcier a7ee2509e4 Merge branch 'master' into 112-int
Conflicts:
	paramiko/win_pageant.py
2013-03-19 13:36:52 -07:00
Jeff Forcier d5db603297 Move changelog re #100 to new release chunk 2013-03-19 13:25:25 -07:00
Jason R. Coombs 0cc6bb970f Updated NEWS 2013-03-19 13:24:31 -07:00
Jason R. Coombs c305691492 Remove dependency on pywin32. Just use ctypes for simplicity. 2013-03-19 13:24:31 -07:00
Jason R. Coombs 9858ccf207 Remove test for presence of ctypes (assumed present in global imports). 2013-03-19 13:24:31 -07:00
Jason R. Coombs abe009b149 Update NEWS per #142 2013-03-04 08:49:47 -05:00
Jason R. Coombs 3cd7f585d0 Remove 'file_size' check from tests. The docstring indicates this parameter is to be passed to the callback, and there's no reason to think this parameter is relevant in affecting whether a useful stat object has been passed (especially when the 'confirm' parameter is explicitly supplied for that decision. This fixes #142. 2013-03-04 08:46:39 -05:00
Jason R. Coombs a3fe422198 Adding test capturing desired behavior and demonstrating issue #142. 2013-03-04 08:45:00 -05:00
Jason R. Coombs 3a9119d78a Delint test_sftp (remove unused imports and unused variables, remove excess whitespace, move imports to top, remove semicolon terminator)
--HG--
extra : source : 01df712a396de5fa7e1c0cc265411fdb2bbc5f41
2013-03-04 08:17:22 -05:00
Jeff Forcier 721f74d8c2 Changelog re #66, re #141. Fixes #66 2013-03-01 12:01:35 -08:00
Olle Lundberg bd1a97a045 Speed up the write operation by bulk calling read.
Bulk check the ACKs from the server every 32MB
(or every write request). This way you gain speed
but also making sure not to get the error too late
in a large transfer.
This works for smaller files too, since there is a
cleanup routine being called when the file has been transfered.
2013-03-01 11:39:13 -08:00
Jeff Forcier dd7edd8ec8 Changelog re #133, and date fix for 1.10 2013-03-01 10:34:35 -08:00
Phillip Heller edc9eaf4f2 Added width_pixel and height_pixel parameters to Channel.get_pty() and
resize_pty(), and Client.invoke_shell().  Perhaps useless, but more RFC
compliant.  Updated methods to include these parameters in server messages.

Adjusted Channel.resize_pty() to neither request nor wait for a response, as
per RFC 4254 6.7 (A response SHOULD NOT be sent to this message.)  This is
necessary as certain hosts have been observed to not acknowledge this type of
channel request (Cisco IOS XR), which causes paramiko to end the session.
2013-03-01 10:33:03 -08:00
Jeff Forcier 277526315e Changelog re #93 2013-03-01 09:42:09 -08:00
Olle Lundberg 1903ee1432 Pep8 fixes 2013-02-28 12:52:01 +01:00
Olle Lundberg 732417bf98 Merge branch 'openssh-compatibility' of github.com:lndbrg/paramiko into openssh-compatibility
Conflicts:
	paramiko/config.py
	tests/test_util.py
2013-02-28 12:51:00 +01:00