Commit Graph

670 Commits

Author SHA1 Message Date
Jeff Forcier f40bf59ff3 Source ordering updates for Transport 2014-02-21 10:25:56 -08:00
Jeff Forcier be4007fb89 Docstring tweak 2014-02-21 10:25:45 -08:00
Jeff Forcier eb332c781b Reorganize Client so API doc flows better 2014-02-21 10:21:19 -08:00
Jeff Forcier 3b0df60b6a This handily explains why everything was really confusing in autodoc 2014-02-14 16:49:29 -08:00
Jeff Forcier 6cdb8291b7 Merge branch '1.10' into sphinx-256 2014-02-14 12:10:02 -08:00
Jeff Forcier 4e9af2f7ca Merge branch '1.10' into 1.11
Conflicts:
	sites/www/changelog.rst
2014-02-14 11:53:59 -08:00
Jeff Forcier 9d7aeff7b1 Use constant time hash comparisons for improved security.
See e.g. http://codahale.com/a-lesson-in-timing-attacks/

Mega thanks to Alex Gaynor for the original patch.
2014-02-14 11:52:00 -08:00
Jeff Forcier 4a5f007c02 Cut 1.11.4 2014-02-14 09:38:14 -08:00
Jeff Forcier 457a34f55b Cut 1.10.6 2014-02-14 09:36:33 -08:00
Jeff Forcier d438ff6b64 Don't raise timeouts as ProxyCommand failures, thanks @mgedmin 2014-02-13 13:44:46 -08:00
Jeff Forcier 4402f67fa6 Don't drop/lose data when our inner timeout goges off. 2014-02-13 13:44:27 -08:00
Jeff Forcier 244e09f57a Slightly safer socket.error handling 2014-02-13 12:54:23 -08:00
Marius Gedminas cfd1efe648 Fix NameError in error-handling case
Fixes #268
2014-02-13 09:38:00 -08:00
Jeff Forcier 58489c893e Potentially horrible attempt at manual subprocess-read timeouts 2014-02-12 17:16:34 -08:00
Jeff Forcier 5b6059c4bd Nuke old merge mistake (or what looks like one anyway.) 2014-02-12 09:48:04 -08:00
Jeff Forcier 36b937d436 Merge branch '1.10' into 1.11 2014-02-11 09:48:00 -08:00
Jeff Forcier 675e30986e Clean up a list-comp (also fixes race condition) 2014-02-11 08:06:14 -08:00
Jeff Forcier 280c240685 Whitespace 2014-02-10 18:11:29 -08:00
Jeff Forcier aed86f26bf Future import for with: under py25 2014-02-10 18:10:52 -08:00
Jeff Forcier 1560c4ab8a Merge remote-tracking branch 'ewxrjk/issue34' into sftp-reordering-34 2014-02-10 17:59:52 -08:00
Olle Lundberg 24635609dc Epydoc -> Sphinx. 2014-01-23 11:32:59 +01:00
Jeff Forcier 2cf23bf784 Merge branch '1.10' into 1.11
Conflicts:
	NEWS
2014-01-21 13:58:44 -08:00
Jeff Forcier a7ea04842e Clean up thread ident import/exec a bit. 2014-01-21 13:51:09 -08:00
Aarni Koskela 39809dab31 Try Py2.5 compatibility as last fallback for thread identity. 2014-01-21 13:31:45 -08:00
Aarni Koskela b0c689d7c8 Support Py2.5 to Py3.4 for thread identity (thanks @lndbrg) 2014-01-21 13:31:43 -08:00
Aarni Koskela d32d457775 Fix agent auth on Windows/Python 2.5) (with thanks to @lndbrg) 2014-01-21 13:31:25 -08:00
Aarni Koskela d8738b1b0f Fix #193 (use RtlMoveMemory instead of msvcrt.memcpy) 2014-01-21 13:30:32 -08:00
Jeff Forcier 1ff3db96f6 Cut 1.11.3 2014-01-08 16:41:04 -08:00
Jeff Forcier 698adf10fb Cut 1.10.5 2014-01-08 16:40:11 -08:00
Jeff Forcier b352357efb Merge branch '1.10' into 1.11
Conflicts:
	NEWS
2014-01-08 13:43:03 -08:00
Nathan Scowcroft 0fea895cdb ditto 2014-01-08 12:45:22 -08:00
Nathan Scowcroft a1c1f8f29f Check correct stored hosts filename. 2014-01-08 12:45:14 -08:00
Jeff Forcier 75c4304fe2 Merge branch '1.10' into 1.11
Conflicts:
	paramiko/__init__.py
2013-10-16 17:00:46 -07:00
Jeff Forcier 3232ce84ed Merge branch '1.9' into 1.10
Conflicts:
	paramiko/__init__.py
2013-10-16 17:00:33 -07:00
Jeff Forcier 858d3fd07f Merge branch '1.8' into 1.9
Conflicts:
	paramiko/__init__.py
2013-10-16 17:00:13 -07:00
Mike Gabriel 6b222528f3 Reintroduce __version_info__ variable
At least one application (mysql-workbench) (used to) use(s) the __version_info__
that got removed by commit 99859b8b02.

Breaking existing software with new versions of paramiko should be avoided.
This pull-request reintroduces the __version_info__ var, but fills it
from the __version__ var. No need to maintain multiple version strings.

Conflicts:
	paramiko/__init__.py
2013-10-16 16:59:35 -07:00
Jeff Forcier 96fdefbcb9 Merge branch '1.10' into 1.11
Updated versions for 1.11.2.

Conflicts:
	paramiko/__init__.py
	setup.py
