rpms/lighttpd/F-9 lighttpd-1.4.19-sslshutdownfix.patch, NONE, 1.1 lighttpd.spec, 1.45, 1.46

Matthias Saou (thias) fedora-extras-commits at redhat.com
Thu May 15 09:33:51 UTC 2008


Author: thias

Update of /cvs/extras/rpms/lighttpd/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7341

Modified Files:
	lighttpd.spec 
Added Files:
	lighttpd-1.4.19-sslshutdownfix.patch 
Log Message:
Sync F-9 branch with F-8 and devel ones.


lighttpd-1.4.19-sslshutdownfix.patch:

--- NEW FILE lighttpd-1.4.19-sslshutdownfix.patch ---
This is a patch combining changes from changesets 2136 & 2139.
See http://trac.lighttpd.net/trac/ticket/285

--- lighttpd-1.4.x/src/connections.c (revision 2103)
+++ lighttpd-1.4.x/src/connections.c (revision 2136)
@@ -200,4 +200,5 @@
 	/* don't resize the buffer if we were in SSL_ERROR_WANT_* */
 
+	ERR_clear_error();
 	do {
 		if (!con->ssl_error_want_reuse_buffer) {
@@ -1670,4 +1671,5 @@
 			if (srv_sock->is_ssl) {
 				int ret;
+				ERR_clear_error();
 				switch ((ret = SSL_shutdown(con->ssl))) {
 				case 1:
@@ -1675,6 +1677,8 @@
 					break;
 				case 0:
-					SSL_shutdown(con->ssl);
-					break;
+					ERR_clear_error();
+					if ((ret = SSL_shutdown(con->ssl)) == 1) break;
+
+					// fall through
 				default:
 					log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:",
--- lighttpd-1.4.x/src/network_openssl.c (revision 2084)
+++ lighttpd-1.4.x/src/network_openssl.c (revision 2136)
@@ -86,4 +86,5 @@
 			 */
 
+			ERR_clear_error();
 			if ((r = SSL_write(ssl, offset, toSend)) <= 0) {
 				unsigned long err;
@@ -188,4 +189,5 @@
 				close(ifd);
 
+				ERR_clear_error();
 				if ((r = SSL_write(ssl, s, toSend)) <= 0) {
 					unsigned long err;
--- lighttpd-1.4.x/src/connections.c (revision 2136)
+++ lighttpd-1.4.x/src/connections.c (revision 2139)
@@ -1670,5 +1670,6 @@
 #ifdef USE_OPENSSL
 			if (srv_sock->is_ssl) {
-				int ret;
+				int ret, ssl_r;
+				unsigned long err;
 				ERR_clear_error();
 				switch ((ret = SSL_shutdown(con->ssl))) {
@@ -1678,14 +1679,40 @@
 				case 0:
 					ERR_clear_error();
-					if ((ret = SSL_shutdown(con->ssl)) == 1) break;
+					if (-1 != (ret = SSL_shutdown(con->ssl))) break;
 
 					// fall through
 				default:
-					log_error_write(srv, __FILE__, __LINE__, "sds", "SSL:",
-							SSL_get_error(con->ssl, ret),
-							ERR_error_string(ERR_get_error(), NULL));
-					return -1;
+
+					switch ((ssl_r = SSL_get_error(con->ssl, ret))) {
+					case SSL_ERROR_WANT_WRITE:
+					case SSL_ERROR_WANT_READ:
+						break;
+					case SSL_ERROR_SYSCALL:
+						/* perhaps we have error waiting in our error-queue */
+						if (0 != (err = ERR_get_error())) {
+							do {
+								log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
+										ssl_r, ret,
+										ERR_error_string(err, NULL));
+							} while((err = ERR_get_error()));
+						} else {
+							log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL (error):",
+									ssl_r, r, errno,
+									strerror(errno));
+						}
+	
+						break;
+					default:
+						while((err = ERR_get_error())) {
+							log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
+									ssl_r, ret,
+									ERR_error_string(err, NULL));
+						}
+	
+						break;
+					}
 				}
 			}
+			ERR_clear_error();
 #endif
 


Index: lighttpd.spec
===================================================================
RCS file: /cvs/extras/rpms/lighttpd/F-9/lighttpd.spec,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- lighttpd.spec	22 Mar 2008 21:12:20 -0000	1.45
+++ lighttpd.spec	15 May 2008 09:33:07 -0000	1.46
@@ -3,7 +3,7 @@
 Summary: Lightning fast webserver with light system requirements
 Name: lighttpd
 Version: 1.4.19
-Release: 2%{?dist}
+Release: 4%{?dist}
 License: BSD
 Group: System Environment/Daemons
 URL: http://www.lighttpd.net/
@@ -18,6 +18,8 @@
 Source101: lighttpd-mod_geoip.txt
 Patch0: lighttpd-1.4.17-defaultconf.patch
 Patch1: lighttpd-1.4.18-mod_geoip.patch
+# Security fixes
+Patch10: lighttpd-1.4.19-sslshutdownfix.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 Requires: system-logos >= 7.92.1
 Requires(pre): /usr/sbin/useradd
@@ -87,6 +89,7 @@
 %setup -q
 %patch0 -p1 -b .defaultconf
 %patch1 -p1 -b .mod_geoip
+%patch10 -p1 -b .sslshutdown
 %{__install} -p -m 0644 %{SOURCE100} src/mod_geoip.c
 %{__install} -p -m 0644 %{SOURCE101} mod_geoip.txt
 
@@ -211,6 +214,12 @@
 
 
 %changelog
+* Thu Apr 24 2008 Matthias Saou <http://freshrpms.net/> 1.4.19-4
+- Merge in second changest from upstream fix for upstream bug #285.
+
+* Thu Mar 27 2008 Matthias Saou <http://freshrpms.net/> 1.4.19-3
+- Include sslshutdown patch, upstream fix to upstream bug #285 (#439066).
+
 * Sat Mar 22 2008 Matthias Saou <http://freshrpms.net/> 1.4.19-2
 - Provide "webserver" (#437884).
 




More information about the scm-commits mailing list