aboutsummaryrefslogtreecommitdiffstats
path: root/net-im
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2012-03-19 17:57:05 +0800
committermm <mm@FreeBSD.org>2012-03-19 17:57:05 +0800
commitfdcb03e18445273fabbd49ac1f6c4b2c1e347e85 (patch)
treec77898c018665496de90d09917e016ed7a779992 /net-im
parent258e37f9d482000629e18ed2f2a7f17113895a64 (diff)
downloadfreebsd-ports-gnome-fdcb03e18445273fabbd49ac1f6c4b2c1e347e85.tar.gz
freebsd-ports-gnome-fdcb03e18445273fabbd49ac1f6c4b2c1e347e85.tar.zst
freebsd-ports-gnome-fdcb03e18445273fabbd49ac1f6c4b2c1e347e85.zip
Add patch for upstream bug #899284
https://bugs.launchpad.net/jabberd2/+bug/899284 Reported by: decke Feature safe: yes
Diffstat (limited to 'net-im')
-rw-r--r--net-im/jabberd/Makefile1
-rw-r--r--net-im/jabberd/files/patch-rev-81867
2 files changed, 68 insertions, 0 deletions
diff --git a/net-im/jabberd/Makefile b/net-im/jabberd/Makefile
index 35c9ece8d733..9e15769aa946 100644
--- a/net-im/jabberd/Makefile
+++ b/net-im/jabberd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= jabberd
PORTVERSION= 2.2.14
+PORTREVISION= 1
CATEGORIES= net-im
MASTER_SITES= http://codex.xiaoka.com/pub/jabberd2/releases/
DIST_SUBDIR= jabber
diff --git a/net-im/jabberd/files/patch-rev-818 b/net-im/jabberd/files/patch-rev-818
new file mode 100644
index 000000000000..bae5cfe0ccb7
--- /dev/null
+++ b/net-im/jabberd/files/patch-rev-818
@@ -0,0 +1,67 @@
+=== modified file 'sx/sasl_gsasl.c'
+--- sx/sasl_gsasl.c 2011-10-08 22:08:29 +0000
++++ sx/sasl_gsasl.c 2011-12-06 19:50:30 +0000
+@@ -138,7 +138,7 @@
+ typedef struct _Gsasl_digest_md5_server_state _Gsasl_digest_md5_server_state;
+
+ /** utility: generate a success nad */
+-static nad_t _sx_sasl_success(sx_t s) {
++static nad_t _sx_sasl_success(sx_t s, char *data, int dlen) {
+ nad_t nad;
+ int ns;
+
+@@ -146,6 +146,8 @@
+ ns = nad_add_namespace(nad, uri_SASL, NULL);
+
+ nad_append_elem(nad, ns, "success", 0);
++ if(data != NULL)
++ nad_append_cdata(nad, data, dlen, 1);
+
+ return nad;
+ }
+@@ -533,15 +535,25 @@
+ if(ret == GSASL_OK) {
+ _sx_debug(ZONE, "sasl handshake completed");
+
++ /* encode the leftover response */
++ ret = gsasl_base64_to(out, outlen, &buf, &buflen);
++ if (ret == GSASL_OK) {
++ /* send success */
++ _sx_nad_write(s, _sx_sasl_success(s, buf, buflen), 0);
++ free(buf);
++
++ /* set a notify on the success nad buffer */
++ ((sx_buf_t) s->wbufq->front->data)->notify = _sx_sasl_notify_success;
++ ((sx_buf_t) s->wbufq->front->data)->notify_arg = (void *) p;
++ }
++ else {
++ _sx_debug(ZONE, "gsasl_base64_to failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret));
++ _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_INCORRECT_ENCODING), 0);
++ if(buf != NULL) free(buf);
++ }
++
+ if(out != NULL) free(out);
+
+- /* send success */
+- _sx_nad_write(s, _sx_sasl_success(s), 0);
+-
+- /* set a notify on the success nad buffer */
+- ((sx_buf_t) s->wbufq->front->data)->notify = _sx_sasl_notify_success;
+- ((sx_buf_t) s->wbufq->front->data)->notify_arg = (void *) p;
+-
+ return;
+ }
+
+@@ -555,6 +567,11 @@
+ _sx_nad_write(s, _sx_sasl_challenge(s, buf, buflen), 0);
+ free(buf);
+ }
++ else {
++ _sx_debug(ZONE, "gsasl_base64_to failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret));
++ _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_INCORRECT_ENCODING), 0);
++ if(buf != NULL) free(buf);
++ }
+
+ if(out != NULL) free(out);
+
+