Commit Graph

583 Commits

Author SHA1 Message Date
Robey Pointer 920b172360 [project @ robey@lag.net-20070326075819-y7972z9cy3ffmw76]
expose PKey for documentation, so inherited methods can be seen in DSSKey and RSAKey
2007-03-26 00:58:19 -07:00
Robey Pointer 6b71c642d1 [project @ robey@lag.net-20070218212332-ufb5mk2ne0bzamx5]
oops, fix doc typo
2007-02-18 13:23:32 -08:00
Robey Pointer cb0e01dd86 [project @ robey@lag.net-20070218212228-qdk8w1n4is0cady3]
bump version to 1.7 zubat
2007-02-18 13:22:28 -08:00
Robey Pointer 83b335e10f [project @ robey@lag.net-20070213191706-v8djxd4jiunb3his]
bump copyright year to 2007
2007-02-13 11:17:06 -08:00
Robey Pointer b9f43f3f06 [project @ robey@lag.net-20070212183021-0c9dx3w16m0x2non]
add a convenience method for open_forwarded_tcpip_channel
2007-02-12 10:30:21 -08:00
Robey Pointer ab2e5a710e [project @ robey@lag.net-20070212182955-eaqi0dhzk0p8tw02]
slightly improve docs; mention check_channel_x11_request
2007-02-12 10:29:55 -08:00
Robey Pointer 44af093090 [project @ robey@lag.net-20070211022613-tvtcqzmho5cxr55u]
fix a couple of typos discovered by mczepiel.
2007-02-10 18:26:13 -08:00
Robey Pointer f384749a8c [project @ robey@lag.net-20070210235828-2a24iw2xqe4lnf42]
patch from mpool to fix a python 2.5 warning: stat() returns floats for
times and we want to encode them as ints.
2007-02-10 15:58:28 -08:00
Robey Pointer c1e3e85353 [project @ robey@lag.net-20061227214016-ebfnh1q09zt8z3ej]
as john arbash meinel points out, this assert wasn't validating internal
consistency, because a readv() request may ask for more data than is left
in the file.  so remove the assert.
2006-12-27 16:40:16 -05:00
Robey Pointer 0a63d74a69 [project @ robey@lag.net-20061227194104-ztyb6hi94wp9egp2]
fix bug in prefetch confirmation
2006-12-27 14:41:04 -05:00
Robey Pointer db89be96ef [project @ robey@lag.net-20061226012748-lmbxlsue9q2jzk8x]
if connecting to the agent fails, assume it's just not there, and don't
raise an exception.  (suggestion from martin pool on bazaar-dev.)
2006-12-25 20:27:48 -05:00
Robey Pointer bc66f5eed2 [project @ robey@lag.net-20061226012631-dlhl2akelqy8z0v8]
remove silly comment about compression not being tested
2006-12-25 20:26:31 -05:00
Robey Pointer 5a30821a7d [project @ robey@lag.net-20061217011840-wndj9dyd2f9g512e]
don't need to expanduser twice
2006-12-16 17:18:40 -08:00
Robey Pointer 029b8989db [project @ robey@lag.net-20061215222108-7pu0151970w1e1lp]
add a ResourceManager to replace __del__ methods, and use it in SSHClient
to automatically close any open transport when the SSHClient is collected.
this won't work on Transport itself (to close the attached packetizer)
because Transport starts up its own thread, and the threading library
keeps a Transport object alive to run that thread.  i think that's okay;
the SSHClient interface is meant to be the easier one, so that's the one
where it's important that some auto-cleanup is attempted.
2006-12-15 14:21:08 -08:00
Robey Pointer 7058f5ead2 [project @ robey@lag.net-20061215211936-rgc3uzy5ai9h6qho]
bug 75370: notice garbage sftp packets
since sftp packets shouldn't be larger than about 32k, if the first length
byte is non-zero (ie, the packet size > 16M), raise an exception.
2006-12-15 13:19:36 -08:00
Robey Pointer 76285309cf [project @ robey@lag.net-20061203023334-72zo500ys0l1le30]
potential port forwarding support; probably buggly cuz i haven't added unit tests yet :)
2006-12-02 18:33:34 -08:00
Robey Pointer aaa97d72c0 [project @ robey@lag.net-20061127192023-ns5lhww0jc84f21t]
absorb socket.errors caused by a closed socket if we knew it was closed
2006-11-27 11:20:23 -08:00
Robey Pointer fec76c51b1 [project @ robey@lag.net-20061121001117-8mf8zzltvfvzzrv7]
add support for opening x11 channels, and a unit test
2006-11-20 16:11:17 -08:00
Robey Pointer 48bb10694b [project @ robey@lag.net-20061120192137-1rcpiiq9mcd58m76]
reorder the closing of the pipe in Channel.close() to make sure it happens even when the channel is closed by the remote host first
2006-11-20 11:21:37 -08:00
Robey Pointer b956cc4831 [project @ robey@lag.net-20061119205558-p5p2tmqx0xt7hq9r]
bump version to 1.6.4 (yanma) and trim the README changes-history a bit
2006-11-19 12:55:58 -08:00
Robey Pointer a9c51b23ce [project @ robey@lag.net-20061113041742-e24468a63d31b8bd]
sometimes the sftp module is used with raw sockets, not just paramiko
Channels.  in this case, calling recv() will never return.  so notice
this and use select() to give python a chance to notice a closed socket.
this kind of thing is especially useful for unit tests.
2006-11-12 20:17:42 -08:00
Robey Pointer 48afc3082a [project @ robey@lag.net-20061112063054-bf71926ff8c98c68]
a bit of cleanup in close() to try harder to avoid having lingering threads
2006-11-11 22:30:54 -08:00
Robey Pointer e2d8357622 [project @ robey@lag.net-20061112055617-098a150cf051bffa]
try a trick that should let 'hostkeys[hostname][keytype] = key' work for
HostKeys objects again.
2006-11-11 21:56:17 -08:00
Robey Pointer e736341e20 [project @ robey@lag.net-20061111004413-7bab08f1bad7f96f]
bug 70398:
allow constructions like:
    hostkeys['hostname'] = {}