2013-09-27 22:00:32 -07:00
Jeff Forcier f2466a3d46 Update version for 1.10.4 2013-09-27 21:59:48 -07:00
Jeff Forcier 07e61c3552 Merge branch '1.10' into 1.11 2013-09-27 21:29:56 -07:00
Jeff Forcier e25c7c4bdf Merge branch '1.9' into 1.10 2013-09-27 21:29:51 -07:00
Jeff Forcier 2de9c72720 Merge branch '1.8' into 1.9 2013-09-27 21:29:41 -07:00
Jeff Forcier 83f44878ea Fixed a typo in the license header of most files
Conflicts:
	paramiko/proxy.py
2013-09-27 21:29:18 -07:00
Jeff Forcier cba4c68365 Merge branch '1.11' into 156-int 2013-09-27 17:30:34 -07:00
Jeff Forcier 7243f8fe90 Merge branch '1.10' into 1.11
Conflicts:
	NEWS
2013-09-27 16:15:31 -07:00
Jeff Forcier 05abcc40f5 Fix #179 - missing host variable in fqdn evaluation 2013-09-27 16:08:59 -07:00
Jeff Forcier bea7d9dc8a Christ almighty I hate non-DRY versioning 2013-09-20 18:01:42 -07:00
Jeff Forcier e2aa7c17b0 Merge branch '1.10' into 1.11
Conflicts:
	NEWS
2013-09-20 14:47:09 -07:00
Jeff Forcier 02387fc88c Merge branch '1.10' into 168-int
Conflicts:
	NEWS
	setup.py
2013-09-20 14:39:55 -07:00
Jeff Forcier 0355672721 Merge branch '1.10' into 1.11
Conflicts:
	NEWS
2013-09-20 13:45:18 -07:00
Jeff Forcier 565eff8274 Apply slightly modified version of patch from #162 2013-09-20 13:19:01 -07:00
Jeff Forcier 2a08a48dd2 Version bump/dumb-fix 2013-07-26 15:07:33 -07:00
Jeff Forcier d2c71ed999 Merge branch '1.10'
Conflicts:
	NEWS
	setup.py
2013-07-26 15:06:58 -07:00
Jeff Forcier 965d00dee9 Version bump 2013-07-26 15:05:35 -07:00
Jeff Forcier ba3ce80c14 Add ML link to docs 'index'
Fixes #48
2013-06-28 13:07:19 -07:00
Emre Yılmaz 3399d519e0 updated config to be compatible with multiple localforward and remoteforward options. 2013-05-21 00:40:28 +03:00
Jeff Forcier d77a4d6421 Merge branch '1.10' 2013-05-05 13:59:41 -07:00
Jeff Forcier 3c2f01c91f Flip bad known_hosts line to INFO from WARN re #153 2013-05-05 13:59:34 -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
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
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
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
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 a7ee2509e4 Merge branch 'master' into 112-int
Conflicts:
	paramiko/win_pageant.py
2013-03-19 13:36:52 -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 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
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
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
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
Olle Lundberg 06f9704820 Pep8 fixes 2013-02-28 12:45:07 +01:00
Olle Lundberg 93dce43e86 Fix argument passed to LazyFqdn 2013-02-28 12:36:21 +01:00
Olle Lundberg f41fc8fd28 Create a copy of the identityfile list.
The copy is needed else the original
identityfile list is in the internal
config list is updated when we modify
the return dictionary.
2013-02-28 12:31:59 +01:00
Olle Lundberg ea3c3f53b6 DRY up the code for populating the return list 2013-02-28 12:14:59 +01:00
Olle Lundberg c79e6a3f92 Whitespace fixes. 2013-02-28 12:14:59 +01:00
Olle Lundberg 32424ba109 Be more pythonic. 2013-02-28 12:11:41 +01:00
Olle Lundberg ac1310c4a1 Implement support for parsing proxycommand. 2013-02-28 12:11:41 +01:00
Olle Lundberg 42d77483e8 Pep8 fixes 2013-02-28 12:10:55 +01:00
Olle Lundberg 85551dffd6 Spelling 2013-02-28 12:08:59 +01:00
Olle Lundberg 57d776b318 Add host negation support to paramiko config.
This is a rewrite of the SSHConfig class to
conform with the rules specified by the
manpage for ssh_config.
This change also adds support for negation
according to the rules introduced by
OpenSSH 5.9. Reference:
http://www.openssh.com/txt/release-5.9
2013-02-28 12:08:59 +01:00
Jeff Forcier 3563fca994 Refactor duplicative code re #110 2013-02-27 19:54:22 -08:00
John Hensley 9d2fb82284 Document SSHConfig FQDN logic.
Merged with pre-picked changes re #128.

Conflicts:
	paramiko/config.py
2013-02-27 19:48:50 -08:00
Parantapa Bhattacharya 2f1daad1b9 Compute host's FQDN on demand only 2013-02-27 19:03:49 -08:00
Jeff Forcier 7e5911a1ff Give sdctr a default value for backwards+test compat
Re #102
2013-02-27 18:50:37 -08:00
Kent Gibson adad068b13 Don't random pad packets for SDCTR ciphers 2013-02-27 18:47:04 -08:00
Jeff Forcier 8e697988af Changelog + docs re #127 2013-02-27 15:56:09 -08:00
Jeff Forcier a69abd4606 Merge pull request #127 from mwilliamson/sftp-file-context-manager
Turn SFTPFile into a context manager
2013-02-27 15:50:48 -08:00
Jeff Forcier 37d0247301 Merge pull request #116 from mvschaik/patch-1
Limit memory allocation of get_bytes to 1MB
2013-02-27 15:31:20 -08:00
Jeff Forcier 6b5d748358 Merge pull request #115 from mvanderkolff/master
Add get_pty named argument to SSHClient.exec_command()
2013-02-03 12:53:35 -08:00