[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Would you cosider accepting this update to address bug 615227 in squeeze?



Hi,

On 06/16/2011 09:57 PM, Adam D. Barratt wrote:
On Tue, 2011-06-14 at 22:31 +0200, Rik Theys wrote:
On Tue, 14 Jun 2011, Adam D. Barratt wrote:
On Tue, 2011-06-14 at 13:39 +0200, Rik Theys wrote:
The debdiff output is in attach.

Overall the diff looks fine, but I noticed that a "config.nice" file has
appeared.  I'm assuming that's not intentionally included in the
package?

It was not intentional, no. Should I remove it from the tar file?

Yes, please.

Looking through build logs for the package, it looks like the file is
generated during the build, so I would have expected it to be cleaned
afterwards rather than end up in the source package.

I've redone the packaging and now the file is no longer in the debdiff.

A new debdiff is attached and I have updated the files at

	http://homes.esat.kuleuven.be/~rtheys/gnutls

Regards,

Rik
diff -Nru mod-gnutls-0.5.6/debian/changelog mod-gnutls-0.5.6/debian/changelog
--- mod-gnutls-0.5.6/debian/changelog	2010-03-26 07:33:39.000000000 +0100
+++ mod-gnutls-0.5.6/debian/changelog	2011-06-17 11:30:31.000000000 +0200
@@ -1,3 +1,9 @@
+mod-gnutls (0.5.6-1squeeze1) stable; urgency=low
+
+  * Apply upstream patch for upstream bug 106 (Closes: #615227)
+
+ -- Rik Theys <Rik.Theys@esat.kuleuven.be>  Fri, 17 Jun 2011 11:29:14 +0200
+
 mod-gnutls (0.5.6-1) unstable; urgency=low
 
   * New upstream release (Closes: #575282)
diff -Nru mod-gnutls-0.5.6/src/gnutls_hooks.c mod-gnutls-0.5.6/src/gnutls_hooks.c
--- mod-gnutls-0.5.6/src/gnutls_hooks.c	2010-03-17 16:39:34.000000000 +0100
+++ mod-gnutls-0.5.6/src/gnutls_hooks.c	2011-06-17 11:28:55.000000000 +0200
@@ -471,7 +471,12 @@
 
 const char *mgs_hook_http_scheme(const request_rec * r)
 {
-    mgs_srvconf_rec *sc =
+    mgs_srvconf_rec *sc;
+    
+    if (r == NULL)
+        return NULL;
+    
+    sc =
 	(mgs_srvconf_rec *) ap_get_module_config(r->server->module_config,
 						 &gnutls_module);
 
@@ -485,7 +490,12 @@
 
 apr_port_t mgs_hook_default_port(const request_rec * r)
 {
-    mgs_srvconf_rec *sc =
+    mgs_srvconf_rec *sc;
+    
+    if (r == NULL)
+        return 0;
+    
+    sc =
 	(mgs_srvconf_rec *) ap_get_module_config(r->server->module_config,
 						 &gnutls_module);
 
@@ -564,6 +574,9 @@
     mgs_srvconf_rec *tsc;
 #endif
 
+    if (session == NULL)
+        return NULL;
+
     _gnutls_log(debug_log_fp,   "%s: %d\n", __func__, __LINE__);
     ctxt = gnutls_transport_get_ptr(session);
 
@@ -676,12 +689,18 @@
 int mgs_hook_pre_connection(conn_rec * c, void *csd)
 {
     mgs_handle_t *ctxt;
-    mgs_srvconf_rec *sc =
+    mgs_srvconf_rec *sc;
+
+    _gnutls_log(debug_log_fp,   "%s: %d\n", __func__, __LINE__);
+    
+    if (c == NULL)
+        return DECLINED;
+    
+    sc =
 	(mgs_srvconf_rec *) ap_get_module_config(c->base_server->
 						 module_config,
 						 &gnutls_module);
 
-    _gnutls_log(debug_log_fp,   "%s: %d\n", __func__, __LINE__);
     if (!(sc && (sc->enabled == GNUTLS_ENABLED_TRUE))) {
 	return DECLINED;
     }
@@ -715,13 +734,16 @@
     mgs_handle_t *ctxt;
     int rv = OK;
 
+    if (r == NULL)
+        return DECLINED;
+
     _gnutls_log(debug_log_fp,   "%s: %d\n", __func__, __LINE__);
     apr_table_t *env = r->subprocess_env;
 
     ctxt =
 	ap_get_module_config(r->connection->conn_config, &gnutls_module);
 
-    if (!ctxt) {
+    if (!ctxt || ctxt->session == NULL) {
 	return DECLINED;
     }
 
@@ -787,14 +809,19 @@
 {
     int rv;
     mgs_handle_t *ctxt;
-    mgs_dirconf_rec *dc = ap_get_module_config(r->per_dir_config,
+    mgs_dirconf_rec *dc;
+    
+    if (r == NULL)
+        return DECLINED;
+    
+    dc = ap_get_module_config(r->per_dir_config,
 					       &gnutls_module);
 
     _gnutls_log(debug_log_fp,   "%s: %d\n", __func__, __LINE__);
     ctxt =
 	ap_get_module_config(r->connection->conn_config, &gnutls_module);
 
-    if (!ctxt) {
+    if (!ctxt || ctxt->session == NULL) {
 	return DECLINED;
     }
 
@@ -858,6 +885,9 @@
     size_t len;
     int ret, i;
 
+    if (r == NULL)
+        return;
+
     apr_table_t *env = r->subprocess_env;
 
     _gnutls_log(debug_log_fp,   "%s: %d\n", __func__, __LINE__);
@@ -966,6 +996,9 @@
     const char *tmp;
     size_t len;
     int ret;
+    
+    if (r == NULL)
+        return;
 
     _gnutls_log(debug_log_fp,   "%s: %d\n", __func__, __LINE__);
     apr_table_t *env = r->subprocess_env;
@@ -1035,6 +1068,9 @@
     } cert;
     apr_time_t activation_time, expiration_time, cur_time;
 
+    if (r == NULL || ctxt == NULL || ctxt->session == NULL)
+        return HTTP_FORBIDDEN;
+
     _gnutls_log(debug_log_fp, "%s: %d\n", __func__, __LINE__);
     cert_list =
 	gnutls_certificate_get_peers(ctxt->session, &cert_list_size);
diff -Nru mod-gnutls-0.5.6/src/gnutls_io.c mod-gnutls-0.5.6/src/gnutls_io.c
--- mod-gnutls-0.5.6/src/gnutls_io.c	2010-03-15 18:49:55.000000000 +0100
+++ mod-gnutls-0.5.6/src/gnutls_io.c	2011-06-17 11:28:55.000000000 +0200
@@ -221,6 +221,10 @@
             ctxt->input_block = APR_NONBLOCK_READ;
         }
     }
+    
+    if (ctxt->session == NULL) {
+        return APR_EGENERAL;
+    }
 
     while (1) {
 
@@ -360,7 +364,7 @@
     int errcode;
     int maxtries = HANDSHAKE_MAX_TRIES;
 
-    if (ctxt->status != 0) {
+    if (ctxt->status != 0 || ctxt->session == NULL) {
         return -1;
     }
 
@@ -441,6 +445,9 @@
 int mgs_rehandshake(mgs_handle_t * ctxt)
 {
     int rv;
+    
+    if (ctxt->session == NULL)
+        return -1;
 
     rv = gnutls_rehandshake(ctxt->session);
     
@@ -565,7 +572,7 @@
 
             apr_bucket_copy(bucket, &e);
             APR_BRIGADE_INSERT_TAIL(ctxt->output_bb, e);
-            
+ 
             if ((status = ap_pass_brigade(f->next, tmpb)) != APR_SUCCESS) {
                 apr_brigade_cleanup(ctxt->output_bb);
                 return status;
@@ -609,10 +616,14 @@
             
             if (len > 0) {
 
-                do {
-                    ret = gnutls_record_send(ctxt->session, data, len);
+                if (ctxt->session == NULL) {
+                    ret = GNUTLS_E_INVALID_REQUEST;
+                } else {
+                    do {
+                        ret = gnutls_record_send(ctxt->session, data, len);
+                    }
+                    while(ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
                 }
-                while(ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
 
                 if (ret < 0) {
                     /* error sending output */
@@ -674,7 +685,8 @@
             if (APR_STATUS_IS_EOF(ctxt->input_rc)) {
                 return 0;
             } else {
-                gnutls_transport_set_errno(ctxt->session, EINTR);
+                if (ctxt->session)
+                    gnutls_transport_set_errno(ctxt->session, EINTR);
                 return -1;
             }
         }
@@ -697,7 +709,8 @@
     if (APR_STATUS_IS_EAGAIN(ctxt->input_rc)
         || APR_STATUS_IS_EINTR(ctxt->input_rc)) {
         if (len == 0) {
-            gnutls_transport_set_errno(ctxt->session, EINTR);
+            if (ctxt->session)
+                gnutls_transport_set_errno(ctxt->session, EINTR);
             return -1;
         }
 

Reply to: