OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 13-Oct-2004 21:14:09
Branch: HEAD Handle: 2004101320140900
Modified files:
openpkg-src/jabberd jabberd.patch jabberd.spec
Log:
apply contributor patch set
Summary:
Revision Changes Path
1.4 +237 -0 openpkg-src/jabberd/jabberd.patch
1.24 +2 -1 openpkg-src/jabberd/jabberd.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/jabberd/jabberd.patch
============================================================================
$ cvs diff -u -r1.3 -r1.4 jabberd.patch
--- openpkg-src/jabberd/jabberd.patch 3 Oct 2004 17:27:39 -0000 1.3
+++ openpkg-src/jabberd/jabberd.patch 13 Oct 2004 19:14:09 -0000 1.4
@@ -10,6 +10,14 @@
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
+@@ -107,6 +108,7 @@
+ {
+ int size;
+ struct pfree *cleanup;
++ struct pfree *cleanup_tail;
+ struct pheap *heap;
+ #ifdef POOL_DEBUG
+ char name[8], zone[32];
Index: etc/c2s.xml.dist.in
--- etc/c2s.xml.dist.in.orig 2004-04-26 07:42:53 +0200
+++ etc/c2s.xml.dist.in 2004-09-22 21:48:33 +0200
@@ -218,3 +226,232 @@
if(ldap_search_s(data->ld, basedn, LDAP_SCOPE_SUBTREE, filter, no_attrs, 0,
&result))
{
log_write(data->ar->c2s->log, LOG_ERR, "ldap: search %s failed: %s",
filter, ldap_err2string(_ldap_get_lderrno(data->ld)));
+Index: s2s/main.c
+--- s2s/main.c.orig 2004-05-31 23:31:05 +0200
++++ s2s/main.c 2004-10-13 19:44:00 +0200
+@@ -62,7 +62,7 @@
+
+ /** pull values out of the config file */
+ static void _s2s_config_expand(s2s_t s2s) {
+- char *str, secret[40];
++ char *str, secret[41];
+ int i, r;
+
+ s2s->id = config_get_one(s2s->config, "id", 0);
+Index: scod/mech_plain.c
+--- scod/mech_plain.c.orig 2004-05-31 23:31:06 +0200
++++ scod/mech_plain.c 2004-10-13 19:44:03 +0200
+@@ -63,7 +63,7 @@
+ }
+ c++;
+
+- pass = (char *) malloc(sizeof(char) * (resplen - ((int) (c - resp))));
++ pass = (char *) malloc(sizeof(char) * (resplen - ((int) (c - resp)) + 1));
+ strncpy(pass, c, (resplen - ((int) (c - resp))));
+ pass[resplen - ((int) (c - resp))] = '\0';
+
+Index: sm/mod_announce.c
+--- sm/mod_announce.c.orig 2004-05-31 23:31:05 +0200
++++ sm/mod_announce.c 2004-10-13 19:44:20 +0200
+@@ -45,9 +45,13 @@
+ os_t os;
+ os_object_t o;
+ os_type_t ot;
++ nad_t nad;
+ int ns, elem, attr;
+ char timestamp[18], telem[5];
+- struct tm tm = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
++ struct tm tm;
++
++ /* struct tm can vary in size depending on platform */
++ memset(&tm, 0, sizeof(struct tm));
+
+ data->loaded = 1;
+
+@@ -55,7 +59,9 @@
+ if((ret = storage_get(mod->mm->sm->st, "motd-message", mod->mm->sm->id, NULL,
&os)) == st_SUCCESS) {
+ os_iter_first(os);
+ o = os_iter_object(os);
+- if(os_object_get(o, "xml", (void **) &data->nad, &ot)) {
++ if(os_object_get(o, "xml", (void **) &nad, &ot)) {
++ /* Copy the nad, as the original is freed when the os is freed below */
++ data->nad = nad_copy(nad);
+ if((ns = nad_find_scoped_namespace(data->nad, uri_DELAY, NULL)) >= 0 &&
+ (elem = nad_find_elem(data->nad, 1, ns, "x", 1)) >= 0 &&
+ (attr = nad_find_attr(data->nad, elem, -1, "stamp", NULL)) >= 0) {
+@@ -197,6 +203,9 @@
+ os_object_t o;
+ st_ret_t ret;
+
++ /* time of this packet */
++ t = time(NULL);
++
+ /* we want messages addressed to /announce */
+ if(pkt->type != pkt_MESSAGE || strlen(pkt->to->resource) < 8 ||
strncmp(pkt->to->resource, "announce", 8) != 0)
+ return mod_PASS;
+@@ -212,7 +221,7 @@
+
+ store = pkt_dup(pkt, NULL, NULL);
+
+- pkt_delay(store, time(NULL), mod->mm->sm->id);
++ pkt_delay(store, t, mod->mm->sm->id);
+
+ /* prepare for storage */
+ os = os_new();
+Index: sm/mod_roster.c
+--- sm/mod_roster.c.orig 2004-05-31 23:31:05 +0200
++++ sm/mod_roster.c 2004-10-13 19:44:09 +0200
+@@ -567,6 +567,9 @@
+ if(user->sessions == NULL)
+ return mod_PASS;
+
++ /* We have to free old packet - Lemming's memory leak fix */
++ pkt_free(pkt);
++
+ /* build a new packet to push out to everyone */
+ pkt = pkt_create(user->sm, "iq", "set", NULL, NULL);
+ ns = nad_add_namespace(pkt->nad, uri_ROSTER, NULL);
+Index: sm/pkt.c
+--- sm/pkt.c.orig 2004-05-31 23:31:05 +0200
++++ sm/pkt.c 2004-10-13 19:44:27 +0200
+@@ -352,12 +352,24 @@
+ jid_free(pkt->rto);
+ pkt->rto = jid_new(pkt->sm->pc, pkt->to->domain, 0);
+
++ if(pkt->rto == NULL) {
++ log_debug(ZONE, "invalid to address on packet, unable to route");
++ pkt_free(pkt);
++ return;
++ }
++
+ nad_set_attr(pkt->nad, 0, -1, "to", pkt->rto->domain, 0);
+
+ if(pkt->rfrom != NULL)
+ jid_free(pkt->rfrom);
+ pkt->rfrom = jid_new(pkt->sm->pc, pkt->sm->id, 0);
+
++ if(pkt->rfrom == NULL) {
++ log_debug(ZONE, "invalid from address on packet, unable to route");
++ pkt_free(pkt);
++ return;
++ }
++
+ nad_set_attr(pkt->nad, 0, -1, "from", pkt->rfrom->domain, 0);
+
+ ret = mm_out_router(pkt->sm->mm, pkt);
+Index: sx/io.c
+--- sx/io.c.orig 2004-05-31 23:31:05 +0200
++++ sx/io.c 2004-10-13 19:43:49 +0200
+@@ -106,7 +106,7 @@
+ }
+
+ /* hand it to the app */
+- if(plugin_error == 0)
++ if ((plugin_error == 0) && (s->state < state_CLOSING))
+ _sx_event(s, event_PACKET, (void *) nad);
+ }
+
+Index: sx/ssl.c
+--- sx/ssl.c.orig 2004-05-31 23:31:06 +0200
++++ sx/ssl.c 2004-10-13 19:44:30 +0200
+@@ -347,7 +347,42 @@
+ _sx_buffer_alloc_margin(buf, 0, pending);
+
+ ret = SSL_read(sc->ssl, &(buf->data[buf->len]), pending);
+- if(ret <= 0) {
++
++ if (ret == 0)
++ {
++ /* ret will equal zero if the SSL stream was closed.
++ (See the SSL_read manpage.) */
++
++ /* If the SSL Shutdown happened properly,
++ (i.e. we got an SSL "close notify")
++ then proccess the last packet recieved. */
++ if (SSL_get_shutdown(sc->ssl) == SSL_RECEIVED_SHUTDOWN)
++ {
++ _sx_close(s);
++ break;
++ }
++
++ /* If the SSL stream was just closed and not shutdown,
++ drop the last packet recieved.
++ WARNING: This may cause clients that use SSLv2 and
++ earlier to not log out properly. */
++
++ err = SSL_get_error(sc->ssl, ret);
++
++ _sx_buffer_clear(buf);
++
++
++ if(err == SSL_ERROR_ZERO_RETURN) {
++ /* ssl channel closed, we're done */
++ _sx_close(s);
++ }
++
++ return -1;
++ }
++ else if(ret < 0) {
++ /* ret will be negative if the SSL stream needs
++ more data, or if there was a SSL error.
++ (See the SSL_read manpage.) */
+ err = SSL_get_error(sc->ssl, ret);
+
+ /* ssl block incomplete, need more */
+@@ -360,11 +395,6 @@
+ /* something's wrong */
+ _sx_buffer_clear(buf);
+
+- if(err == SSL_ERROR_ZERO_RETURN) {
+- /* ssl channel closed, we're done */
+- _sx_close(s);
+- return -1;
+- }
+
+ /* !!! need checks for renegotiation */
+
+Index: util/nad.c
+--- util/nad.c.orig 2004-10-13 19:43:53 +0200
++++ util/nad.c 2004-10-13 19:44:35 +0200
+@@ -734,7 +734,7 @@
+ for(ns = nad->elems[elem].ns; ns >= 0; ns = nad->nss[ns].next)
+ {
+ /* never explicitly declare the implicit xml namespace */
+- if(nad->nss[ns].lprefix == strlen(uri_XML) && strncmp(uri_XML, nad->cdata
+ nad->nss[ns].iprefix, nad->nss[ns].lprefix) == 0)
++ if(nad->nss[ns].luri == strlen(uri_XML) && strncmp(uri_XML, nad->cdata +
nad->nss[ns].iuri, nad->nss[ns].luri) == 0)
+ continue;
+
+ /* make space */
+Index: util/xhash.c
+--- util/xhash.c.orig 2004-05-31 23:31:06 +0200
++++ util/xhash.c 2004-10-13 19:44:38 +0200
+@@ -71,7 +71,7 @@
+ xhn n;
+ int i = index % h->prime;
+ for(n = &h->zen[i]; n != NULL; n = n->next)
+- if(n->key != NULL && strncmp(key, n->key, len) == 0)
++ if(n->key != NULL && (strlen(n->key)==len) && (strncmp(key, n->key, len)
== 0))
+ return n;
+ return NULL;
+ }
+Index: util/pool.c
+--- util/pool.c.orig 2004-05-31 23:31:06 +0200
++++ util/pool.c 2004-10-13 19:43:56 +0200
+@@ -85,13 +85,14 @@
+ if(p->cleanup == NULL)
+ {
+ p->cleanup = pf;
++ p->cleanup_tail = pf;
+ return;
+ }
+
+- /* fast forward to end of list */
+- for(cur = p->cleanup; cur->next != NULL; cur = cur->next);
+-
++ /* append at end of list */
++ cur = p->cleanup_tail;
+ cur->next = pf;
++ p->cleanup_tail = pf;
+ }
+
+ /** create a cleanup tracker */
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/jabberd/jabberd.spec
============================================================================
$ cvs diff -u -r1.23 -r1.24 jabberd.spec
--- openpkg-src/jabberd/jabberd.spec 11 Oct 2004 14:46:43 -0000 1.23
+++ openpkg-src/jabberd/jabberd.spec 13 Oct 2004 19:14:09 -0000 1.24
@@ -38,7 +38,7 @@
Group: Network
License: JOSL/GPL
Version: %{V_major}%{V_minor}
-Release: 20041011
+Release: 20041013
# package options
%option with_mysql no
@@ -119,6 +119,7 @@
--enable-idn \
--enable-fs \
--enable-db \
+ --enable-pipe \
%if "%{with_mysql}" == "yes"
--enable-mysql \
%else
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]