to create an empty host entry object, so that future attempts to set
keys will at least not throw an exception.  (they'll still silently do
nothing, though.)
2006-11-10 16:44:13 -08:00
Robey Pointer 482d0bcef2 [project @ robey@lag.net-20061031223747-9fda3f2c1112c5dc]
(bug 69222)
on some recent linux kernels, a socket can return "readable" from select,
but a subsequent read() will return EAGAIN.  this is against the contract
of select(), so python's socketmodule doesn't catch it or handle it.
therefore, we need to.  EAGAIN should now be treated the same as a
socket timeout.
2006-10-31 14:37:47 -08:00
Robey Pointer 4628a53acf [project @ robey@lag.net-20061031190617-1113fb493ff5b690]
(bug 69330)
in SFTPClient._auth, check for the existence of the rsa/dsa keys before
trying to open them, so that an I/O exception doesn't mask an earlier
one.
2006-10-31 11:06:17 -08:00
Robey Pointer 7e27adacf1 [project @ robey@lag.net-20061015015628-371a037b5165d634]
bump version to 1.6.3
2006-10-14 18:56:28 -07:00
Robey Pointer 4d090c71a6 [project @ robey@lag.net-20061008002032-d6803b57bac4f62c]
i think the compression needs to be inside this lock in order to preserve order
2006-10-07 17:20:32 -07:00
Robey Pointer 93ab477408 [project @ robey@lag.net-20061001034525-8f78a989ecde720c]
bug fix from mike looijmans: notify any thread waiting in accept() when the transport dies
2006-09-30 20:45:25 -07:00
Robey Pointer 64b89b6efd [project @ robey@lag.net-20061001034455-bf6880fdbd4dd29e]
trivial doc fixes
2006-09-30 20:44:55 -07:00
Robey Pointer 31c26eafb9 [project @ robey@lag.net-20060911175604-bf2798fcebd62780]
trap EOF errors when reading a response, and translate into SSHException
2006-09-11 10:56:04 -07:00
Robey Pointer 4acb9589ce [project @ robey@lag.net-20060908023959-de70f0675f25fa64]
fixes from mike barber for chdir and sftp attr __str__
2006-09-07 19:39:59 -07:00
Robey Pointer 682185bac1 [project @ robey@lag.net-20060908015516-1b8ac2af031586fe]
better way to change the module name
2006-09-07 18:55:16 -07:00
Robey Pointer df20443b29 [project @ robey@lag.net-20060901205930-021bcc34e3d5d8c8]
sadly, revert the append optimization -- it breaks for openssh
2006-09-01 13:59:30 -07:00
Robey Pointer 1f4a3f1976 [project @ robey@lag.net-20060829181836-1cd17df7729c4db8]
remove usage of has_key, which is dangerous and deprecated
2006-08-29 11:18:36 -07:00
Robey Pointer b23079b135 [project @ robey@lag.net-20060829012231-328fee7de77036be]
fix a couple of pcheck warnings
2006-08-28 18:22:31 -07:00
Robey Pointer 2b8738d3ce [project @ robey@lag.net-20060828234834-51542dc36057b361]
fix __setitem__ to do the right thing
2006-08-28 16:48:34 -07:00
Robey Pointer c2b38a1fb8 [project @ robey@lag.net-20060823025610-adee7f6d9bd92725]
ok, ok, switch back to open()
2006-08-22 19:56:10 -07:00
Robey Pointer 145ceab54c [project @ robey@lag.net-20060823025538-3f8a4d761d7d4118]
when a file is open for append, don't stat to get the file position unless the user asks for it explicitly
2006-08-22 19:55:38 -07:00
Robey Pointer cc3e383baf [project @ robey@lag.net-20060822025601-aab3b723b95d3a9c]
add 'flags' param to SFTPHandle and make the default impl avoid calling tell() when in append mode; add proper append-mode support to stub_sftp
2006-08-21 19:56:01 -07:00
Robey Pointer 49418d1145 [project @ robey@lag.net-20060816213132-2e094c077d22dc50]
bump version to 1.6.2
2006-08-16 14:31:32 -07:00
Robey Pointer bfe8fac5bf [project @ robey@lag.net-20060816213106-99cffe9de5d555c5]
don't need odict anymore
2006-08-16 14:31:06 -07:00
Robey Pointer 929ce8df7a [project @ robey@lag.net-20060813195045-ca4148e233794d4b]
add a unit test to verify that all the paramiko symbols are exported correctly
2006-08-13 12:50:45 -07:00
Robey Pointer 6d37b6b810 [project @ robey@lag.net-20060813193546-c92b58af1c27d156]
missing commas in exported class list (bug 55946)
2006-08-13 12:35:46 -07:00
Robey Pointer 4bedcfbf39 [project @ robey@lag.net-20060801182715-f0977a00fbcce456]
fix logic in checking prefetch buffers: don't stop looking for prefetched data just because all the buffers have arrived
2006-08-01 11:27:15 -07:00
Robey Pointer 05de66db6d [project @ robey@lag.net-20060801182357-e030af9570314145]
use hexlify instead of home-grown hexify
2006-08-01 11:23:57 -07:00
Robey Pointer 4086a5cd35 [project @ robey@lag.net-20060729182801-e5e501844712bd85]
oops, forgot to import SSHException
2006-07-29 11:28:01 -07:00
Robey Pointer 6821b6e8e8 [project @ robey@lag.net-20060727025519-bffe5bcc0556d779]
variant of a patch from warren young to preserve the order of host entries from the 'known_hosts' file and preserve knowlege of which lines had multiple hostnames on them
2006-07-26 19:55:19 -07:00
Robey Pointer 17a93bce4c [project @ robey@lag.net-20060726191515-6ff627b4d7216073]
if a chunk has been requested in prefetch, don't bother doing an overlapping prefetch during readv
2006-07-26 12:15:15 -07:00
Robey Pointer c731a077fb [project @ robey@lag.net-20060726002947-e60cb0a3d7b86919]
don't fetch readv chunks that we have reason to believe are already in prefetch buffers.  no longer need to order the prefetch requests either.
2006-07-25 17:29:47 -07:00
Robey Pointer c24db3e38c [project @ robey@lag.net-20060726000907-b9a2d46eecc64cec]
allow prefetch + readv to occur at the same time (even though it will be really inefficient).  instead of a moving pointer, use the prefetched buffers as an indication of what we've downloaded so far.  break up large readv requests into the max packet size.  add 2 more unit tests to test this stuff.
2006-07-25 17:09:07 -07:00
Robey Pointer 787b0b461d [project @ robey@lag.net-20060723235649-5f757e44908ffb31]
attempt to implement support for kex-gex 'old' packet type, which is apparently used by putty (this would only affect paramiko in server mode)
2006-07-23 16:56:49 -07:00
Robey Pointer 4737e44e40 [project @ robey@lag.net-20060723235548-2f5f9ae591d683ca]
clean up use of expected_packet and make it accept a tuple of packet types
2006-07-23 16:55:48 -07:00
Robey Pointer ffcc22e784 [project @ robey@lag.net-20060713194617-35597c20a6b3bc59]
bump version to 1.6 (oops, forgot to check this in a few days ago)
2006-07-13 12:46:17 -07:00
Robey Pointer ec6e76abc6 [project @ robey@lag.net-20060710070003-b9c4a1a7f7ab0ae9]
apparently some sftp servers may return an mtime of 0xffffffff -- just in case, ignore that value
2006-07-10 00:00:03 -07:00
Robey Pointer 9c8a06b877 [project @ robey@lag.net-20060628050022-2f0d754ed70356f1]
anal-retentive conversion to 'while True'
2006-06-27 22:00:22 -07:00
Robey Pointer c22df44900 [project @ robey@lag.net-20060628045919-ffac82c51c51b3df]
make HostKeys use odict to ensure order is preserved, and add HostKeys.save()
2006-06-27 21:59:19 -07:00
Robey Pointer 4fa4fdee4b [project @ robey@lag.net-20060627064106-71a2bfb5a39a2913]
add PKey.from_private_key to read from a file object
2006-06-26 23:41:06 -07:00
Robey Pointer d81758f1ff [project @ robey@lag.net-20060627060810-93a5453df5ae4a62]
log mkdir mode when given
2006-06-26 23:08:10 -07:00
Robey Pointer be86d5474a [project @ robey@lag.net-20060627060703-3d7eadfb1f5042ad]
catch and discard exceptions thrown when sending a status response during an exception
2006-06-26 23:07:03 -07:00
Robey Pointer 79d239693a [project @ robey@lag.net-20060627060600-07d5b7e2fc57202d]
add PKey.write_private_key to write a private key into a file object, and add tests for it
2006-06-26 23:06:00 -07:00
Robey Pointer 1726162508 [project @ robey@lag.net-20060530070000-358e08e75c891d8b]
add __setitem__ for HostKeys
2006-05-30 00:00:00 -07:00
Robey Pointer e0f0ae5eb2 [project @ robey@lag.net-20060530065945-158cc1305bfc2c82]
missed the client id
2006-05-29 23:59:45 -07:00
Robey Pointer 471876ff3e [project @ robey@lag.net-20060530065858-6300e2d76304778c]
convert an EOFError into SSHException during sftp negotation
2006-05-29 23:58:58 -07:00
Robey Pointer af4b8fedc9 [project @ robey@lag.net-20060511013313-411d1524da3b53f0]
bump version to 1.6, fix up docs a little bit
2006-05-10 18:33:13 -07:00
Robey Pointer 6f4110a066 [project @ robey@lag.net-20060511011140-ab3550c28121f900]
fix a few bugs found by pycheck
2006-05-10 18:11:40 -07:00
Robey Pointer 8843feb633 [project @ robey@lag.net-20060509164549-14e664f234b4b747]
new parent exception for all auth failures, and new specific exception for bad host key
2006-05-09 09:45:49 -07:00
Robey Pointer 02e8178510 [project @ robey@lag.net-20060508005224-a8a04cd59f9fa016]
pulled out openssh config parsing into its own class
2006-05-07 17:52:24 -07:00
Robey Pointer 1d2bd214c3 [project @ robey@lag.net-20060508002214-0403d95f73b152f5]
couple of doc fixes
2006-05-07 17:22:14 -07:00
Robey Pointer 2a03425e27 [project @ robey@lag.net-20060508002007-3b7b87c361fe876a]
add unit tests for SSHClient, and fix a few bugs that uncovered
2006-05-07 17:20:07 -07:00
Robey Pointer de1e072c73 [project @ robey@lag.net-20060507230153-dba6b2d664b5ef3f]
channel operations raise an exception on error now instead of returning a bool
2006-05-07 16:01:53 -07:00
Robey Pointer 581103665b [project @ robey@lag.net-20060504025237-a015ee747d9a2e75]
if open_channel fails, it now raises ChannelException.  added a unit test for that too.  renegotiate_keys will also raise an exception now instead of returning a bool.
2006-05-03 19:52:37 -07:00
Robey Pointer 2067e9a136 [project @ robey@lag.net-20060502002709-617a268779f7ca6b]
readv should just yield results as it gets them (suggestion from robertc)
2006-05-01 17:27:09 -07:00
Robey Pointer e646d0ee4c [project @ robey@lag.net-20060430023238-3cd706d10c2de472]
try to clean up if the server object throws an exception
2006-04-29 19:32:38 -07:00
Robey Pointer c278de9fd4 [project @ robey@lag.net-20060428174959-bae73f58ca8ed33a]
patch from nicholas piper to catch keepalives sent to the client
2006-04-28 10:49:59 -07:00
Robey Pointer 3bcdf46a9d [project @ robey@lag.net-20060424011126-66797c157af18805]
add SSHClient (so far)
2006-04-23 18:11:26 -07:00
Robey Pointer 8e81ba61f5 [project @ robey@lag.net-20060424011046-7edc8e67b364f07d]
mark a couple of functions as since 1.5.2
2006-04-23 18:10:46 -07:00
Robey Pointer abb7f1f1ba [project @ robey@lag.net-20060420072627-958cad5e36cb8ecc]
fix a bug where prefetch() at EOF would throw an exception, and add a unit test
2006-04-20 00:26:27 -07:00
Robey Pointer d965f00563 [project @ robey@lag.net-20060412205753-e6c5d195a51fc389]
fix docs
2006-04-12 13:57:53 -07:00
Robey Pointer 6e2f3b6548 [project @ robey@lag.net-20060412203612-863c46529730f786]
bump up the default banner timeout to 15 seconds and make it configurable via (undocumented) Transport.banner_timeout
2006-04-12 13:36:12 -07:00
Robey Pointer 37dd98bc61 [project @ robey@lag.net-20060412093740-9fad67f9fbafcd7d]
fix doc typo
2006-04-12 02:37:40 -07:00
Robey Pointer f765980313 [project @ robey@lag.net-20060412084327-0d666ca96c0b0976]
oops, don't forget to add the empty() method
2006-04-12 01:43:27 -07:00
Robey Pointer e7afd83308 [project @ robey@lag.net-20060412084250-bd347f3f01aca394]
flip the switch: use BufferedPipe inside Channel
2006-04-12 01:42:50 -07:00
Robey Pointer b7a615d02a [project @ robey@lag.net-20060411224733-0361ad3758aee64d]
add a way to set the event to trigger, and fix a typo
2006-04-11 15:47:33 -07:00
Robey Pointer 9e14a3bf58 [project @ robey@lag.net-20060411073946-8830b560b276266f]
factor out BufferedPipe into its own class
2006-04-11 00:39:46 -07:00
Robey Pointer 017d315bce [project @ robey@lag.net-20060409073938-bcbb9a13a6f311c2]
changes to win_pageant from todd whiteman which avoid using ctypes and apparently makes the pageant agent work
2006-04-09 00:39:38 -07:00
Robey Pointer ccc1046a5c [project @ robey@lag.net-20060406181821-68f9bc13b3580d37]
some fixes for win32: potential fix for lockup during failed tests; don't try chmod/chown or symlinks; fix canonicalize to convert dos-style path separators to '/'; open local files in binary mode; close a file before erasing it
2006-04-06 11:18:21 -07:00
Robey Pointer d7b28ac257 [project @ robey@lag.net-20060327001936-9dd7d3b155614bbf]
allow multiple prefetches to happen in rapid succession
2006-03-26 16:19:36 -08:00
Robey Pointer 4120a15823 [project @ robey@lag.net-20060326235536-31da9988fb7a06be]
slightly more docs to hostkeys
2006-03-26 15:55:36 -08:00
Robey Pointer 016060388a [project @ robey@lag.net-20060324174423-1d310608680dd29b]
try out john's win_pageant code
2006-03-24 09:44:23 -08:00
Robey Pointer 4eb0b9ac3e [project @ robey@lag.net-20060312042905-752c324bdc1ac2cf]
bump version to 1.5.4
2006-03-11 20:29:05 -08:00
Robey Pointer 82d8ca6e11 [project @ robey@lag.net-20060312040732-8d16f6c42f12f138]
document readv, fix thinko, and add a readv unit test
2006-03-11 20:07:32 -08:00
Robey Pointer 862e1f48e3 [project @ robey@lag.net-20060310022234-c183ad0b3f31eb28]
generalize the prefetching a bit so that it can be reused for a readv method
2006-03-09 18:22:34 -08:00
Robey Pointer a98c5cf627 [project @ robey@lag.net-20060309082830-ea89d2b2259098a2]
revise the prefetch machinery so that it doesn't assert if you seek to earlier than the prefetched buffers.  also, keep around any prefetched data that has been seeked around, so that jumping around in the file will still get the benefit of prefetch, though only the first time any chunk is read.
2006-03-09 00:28:30 -08:00
Robey Pointer bbcf7687aa [project @ robey@lag.net-20060309082217-438047d0007d5a5b]
reads were being rounded up to an 8k buffer size, even with no buffering specified when the file was opened.  i traced this back to the old ChannelFile where it worked correctly.  fix to only buffer when asked to.
2006-03-09 00:22:17 -08:00
Robey Pointer de6315b9c5 [project @ robey@lag.net-20060309080450-bad95b03d60d3d4f]
improve HostKeys so that it more correctly emulates a dict, and add a unit test to verify that
2006-03-09 00:04:50 -08:00
Robey Pointer 90a577c775 [project @ robey@lag.net-20060228030121-67362d86a18a352b]
heh, this import will always fail unless we have 'os' handy
2006-02-27 19:01:21 -08:00
Robey Pointer 5b7957ce39 [project @ robey@lag.net-20060220072303-cdc3bc647d5732b0]
bump version to 1.5.3
2006-02-19 23:23:03 -08:00
Robey Pointer 2103553ff5 [project @ robey@lag.net-20060220040447-d7b79989d3b680ed]
remove @since that predate 1.0
2006-02-19 20:04:47 -08:00
Robey Pointer 6459365f50 [project @ robey@lag.net-20060220040343-f13904d9c97035e3]
explain why paths aren't, and can't be, unicode strings when passed to SFTPServerInterface
2006-02-19 20:03:43 -08:00
Robey Pointer 4be91d1c4d [project @ robey@lag.net-20060220031741-3227438ff1b03a29]
add SFTPClient.truncate.  add chmod, chown, utime, and truncate to SFTPFile.  and of course tests.
2006-02-19 19:17:41 -08:00
Robey Pointer 8446c0bda1 [project @ robey@lag.net-20060220005934-58d0df2920e799b5]
update copyright year
2006-02-19 16:59:34 -08:00
Robey Pointer 409c4fc482 [project @ robey@lag.net-20060220003513-aa54e3e771a530fd]
add HostKeys, a helper for reading/parsing openssh known_hosts files, including hashed-host support
2006-02-19 16:35:13 -08:00
Robey Pointer 08c9efc86a [project @ robey@lag.net-20060213181724-ba80fa329c5be7f4]
not all sftp servers obey the 'all filenames are utf8' requirement, so if both ascii and utf8 codecs fail, just return the filename as a byte string
2006-02-13 10:17:24 -08:00
Robey Pointer 97496845bb [project @ robey@master-shake.local-20060210175613-e7a1fccdcc4e689c]
this del is also useless
2006-02-10 09:56:13 -08:00
Robey Pointer 12efdd7ca1 [project @ robey@master-shake.local-20060209073516-77f30d55aee054ea]
packetizer doesn't need a __del__, and the keepalive should use a weakref
2006-02-08 23:35:16 -08:00
Robey Pointer 07dfbd5808 [project @ robey@master-shake.local-20060209030347-a7238bae41dad9d7]
doing a close() on Transport.__del__ is useless: because a Transport can't go away until all its Channels are collected, it will never make a difference.  so don't do it, cuz __del__ is pretty hairy.
2006-02-08 19:03:47 -08:00
Robey Pointer 27ccd56af7 [project @ robey@master-shake.local-20060209030112-ab9669fa6d1d3d26]
avoid really obvious/brainfart reference loop.  found by andrew bennetts
2006-02-08 19:01:12 -08:00
Robey Pointer 619192814d [project @ robey@master-shake.local-20060206064228-23198d2e82bd7248]
add getpeername() call to make asyncore work better
2006-02-05 22:42:28 -08:00
Robey Pointer 2853a7ae05 [project @ robey@master-shake.local-20060203180829-27d4707bf572ac5b]
Transport doesn't need HMAC
2006-02-03 10:08:29 -08:00
Robey Pointer 0627f09494 [project @ robey@dhcp-192-168-1-88.danger.com-20060202005930-3248b8be189d5d23]
reorder the event check so that a positive event is noticed before a closed channel
2006-02-01 16:59:30 -08:00
Robey Pointer 2262f7f188 [project @ robey@master-shake.local-20060201193536-86f3fd393e7ef8f9]
don't clear the select pipe when the recv buffer is cleared out, if we're at EOF (found by thomas steinacher)
2006-02-01 11:35:36 -08:00
Robey Pointer c091dff994 [project @ robey@master-shake.local-20060131005629-3f1bfead54bd5283]
add more logging to sftp client
2006-01-30 16:56:29 -08:00
Robey Pointer eeb76522ea [project @ robey@master-shake.local-20060130182053-0d5b7aba9dc9d9b3]
tone down the packet logging
2006-01-30 10:20:53 -08:00
Robey Pointer 3596251856 [project @ robey@master-shake.local-20060130182024-4f0c84964b65cb72]
describe auth types better in logs
2006-01-30 10:20:24 -08:00
Robey Pointer cf0c5c7720 [project @ robey@master-shake.local-20060127035453-c91a77a5aa6d2136]
a few more pychecker warning fixups
2006-01-26 19:54:53 -08:00
Robey Pointer 1a469d97fd [project @ robey@master-shake.local-20060127035342-a7bb21c598c8136d]
(possibly misguided) attempt to reduce paramiko's exports
2006-01-26 19:53:42 -08:00
Robey Pointer 7058195e38 [project @ robey@master-shake.local-20060126205008-cbf83d6697711e37]
when setting a new log channel, pass that info on to the packetizer
2006-01-26 12:50:08 -08:00
Robey Pointer d44035e716 [project @ robey@master-shake.local-20060126204925-3cc14de36a8c5c1f]
winscp doesn't like it if the server sends version info before the client does
2006-01-26 12:49:25 -08:00
Robey Pointer f5421e7600 [project @ robey@master-shake.local-20060120182350-92e8f21d029f8634]
catch a case where the sftp server might give an invalid error code
2006-01-20 10:23:50 -08:00
Robey Pointer fa90f1247a [project @ robey@master-shake.local-20060120182320-d569b04adc2bd622]
some performance improvements: be a LOT less aggressive about stirring the randpool; use buffering when reading the banner; add a hook for using a native-compiled hmac (which gives the biggest boost, but should probably be done in pycrypto)
2006-01-20 10:23:20 -08:00
Robey Pointer f02a4bcded [project @ robey@master-shake.local-20060119232616-edcb93583d3dc005]
john points out i could just use None for no-value and it would be a lot simpler... good point
2006-01-19 15:26:16 -08:00
Robey Pointer 1731d51b51 [project @ robey@master-shake.local-20060119072156-31241967db33d1d9]
john a meinel caught a typo in the previous sort() patch
2006-01-18 23:21:56 -08:00
Robey Pointer 6a145dea09 [project @ robey@master-shake.local-20060119065503-341b1f0c0d161e22]
add Transport.atfork to handle the case where a forked child needs to cleanly dispose of a Transport where the socket is shared with its parent
2006-01-18 22:55:03 -08:00
Robey Pointer be7d99886c [project @ robey@master-shake.local-20060115063338-50ebabff6276f500]
patch from jan hudec to fix a python 2.4-ism
2006-01-14 22:33:38 -08:00
Robey Pointer cb3008b402 [project @ robey@master-shake.local-20060115063008-4f68552398868788]
fix a bunch of pychecker warnings, some of which were actual (but unlikely) bugs
2006-01-14 22:30:08 -08:00
Robey Pointer 26397bff47 [project @ robey@lag.net-20051216180002-5661c935adb8262e]
ENOTDIR should be translated into NO_SUCH_FILE -- openssh does it, and there really isn't any better mapping for it
2005-12-16 10:00:02 -08:00
Robey Pointer 995343439a [project @ robey@lag.net-20051204092822-69155fa5abbc4637]
bump version to 1.5.2
2005-12-04 01:28:22 -08:00
Robey Pointer a8abbbecb8 [project @ robey@lag.net-20051204090414-7c8318ab735f6188]
experimental util functions for parsing/getting openssh host config, and unit tests (turned out to be pretty easy)
2005-12-04 01:04:14 -08:00
Robey Pointer 373e65dd97 [project @ robey@lag.net-20051204090235-431d6d71cee11f68]
don't call _send_user_message() while holding the channel lock.  the call may
block waiting for CTS (during rekey), and the feeder thread may be waiting on
the channel lock to clear out channel traffic before it gets to the kex-init.
instead, the 2 methods that wanted to send from inside the lock now just return
messages to send.  slightly hacky but functional. :)
2005-12-04 01:02:35 -08:00
Robey Pointer fdf927cffd [project @ robey@ralph.lag.net-20051204043251-efc5e0b9adee5403]
remember once a transport is authenticated, so that after rekeying when using openssh-style delayed zlib (zlib@openssh.com), we know it's okay to immediately start new compression
2005-12-03 20:32:51 -08:00
Robey Pointer 8aa2131e28 [project @ robey@ralph.lag.net-20051204042920-132f9184b775ffb1]
fix typo in doc
2005-12-03 20:29:20 -08:00
Robey Pointer 2de86653c7 [project @ robey@ralph.lag.net-20051204042853-ba804918019cbdba]
windows users who switch between cygwin and native mode may sometimes have an SSH_AUTH_SOCK environ var set from cygwin, even when in native mode there's no such thing as an AF_LOCAL socket -- check for native windows mode and avoid trying unix ssh agents in that case
2005-12-03 20:28:53 -08:00
Robey Pointer a8778ffe6f [project @ robey@ralph.lag.net-20051203043206-1a5ab28112642246]
when closing an sftp file because of __del__, don't wait for a response, just shoot off a request and leave (on linux, the GC is run from a devoted thread)
2005-12-02 20:32:06 -08:00
Robey Pointer 62a83e7d03 [project @ robey@ralph.lag.net-20051203043112-0091aa8e40980487]
serialize outgoing requests (duh) -- when prefetching multiple files, there may be several threads pumping out read requests
2005-12-02 20:31:12 -08:00
Robey Pointer 2d06308fd9 [project @ robey@ralph.lag.net-20051203042147-7e7a922aadc37bc2]
only create the log filter once, so it doesn't get applied more than once (tiny thing that bothered me during debugging)
2005-12-02 20:21:47 -08:00
Robey Pointer 35b5719dc2 [project @ robey@lag.net-20051203003250-030b7c160f13aca9]
oops, forgot to add this file -- guess friday really is hawaiian shirt day :)
2005-12-02 16:32:50 -08:00
Robey Pointer 568ddd963d [project @ robey@lag.net-20051202211544-900e02e2693d4a92]
add tentative compression support (off by default)
2005-12-02 13:15:44 -08:00
Robey Pointer e7a45fee60 [project @ robey@lag.net-20051202204242-1fb4a6438ba50969]
nail down select() on EOF: occasionally a channel would be closed remotely but select() wouldn't trigger.  when a channel gets EOF or is closed, set the pipe FOREVER.
2005-12-02 12:42:42 -08:00
Robey Pointer 76eafefcea [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-82]
convert_status is already called.  calling it again was breaking van dyke sftp servers, which add garbage to the end of their sftp packets
2005-11-25 19:09:59 +00:00
Robey Pointer ba6165a4aa [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-81]
copy from jaramiko: only check for rekey at the beginning of a packet
2005-11-12 01:38:27 +00:00
Robey Pointer 6de6dc72c6 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-80]
add 'x' flag to open to allow O_EXCL behavior
2005-11-12 01:10:41 +00:00
Robey Pointer 7e95e2afc8 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-79]
in Transport.__del__, don't try to clean up attributes that were never created
2005-11-11 17:43:01 +00:00
Robey Pointer 42867ded42 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-78]
oops, this file wasn't saved yet when i did the randpool.stir() commit
2005-10-31 19:09:46 +00:00
Robey Pointer b9106e4f21 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-77]
bump up version to 1.5.1
2005-10-31 03:28:54 +00:00
Robey Pointer b1d58c5ceb [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-76]
add a few more randpool.stir() calls
2005-10-31 03:27:13 +00:00
Robey Pointer 25d55e6089 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-75]
fix a few windows bugs (and broken str() on SFTPAttributes) reported by grzegorz makarewicz
2005-10-31 03:26:10 +00:00
Robey Pointer e57c4baab5 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-74]
raise the max packet size so that the max sftp packet will fit
2005-10-30 21:13:36 +00:00
Robey Pointer a355cf43d9 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-73]
packet read sizes were overestimated by 1 byte
2005-10-29 20:57:43 +00:00
Robey Pointer 66919286b6 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-72]
don't attempt to start a rekey negotiation from within send_message -- always do it from the feeder thread.  this prevents a situation where more than one thread may decide spontaneously to rekey, sending multiple kexinit messages, which confuses the hell out of the remote host :)  also, do some locking around the clear-to-send event, to avoid a race when we first go into rekeying.  add some tests for these things too
2005-10-29 20:47:04 +00:00
Robey Pointer 3c67e35b5f [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-71]
the window-adjust can be sent outside of the lock, as long as the window size tracking is done within the lock (ie: allocate window space within the lock, then send the ack later) -- helps avoid deadlocks
2005-10-29 20:41:14 +00:00
Robey Pointer f65edffbfb [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-70]
add SFTPFile.prefetch() to allow pre-fetching a file that will be downloaded in full -- quick testing showed this could speed up downloads 3x or more
2005-10-24 06:19:56 +00:00
Robey Pointer c986f92dc5 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-69]
i think seek_cur had a bug here
2005-10-22 06:38:43 +00:00
Robey Pointer d42d6af12b [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-68]
set errno for some errors
2005-10-22 06:35:57 +00:00
Robey Pointer 95bf2b0957 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-67]
oops, dont forget to export SFTPFile for docs :)
2005-10-20 04:42:10 +00:00
Robey Pointer 64d89583c7 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-66]
fix a test that failed once: the encoding of R or S in dss signatures might not always be exactly 20 bytes
2005-10-17 16:36:55 +00:00
Robey Pointer 6eab0b3b4d [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-65]
remove unnecessary shebangs, fix import lines to be explicit about imports from within paramiko, and a bit of whitespace cleanup
2005-10-13 18:52:59 +00:00
Robey Pointer 8bb5e65499 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-64]
track channels seen and throw away (without error) messages bound for nonexistent channels that *used* to exist -- fixes a bug found by gordon good
2005-10-13 18:51:18 +00:00
Robey Pointer 7f9677d5ab [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-63]
fix doc typo
2005-10-02 20:12:48 +00:00
Robey Pointer 65883e673b [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-62]
readme comments, bump version to 1.5 paras
2005-10-02 20:08:39 +00:00
Robey Pointer f2ec841a15 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-61]
add server-side support for keyboard-interactive auth, and a couple of unit tests
2005-09-27 04:03:27 +00:00
Robey Pointer fb73c0ef7f [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-60]
add file pipelining for writes
2005-09-25 09:11:23 +00:00
Robey Pointer 364479610e [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-59]
add auth_none and auth_interactive to support 'no auth' and 'keyboard-interactive auth'; for password auth, add a mode where it will try to fallback to keyboard-interactive in a pinch
2005-09-21 22:42:11 +00:00
Robey Pointer 24045332c5 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-58]
make the str form of BadAuthenticationType describe the allowed auth types
2005-09-21 22:37:23 +00:00
Robey Pointer 112b72511e [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-56]
patch from nathaniel smith: fix SFTPClient.open() 'a' flag, and guard against multiple close() of the same file
2005-09-18 07:25:54 +00:00
Robey Pointer 0f3bf86617 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-54]
smooth BaseTransport and Transport together, and move the auth stuff into AuthHandler -- an improvement i made in jaramiko and decided deserved to be backported
2005-08-09 07:40:07 +00:00
Robey Pointer 646db7c787 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-52]
rework init so classes all appear in the right package in docs (yaaaay)
2005-08-09 06:30:59 +00:00
Robey Pointer 7cd7841556 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-51]
rename 3 globals so they're not exposed in docs
2005-08-09 06:30:22 +00:00
Robey Pointer a4fc5bb8a7 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-50]
add docs to Message
2005-08-09 06:29:59 +00:00
Robey Pointer 7b4cd51b76 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-49]
dumb tiny tweaks
2005-08-03 06:57:51 +00:00
Robey Pointer eb60811594 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-48]
can use up to 32k buffers here
2005-08-03 06:57:30 +00:00
Robey Pointer 5a5cd201b7 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-47]
bump version number to 1.4 oddish
2005-07-18 06:40:30 +00:00
Robey Pointer d8ee5e2a4a [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-46]
add SFTPFile.check and server support (and test) -- it's an sftp extension that allows a client to retrieve the hash of part or all of a file without downloading it.  we're probably the only ones who implement it yet
2005-07-18 05:43:44 +00:00
Robey Pointer e9ccd7ea20 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-45]
yeah! figured out the last things that were causing GC cycles and got rid of them: Channels, Transports, SFTPClients, and SFTPFiles can all have __del__ methods now, which auto-close themselves :)
2005-07-17 20:06:29 +00:00
Robey Pointer f27e625926 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-44]
try to handle utf8 paths in a sane way in SFTPClient: assume incoming strings are already utf8, and encode incoming unicodes -- for return values, use str if an ascii encoding will work, otherwise return a unicode
2005-07-17 07:01:51 +00:00
Robey Pointer a22719c338 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-43]
allow start_client and start_server to be passed no event object for synchronous behavior
2005-07-16 16:41:39 +00:00
Robey Pointer 458a0de23f [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-42]
don't forget to export Agent
2005-07-16 16:35:25 +00:00
Robey Pointer 37f3775389 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-41]
pull in tiny changes from ralph
Patches applied:

 * robey@lag.net--2005/paramiko--dev--1--patch-2
   merge laptop work

 * robey@lag.net--2005/paramiko--dev--1--patch-3
   update from laptop

 * robey@lag.net--2005/paramiko--dev--1--patch-4
   integrate tons more laptop work

 * robey@lag.net--2005/paramiko--dev--1--patch-5
   thew has a good point: this is stable software now, not alpha

 * robey@lag.net--2005/paramiko--dev--1--patch-6
   roll up laptop changes
