From e299181a5dda25aed4879ebcbe1359604448b3ae Mon Sep 17 00:00:00 2001 From: "Jeremy T. Bouse" Date: Fri, 27 Nov 2009 16:25:55 -0500 Subject: Imported Upstream version 1.7.6 --- docs/paramiko.rng_posix-pysrc.html | 70 +++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'docs/paramiko.rng_posix-pysrc.html') diff --git a/docs/paramiko.rng_posix-pysrc.html b/docs/paramiko.rng_posix-pysrc.html index 108ba64..a116ea8 100644 --- a/docs/paramiko.rng_posix-pysrc.html +++ b/docs/paramiko.rng_posix-pysrc.html @@ -55,26 +55,26 @@

Source Code for Module paramiko.rng_posix

  1  #!/usr/bin/python 
- 2  # -*- coding: ascii -*- 
- 3  # Copyright (C) 2008  Dwayne C. Litzenberger <dlitz@dlitz.net> 
- 4  # Copyright (C) 2008  Open Systems Canada Limited 
- 5  # 
- 6  # This file is part of paramiko. 
- 7  # 
- 8  # Paramiko is free software; you can redistribute it and/or modify it under the 
- 9  # terms of the GNU Lesser General Public License as published by the Free 
-10  # Software Foundation; either version 2.1 of the License, or (at your option) 
-11  # any later version. 
-12  # 
-13  # Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY 
-14  # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 
-15  # A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more 
-16  # details. 
-17  # 
-18  # You should have received a copy of the GNU Lesser General Public License 
-19  # along with Paramiko; if not, write to the Free Software Foundation, Inc., 
-20  # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
-21   
+ 2  # -*- coding: ascii -*- 
+ 3  # Copyright (C) 2008  Dwayne C. Litzenberger <dlitz@dlitz.net> 
+ 4  # Copyright (C) 2008  Open Systems Canada Limited 
+ 5  # 
+ 6  # This file is part of paramiko. 
+ 7  # 
+ 8  # Paramiko is free software; you can redistribute it and/or modify it under the 
+ 9  # terms of the GNU Lesser General Public License as published by the Free 
+10  # Software Foundation; either version 2.1 of the License, or (at your option) 
+11  # any later version. 
+12  # 
+13  # Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY 
+14  # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 
+15  # A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more 
+16  # details. 
+17  # 
+18  # You should have received a copy of the GNU Lesser General Public License 
+19  # along with Paramiko; if not, write to the Free Software Foundation, Inc., 
+20  # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
+21   
 22  import os 
 23  import 43   
 44      f = None 
 45      g = None 
-46       
+46   
 47      if device_path is None: 
 48          device_path = "/dev/urandom" 
 49   
 50      try: 
 51          # Try to open /dev/urandom now so that paramiko will be able to access 
-52          # it even if os.chroot() is invoked later. 
-53          try: 
+52          # it even if os.chroot() is invoked later. 
+53          try: 
 54              f = open(device_path, "rb", 0) 
 55          except EnvironmentError: 
 56              raise error("Unable to open /dev/urandom") 
-57           
+57   
 58          # Open a second file descriptor for sanity checking later. 
-59          try: 
+59          try: 
 60              g = open(device_path, "rb", 0) 
 61          except EnvironmentError: 
 62              raise error("Unable to open /dev/urandom") 
 63   
 64          # Check that /dev/urandom is a character special device, not a regular file. 
-65          st = os.fstat(f.65          st = os.fstat(f.fileno())   # f 
 66          if stat.S_ISCHR(st.st_mode): 
 67              raise error("/dev/urandom is not a character special device") 
-68           
+68   
 69          st = os.fstat(g.fileno())   # g 
@@ -165,9 +165,9 @@ paramiko.SFTPHandle.stat
 paramiko.SFTPServerInterface.stat" class="py-name" href="#" onclick="return doclink('link-17', 'stat', 'link-0');">stat.S_ISCHR(st.st_mode): 
 71              raise error("/dev/urandom is not a character special device") 
-72           
+72   
 73          # Check that /dev/urandom always returns the number of bytes requested 
-74          x = f.74          x = f.read(20) 
 75          y = g.76          if len(x) != 20 or len(y) != 20: 
 77              raise error("Error reading from /dev/urandom: input truncated") 
-78       
+78   
 79          # Check that different reads return different data 
-80          if x == y: 
+80          if x == y: 
 81              raise error("/dev/urandom is broken; returning identical data: %r == %r" % (x, y)) 
 82   
 83          # Close the duplicate file object 
-84          g.84          g.close() 
 85   
 86          # Return the first file object 
-87          return _RNG(f) 
+87          return _RNG(f) 
 88   
 89      except error: 
@@ -230,7 +230,7 @@ paramiko.win_pageant.PageantConnection.close" class="py-name" href="#" onclick="
 94          raise 
 95   
 96  # vim:set ts=4 sw=4 sts=4 expandtab: 
-97