Commit Graph

583 Commits

Author SHA1 Message Date
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
Jeff Forcier 0c56e2a40b Merge branch '1.9' 2013-02-03 11:52:36 -08:00
Jeff Forcier 6284666cfd Merge branch '1.8' into 1.9 2013-02-03 11:52:30 -08:00
Jeff Forcier bf87cd124d Update explicitly-stated Python version reqs to 2.5+ 2013-02-03 11:52:11 -08:00
Michael Williamson 602250fdf9 Turn SFTPFile into a context manager 2013-01-04 23:43:15 +00:00
Jason R. Coombs 6c4c00a3f3 Merge changes from no_pywin32 2012-12-02 07:12:37 -05:00
Jason R. Coombs 7bde7840dd Merge with master 2012-12-02 06:48:32 -05:00
Jason R. Coombs 9f21d36040 Restore Python 2.5 compatibility w.r.t with statement. 2012-11-30 20:26:21 -05:00
Maarten 3bbcf808d8 Limit memory allocation of get_bytes to 1MB
If get_bytes() can pad unlimited, a RSA pub key could be crafted
that would allocate GB's of nulls, thereby forming a DoS-vector.
2012-11-30 15:14:49 +01:00
Michael van der Kolff cd51bfc031 Add support for get_pty to SSHClient.exec_command() 2012-11-30 22:02:09 +11:00
Jeff Forcier 2cbe383080 Apply put() version of #90 2012-11-29 16:16:35 -08:00
Eric Buehl 9c0d467667 allow uploading of files from an open file object 2012-11-29 16:09:47 -08:00
Jeff Forcier 531606b0d6 Revert "Make send() and recv() fail when channel is closed"
This reverts commit 23f3099b6f.
2012-11-29 15:19:56 -08:00
Jeff Forcier 2223aa10cc Revert "Forgot to import errno"
This reverts commit 668870aa83.
2012-11-29 15:19:50 -08:00
Jeff Forcier 287f9c3423 Revert "Forgot to import errno"
This reverts commit 203c7379ac.
2012-11-29 15:19:15 -08:00
Jeff Forcier bda161330f Revert "Make send() and recv() fail when channel is closed"
This reverts commit 8496eff0b7.
2012-11-29 15:19:07 -08:00
Jeff Forcier 682a3eff84 Revert "Forgot to import errno"
This reverts commit 537f95dbb3.
2012-11-29 15:18:48 -08:00
Jeff Forcier 7a4d3c4e42 Revert "Make send() and recv() fail when channel is closed"
This reverts commit bc3674d0f0.
2012-11-29 15:18:40 -08:00
Tomer Filiba 203c7379ac Forgot to import errno 2012-11-29 14:55:34 -08:00
Tomer Filiba 8496eff0b7 Make send() and recv() fail when channel is closed
``sendall()`` was checking if the channel has been closed,
and failed accordingly, but ``send()`` and ``recv()`` did not.
This meant that ``chan.send("foo")`` when the channel was already
closed, just blocked forever.
2012-11-29 14:55:31 -08:00
Tomer Filiba 537f95dbb3 Forgot to import errno 2012-11-29 14:38:33 -08:00
Tomer Filiba bc3674d0f0 Make send() and recv() fail when channel is closed
``sendall()`` was checking if the channel has been closed,
and failed accordingly, but ``send()`` and ``recv()`` did not.
This meant that ``chan.send("foo")`` when the channel was already
closed, just blocked forever.
2012-11-29 14:38:23 -08:00
Jeff Forcier 962d4a3cec Merge pull request #99 from tomerfiliba/patch-1
Make send() and recv() fail when channel is closed
2012-11-29 14:35:19 -08:00
Jeff Forcier b9c39fc1d2 Merge pull request #95 from Bockit/master
Add a closed property to BufferedFile
2012-11-29 08:53:53 -08:00
Jeff Forcier 2575b3efc4 Fix #94 2012-11-29 08:52:39 -08:00
Jeff Forcier 2403504b44 Fix #113: add timeout passthru to exec_command 2012-11-28 22:22:33 -08:00
Jeff Forcier 10c51e2726 Bump dev version to 1.10 2012-11-28 22:18:44 -08:00
Jason R. Coombs 13892788c3 Copied code from jaraco.windows rather than requiring it as a dependency. 2012-11-23 14:15:33 -05:00
Jason R. Coombs c0ef3fd493 Create the memory map with the security attributes for the current user (rather than the default) to avoid permissions failures when the client and the agent run in different UAC contexts. Fixes #98. 2012-11-23 14:08:16 -05:00
Jason R. Coombs 0698254b18 Use MemoryMap from jaraco.windows in lieu of mmap.mmap. 2012-11-23 14:03:20 -05:00
Jason R. Coombs 64d6734086 Simplify pageant implementation by using an anonymous mmap instead of an explicit file. Requires Python 2.5. 2012-11-23 13:07:28 -05:00
Olle Lundberg a07a339006 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.
2012-11-20 12:43:40 +01:00
Olle Lundberg 78654e82ec DRY up the code for populating the return list 2012-11-20 00:45:32 +01:00
Jeff Forcier 7f4c26f860 Cut 1.8.1 2012-11-06 13:08:41 -08:00
Jeff Forcier a3b44c7ed9 Bump to 1.9.0 for release 2012-11-06 13:06:08 -08:00
Jeff Forcier ebd007b217 Python 2.5 compat 2012-11-05 23:10:13 -08:00
Jeff Forcier e7ab3c068f Fix broken import 2012-11-05 23:10:05 -08:00
Jeff Forcier 308c5f57d9 Add ProxyCommand classes to top level API 2012-11-05 23:09:52 -08:00
Jeff Forcier fd392d6b20 One more patch from @clarete's work 2012-11-05 17:47:33 -08:00
Jeff Forcier 191a5fc08c Implement (& test for) ProxyCommand interpolation.
Forgot this earlier.
2012-11-05 17:44:25 -08:00
Jeff Forcier 0981c25cd8 Formatting 2012-11-05 17:35:06 -08:00
Jeff Forcier 0a276ac34b Bubble up ProxyCommandFailure in packetizer 2012-11-05 17:31:17 -08:00
Jeff Forcier 394ab2699e Post-import edits 2012-11-05 17:29:32 -08:00
Jeff Forcier 5d15467ad4 Import BadProxyCommand 2012-11-05 17:29:23 -08:00
Jeff Forcier 27271fa455 Post-import edits 2012-11-05 17:26:47 -08:00
Jeff Forcier 7cd2f2715b Initial port of ProxyCommand class from @clarete 2012-11-05 17:25:03 -08:00
Jeff Forcier 270bb94a46 Fix ProxyCommand equals splitting.
Uses regex approach from @lndbrg
2012-11-05 17:18:48 -08:00
Jeff Forcier f9b7ce902f Tweak docstring re #77 2012-11-05 13:30:56 -08:00
Steven Noonan 31ea4f0734 SSHClient: add 'sock' parameter to connect() for tunneling
Re #77