2005-07-14 02:51:31 +00:00
Robey Pointer a321fa026d [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-40]
anal tweak of docs
2005-07-14 02:46:35 +00:00
Robey Pointer 4c22409524 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-38]
fix util docs a bit
2005-07-14 02:36:30 +00:00
Robey Pointer b5f0b3c786 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-37]
remove debug print
2005-07-14 02:36:15 +00:00
Robey Pointer 1a6ba349da [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-36]
move load_host_keys into util where others can use it
2005-07-14 02:19:13 +00:00
Robey Pointer e12e16858e [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-35]
oooooops, didn't mean to leave posix commented out
2005-07-14 02:18:45 +00:00
Robey Pointer f565576321 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-34]
fix a comment claiming that channels are closed automatically when GC'd (they aren't and can't be); don't close the pipe until the app explicitly calls close(); signal EOF via the pipe
2005-07-14 02:17:38 +00:00
Robey Pointer 93f3cae64f [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-33]
add SFTPClient.put and SFTPClient.get, and make sftp file objects auto-close on del
2005-07-13 08:35:15 +00:00
Robey Pointer 1f88224239 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-32]
add the concept of a cwd to SFTPClient, and add a unit test for it
2005-07-13 07:59:35 +00:00
Robey Pointer e6e4c4bff7 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-31]
fix whitespace on a line that bugged me
2005-07-13 07:57:12 +00:00
Robey Pointer b3ec01f57e [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-30]
fix stupid line that broke dss's unit test... that'll teach me to fuss over pychecker warnings
2005-07-13 07:56:44 +00:00
Robey Pointer 0ac7b0dcbd [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-29]
a bunch of silly changes where i was trying to fix pychecker warnings before i decided it wasnt worth the effort
2005-07-10 09:56:00 +00:00
Robey Pointer 5ba8b47a45 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-28]
forgot to import server
2005-07-09 17:31:09 +00:00
Robey Pointer ae18228d07 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-26]
new ssh agent support!  from john rochester.  added a bunch of docs to it, and changed demo.py to use an Agent if it finds a working key there.
2005-07-07 01:35:31 +00:00
Robey Pointer e3ed1616d1 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-25]
cool optimization from john rochester: use cStringIO in Message (and also fix some unit test bugs revealed by the change)
2005-07-07 01:10:57 +00:00
Robey Pointer 0b093e49b4 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-24]
the previous windows pipe fix still didn't work.  replace it with a new pipe.py abstraction of pipes (one for posix, one for windows) which appears to finally work on windows.  for real this time.  also add some more documentation to Channel to explain that after exec_command, invoke_shell, or invoke_subsystem, a Channel can't be reused.
2005-07-07 01:03:49 +00:00
Robey Pointer de81b40e7d [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-23]
stupid little doc tweaks
2005-07-03 01:31:31 +00:00
Robey Pointer 9d27762720 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-22]
some doc changes; catch socket.error in the transport thread and log it as such instead of as an 'unknown exception'
2005-07-03 01:26:35 +00:00
Robey Pointer 401e37fa23 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-21]
oops, missed changing the version name to nidoran
2005-06-28 08:15:24 +00:00
Robey Pointer dff128c814 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-20]
fix docs and update version to 1.3.1
2005-06-28 08:00:12 +00:00
Robey Pointer 6ee7921d06 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-18]
tweak random stuff in transport that i forgot what it does
2005-06-28 07:23:41 +00:00
Robey Pointer 1fb38470aa [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-16]
forgot this one
2005-06-28 03:47:12 +00:00
Robey Pointer 81ba7dccef [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-15]
random doc/comment tweaks
2005-06-28 03:44:25 +00:00
Robey Pointer c0b22a3aec [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-14]
cute trick i saw openssh do in a network trace: if we're not encrypting, don't waste random bytes for the padding in packetizing
2005-06-28 03:42:57 +00:00
Robey Pointer c5d2e9904a [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-13]
change pipe method to something that probably works on windows (the old system did not); also fix a race in _unlink
2005-06-28 03:42:14 +00:00
Robey Pointer 44239ae077 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-10]
fix stupid bug in kex_group1 which luckily only affected unit tests
2005-05-21 20:35:29 +00:00
Robey Pointer cb5aa0671b [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-9]
oooh maybe i'll test things before checking them in next time: rekeying was a little bit overzealous.  now it's careful to only rekey once and reset the counters in sync
2005-05-14 06:21:36 +00:00
Robey Pointer 366f216e3f [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-8]
add unit tests for the packetizer, and fix a little locking bug where i think more of the packetizer write function should be inside a lock
2005-05-10 17:36:38 +00:00
Robey Pointer e8efe095a6 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-7]
don't close the socket until the destructor -- we may drop a session before the socket is actually finished
2005-05-04 02:44:00 +00:00
Robey Pointer 2c264c7df5 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-6]
when an auth method is rejected, log the list of acceptable auth methods
2005-05-04 02:43:14 +00:00
Robey Pointer 36055c5ac2 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-5]
split out Packetizer, fix banner detection bug, new unit test
split out a chunk of BaseTransport into a Packetizer class, which handles
the in/out packet data, ciphers, etc.  it didn't make the code any smaller
(transport.py is still close to 1500 lines, which is awful) but it did split
out a coherent chunk of functionality into a discrete unit.

