From fead211c5ca75b654c218c6bcfc75552284719c6 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Mon, 28 Feb 2005 08:06:08 +0000 Subject: [PATCH] [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. --- Makefile | 2 +- README | 8 +++++--- demo.py | 18 ++++++++++++++++++ demo_server.py | 18 ++++++++++++++++++ demo_simple.py | 18 ++++++++++++++++++ demo_windows.py | 19 +++++++++++++++++++ forward.py | 18 ++++++++++++++++++ paramiko/__init__.py | 4 ++-- paramiko/auth_transport.py | 2 +- paramiko/ber.py | 2 +- paramiko/channel.py | 2 +- paramiko/common.py | 2 +- paramiko/dsskey.py | 2 +- paramiko/file.py | 2 +- paramiko/kex_gex.py | 2 +- paramiko/kex_group1.py | 2 +- paramiko/logging22.py | 2 +- paramiko/message.py | 2 +- paramiko/pkey.py | 2 +- paramiko/primes.py | 2 +- paramiko/rsakey.py | 2 +- paramiko/server.py | 2 +- paramiko/sftp.py | 2 +- paramiko/sftp_attr.py | 2 +- paramiko/sftp_client.py | 12 ++++++------ paramiko/sftp_handle.py | 2 +- paramiko/sftp_server.py | 2 +- paramiko/sftp_si.py | 2 +- paramiko/ssh_exception.py | 2 +- paramiko/transport.py | 2 +- paramiko/util.py | 2 +- setup.py | 19 +++++++++++++++++++ test.py | 2 +- tests/loop.py | 2 +- tests/stub_sftp.py | 2 +- tests/test_file.py | 2 +- tests/test_kex.py | 2 +- tests/test_message.py | 2 +- tests/test_pkey.py | 2 +- tests/test_sftp.py | 8 ++++---- tests/test_transport.py | 2 +- 41 files changed, 158 insertions(+), 46 deletions(-) diff --git a/Makefile b/Makefile index 93dbab3..96f289b 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ # ivysaur (22oct04) # jigglypuff (6nov04) - 1.0 # kabuto (12dec04) - 1.1 -# lapras (26feb05) - 1.2 +# lapras (28feb05) - 1.2 release: python ./setup.py sdist --formats=zip diff --git a/README b/README index fd0e42b..526ffe4 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ paramiko 1.2 -"lapras" release, 26 feb 2005 +"lapras" release, 28 feb 2005 -Copyright (c) 2003-2004 Robey Pointer +Copyright (c) 2003-2005 Robey Pointer http://www.lag.net/paramiko/ @@ -158,7 +158,9 @@ v1.2 LAPRAS * moved check_global_request into ServerInterface, where it should've been all along (oops) * SFTPHandle's default implementations are fleshed out more -* made logging a bit more consistent +* made logging a bit more consistent, and started logging thread ids +* fixed a few race conditions, one of which would sometimes cause a Transport + to fail to start on slow machines * more unit tests v1.1 KABUTO diff --git a/demo.py b/demo.py index 9633c5c..0754fd7 100755 --- a/demo.py +++ b/demo.py @@ -1,5 +1,23 @@ #!/usr/bin/python +# Copyright (C) 2003-2005 Robey Pointer +# +# This file is part of paramiko. +# +# Paramiko is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Paramiko; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + import sys, os, socket, threading, getpass, time, base64, select, termios, tty, traceback import paramiko diff --git a/demo_server.py b/demo_server.py index 84d2f5b..599eb46 100755 --- a/demo_server.py +++ b/demo_server.py @@ -1,5 +1,23 @@ #!/usr/bin/python +# Copyright (C) 2003-2005 Robey Pointer +# +# This file is part of paramiko. +# +# Paramiko is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Paramiko; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + import sys, os, socket, threading, traceback, base64 import paramiko diff --git a/demo_simple.py b/demo_simple.py index e11ebf1..18e585f 100755 --- a/demo_simple.py +++ b/demo_simple.py @@ -1,5 +1,23 @@ #!/usr/bin/python +# Copyright (C) 2003-2005 Robey Pointer +# +# This file is part of paramiko. +# +# Paramiko is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Paramiko; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + import sys, os, base64, getpass, socket, traceback, termios, tty, select import paramiko diff --git a/demo_windows.py b/demo_windows.py index 84e3ec6..f3f9f90 100755 --- a/demo_windows.py +++ b/demo_windows.py @@ -1,5 +1,24 @@ #!/usr/bin/python +# Copyright (C) 2003-2005 Robey Pointer +# +# This file is part of paramiko. +# +# Paramiko is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Paramiko; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + + # This demo is like demo_simple.py, but it doesn't try to use select() # to poll the ssh channel for reading, so it can be used on Windows. # It logs into a shell, executes "ls", prints out the results, and diff --git a/forward.py b/forward.py index 798d9d5..61532fb 100755 --- a/forward.py +++ b/forward.py @@ -1,5 +1,23 @@ #!/usr/bin/python +# Copyright (C) 2003-2005 Robey Pointer +# +# This file is part of paramiko. +# +# Paramiko is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Paramiko; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + """ Sample script showing how to do local port forwarding over paramiko. diff --git a/paramiko/__init__.py b/paramiko/__init__.py index fc8d32d..d8824bc 100644 --- a/paramiko/__init__.py +++ b/paramiko/__init__.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # @@ -61,7 +61,7 @@ if sys.version_info < (2, 2): __author__ = "Robey Pointer " -__date__ = "26 Feb 2005" +__date__ = "28 Feb 2005" __version__ = "1.2 (lapras)" __license__ = "GNU Lesser General Public License (LGPL)" diff --git a/paramiko/auth_transport.py b/paramiko/auth_transport.py index 32e99ba..832f324 100644 --- a/paramiko/auth_transport.py +++ b/paramiko/auth_transport.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/ber.py b/paramiko/ber.py index d26a6fb..d479233 100644 --- a/paramiko/ber.py +++ b/paramiko/ber.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/channel.py b/paramiko/channel.py index 41df4d9..7862471 100644 --- a/paramiko/channel.py +++ b/paramiko/channel.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/common.py b/paramiko/common.py index d7414d1..4279375 100644 --- a/paramiko/common.py +++ b/paramiko/common.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/dsskey.py b/paramiko/dsskey.py index f1fe5ae..cd3edc5 100644 --- a/paramiko/dsskey.py +++ b/paramiko/dsskey.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/file.py b/paramiko/file.py index 442e433..c0601b0 100644 --- a/paramiko/file.py +++ b/paramiko/file.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/kex_gex.py b/paramiko/kex_gex.py index c324211..cd03a7c 100644 --- a/paramiko/kex_gex.py +++ b/paramiko/kex_gex.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/kex_group1.py b/paramiko/kex_group1.py index 9b77a0f..263cf8a 100644 --- a/paramiko/kex_group1.py +++ b/paramiko/kex_group1.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/logging22.py b/paramiko/logging22.py index acf843b..85f5947 100644 --- a/paramiko/logging22.py +++ b/paramiko/logging22.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/message.py b/paramiko/message.py index 3ebd4f0..17cc532 100644 --- a/paramiko/message.py +++ b/paramiko/message.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/pkey.py b/paramiko/pkey.py index 9ea781b..4938127 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/primes.py b/paramiko/primes.py index f380995..73184a5 100644 --- a/paramiko/primes.py +++ b/paramiko/primes.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py index 595b29e..567c716 100644 --- a/paramiko/rsakey.py +++ b/paramiko/rsakey.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/server.py b/paramiko/server.py index 7493e2c..8c268d2 100644 --- a/paramiko/server.py +++ b/paramiko/server.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/sftp.py b/paramiko/sftp.py index ccf5b14..1b3014d 100644 --- a/paramiko/sftp.py +++ b/paramiko/sftp.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/sftp_attr.py b/paramiko/sftp_attr.py index f1cfaf6..5c76e31 100644 --- a/paramiko/sftp_attr.py +++ b/paramiko/sftp_attr.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index 2382651..3beee67 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # @@ -52,7 +52,7 @@ class SFTPClient (BaseSFTP): # override default logger transport = self.sock.get_transport() self.logger = util.get_logger(transport.get_log_channel() + '.' + - self.sock.get_name() + '.sftp') + self.sock.get_name() + '.sftp') self.ultra_debug = transport.ultra_debug self._send_version() @@ -145,7 +145,7 @@ class SFTPClient (BaseSFTP): @param mode: mode (python-style) to open in. @type mode: string @param bufsize: desired buffering (-1 = default buffer size, 0 = - unbuffered, 1 = line buffered, >1 = requested buffer size). + unbuffered, 1 = line buffered, >1 = requested buffer size). @type bufsize: int @return: a file object representing the open file. @rtype: SFTPFile @@ -176,7 +176,7 @@ class SFTPClient (BaseSFTP): @type path: string @raise IOError: if the path refers to a folder (directory). Use - L{rmdir} to remove a folder. + L{rmdir} to remove a folder. """ self._request(CMD_REMOVE, path) @@ -192,7 +192,7 @@ class SFTPClient (BaseSFTP): @type newpath: string @raise IOError: if C{newpath} is a folder, or something else goes - wrong. + wrong. """ self._request(CMD_RENAME, oldpath, newpath) @@ -317,7 +317,7 @@ class SFTPClient (BaseSFTP): @param path: path of the file to modify. @type path: string @param times: C{None} or a tuple of (access time, modified time) in - standard internet epoch time (seconds since 01 January 1970 GMT). + standard internet epoch time (seconds since 01 January 1970 GMT). @type times: tuple of int """ if times is None: diff --git a/paramiko/sftp_handle.py b/paramiko/sftp_handle.py index e83f7d5..f290e1f 100644 --- a/paramiko/sftp_handle.py +++ b/paramiko/sftp_handle.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/sftp_server.py b/paramiko/sftp_server.py index 06fead3..232069d 100644 --- a/paramiko/sftp_server.py +++ b/paramiko/sftp_server.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/sftp_si.py b/paramiko/sftp_si.py index 3a7e10d..93b7d06 100644 --- a/paramiko/sftp_si.py +++ b/paramiko/sftp_si.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py index bd6a3ca..498ebc2 100644 --- a/paramiko/ssh_exception.py +++ b/paramiko/ssh_exception.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/transport.py b/paramiko/transport.py index 541b29d..b03e007 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/paramiko/util.py b/paramiko/util.py index 636b9f3..2a9909c 100644 --- a/paramiko/util.py +++ b/paramiko/util.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/setup.py b/setup.py index c2db520..5531ce2 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,24 @@ from distutils.core import setup +# Copyright (C) 2003-2005 Robey Pointer +# +# This file is part of paramiko. +# +# Paramiko is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Paramiko; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + + longdesc = ''' This is a library for making SSH2 connections (client or server). Emphasis is on using SSH2 as an alternative to SSL for making secure diff --git a/test.py b/test.py index 01e8a0f..2c4a28a 100755 --- a/test.py +++ b/test.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/tests/loop.py b/tests/loop.py index 22a173f..ad5f7ca 100644 --- a/tests/loop.py +++ b/tests/loop.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/tests/stub_sftp.py b/tests/stub_sftp.py index e1dbb97..639477c 100644 --- a/tests/stub_sftp.py +++ b/tests/stub_sftp.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/tests/test_file.py b/tests/test_file.py index 7914a43..250821c 100755 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/tests/test_kex.py b/tests/test_kex.py index c7a8689..f4e9193 100644 --- a/tests/test_kex.py +++ b/tests/test_kex.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/tests/test_message.py b/tests/test_message.py index 218ab52..441e3ce 100644 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/tests/test_pkey.py b/tests/test_pkey.py index 6bbeb53..3fe4861 100644 --- a/tests/test_pkey.py +++ b/tests/test_pkey.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # diff --git a/tests/test_sftp.py b/tests/test_sftp.py index ba00a18..79a52c2 100755 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. # @@ -438,16 +438,16 @@ class SFTPTest (unittest.TestCase): finally: sftp.remove('%s/hongry.txt' % FOLDER) - def test_E_big_file_no_buffer(self): + def test_E_big_file_big_buffer(self): """ - write a 1MB file, with no linefeeds, and no buffering. + write a 1MB file, with no linefeeds, and a big buffer. """ global g_big_file_test if not g_big_file_test: return kblob = (1024 * 1024 * 'x') try: - f = sftp.open('%s/hongry.txt' % FOLDER, 'w') + f = sftp.open('%s/hongry.txt' % FOLDER, 'w', 128 * 1024) f.write(kblob) f.close() diff --git a/tests/test_transport.py b/tests/test_transport.py index 71ca140..bd11487 100644 --- a/tests/test_transport.py +++ b/tests/test_transport.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (C) 2003-2004 Robey Pointer +# Copyright (C) 2003-2005 Robey Pointer # # This file is part of paramiko. #