head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	2011.06.08.08.17.06;	author wen;	state dead;
branches;
next	1.1;

1.1
date	2011.03.07.06.57.38;	author wen;	state Exp;
branches;
next	;


desc
@@


1.2
log
@- Update to 2.6.7
@
text
@--- Lib/smtpd.py.orig   2011-03-05 13:51:22.000000000 +0000
+++ Lib/smtpd.py        2011-03-05 13:52:42.000000000 +0000
@@@@ -121,7 +121,15 @@@@
         self.__rcpttos = []
         self.__data = ''
         self.__fqdn = socket.getfqdn()
-        self.__peer = conn.getpeername()
+        try:
+            self.__peer = conn.getpeername()
+        except socket.error as err:
+            # a race condition  may occur if the other end is closing
+            # before we can get the peername
+            self.close()
+            if err.args[0] != errno.ENOTCONN:
+                raise
+            return
         print >> DEBUGSTREAM, 'Peer:', repr(self.__peer)
         self.push('220 %s %s' % (self.__fqdn, __version__))
         self.set_terminator('\r\n')
@@@@ -291,7 +299,20 @@@@
                 localaddr, remoteaddr)

     def handle_accept(self):
-        conn, addr = self.accept()
+        try:
+            conn, addr = self.accept()
+        except TypeError:
+            # sometimes accept() might return None
+            return
+        except socket.error as err:
+            # ECONNABORTED might be thrown
+            if err.args[0] != errno.ECONNABORTED:
+                raise
+            return
+        else:
+            # sometimes addr == None instead of (ip, port)
+            if addr == None:
+                return
         print >> DEBUGSTREAM, 'Incoming connection from %s' % repr(addr)
         channel = SMTPChannel(self, conn, addr)

@


1.1
log
@- Apply two patch from svn.python.org to fix CVE-2010-3493 and SA43463

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-3493
http://secunia.com/advisories/43463
@
text
@@