in the process, fixed a bug that alain spineux pointed out: the banner
check was too forgiving and would block forever waiting for an SSH banner.
now it waits 5 seconds for the first line, and 2 seconds for each subsequent
line, before giving up.

added a unit test to test keepalive, since i wasn't sure that was still
working after pulling out Packetizer.
2005-05-01 08:04:59 +00:00
Robey Pointer 2f2d7bdee8 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-4]
add Transport.open_sftp_client
2005-04-30 19:21:43 +00:00
Robey Pointer bcf197d027 [project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-3]
make SFTPClient.file an alias for SFTPClient.open.
clean up docs a little, and make 'file' an alias for 'open'.
this is how python is heading in general.
2005-04-21 16:59:03 +00:00
Robey Pointer bd7911895b [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-164]
fix some docs
remove some epydoc comments about fileno() being non-portable.
2005-04-18 00:53:57 +00:00
Robey Pointer 89ccac6bfa [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-163]
add SFTPClient.close()
add SFTPClient.close() and add a simple little unit test for it.
2005-04-18 00:30:52 +00:00
Robey Pointer 18aaff8521 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-161]
integrated laptop work (test commit)
Patches applied:

 * robey@lag.net--2003-public-master-shake/secsh--dev--1.0--base-0
   tag of robey@lag.net--2003-public/secsh--dev--1.0--patch-160

 * robey@lag.net--2003-public-master-shake/secsh--dev--1.0--patch-1
   test commit

 * robey@lag.net--2003-public/secsh--dev--1.0--base-0
   initial import

 * robey@lag.net--2003-public/secsh--dev--1.0--patch-1
   no changes