This parameter, if set, can be used to make Paramiko wrap an existing socket
connected to a remote SSH server. For instance, you could set up another
SSHClient directly connected to a "gateway" host, and then create a direct-tcpip
tunnel to a "target" host directly accessible from the gateway's perspective
(e.g. think of trying to establish an SSH connection to hosts behind a NAT).
The gateway host would then establish a TCP connection to the target host
directly, and a channel is exposed on the client side. This channel could be
wrapped by an SSHClient class using the connect() function, avoiding the need
to establish a new TCP connnection.

This effectively allows you to create tunneled SSH connections.

Based on work by Oskari Saarenmaa <os@ohmu.fi>, in Paramiko pull request #39.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2012-11-05 13:30:48 -08:00
Jason R. Coombs 45aa88b530 Remove dependency on pywin32. Just use ctypes for simplicity. 2012-11-01 10:09:41 -04:00
Jason R. Coombs e0d71b5efb Remove test for presence of ctypes (assumed present in global imports). 2012-11-01 10:03:46 -04:00
Tomer Filiba 668870aa83 Forgot to import errno 2012-10-26 15:46:28 +03:00
Tomer Filiba 23f3099b6f Make send() and recv() fail when channel is closed
``sendall()`` was checking if the channel has been closed, 
and failed accordingly, but ``send()`` and ``recv()`` did not.
This meant that ``chan.send("foo")`` when the channel was already
closed, just blocked forever.
2012-10-26 15:44:34 +03:00
James Hiscock c78a5856e8 Update paramiko/file.py
Added a closed property as an alternative accessor to BufferedFile's _closed property.
2012-10-17 14:25:22 +12:00
Olle Lundberg 04cc4d5510 Be more pythonic. 2012-10-16 16:54:44 +02:00
Olle Lundberg 7ce9875ed7 Implement support for parsing proxycommand. 2012-10-16 16:38:38 +02:00
Olle Lundberg b22c11ab1b Pep8 fixes 2012-10-16 15:00:08 +02:00
Olle Lundberg 2dd74f953d Spelling 2012-10-16 14:52:27 +02:00
Olle Lundberg ad587fa0ef 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
2012-10-16 13:57:05 +02:00
Jeff Forcier 1341e28882 Move SFTPClient.get() termination condition to loop end.
Ensures callback always executes even for zero-len files.

Fixes #90
2012-10-14 21:46:50 -07:00
Jeff Forcier 2e016358ef Whitespace + lang tweak 2012-09-25 18:09:35 -07:00
Jeff Forcier 30a2d14b78 Init header update 2012-09-25 18:05:01 -07:00
Jeff Forcier dd6fb2577d Bump to 0.8.x due to nontrivial changes
(cherry picked from commit d7def60c4784fed39fc8714753304a150da131c7)

Conflicts:
	setup.py
