Hi,
On 06/14/2011 01:11 PM, Adam D. Barratt wrote:
I've changed the packaging so the patch is applied to the tar. You
can find my packaging attempt at
https://homes.esat.kuleuven.be/~rtheys/gnutls
Please could you provide a debdiff against the current package? i.e. the
output of "debdiff $stable.dsc yours.dsc".
The debdiff output is in attach.
Regards,
Rik
diff -Nru mod-gnutls-0.5.6/config.nice mod-gnutls-0.5.6/config.nice
--- mod-gnutls-0.5.6/config.nice 1970-01-01 01:00:00.000000000 +0100
+++ mod-gnutls-0.5.6/config.nice 2011-06-10 08:58:37.000000000 +0200
@@ -0,0 +1,17 @@
+#! /bin/sh
+#
+# Created by configure
+
+"./configure" \
+"--build=x86_64-linux-gnu" \
+"--prefix=/usr" \
+"--includedir=${prefix}/include" \
+"--mandir=${prefix}/share/man" \
+"--infodir=${prefix}/share/info" \
+"--sysconfdir=/etc" \
+"--localstatedir=/var" \
+"--libexecdir=${prefix}/lib/mod-gnutls" \
+"--disable-maintainer-mode" \
+"--disable-dependency-tracking" \
+"--with-apxs=/usr/bin/apxs2" \
+"$@"
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-10 08:30:26.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.th...@esat.kuleuven.be> Fri, 10 Jun 2011 08:29:07 +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-10 08:58:27.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-10 08:58:27.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;
}