2005-04-16 23:38:22 +00:00
Robey Pointer 2bdbe28234 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-160]
1.3 marowak
bump version to 1.3 / marowak
2005-04-10 00:46:41 +00:00
Robey Pointer 7e40c6f2be [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-159]
clean up SFTPAttributes.__repr__
clean up SFTPAttributes repr() a bit.
2005-04-10 00:39:18 +00:00
Robey Pointer 71a337ee08 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-157]
change SubsystemHandler/SFTPServerInterface API
change the API of SubsystemHandler to accept a reference to the
ServerInstance object during construction.  this will break all code
that currently creates subsystem handlers (like sftp servers) -- sorry!

lots of little doc fixups (mostly indenting).
2005-04-06 07:24:28 +00:00
Robey Pointer 5d8d1938fa [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-156]
rewrite channel pipes to work on windows
the pipe system i was using for simulating an os-level FD (for select) was
retarded.  i realized this week that i could just use a single byte in the
pipe to signal "data is ready" and not try to feed all incoming data thru
the pipe -- and then i don't have to try to make the pipe non-blocking (which
should make it work on windows).  a lot of duplicate code got removed and now
it's all going thru the same code-path on read.

there's still a slight penalty on incoming feeds and calling 'recv' when a
pipe has been opened (by calling 'fileno'), but it's tiny.