2012-09-24 19:00:19 -07:00
Jeff Forcier 3c01fdda14 Fix #28: hide interpreter-death threading exceptions
(cherry picked from commit 3709d2e02bf67ccc272e1f2311e5db125a922ba0)
2012-09-24 18:59:54 -07:00
Jeff Forcier 66118cad83 Improve unknown-server exception language
Fixes #11
(cherry picked from commit 01ab79211c3aeeb8dd55dafff3ce7b3a77844ca6)
2012-09-24 18:58:59 -07:00
Douglas Turk 681a465f32 Handle/fix handling of EINTR errors in a few places.
(cherry picked from commit 351bdb72e539c373985e108c89f61839f3acdd2a)

Conflicts:
	paramiko/agent.py
	paramiko/client.py
	paramiko/transport.py
2012-09-24 18:58:54 -07:00
Jeff Forcier 7ead8d9c70 Fix unbound local variable exception
(cherry picked from commit 503d7e62602cfe3ed63a4f44fba12874a17aa199)
2012-09-24 18:56:45 -07:00
Andrew 38dec6fc5b - make sure we honor 2-factor for all auth_pkey blocks
- explicit check for ['password'] as remaining auth type
(cherry picked from commit 53a3421da6d74333c4679fd6289d418917833b44)
2012-09-24 18:54:30 -07:00
Andrew b592eb1074 make sure to break out of key auth loop on success when doing 2-factor
(cherry picked from commit 0a4aa8a9d119022adef3b8d89f129ea26110fc1a)
2012-09-23 16:46:07 -07:00
Andrew 33176b90f7 add support for 2 factor authentication (key+password)
(cherry picked from commit be19c273bbe77d58fd67edeabf344ff253997b23)
2012-09-23 16:46:06 -07:00
Thomas Vander Stichele 01aaf70fc2 show us the offending host key
(cherry picked from commit a753df8ea43c26114942147fde2f10f82da5ca29)
2012-09-23 16:45:53 -07:00
Jan Brauer 7f526044e0 re #33 - fix typo, be more pythonic
(cherry picked from commit 803820c3c8b1aaf2a11588431582916dbb23ea1e)
2012-09-23 16:45:51 -07:00
Jan Brauer d18b8cf1e9 Fix #33 - parse config as described by manpage
(cherry picked from commit 011805eae07ee7be6140b95f6d8669763c55b3d9)
2012-09-23 16:45:49 -07:00
Jeff Forcier 01735419f3 Bump to 1.7.14
(cherry picked from commit c3a7e9d587)

Conflicts:
	setup.py
2012-09-23 16:20:01 -07:00
Jeff Forcier 077fdae801 Reorganize forwarded agent cxns to avoid errors
Fixes [Fabric #562](https://github.com/fabric/fabric/issues/562).
(cherry picked from commit 58aa52085b)
2012-09-23 16:19:42 -07:00
Jeff Forcier 1a033dc596 safe type checking (isinstance instead of type-is)
Maintainer note: added changelog entry.
(cherry picked from commit 8917d83221)
2012-09-23 16:19:40 -07:00
Olle Lundberg 6b8284640e Add support for variable expansion in SSHConfig
(cherry picked from commit 31482a46d6)
2012-09-23 16:19:31 -07:00
Olle Lundberg 697524a79f Add basic support for parameter substitution in SSHConfig.
(cherry picked from commit fb24d79695)
2012-09-23 16:19:29 -07:00
Bobby Impollonia bd5c843040 Replace hard tabs with spaces
(cherry picked from commit c07eddb9e1)
2012-09-23 16:18:56 -07:00
Jeff Forcier 11ca8134a2 Cut 1.7.13
(cherry picked from commit 998377f353)

Conflicts:
	setup.py
2012-09-23 16:11:18 -07:00
Jeff Forcier 9c5791edb8 Fixes #4, thanks again to @jaraco
(cherry picked from commit b59430efef)
2012-09-23 16:10:52 -07:00
Jeff Forcier 9b2f36fc1f Whitespace tweaks, thanks @jaraco
(cherry picked from commit 3b20efcc14)
2012-09-23 16:10:50 -07:00
Jeff Forcier 1882f3470b Move fcntl import to avoid high level ImportErrors on Windows
Fixes #5.
(cherry picked from commit ec2aedac71)
2012-09-23 16:10:42 -07:00
Jeff Forcier ac7f513ee8 Release 1.7.12
(cherry picked from commit c630917d0d)

Conflicts:
	paramiko/__init__.py
	setup.py
2012-09-23 16:09:44 -07:00
Jeff Forcier 0916fbe292 Forgot to re-add import, derp
(cherry picked from commit 474ace1ca4)
2012-09-23 16:08:39 -07:00
Jeff Forcier 3d598a64b4 Add IO sleep to agent forward communications.
Without this, use of agent forwarding causes
high CPU usage on some clients.
(cherry picked from commit 3030589aaa)

Conflicts:
	paramiko/agent.py
2012-09-23 16:08:35 -07:00
Jeff Forcier d3b48e9b44 Bump to 1.7.11
(cherry picked from commit 9234baed01)

Conflicts:
	paramiko/__init__.py
	setup.py
2012-09-23 16:07:03 -07:00