[Pkg-citadel-commit] r313 - in citadel/trunk/debian: . patches

meskes at alioth.debian.org meskes at alioth.debian.org
Wed Apr 1 09:53:01 UTC 2009


Author: meskes
Date: 2009-04-01 09:53:01 +0000 (Wed, 01 Apr 2009)
New Revision: 313

Added:
   citadel/trunk/debian/patches/743-744.diff
Modified:
   citadel/trunk/debian/changelog
   citadel/trunk/debian/patches/series
Log:
Updated to unoffical 7.44 release.


Modified: citadel/trunk/debian/changelog
===================================================================
--- citadel/trunk/debian/changelog	2009-04-01 09:39:12 UTC (rev 312)
+++ citadel/trunk/debian/changelog	2009-04-01 09:53:01 UTC (rev 313)
@@ -1,6 +1,7 @@
 citadel (7.43-2) unstable; urgency=low
 
   * Install xml file needed ot funambol email sync, closes: #520491
+  * Upgraded source to unofficial 7.44 release.
 
  -- Michael Meskes <meskes at debian.org>  Wed, 01 Apr 2009 11:39:28 +0200
 

Added: citadel/trunk/debian/patches/743-744.diff
===================================================================
--- citadel/trunk/debian/patches/743-744.diff	                        (rev 0)
+++ citadel/trunk/debian/patches/743-744.diff	2009-04-01 09:53:01 UTC (rev 313)
@@ -0,0 +1,843 @@
+diff -ruN citadel.orig/citadel_dirs.c citadel/citadel_dirs.c
+--- citadel.orig/citadel_dirs.c	2009-03-17 04:24:55.000000000 +0100
++++ citadel/citadel_dirs.c	2009-04-01 11:48:28.000000000 +0200
+@@ -33,6 +33,7 @@
+ char ctdl_dspam_dir[PATH_MAX]="dspam";
+ char ctdl_file_dir[PATH_MAX]="files";
+ char ctdl_hlp_dir[PATH_MAX]="help";
++char ctdl_shared_dir[PATH_MAX]="";
+ char ctdl_image_dir[PATH_MAX]="images";
+ char ctdl_info_dir[PATH_MAX]="info";
+ char ctdl_key_dir[PATH_MAX]=SSL_DIR;
+@@ -184,6 +185,8 @@
+ #endif
+ 	COMPUTE_DIRECTORY(ctdl_hlp_dir);
+ 	StripSlashes(ctdl_hlp_dir, 1);
++	COMPUTE_DIRECTORY(ctdl_shared_dir);
++	StripSlashes(ctdl_shared_dir, 1);
+ 
+ #ifndef HAVE_DATA_DIR
+ 	basedir=ctdldir;
+@@ -328,7 +331,7 @@
+         snprintf(file_funambol_msg,
+                 sizeof file_funambol_msg,
+                 "%sfunambol_newmail_soap.xml",
+-                ctdl_spool_dir);
++                ctdl_shared_dir);
+ 	StripSlashes(file_funambol_msg, 0);
+ 
+ 	DBG_PRINT(ctdl_bio_dir);
+diff -ruN citadel.orig/citadel_dirs.h citadel/citadel_dirs.h
+--- citadel.orig/citadel_dirs.h	2009-03-17 04:24:55.000000000 +0100
++++ citadel/citadel_dirs.h	2009-04-01 11:48:28.000000000 +0200
+@@ -14,6 +14,7 @@
+ extern char ctdl_dspam_dir[PATH_MAX];
+ extern char ctdl_file_dir[PATH_MAX];
+ extern char ctdl_hlp_dir[PATH_MAX];
++extern char ctdl_shared_dir[PATH_MAX];
+ extern char ctdl_image_dir[PATH_MAX];
+ extern char ctdl_info_dir[PATH_MAX];
+ extern char ctdl_key_dir[PATH_MAX];
+diff -ruN citadel.orig/citadel.h citadel/citadel.h
+--- citadel.orig/citadel.h	2009-03-17 04:24:55.000000000 +0100
++++ citadel/citadel.h	2009-04-01 11:48:32.000000000 +0200
+@@ -38,10 +38,10 @@
+  * usually more strict because you're not really supposed to dump/load and
+  * upgrade at the same time.
+  */
+-#define REV_LEVEL	743		/* This version */
++#define REV_LEVEL	744		/* This version */
+ #define REV_MIN		591		/* Oldest compatible database */
+ #define EXPORT_REV_MIN	737		/* Oldest compatible export files */
+-#define LIBCITADEL_MIN	743		/* Minimum required version of libcitadel */
++#define LIBCITADEL_MIN	744		/* Minimum required version of libcitadel */
+ 
+ #define SERVER_TYPE 0			/* zero for stock Citadel; other developers please
+ 					   obtain SERVER_TYPE codes for your implementations */
+diff -ruN citadel.orig/citadel.nsi citadel/citadel.nsi
+--- citadel.orig/citadel.nsi	2009-03-17 04:24:55.000000000 +0100
++++ citadel/citadel.nsi	2009-04-01 11:48:28.000000000 +0200
+@@ -4,7 +4,7 @@
+ 
+ !include "${NSISDIR}\Contrib\Modern UI\System.nsh"
+ !define MUI_PRODUCT "Citadel"
+-!define MUI_VERSION "7.43"
++!define MUI_VERSION "7.44"
+ !define MUI_WELCOMEPAGE
+ !define MUI_LICENSEPAGE
+ !define MUI_COMPONENTSPAGE
+@@ -18,7 +18,7 @@
+ ;!define MUI_ICON "${NSISDIR}\Contrib\Icons\modern-install.ico"
+ ;!define MUI_UNICON "${NSISDIR}\Contrib\Icons\modern-uninstall.ico"
+ 
+-OutFile "citadel-7.43.exe"
++OutFile "citadel-7.44.exe"
+ BGGradient off
+ 
+ LangString DESC_Citadel ${LANG_ENGLISH} "Citadel client and core libraries (required)"
+diff -ruN citadel.orig/config.c citadel/config.c
+--- citadel.orig/config.c	2009-03-17 04:24:55.000000000 +0100
++++ citadel/config.c	2009-04-01 11:48:32.000000000 +0200
+@@ -63,7 +63,7 @@
+ 	int desired_mode = (S_IFREG | S_IRUSR | S_IWUSR) ;
+ 	if (st.st_mode != desired_mode) {
+ 		fprintf(stderr, "%s must be set to permissions mode %03o but they are %03o\n",
+-			file_citadel_config, desired_mode, st.st_mode);
++			file_citadel_config, (desired_mode & 0xFFF), (st.st_mode & 0xFFF));
+ 		exit(CTDLEXIT_CONFIG);
+ 	}
+ #endif
+diff -ruN citadel.orig/configure.ac citadel/configure.ac
+--- citadel.orig/configure.ac	2009-03-17 04:24:55.000000000 +0100
++++ citadel/configure.ac	2009-04-01 11:48:28.000000000 +0200
+@@ -1,7 +1,7 @@
+ dnl Process this file with autoconf to produce a configure script.
+ dnl $Id: configure.ac 7220 2009-03-17 03:22:44Z ajc $
+ AC_PREREQ(2.52)
+-AC_INIT([Citadel], [7.43], [http://www.citadel.org/])
++AC_INIT([Citadel], [7.44], [http://www.citadel.org/])
+ AC_REVISION([$Revision: 5108 $])
+ AC_CONFIG_SRCDIR([citserver.c])
+ AC_PREFIX_DEFAULT(/usr/local/citadel)
+diff -ruN citadel.orig/docs/citadel.html citadel/docs/citadel.html
+--- citadel.orig/docs/citadel.html	2008-10-13 15:48:45.000000000 +0200
++++ citadel/docs/citadel.html	2009-04-01 11:48:28.000000000 +0200
+@@ -9,145 +9,31 @@
+ <div align="center">
+ <h1>C I T A D E L</h1>
+ <h2>an open source messaging and collaboration platform</h2>
+-Copyright &copy;1987-2008 by the Citadel development team:<br>
+-<br>
+-<table align="center" border="0" cellpadding="2" cellspacing="2">
+-  <tbody>
+-    <tr>
+-      <td valign="top">Clint Adams<br>
+-      </td>
+-      <td valign="top"><i>portability enhancements<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Steven M. Bellovin<br>
+-      </td>
+-      <td valign="top"><i>author of public domain 'parsedate' function<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Nathan Bryant<br>
+-      </td>
+-      <td valign="top"><i>build system, security, database access, and
+-others<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Art Cancro<br>
+-      </td>
+-      <td valign="top"><i>overall system design and lead developer<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Brian Costello<br>
+-      </td>
+-      <td valign="top"><i>cosmetics, additional commands<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Nick Georbit<br>
+-      </td>
+-      <td valign="top"><i>additional client features<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">David Given<br>
+-      </td>
+-      <td valign="top"><i>IMAP and build patches<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Dave West<br>
+-      </td>
+-      <td valign="top"><i>server features<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Wilfried Goesgens<br>
+-      </td>
+-      <td valign="top"><i>build system patches<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Michael Hampton<br>
+-      </td>
+-      <td valign="top"><i>client software development<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Andru Luvisi<br>
+-      </td>
+-      <td valign="top"><i>troubleshooting and development assistance<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Daniel Malament<br>
+-      </td>
+-      <td valign="top"><i>string compare function for IMAP server<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Stu Mark<br>
+-      </td>
+-      <td valign="top"><i>additional client features, IGnet protocol design<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Edward S. Marshall<br>
+-      </td>
+-      <td valign="top"><i>RBL checking function design<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Ben Mehlman<br>
+-      </td>
+-      <td valign="top"><i>additional client features<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Matt Pfleger<br>
+-      </td>
+-      <td valign="top"><i>additional client features<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Ari Samson<br>
+-      </td>
+-      <td valign="top"><i>assistance with project management<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Trey Van Riper<br>
+-      </td>
+-      <td valign="top"><i>QA and portability enhancements<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">John Walker<br>
+-      </td>
+-      <td valign="top"><i>author of public domain base64 encoder/decoder<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Steve Williams<br>
+-      </td>
+-      <td valign="top"><i>documentation<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Ethan Young<br>
+-      </td>
+-      <td valign="top"><i>IGnet protocol design<br>
+-      </i></td>
+-    </tr>
+-    <tr>
+-      <td valign="top">Edward Flick<br>
+-      </td>
+-      <td valign="top"><i>ClamAV integration module<br>
+-      </i></td>
+-    </tr>
+-  </tbody>
+-</table>
++Copyright &copy;1987-2009 by the Citadel development team.  Contributors include:
++<ul>
++      <li>Clint Adams
++      <li>Steven M. Bellovin
++      <li>Nathan Bryant
++      <li>Art Cancro
++      <li>Brian Costello
++      <li>Edward Flick
++      <li>Nick Georbit
++      <li>David Given
++      <li>Dave West
++      <li>Wilfried Goesgens
++      <li>Michael Hampton
++      <li>Andru Luvisi
++      <li>Daniel Malament
++      <li>Stu Mark
++      <li>Edward S. Marshall
++      <li>Ben Mehlman
++      <li>Matt Pfleger
++      <li>Ari Samson
++      <li>Trey Van Riper
++      <li>John Walker
++      <li>Steve Williams
++      <li>Ethan Young
++</ul>
+ </div>
+ <br>
+ <div align="justify">The entire package is open source software.  You may
+diff -ruN citadel.orig/funambol_newmail_soap.xml citadel/funambol_newmail_soap.xml
+--- citadel.orig/funambol_newmail_soap.xml	1970-01-01 01:00:00.000000000 +0100
++++ citadel/funambol_newmail_soap.xml	2009-04-01 11:48:28.000000000 +0200
+@@ -0,0 +1,40 @@
++<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><sendNotificationMessages soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
++<arg0 xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">^notifyuser</arg0><arg1 xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
++&lt;java version=&quot;1.5.0_13&quot; class=&quot;java.beans.XMLDecoder&quot;&gt; 
++ &lt;array class=&quot;com.funambol.framework.core.Alert&quot; length=&quot;1&quot;&gt; 
++  &lt;void index=&quot;0&quot;&gt; 
++   &lt;object class=&quot;com.funambol.framework.core.Alert&quot;&gt; 
++    &lt;void property=&quot;cmdID&quot;&gt; 
++     &lt;object class=&quot;com.funambol.framework.core.CmdID&quot;/&gt; 
++    &lt;/void&gt; 
++    &lt;void property=&quot;data&quot;&gt; 
++     &lt;int&gt;206&lt;/int&gt; 
++    &lt;/void&gt; 
++    &lt;void property=&quot;items&quot;&gt; 
++     &lt;void method=&quot;add&quot;&gt; 
++      &lt;object class=&quot;com.funambol.framework.core.Item&quot;&gt; 
++       &lt;void property=&quot;meta&quot;&gt; 
++        &lt;object class=&quot;com.funambol.framework.core.Meta&quot;&gt; 
++         &lt;void property=&quot;metInf&quot;&gt; 
++          &lt;void property=&quot;type&quot;&gt; 
++           &lt;string&gt;application/vnd.omads-email+xml&lt;/string&gt; 
++          &lt;/void&gt; 
++         &lt;/void&gt; 
++        &lt;/object&gt; 
++       &lt;/void&gt; 
++       &lt;void property=&quot;target&quot;&gt; 
++        &lt;object class=&quot;com.funambol.framework.core.Target&quot;&gt; 
++         &lt;void property=&quot;locURI&quot;&gt; 
++          &lt;string&gt;^syncsource&lt;/string&gt; 
++         &lt;/void&gt; 
++        &lt;/object&gt; 
++       &lt;/void&gt; 
++      &lt;/object&gt; 
++     &lt;/void&gt; 
++    &lt;/void&gt; 
++   &lt;/object&gt; 
++  &lt;/void&gt; 
++ &lt;/array&gt; 
++&lt;/java&gt; 
++</arg1><arg2 href="#id0"/></sendNotificationMessages>
++<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef></soapenv:Body></soapenv:Envelope>
+diff -ruN citadel.orig/locate_host.c citadel/locate_host.c
+--- citadel.orig/locate_host.c	2008-04-11 16:26:49.000000000 +0200
++++ citadel/locate_host.c	2009-04-01 11:48:32.000000000 +0200
+@@ -14,9 +14,11 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
++#include <arpa/inet.h>
+ #include <limits.h>
+ #include <netdb.h>
+ #include <string.h>
++#include <errno.h>
+ #include <libcitadel.h>
+ #include "citadel.h"
+ #include "server.h"
+@@ -271,21 +273,17 @@
+  */
+ int rbl_check_addr(struct in_addr *addr, char *message_to_spammer)
+ {
+-	const char *i;
+ 	int a1, a2, a3, a4;
+ 	char tbuf[256];
+ 	int rbl;
+ 	int num_rbl;
+ 	char rbl_domains[SIZ];
+ 	char txt_answer[1024];
++	char dotted_quad[32];
+ 
+ 	strcpy(message_to_spammer, "ok");
+-
+-	i = (const char *) addr;
+-	a1 = ((*i++) & 0xff);
+-	a2 = ((*i++) & 0xff);
+-	a3 = ((*i++) & 0xff);
+-	a4 = ((*i++) & 0xff);
++	safestrncpy(dotted_quad, inet_ntoa(*addr), sizeof dotted_quad);
++	sscanf(dotted_quad, "%d.%d.%d.%d", &a1, &a2, &a3, &a4);
+ 
+ 	/* See if we have any RBL domains configured */
+ 	num_rbl = get_hosts(rbl_domains, "rbl");
+@@ -299,7 +297,7 @@
+                 extract_token(&tbuf[strlen(tbuf)], rbl_domains, rbl, '|', (sizeof tbuf - strlen(tbuf)));
+ 
+ 		if (rblcheck_backend(tbuf, txt_answer, sizeof txt_answer)) {
+-			sprintf(message_to_spammer, "5.7.1 %s", txt_answer);
++			strcpy(message_to_spammer, txt_answer);
+ 			CtdlLogPrintf(CTDL_INFO, "RBL: %s\n", txt_answer);
+ 			return(1);
+ 		}
+@@ -312,26 +310,24 @@
+ /*
+  * Check to see if the client host is on some sort of spam list (RBL)
+  * If spammer, returns nonzero and places reason in 'message_to_spammer'
++ *
++ * PORTABILITY NOTE!  I've made my best effort to rewrite this in a portable fashion.
++ * If anyone makes changes to this function, please shout-out so we can test it to
++ * make sure it didn't break on Linux!
+  */
+ int rbl_check(char *message_to_spammer) {
+-	struct sockaddr_in sin;
+-	int len;	/* should be socklen_t but doesn't work on Macintosh */
+-	struct timeval tv1, tv2;
+-	suseconds_t total_time = 0;
+-
+-	gettimeofday(&tv1, NULL);
+-	len = 0;
+-	memset (&sin, 0, sizeof (struct sockaddr_in));
+-	if (!getpeername(CC->client_socket, (struct sockaddr *) &sin, (socklen_t *)&len)) {
+-		return(rbl_check_addr(&sin.sin_addr, message_to_spammer));
+-	}
+-	
+-	gettimeofday(&tv2, NULL);
+-	total_time = (tv2.tv_usec + (tv2.tv_sec * 1000000)) - (tv1.tv_usec + (tv1.tv_sec * 1000000));
+-	CtdlLogPrintf(CTDL_DEBUG, "RBL check completed in %ld.%ld seconds\n",
+-		(total_time / 1000000),
+-		(total_time % 1000000)
+-	);
++	int r;
++	struct sockaddr_in peer;
++	socklen_t peer_len = 0;
++
++	peer_len = sizeof(peer);
++	r = getpeername(CC->client_socket, &peer, &peer_len);
++	if (r == 0) {
++		return(rbl_check_addr(&peer.sin_addr, message_to_spammer));
++	}
++	else {
++		CtdlLogPrintf(CTDL_INFO, "RBL getpeername() failed: %s\n", strerror(errno));
++	}
+ 	return(0);
+ }
+ 
+diff -ruN citadel.orig/Makefile.in citadel/Makefile.in
+--- citadel.orig/Makefile.in	2009-03-17 04:24:55.000000000 +0100
++++ citadel/Makefile.in	2009-04-01 11:48:32.000000000 +0200
+@@ -206,7 +206,7 @@
+ 		 network/systems; do \
+ 		$(srcdir)/mkinstalldirs $(DESTDIR)$(prefix)/$$i; \
+ 	done
+-	@for i in citadel.rc public_clients \
++	@for i in funambol_newmail_soap.xml citadel.rc public_clients \
+ 		 `find $(srcdir)/help $(srcdir)/messages $(srcdir)/network -type f | grep -v .svn`; do \
+ 		echo $(INSTALL_DATA) $$i $(DESTDIR)$(prefix)/$$i; \
+ 		$(INSTALL_DATA) $$i $(DESTDIR)$(prefix)/$$i; \
+@@ -233,7 +233,7 @@
+ 	done
+ 
+ 	$(srcdir)/mkinstalldirs $(DESTDIR)$(HELP_DIR)/help
+-	@for i in  \
++	@for i in  funambol_newmail_soap.xml \
+ 		 `find $(srcdir)/help -type f | grep -v .svn`; do \
+ 		echo $(INSTALL_DATA) $$i $(DESTDIR)$(HELP_DIR)/$$i; \
+ 		$(INSTALL_DATA) $$i $(DESTDIR)$(HELP_DIR)/$$i; \
+diff -ruN citadel.orig/modules/calendar/serv_calendar.c citadel/modules/calendar/serv_calendar.c
+--- citadel.orig/modules/calendar/serv_calendar.c	2009-02-20 19:28:25.000000000 +0100
++++ citadel/modules/calendar/serv_calendar.c	2009-04-01 11:48:32.000000000 +0200
+@@ -808,51 +808,64 @@
+ 			struct icaltimetype t2start,
+ 			struct icaltimetype t2end
+ ) {
+-
+ 	if (icaltime_is_null_time(t1start)) return(0);
+ 	if (icaltime_is_null_time(t2start)) return(0);
+ 
+-	/* First, check for all-day events */
+-	if (t1start.is_date) {
+-		if (!icaltime_compare_date_only(t1start, t2start)) {
+-			return(1);
+-		}
+-		if (!icaltime_is_null_time(t2end)) {
+-			if (!icaltime_compare_date_only(t1start, t2end)) {
+-				return(1);
+-			}
++	/* if either event lacks end time, assume end = start */
++	if (icaltime_is_null_time(t1end))
++		memcpy(&t1end, &t1start, sizeof(struct icaltimetype));
++	else {
++		if (t1end.is_date && icaltime_compare(t1start, t1end)) {
++                        /*
++                         * the end date is non-inclusive so adjust it by one
++                         * day because our test is inclusive, note that a day is
++                         * not too much because we are talking about all day
++                         * events
++			 * if start = end we assume that nevertheless the whole
++			 * day is meant
++                         */
++			icaltime_adjust(&t1end, -1, 0, 0, 0);	
+ 		}
+ 	}
+ 
+-	if (t2start.is_date) {
+-		if (!icaltime_compare_date_only(t2start, t1start)) {
+-			return(1);
+-		}
+-		if (!icaltime_is_null_time(t1end)) {
+-			if (!icaltime_compare_date_only(t2start, t1end)) {
+-				return(1);
+-			}
++	if (icaltime_is_null_time(t2end))
++		memcpy(&t2end, &t2start, sizeof(struct icaltimetype));
++	else {
++		if (t2end.is_date && icaltime_compare(t2start, t2end)) {
++			icaltime_adjust(&t2end, -1, 0, 0, 0);	
+ 		}
+ 	}
+ 
+-	/* Now check for overlaps using date *and* time. */
++	/* First, check for all-day events */
++	if (t1start.is_date || t2start.is_date) {
++		/* If event 1 ends before event 2 starts, we're in the clear. */
++		if (icaltime_compare_date_only(t1end, t2start) < 0) return(0);
++
++		/* If event 2 ends before event 1 starts, we're also ok. */
++		if (icaltime_compare_date_only(t2end, t1start) < 0) return(0);
++
++		return(1);
++	}
+ 
+-	/* First, bail out if either event 1 or event 2 is missing end time. */
+-	if (icaltime_is_null_time(t1end)) return(0);
+-	if (icaltime_is_null_time(t2end)) return(0);
++	/* lprintf (9, "Comparing t1start %d:%d t1end %d:%d t2start %d:%d t2end %d:%d \n",
++		t1start.hour, t1start.minute, t1end.hour, t1end.minute,
++		t2start.hour, t2start.minute, t2end.hour, t2end.minute);
++	*/
++
++	/* Now check for overlaps using date *and* time. */
+ 
+ 	/* If event 1 ends before event 2 starts, we're in the clear. */
+ 	if (icaltime_compare(t1end, t2start) <= 0) return(0);
++	/* lprintf(9, "first passed\n"); */
+ 
+ 	/* If event 2 ends before event 1 starts, we're also ok. */
+ 	if (icaltime_compare(t2end, t1start) <= 0) return(0);
++	/* lprintf(9, "second passed\n"); */
+ 
+ 	/* Otherwise, they overlap. */
+ 	return(1);
+ }
+ 
+-
+-
+ /* 
+  * Phase 6 of "hunt for conflicts"
+  * called by ical_conflicts_phase5()
+diff -ruN citadel.orig/modules/extnotify/funambol65.c citadel/modules/extnotify/funambol65.c
+--- citadel.orig/modules/extnotify/funambol65.c	2008-04-11 16:26:48.000000000 +0200
++++ citadel/modules/extnotify/funambol65.c	2009-04-01 11:48:32.000000000 +0200
+@@ -16,6 +16,7 @@
+ #include <sys/socket.h>
+ #include <time.h>
+ #include <libcitadel.h>
++#include <errno.h>
+ 
+ #include "citadel.h"
+ #include "citadel_dirs.h"
+@@ -34,20 +35,45 @@
+ int notify_funambol_server(char *user) {
+ 	char port[1024];
+ 	int sock = -1;
+-	char *buf;
+-	char *SOAPMessage;
+-	char *SOAPHeader;
+-	char *funambolCreds;
+-	FILE *template;
++	char *buf = NULL;
++	char *SOAPMessage = NULL;
++	char *SOAPHeader = NULL;
++	char *funambolCreds = NULL;
++	FILE *template = NULL;
+ 	
+ 	sprintf(port, "%d", config.c_funambol_port);
+ 	sock = sock_connect(config.c_funambol_host, port, "tcp");
+ 	if (sock >= 0) 
+ 		CtdlLogPrintf(CTDL_DEBUG, "Connected to Funambol!\n");
+-	else 
++	else {
++		char buf[SIZ];
++
++		snprintf(buf, SIZ, 
++			 "Unable to connect to %s:%d [%s]; won't send notification\r\n", 
++			 config.c_funambol_host, 
++			 config.c_funambol_port, 
++			 strerror(errno));
++		CtdlLogPrintf(CTDL_ERR, buf);
++
++		aide_message(buf, "External notifier unable to connect remote host!");
+ 		goto bail;
++	}
+ 	// Load the template SOAP message. Get mallocs done too
+ 	template = fopen(file_funambol_msg, "r");
++
++	if (template == NULL) {
++		char buf[SIZ];
++
++		snprintf(buf, SIZ, 
++			 "Cannot load template file %s [%s]won't send notification\r\n", 
++			 file_funambol_msg, strerror(errno));
++		CtdlLogPrintf(CTDL_ERR, buf);
++
++		aide_message(buf, "External notifier unable to find message template!");
++		goto free;
++	}
++
++
+ 	buf = malloc(SIZ);
+ 	memset(buf, 0, SIZ);
+ 	SOAPMessage = malloc(3072);
+@@ -65,7 +91,14 @@
+ 	fclose(template);
+ 	
+ 	if (strlen(SOAPMessage) < 0) {
+-		printf("Cannot load template file\r\n");
++		char buf[SIZ];
++
++		snprintf(buf, SIZ, 
++			 "Cannot load template file %s; won't send notification\r\n", 
++			 file_funambol_msg);
++		CtdlLogPrintf(CTDL_ERR, buf);
++
++		aide_message(buf, "External notifier unable to load message template!");
+ 		goto free;
+ 	}
+ 	// Do substitutions
+diff -ruN citadel.orig/modules/sieve/serv_sieve.c citadel/modules/sieve/serv_sieve.c
+--- citadel.orig/modules/sieve/serv_sieve.c	2009-02-20 19:28:25.000000000 +0100
++++ citadel/modules/sieve/serv_sieve.c	2009-04-01 11:48:32.000000000 +0200
+@@ -518,7 +518,10 @@
+ 
+ 	CtdlLogPrintf(CTDL_DEBUG, "Performing sieve processing on msg <%ld>\n", msgnum);
+ 
+-	msg = CtdlFetchMessage(msgnum, 0);
++	/*
++	 * Make sure you include message body so you can get those second-level headers ;)
++	 */
++	msg = CtdlFetchMessage(msgnum, 1);
+ 	if (msg == NULL) return;
+ 
+ 	/*
+diff -ruN citadel.orig/modules/smtp/serv_smtp.c citadel/modules/smtp/serv_smtp.c
+--- citadel.orig/modules/smtp/serv_smtp.c	2009-03-17 04:24:54.000000000 +0100
++++ citadel/modules/smtp/serv_smtp.c	2009-04-01 11:48:32.000000000 +0200
+@@ -1696,6 +1696,7 @@
+  */
+ void smtp_do_queue(void) {
+ 	static int doing_queue = 0;
++	int num_processed = 0;
+ 
+ 	/*
+ 	 * This is a simple concurrency check to make sure only one queue run
+@@ -1715,10 +1716,9 @@
+ 		CtdlLogPrintf(CTDL_ERR, "Cannot find room <%s>\n", SMTP_SPOOLOUT_ROOM);
+ 		return;
+ 	}
+-	CtdlForEachMessage(MSGS_ALL, 0L, NULL,
+-		SPOOLMIME, NULL, smtp_do_procmsg, NULL);
++	num_processed = CtdlForEachMessage(MSGS_ALL, 0L, NULL, SPOOLMIME, NULL, smtp_do_procmsg, NULL);
+ 
+-	CtdlLogPrintf(CTDL_INFO, "SMTP client: queue run completed\n");
++	CtdlLogPrintf(CTDL_INFO, "SMTP client: queue run completed; %d messages processed\n", num_processed);
+ 	run_queue_now = 0;
+ 	doing_queue = 0;
+ }
+diff -ruN citadel.orig/msgbase.c citadel/msgbase.c
+--- citadel.orig/msgbase.c	2009-02-20 19:28:25.000000000 +0100
++++ citadel/msgbase.c	2009-04-01 11:48:28.000000000 +0200
+@@ -3031,8 +3031,8 @@
+ /*
+  * Convenience function for generating small administrative messages.
+  */
+-void quickie_message(char *from, char *fromaddr, char *to, char *room, char *text, 
+-			int format_type, char *subject)
++void quickie_message(const char *from, const char *fromaddr, char *to, char *room, const char *text, 
++			int format_type, const char *subject)
+ {
+ 	struct CtdlMessage *msg;
+ 	struct recptypes *recp = NULL;
+diff -ruN citadel.orig/msgbase.h citadel/msgbase.h
+--- citadel.orig/msgbase.h	2008-09-12 04:22:17.000000000 +0200
++++ citadel/msgbase.h	2009-04-01 11:48:28.000000000 +0200
+@@ -100,7 +100,7 @@
+ long send_message (struct CtdlMessage *);
+ void loadtroom (void);
+ long CtdlSubmitMsg(struct CtdlMessage *, struct recptypes *, char *, int);
+-void quickie_message (char *, char *, char *, char *, char *, int, char *);
++void quickie_message (const char *, const char *, char *, char *, const char *, int, const char *);
+ void cmd_ent0 (char *entargs);
+ void cmd_dele (char *delstr);
+ void cmd_move (char *args);
+diff -ruN citadel.orig/network/funambol_newmail_soap.xml citadel/network/funambol_newmail_soap.xml
+--- citadel.orig/network/funambol_newmail_soap.xml	2008-01-31 19:53:48.000000000 +0100
++++ citadel/network/funambol_newmail_soap.xml	2009-04-01 11:48:28.000000000 +0200
+@@ -1,40 +0,0 @@
+-<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><sendNotificationMessages soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+-<arg0 xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">^notifyuser</arg0><arg1 xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
+-&lt;java version=&quot;1.5.0_13&quot; class=&quot;java.beans.XMLDecoder&quot;&gt; 
+- &lt;array class=&quot;com.funambol.framework.core.Alert&quot; length=&quot;1&quot;&gt; 
+-  &lt;void index=&quot;0&quot;&gt; 
+-   &lt;object class=&quot;com.funambol.framework.core.Alert&quot;&gt; 
+-    &lt;void property=&quot;cmdID&quot;&gt; 
+-     &lt;object class=&quot;com.funambol.framework.core.CmdID&quot;/&gt; 
+-    &lt;/void&gt; 
+-    &lt;void property=&quot;data&quot;&gt; 
+-     &lt;int&gt;206&lt;/int&gt; 
+-    &lt;/void&gt; 
+-    &lt;void property=&quot;items&quot;&gt; 
+-     &lt;void method=&quot;add&quot;&gt; 
+-      &lt;object class=&quot;com.funambol.framework.core.Item&quot;&gt; 
+-       &lt;void property=&quot;meta&quot;&gt; 
+-        &lt;object class=&quot;com.funambol.framework.core.Meta&quot;&gt; 
+-         &lt;void property=&quot;metInf&quot;&gt; 
+-          &lt;void property=&quot;type&quot;&gt; 
+-           &lt;string&gt;application/vnd.omads-email+xml&lt;/string&gt; 
+-          &lt;/void&gt; 
+-         &lt;/void&gt; 
+-        &lt;/object&gt; 
+-       &lt;/void&gt; 
+-       &lt;void property=&quot;target&quot;&gt; 
+-        &lt;object class=&quot;com.funambol.framework.core.Target&quot;&gt; 
+-         &lt;void property=&quot;locURI&quot;&gt; 
+-          &lt;string&gt;^syncsource&lt;/string&gt; 
+-         &lt;/void&gt; 
+-        &lt;/object&gt; 
+-       &lt;/void&gt; 
+-      &lt;/object&gt; 
+-     &lt;/void&gt; 
+-    &lt;/void&gt; 
+-   &lt;/object&gt; 
+-  &lt;/void&gt; 
+- &lt;/array&gt; 
+-&lt;/java&gt; 
+-</arg1><arg2 href="#id0"/></sendNotificationMessages>
+-<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef></soapenv:Body></soapenv:Envelope>
+diff -ruN citadel.orig/room_ops.c citadel/room_ops.c
+--- citadel.orig/room_ops.c	2008-04-11 16:26:49.000000000 +0200
++++ citadel/room_ops.c	2009-04-01 11:48:28.000000000 +0200
+@@ -181,7 +181,7 @@
+ 	if ( (userbuf->axlevel >= 6)
+ 	   || (userbuf->usernum == roombuf->QRroomaide)
+ 	   ) {
+-		retval = retval | UA_ADMINALLOWED | UA_DELETEALLOWED;
++		retval = retval | UA_ADMINALLOWED | UA_DELETEALLOWED | UA_POSTALLOWED;
+ 	}
+ 
+ NEWMSG:	/* By the way, we also check for the presence of new messages */
+diff -ruN citadel.orig/server_main.c citadel/server_main.c
+--- citadel.orig/server_main.c	2008-07-04 05:52:41.000000000 +0200
++++ citadel/server_main.c	2009-04-01 11:48:28.000000000 +0200
+@@ -310,6 +310,14 @@
+ 		start_chkpwd_daemon();
+ 	}
+ 
++
++	/*
++	 * check, whether we're fired up another time after a crash.
++	 * if, post an aide message, so the admin has a chance to react.
++	 */
++	checkcrash ();
++
++
+ 	/*
+ 	 * Now that we've bound the sockets, change to the Citadel user id and its
+ 	 * corresponding group ids
+diff -ruN citadel.orig/sysdep.c citadel/sysdep.c
+--- citadel.orig/sysdep.c	2009-03-17 04:24:55.000000000 +0100
++++ citadel/sysdep.c	2009-04-01 11:48:28.000000000 +0200
+@@ -566,13 +566,17 @@
+ 
+ void buffer_output(void) {
+ #ifdef HAVE_TCP_BUFFERING
+-	setsockopt(CC->client_socket, IPPROTO_TCP, TCP_CORK, &on, 4);
++	if (!CC->redirect_ssl) {
++		setsockopt(CC->client_socket, IPPROTO_TCP, TCP_CORK, &on, 4);
++	}
+ #endif
+ }
+ 
+ void unbuffer_output(void) {
+ #ifdef HAVE_TCP_BUFFERING
+-	setsockopt(CC->client_socket, IPPROTO_TCP, TCP_CORK, &off, 4);
++	if (!CC->redirect_ssl) {
++		setsockopt(CC->client_socket, IPPROTO_TCP, TCP_CORK, &off, 4);
++	}
+ #endif
+ }
+ 
+@@ -896,6 +900,9 @@
+ 	exit(0);
+ }
+ 
++int nFireUps = 0;
++int nFireUpsNonRestart = 0;
++pid_t ForkedPid = 1;
+ 
+ /*
+  * Start running as a daemon.
+@@ -951,9 +958,8 @@
+ 			}
+ 			waitpid(current_child, &status, 0);
+ 		}
+-
+ 		do_restart = 0;
+-
++		nFireUpsNonRestart = nFireUps;
+ 		/* Did the main process exit with an actual exit code? */
+ 		if (WIFEXITED(status)) {
+ 
+@@ -970,12 +976,16 @@
+ 			/* Any other exit code means we should restart. */
+ 			else {
+ 				do_restart = 1;
++				nFireUps++;
++				ForkedPid = current_child;
+ 			}
+ 		}
+ 
+ 		/* Any other type of termination (signals, etc.) should also restart. */
+ 		else {
+ 			do_restart = 1;
++			nFireUps++;
++			ForkedPid = current_child;
+ 		}
+ 
+ 	} while (do_restart);
+@@ -986,6 +996,28 @@
+ 
+ 
+ 
++void checkcrash(void)
++{
++	if (nFireUpsNonRestart != nFireUps)
++	{
++		StrBuf *CrashMail;
++
++		CrashMail = NewStrBuf();
++		CtdlLogPrintf (CTDL_ALERT, "----------------sending crash mail\n");
++		StrBufPrintf(CrashMail, 
++			     "Your CitServer is just recovering from an unexpected termination.\n"
++			     " this maybe the result of an error in citserver or an external influence.\n"
++			     " You can get more information on this by enabling coredumping; for more information see\n"
++			     " http://citadel.org/doku.php/faq:mastering_your_os:gdb#how.do.i.make.my.system.produce.core-files\n"
++			     " If you already did, the file you're looking for most probably is %score.%d\n"
++			     " Yours faithfully...",
++			     ctdl_run_dir, ForkedPid);
++		aide_message(ChrPtr(CrashMail), "Citadel server crashed.");
++		FreeStrBuf(&CrashMail);
++	}
++}
++
++
+ /*
+  * Generic routine to convert a login name to a full name (gecos)
+  * Returns nonzero if a conversion took place
+diff -ruN citadel.orig/sysdep_decls.h citadel/sysdep_decls.h
+--- citadel.orig/sysdep_decls.h	2009-02-20 19:28:25.000000000 +0100
++++ citadel/sysdep_decls.h	2009-04-01 11:48:28.000000000 +0200
+@@ -70,6 +70,7 @@
+ void kill_session (int session_to_kill);
+ void *sd_context_loop (struct CitContext *con);
+ void start_daemon (int do_close_stdio);
++void checkcrash(void);
+ void cmd_nset (char *cmdbuf);
+ int convert_login (char *NameToConvert);
+ void *worker_thread (void *arg);

Modified: citadel/trunk/debian/patches/series
===================================================================
--- citadel/trunk/debian/patches/series	2009-04-01 09:39:12 UTC (rev 312)
+++ citadel/trunk/debian/patches/series	2009-04-01 09:53:01 UTC (rev 313)
@@ -0,0 +1 @@
+743-744.diff




More information about the Pkg-citadel-commit mailing list