removed a bunch of documentation and comments about things not working on
windows, since i think they probably do now.
2005-03-26 05:53:00 +00:00
Robey Pointer 3e5bd84cc5 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-155]
fix sending of large sftp packet sizes
fix a bug where packets larger than about 12KB would cause the session to
die on platforms other than osx.  turns out that on most platforms, setting a
socket timeout also causes timeouts to occur on writes (but not on osx).  so
on a huge write, once the os buffers were full, paramiko would get a
socket.timeout exception when writing, and bail.

since the timeout is primarily so we can periodically poll to see if the
session has been killed from elsewhere, do that on a timeout but otherwise
continue trying to write.  large packet sizes (in sftp) should now work.
2005-03-25 20:06:56 +00:00
Robey Pointer fead211c5c [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-154]
even better 1.2 lapras
re-bump the version # to 1.2 (with a new date since i added more stuff).
add 2005 to the copyright date in a bunch of files.
2005-02-28 08:06:08 +00:00
Robey Pointer 7490172401 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-153]
tweak sftp_file write behavior on large blocks of data
BufferedFile.write() wasn't correctly dealing with the possibility that the
underlying write might not write the entire data block at once (even though
the docs said it would).  now that it's working, make sftp_file take
advantage of it in order to chop up blocks larger than 32kB (the max allowed
on sftp) and add a unit test for it.
2005-02-28 07:49:56 +00:00
Robey Pointer 2746d44906 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-152]
little doc fixes
stupid little doc fixups that didn't fit with the other patches.
2005-02-28 07:17:21 +00:00
Robey Pointer 246f3d46a2 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-151]
fix race in transport thread startup
set active=True from the methods that start the main transport thread, right
before actually starting the thread.  this avoids a race where the main
thread could be started, but the original thread could wake up from the
event.wait(0.1) before the new thread actually set the transport active.
impossible, you say?  no machines so slow exist?  au contraire, my sad
little linux box faced this problem earlier today.
2005-02-28 07:16:22 +00:00
Robey Pointer 4b8a9d3b7a [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-150]
when combining stderr with stdout on a channel, merge the buffers too
when turning on combine-stderr mode on a channel, grab the channel lock and
feed any existing stderr buffer into the normal buffer.  this should help
applications (and my unit tests) avoid races between data coming in over
stderr and setting combine-stderr.

_send_eof is now slightly safer too, although i don't think that really fixed
anything.  it just makes me feel better.
2005-02-28 07:14:11 +00:00
Robey Pointer 8ee26cd412 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-149]
add thread ids to logs
add a logging filter that reports the thread-id of the logger, and use
that for all paramiko logging.  since thread-local stuff didn't appear
until python 2.4, i hacked up my own little version to assign incrementing
numbers to threads as they log.
2005-02-28 07:09:02 +00:00
Robey Pointer b45a3a98a8 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-147]
1.2 (lapras)
bump version stuff to 1.2 / lapras.
2005-02-26 21:11:04 +00:00
Robey Pointer fb2d7bbddd [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-146]
raise better exception on empty key
raise a clearer exception when trying to create an empty key.
2005-02-15 15:48:47 +00:00
Robey Pointer c7d56a309d [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-145]
add methods for sending/receiving a channel's exit status
track a channel's exit status and provide a method (recv_exit_status) to
block waiting for it to arrive.  also provide a convenience method for
servers to send it (send_exit_status).  add shutdown_read and shutdown_write.
fix a bug in sending window change requests.
2005-02-15 15:47:02 +00:00
Robey Pointer f7b0a62e4b [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-144]
fix docs
clean up some of the docs.
2005-02-06 23:32:22 +00:00
Robey Pointer c1ed20c4af [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-141]
misc logging fixes
change the level of some log messages so interesting stuff gets logged at
info instead of debug.  fix an oops where channels defaulted to being in
ultra debug mode, and make this mode depend on a new Transport method:
"set_hexdump".
2005-01-25 05:17:55 +00:00
Robey Pointer 8878a5f3c2 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-140]
more flexible logging
some tweaks to make channels etc follow the logger setting of their parent
transport, so that setting the log channel for a paramiko transport will
cause all sub-logging to branch out from that channel.

also, close all open file handles when the sftp server ends.
2005-01-17 10:09:09 +00:00
Robey Pointer b89025d409 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-138]
doc fixups
little doc fixups that i did obsessively on the train one morning.
2005-01-16 20:14:07 +00:00
Robey Pointer 1eda9b051b [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-137]
added listdir_attr()
add SFTPClient.listdir_attr() to fetch a list of files & their attributes,
instead of just their filenames.  artur piwko would find this useful.
2005-01-09 05:27:07 +00:00
Robey Pointer 34f9df1536 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-135]
more sftp cleanup
oops, this should've been part of the last patch.
2004-12-19 19:50:00 +00:00
Robey Pointer 8d127ae8e1 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-134]
cleanup & docs in sftp
add some more docs to SFTPHandle, and give a default implementation for
close() that's usually right.  add a flush() to the default implementation
of write().  document that symlink's args in the sftp protocol are out of
order (the spec is wrong).
2004-12-19 19:43:27 +00:00
Robey Pointer 1cf0d33f1d [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-132]
oops (continued)
er, part 2 of that.
2004-12-13 07:31:01 +00:00
Robey Pointer caa8d4cf41 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-131]
move check_global_request
move check_global_request into the server interface -- i missed it during
the initial move (oops).
2004-12-13 07:29:38 +00:00
Robey Pointer 2d9ad663ba [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-130]
small fixups
move _wait_for_send_window into the right place in Channel.  remove outdated
note from auth_transport.  fix download url in setup.py.
2004-12-13 07:27:39 +00:00
Robey Pointer ee0d4ae68e [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-129]
1.1 (kabuto)
edit various files to bump the version to 1.1.
also fix to point to the new url.
2004-12-12 09:58:40 +00:00
Robey Pointer 1a32d2b4ef [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-127]
doc fixups
fix some typos in sftp_client docs
2004-12-12 09:32:17 +00:00
Robey Pointer a3971274e8 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-126]
server support for stderr & exec_command
for the server side of my stderr blunder, add send_stderr & sendall_stderr,
and make the sending side of makefile_stderr work correctly.

also, call check_channel_exec_request on a server object for exec requests
on a channel.
2004-12-12 09:25:15 +00:00
Robey Pointer 83a932a1b3 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-125]
add client-side multi-part auth support
added support for multi-part authentication (even though nobody supports it
that i've seen).  on a successful "partial" auth, the auth_* method will
return a list of acceptable means to continue authenticating.
2004-12-12 09:16:03 +00:00
Robey Pointer 438673c11f [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-124]
docs fixup
fix a comment typo, and add @since designators to a couple of new methods.
2004-12-11 03:44:33 +00:00
Robey Pointer 767d739299 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-123]
clean up authentication
add new exception "BadAuthenticationType", which is raised when auth fails
because your auth type (password or public-key) isn't valid on the server.

