Commit Graph

1404 Commits

Author SHA1 Message Date
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 e915dccc7d [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-148]
forgot to check in stub_sftp
yikes! don't forget to check this in: needed for unit tests.
2005-02-26 21:12:43 +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 0d10322783 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-143]
fix an sftp unit test
fix one of the sftp unit tests to actually work.
2005-02-06 23:30:40 +00:00
Robey Pointer ccd64202d9 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-142]
fix windows sample script's HOME
fix the HOME environ var to work on windows too.
2005-02-05 07:45:20 +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 3db675d1be [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-139]
make loopback sftp tests the default
change the unit tests to default to always running the sftp tests locally,
and make a -R option to force the tests to run against a remote server.
the tests seem to work fine locally, and it helps test out server mode,
even though there's a danger that they could get isolated from reality
and only test that paramiko can talk to itself.
2005-01-16 21:03:15 +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 811f2bf30f [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-136]
loopback sftp test
add ability to turn off more tests, and a secret (for now) -X option to do
the sftp tests via loopback socket.  added another symlink sftp test to see
what happens with absolute symlinks.
2004-12-19 19:56:48 +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 b2eb38483c [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-133]
unit test madness
add some more testy bits and fix up some other bits.
2004-12-13 07:32:14 +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 97eca767a2 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-128]
more unit tests
added unit tests for multi-part auth, exec_command, and invoke_shell.
2004-12-12 09:38:24 +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 fb54934726 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-119]
reformat README
reformatted the README to a slightly smaller margin, just because.
2004-12-10 07:55:33 +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 0fa97ec147 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-117]
readme comments
add another fixme to the readme
2004-12-09 02:42:36 +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 5a1b5848ae [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-105]
move ChangeLog
move ChangeLog out of the way because tla can autogenerate any useful
ChangeLog.
2004-11-07 02:29:20 +00:00