used this as an excuse to clean up auth_password and auth_publickey so their
'event' arg is optional, and if missing, they block until auth is finished,
raising an exception on error.

also, don't close the session on failed auth -- the server may let you try
again.

added some test cases for failed auth.
2004-12-11 03:43:18 +00:00
Robey Pointer 73a0df1df3 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-122]
symlink, readlink
add support for symlink command, and finish support for readlink.  (i guess
i started readlink a while ago but forgot to add the right method to the
SFTPServerInterface class.)
2004-12-10 08:30:44 +00:00
Robey Pointer fa8c4e20bd [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-121]
other part of that last patch
oops, forgot this part.
2004-12-10 08:27:43 +00:00
Robey Pointer 37892fc0c7 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-120]
add stderr support methods
big embarrassment: i didn't read the ssh2 docs close enough, and all this
time paramiko wasn't handling "extended_data" packets, which contain stderr
output.

so now, several new functions: recv_stderr_ready() and recv_stderr() to
mirror recv_ready() and recv(), and set_combined_stderr() to force stderr
to be combined into stdout.  also, makefile_stderr() to create a fake file
object to represent stderr.
2004-12-10 08:25:28 +00:00
Robey Pointer ad87909720 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-118]
fix SFTPFile gettimeout/settimeout
i don't think the gettimeout/settimeout calls on SFTPFile ever worked.
also, simplify the implementation of _get_size() since it's nearly
identical to stat().
2004-12-09 04:15:12 +00:00
Robey Pointer ed8b376205 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-116]
doc fixups
explain "recv_ready" better, and add debug descriptions for the kex codes.
2004-11-26 22:07:31 +00:00
Robey Pointer df63dc4154 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-115]
fix CONNECTION_FAILED_CODE
oops, fix typo in channel request failed.
2004-11-25 19:39:34 +00:00
Robey Pointer 13f818f04f [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-114]
fix typo in channel
fix typo that alain found: pipd_wfd -> pipe_wfd.
2004-11-22 07:40:39 +00:00
Robey Pointer a8a023a243 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-113]
sftp server support!
finally check in sftp_handle (file handle abstraction), sftp_si (server
interface), and sftp_server (server implementation) -- all of which make
a roughly 90% implementation of server-side sftp.
2004-11-22 07:27:21 +00:00
Robey Pointer 611d66428e [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-112]
add finish_subsystem()
when a SubsystemHandler is being decomissioned (the client has closed the
channel or transport, or the socket went away), make a callback to let the
handler do any shutdown it needs to.
2004-11-22 07:07:08 +00:00
Robey Pointer 961525f3d8 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-111]
fix extremely unlikely channel counter wrapping
Transport's channel counter can overflow after 4 billion some channels are
created.  make it wrap back around after 16 million instead.  also allow the
logging channel to be set manually.  fix some comments elsewhere.
2004-11-22 07:04:31 +00:00
Robey Pointer fda92c6f44 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-110]
fix Transport.get_username() to work in server mode too
whenever i split the 'username' field into username and auth_username,
i guess that made get_username() stop working for server mode (because the
username was stored in a different field).  this should fix it.
2004-11-22 07:01:43 +00:00
Robey Pointer 73e8a134ce [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-109]
v1.0 (jigglypuff)
bump all the version numbers up to 1.0 (jigglypuff).
2004-11-07 03:10:53 +00:00
Robey Pointer 920df7d0ae [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-108]
add filename to SFTPAttributes
add filename to the attributes stored in an SFTPAttributes object.
2004-11-07 02:51:42 +00:00
Robey Pointer 2f3228dd88 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-107]
fix kex_gex
fix kex_gex (group-exchange key exchange) to, *cough*, work again, and also
layout kex_group1 a little more sanely.
2004-11-07 02:31:48 +00:00
Robey Pointer 224f6e4747 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-104]
fix location of SFTPError
fix location of SFTPError.
2004-11-07 02:28:33 +00:00
Robey Pointer 1c32fcd99a [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-103]
rename sftp constants
replace oddly named sftp constants (FX_OK for example) with names that make
a bit more sense when sober (SFTP_OK).
2004-11-07 02:17:18 +00:00
Robey Pointer 6eb59a2b53 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-98]
don't unlink a Channel until the server closes it too
when close()'ing a Channel, don't immediately unlink it from the Transport.
instead, wait for the server to send a close message.

this should fix a bug where doing close() on an EOF'd channel would cause
the entire transport to be killed, because the server would send an
'exit-status' and 'close' message for a channel that we no longer had a
record of.
2004-11-01 03:54:01 +00:00
Robey Pointer d7caa20213 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-97]
better debugging, improve subsytem handler
add a list of ssh packet names for debugging.  improve the server-mode
subsystem handler so it can take extra parameters (list or keyword) and
pass them to the subsystem constructor.  remove a misleading comment
about rekeying (which was already implemented).
2004-11-01 03:43:28 +00:00
Robey Pointer 44d07583bb [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-96]
remove key.valid check
oops!  'key.valid' no longer works -- catch the SSHException instead, and log
it.
2004-11-01 03:37:42 +00:00
Robey Pointer a73413c588 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-95]
ivysaur 0.9
update ivysaur release date, and add the list of changes to the README
file.
2004-10-23 07:36:23 +00:00
Robey Pointer 6caf15b425 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-94]
start testing Transport
the beginnings of tests for Transport.  only the bare minimum is there right
now.

also started doc'ing things up to ivysaur.
2004-10-20 16:52:51 +00:00
Robey Pointer 2939b6936b [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-93]
switch Transport.connect() to using a Pkey object for the host key
i suddenly realized that passing "hostkeytype" and "hostkey" as strings to
Transport.connect() was pretty silly since i went to all the effort of making
a class specifically for holding keys.  so Transport.connect() now just takes
host-key argument: "hostkey" as a PKey object.

updated the demos to use PKey objects when reading the host key file, and to
use the new "hostkey" argument.
2004-10-18 04:54:27 +00:00
Robey Pointer a5f6a984ee [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-90]
fix __init__
fix __init__ to export BufferedFile and randpool, and to catch up with the
changes from a week or 2 ago where sftp_attr & friends were split off.
2004-09-25 21:58:11 +00:00
Robey Pointer 12269c0c9b [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-89]
fix some Transport docs
document that Transport also would like close() and settimeout() to exist
on the socket-like object passed to the constructor.
2004-09-25 21:47:19 +00:00
Robey Pointer 3e644a94f1 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-88]
add Message.rewind()
add rewind() method to Message, which just resets the pointer so you can
start reading from the beginning again.  this is useful for some tests.
2004-09-25 21:32:53 +00:00
Robey Pointer 12287b3e0e [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-87]
clean up pkey interface
change the pkey interface so that it's no longer possible to have a pkey
that doesn't represent a valid key.  (ie: no more "blank" key objects.)
also add "get_bits" and "can_sign" methods to determine the key bit length
and whether it can sign things (contains the "private parts") respectively.
2004-09-25 21:28:23 +00:00
Robey Pointer 4cac30252a [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-85]
move SFTPFile and SFTPAttributes into their own files
move SFTPFile and SFTPAttributes into their own files.
2004-09-11 20:56:01 +00:00
Robey Pointer 3a4ca74e0a [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-84]
add sftp.normalize
kevin c. dorff pointed out that it would be nice to expose a way to
determine the server's "current working directory", so this new method
(normalize) directly maps to REALPATH.
2004-09-11 20:50:39 +00:00
Robey Pointer 5176b1ab85 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-83]
tweak Message.add() in the key exchanges
use the new Message.add() behavior to make a little code here much easier
to read.
2004-09-11 20:43:09 +00:00
Robey Pointer 0e66dd47ac [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-82]
doc fixes
fix "string" -> "str" in types when documenting BufferedFile.
2004-09-11 20:40:08 +00:00
Robey Pointer 8c9add1a6b [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-80]
move SubsystemHandler to server.py
move SubsystemHandler into server.py where it makes more sense (it's part of
the server interface).

also fix up paramiko's "version string" used in ssh2 negotiation to stop
saying "pyssh" and start saying "paramiko". :)
2004-09-11 20:36:49 +00:00
Robey Pointer 026425c117 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-79]
Message.add() can take many args
a bit of cleanup to Message:  add() can now take any number of params, and
will add them all in order (using type guessing).
2004-09-11 20:35:19 +00:00
Robey Pointer caa1f88105 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-78]
fix rbuffer -> _rbuffer in 3 places i missed
fix 3 places where "rbuffer" hadn't been converted to "_rbuffer".  thanks to
kevin c. dorff for the bug report.
2004-09-09 01:36:45 +00:00
Robey Pointer ff6ff88209 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-77]
docs for SubsystemHandler
add documentation to constructor for SubsystemHandler.
2004-09-07 06:56:49 +00:00
Robey Pointer 7946f33769 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-76]
add sftp_client.py
i retardedly forgot to import this file a few days ago: it's the split-out
client mode for sftp.  it now also has some changes to adapt it to the
improved SFTPAttributes object API.
2004-09-07 06:54:31 +00:00
Robey Pointer 574c0dd368 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-75]
clean up SFTPAttributes
add english descriptions to the FX_* error codes of sftp.  clean up (and
document) SFTPAttributes since it's exported now, and make it simple to
generate one from a python os.stat object.  make "_pythonize" the default --
that is, just use the same field names as python does for os.stat.  (i'm not
sure why i didn't do it that way in the first place; probably ignorance.)
also add str() method that converts the SFTPAttributes into a string suitable
for use in ls (used in an obscure way in sftp servers).
2004-09-07 06:51:03 +00:00
Robey Pointer 3973265264 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-73]
split sftp into sftp, sftp_client; renamed SFTP -> SFTPClient
add sftp_client file, and split out the common code (sftp) from stuff specific
to client mode (sftp_client).  renamed SFTP class to SFTPClient, but left an
alias so old code will still work.

renamed a bunch of sftp constants now that they're better hidden from epydoc.
2004-09-05 07:44:03 +00:00
Robey Pointer 8dbab50233 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-72]
some framework for adding subsystem handlers in server mode
you can now register a subsystem with a Transport by passing in the name
(like "sftp") and a class (like a hypothetical SFTPServer).  the default
ServerInterface.check_channel_request_subsystem now checks this table in
Transport, and if it finds a match, it creates a new thread for the handler
and calls into it.  a new class SubsystemHandler is added for this purpose
(to be subclassed).
2004-09-05 07:41:45 +00:00
Robey Pointer 6cef2f1259 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-71]
remove redundant 'auth_complete' member
remove the redundant 'auth_complete' field and just use 'authenticated' for
both client and server mode.  this makes the repr() string look correct in
server mode instead of always claiming that the transport is un-auth'd.
2004-09-05 07:37:40 +00:00
Robey Pointer aba7e37a38 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-70]
clean up server interface; no longer need to subclass Channel
- export AUTH_*, OPEN_FAILED_*, and the new OPEN_SUCCEEDED into the paramiko
  namespace instead of making people dig into paramiko.Transport.AUTH_* etc.
- move all of the check_* methods from Channel to ServerInterface so apps
  don't need to subclass Channel anymore just to run an ssh server
- ServerInterface.check_channel_request() returns an error code now, not a
  new Channel object
- fix demo_server.py to follow all these changes
- fix a bunch of places where i used "string" in docstrings but meant "str"
- added Channel.get_id()
2004-09-03 22:39:20 +00:00
Robey Pointer 440b3de06a [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-69]
clean up SecurityOptions
the preferences are now tuples in Transport, and passed as tuples out of
SecurityOptions, so that the options can't be modified without setting them
back to the options field again.  the algorithm lists in Transport are used
to validate the fields.
2004-08-31 02:44:56 +00:00
Robey Pointer aebe186c3e [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-68]
added Transport.get_security_options()
just something i wanted to play with:
added Transport.get_security_options() which returns a SecurityOptions object.
this object is a kind of proxy for the 4 "preferred_*" fields in Transport,
and lets me avoid exposing those fields directly in case i change my mind
later about how they should be stored.

added some docs to Channel explaining that the request methods now return
True/False, and fixed up docs in a few other places.
2004-08-30 20:22:10 +00:00
Robey Pointer 5598a8f88f [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-67]
replay patch 63 (missing channel changes)
i'm still getting the hang of tla/arch, obviously.

replay patch 63, which was meant to be part of the later mega-patch, but
apparently when i reversed it, i lost it entirely.
2004-08-28 04:21:12 +00:00
Robey Pointer c86c4f3949 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-66]
new ServerInterface class, outbound rekey works, etc.
a bunch of changes that i'm too lazy to split out into individual patches:
* all the server overrides from transport.py have been moved into a separate
  class ServerInterface, so server code doesn't have to subclass the whole
  paramiko library
* updated demo_server to subclass ServerInterface
* when re-keying during a session, block other messages until the new keys
  are activated (openssh doensn't like any other traffic during a rekey)
* re-key when outbound limits are tripped too (was only counting inbound
  traffic)
* don't log scary things on EOF
2004-08-27 00:57:40 +00:00
Robey Pointer 34d975b972 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-65]
add settimeout/gettimeout/setblocking, some bugfixes.
hide the command and response codes in sftp so they aren't exported.
add settimeout/gettimeout/setblocking that just wrap calls to the underlying
socket or channel.  fix _read_all to not catch timeout exceptions.
2004-08-27 00:28:33 +00:00
Robey Pointer 32afce8d49 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-64]
reverse messed-up patch
Patches applied:

 * robey@lag.net--2003-public/secsh--dev--1.0--base-0
   initial import

 * robey@lag.net--2003-public/secsh--dev--1.0--patch-1
   no changes
2004-08-27 00:26:35 +00:00
Robey Pointer 3eb52a18ab [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-63]
add settimeout/gettimeout/setblocking, some bugfixes.
hide the command and response codes in sftp so they aren't exported.
add settimeout/gettimeout/setblocking that just wrap calls to the underlying
socket or channel.  fix _read_all to not catch timeout exceptions.
2004-08-27 00:06:42 +00:00
Robey Pointer c6a61c2a01 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-62]
version -> horsea
up version to horsea.
2004-06-27 20:14:15 +00:00
Robey Pointer 690a05fff8 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-61]
no more Foobar
fix "Foobar" to be "Paramiko" in the one place i missed it in all the gpl
headers.  sigh. :)
2004-06-10 18:12:00 +00:00
Robey Pointer 146417c56c [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-60]
limit read/write requests to 32KB, advertise 32KB max packet size
one of the unit tests was failing because the openssh sftp server was dropping
the connection without any error.  turns out they have a maximum allowed write
size (possibly around 64KB).  the sftp rfcs have a small hint that some servers
may drop read/write requests of greater than 32KB.

so, all reads are limited to 32KB, and all writes > 32KB are now chopped up
and sent in 32KB chunks.  this seems to keep openssh happy.

also, we now advertise 32KB max packet size instead of 8KB (the speed
improves a lot), and log when we read/write a packet.  and sftp files are
flushed on seek.
2004-06-10 18:08:50 +00:00
Robey Pointer f0ba3c482e [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-59]
speed up parts of BufferedFile
BufferedFile uses cStringIO for the write buffer now (i don't actually notice
any speed difference so this might revert later) and the default buffer size
has been upped from 1KB to 8KB.

when scanning for linefeeds (when writing to a line-buffered file), only scan
the newly-written bytes, since we know all the previously buffered data is
linefeed-free.  this was the #1 slowdown on the 1MB-file unit test.

also, limit the buffering on line-buffered files to whatever the default
buffer size is.  there's no reason to buffer 1MB waiting for a linefeed.
2004-06-10 18:02:13 +00:00
Robey Pointer cba104ce3f [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-58]
some Channel fixes for max packet size & blocking on zero window
some clean-ups and fixes to channels:
* when send() is blocked on a zero-width window, check that the channel is
  still open.  this was causing some lockups.
* set a lower bound to the "maximum packet size" we accept from the remote
  host.  if they tell us anything less than 1KB, assume they meant 1KB.  (it's
  not reasonable to fragment below that.)
* leave a little padding instead of cutting right up to the maximum packet
  size: some space will be taken up by protocol overhead.
* turn off some of the debug log lines unless "ultra_debug" is on (nobody
  cares about the feed info)
2004-06-10 17:55:17 +00:00
Robey Pointer 9baa2b361e [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-56]
add forward.py demo script; bump to gyarados
add a demo script to show how to do local port forwarding.

add gyarados to all the docs and bump the version number everywhere.
2004-05-31 23:48:10 +00:00
Robey Pointer af8cfeced9 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-54]
add direct-tcpip ability to open_channel
open_channel can now be given a dest_addr and src_addr, which are filled in
if the channel type is "forwarded-tcpip" or "direct-tcpip".  these channel
types are used in remote & local port forwarding, respectively.  i've only
tested "direct-tcpip" but i think if one works, they both should work.

also fixed a bug in connect where it was still assuming the old meaning for
get_remove_server_key() (oops!) and changed the sense of a send() failure
from <= 0 to < 0 since it may be possible for send() to return 0 and it not
be an EOF error.
2004-05-29 18:56:10 +00:00
Robey Pointer ed77581d7a [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-52]
fix deadlock in closing a channel
closing a channel would enter an odd codepath where the lock was grabbed,
some stuff was done, then another function was called where the lock was
grabbed again.  unfortunately python locks aren't monitors so this would
deadlock.  instead, make the smaller function lock-free with an explicit
notice that you must be holding the lock before calling.
2004-05-17 07:41:50 +00:00
Robey Pointer 36a867a017 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-51]
fix utf8, raise packet size, log exceptions, be more lax with sfp servers
explicitly import utf8 encodings for "freezing" (and also because not all
platforms come with utf8, apparently).  raise the max acceptable packet size
to 8kB, cuz 2kB was too low.  log exceptions at error level instead of debug
level.  and don't reject older sftp servers.
2004-05-17 00:43:43 +00:00
Robey Pointer 4d774d62a5 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-50]
fearow date and last-minute fixes
update release date of fearow to 23apr.  fix channel._set_closed() to grab
the lock before notifying the in/out buffers that the channel is closed.
try roger's trick for finding the home folder on windows.
2004-04-23 22:55:16 +00:00