Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jan 2002 16:33:51 +0100 (CET)
From:      Thierry Thomas <thierry@pompo.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/34089: Maintainer-update: misc/libmcal causes errors in httpd
Message-ID:  <20020120153351.3AF677511@graf.pompo.net>

next in thread | raw e-mail | index | archive | help

>Number:         34089
>Category:       ports
>Synopsis:       Maintainer-update: misc/libmcal causes errors in httpd
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 20 07:40:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Thierry Thomas
>Release:        FreeBSD 4.5-RC i386
>Organization:
Kabbale Eros
>Environment:
System: FreeBSD graf.pompo.net 4.5-RC FreeBSD 4.5-RC #0: Sat Jan 12 16:26:48 CET 2002 root@graf.pompo.net:/usr/obj/mntsrc/src/sys/GRAF010429 i386


	
>Description:
	In some circumstances libmcal causes warnings and even errors in /var/log/httpd-error.log:

httpd in free(): warning: recursive call
httpd in free(): warning: page is already free
httpd in free(): warning: chunk is already free
httpd in free(): error: freelist is destroyed

>How-To-Repeat:
	Do not know exactly, but these errors occured when using kronolith.

>Fix:

	After applying the following patches (from libmcal's CVS) I have been
	playing with kronolith without noticing any warnings or erors.

	(+ bump portrevision + change maintainer address.)


diff -urN /usr/ports/misc/libmcal.orig/Makefile /usr/ports/misc/libmcal/Makefile
--- /usr/ports/misc/libmcal.orig/Makefile	Wed Dec 12 21:16:21 2001
+++ /usr/ports/misc/libmcal/Makefile	Sun Jan 20 13:51:58 2002
@@ -1,19 +1,19 @@
 # New ports collection makefile for:	libmcal
 # Date created:		Sat Oct 13 08:45:04 GMT 2001
-# Whom:			thierry@thomas.as
+# Whom:			thierry@pompo.net
 #
 # $FreeBSD: ports/misc/libmcal/Makefile,v 1.2 2001/12/12 20:16:21 ijliao Exp $
 #
 
 PORTNAME=	libmcal
 PORTVERSION=	0.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	misc
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
 DISTFILES=	${DISTNAME}${EXTRACT_SUFX} mcaldrivers-0.8.tar.gz
 
-MAINTAINER=	thierry@thomas.as
+MAINTAINER=	thierry@pompo.net
 
 LIB_DEPENDS=	ltdl.1:${PORTSDIR}/devel/libtool
 
diff -urN /usr/ports/misc/libmcal.orig/files/patch-ag /usr/ports/misc/libmcal/files/patch-ag
--- /usr/ports/misc/libmcal.orig/files/patch-ag	Sat Dec  8 21:29:55 2001
+++ /usr/ports/misc/libmcal/files/patch-ag	Sun Jan 20 13:22:58 2002
@@ -1,16 +1,17 @@
 --- icalroutines.c.orig	Tue Jan 25 04:08:10 2000
-+++ icalroutines.c	Thu May 11 21:43:23 2000
++++ icalroutines.c	Sun Jan 20 13:21:22 2002
 @@ -1,5 +1,5 @@
  /*
 - *	#$Id: icalroutines.c,v 1.1 2000/01/25 03:08:10 markie Exp $
-+ *	#$Id: icalroutines.c,v 1.2 2000/05/11 19:43:23 inan Exp $
++ *	#$Id: icalroutines.c,v 1.3 2001/12/10 03:16:41 chuck Exp $
   *
   * Libmcal - Modular Calendar Access Library 
   * Copyright (C) 1999 Mark Musone and Andrew Skalski
-@@ -594,3 +594,110 @@
+@@ -593,4 +593,111 @@
+                 }
                  putc(pad, out);
          }
- }
++}
 +
 +#define MAX(a,b) (a)>(b) ? (a) :(b) 
 +void
@@ -117,4 +118,4 @@
 +    } else {
 +        *output = RECUR_NONE;
 +    }
-+}
+ }
diff -urN /usr/ports/misc/libmcal.orig/files/patch-aj /usr/ports/misc/libmcal/files/patch-aj
--- /usr/ports/misc/libmcal.orig/files/patch-aj	Sat Dec  8 21:39:05 2001
+++ /usr/ports/misc/libmcal/files/patch-aj	Sun Jan 20 13:16:27 2002
@@ -1,9 +1,9 @@
 --- mcal.c.orig	Sun Feb 27 06:01:54 2000
-+++ mcal.c	Tue Jan  9 04:26:48 2001
++++ mcal.c	Sun Jan 20 13:13:15 2002
 @@ -1,5 +1,5 @@
  /*
 - *	$Id: mcal.c,v 1.6 2000/02/27 05:01:54 inan Exp $
-+ *	$Id: mcal.c,v 1.9 2001/01/09 03:26:48 markie Exp $
++ *	$Id: mcal.c,v 1.10 2001/12/10 03:16:41 chuck Exp $
   * Libmcal - Modular Calendar Access Library
   * Copyright (C) 1999 Mark Musone and Andrew Skalski
   *
@@ -121,19 +121,21 @@
  static bool		dummy_search_range(	CALSTREAM *stream,
  						const datetime_t *start,
  						const datetime_t *end);
-@@ -967,18 +1023,28 @@
+@@ -966,6 +1022,13 @@
+ 					unsigned long id);
  static bool		dummy_snooze(	CALSTREAM *stream,
  					unsigned long id);
- 
++static bool		 dummy_store(	CALSTREAM *stream,
++					const CALEVENT *event);
 +static bool		dummy_delete(	CALSTREAM *stream,
 +					char *calendar);
 +
 +static bool		dummy_rename(	CALSTREAM *stream,
 +					char *src,char *dest);
-+
+ 
  const CALDRIVER dummy_driver =
  {
- 	dummy_valid,
+@@ -973,12 +1036,17 @@
  	dummy_open,
  	dummy_close,
  	dummy_ping,
@@ -144,13 +146,14 @@
  	dummy_append,
  	dummy_remove,
  	dummy_snooze,
++	dummy_store,
 +	dummy_delete,
 +	dummy_rename,
 +	
  };
  
  
-@@ -1011,6 +1077,12 @@
+@@ -1011,6 +1079,12 @@
  	return false;
  }
  
@@ -163,10 +166,16 @@
  
  bool
  dummy_search_range(	CALSTREAM *stream,
-@@ -1052,6 +1124,18 @@
+@@ -1052,6 +1126,24 @@
  
  bool
  dummy_snooze(CALSTREAM *stream, unsigned long id)
++{
++	return false;
++}
++
++bool
++dummy_store(CALSTREAM *stream, const CALEVENT *event)
 +{
 +	return false;
 +}
diff -urN /usr/ports/misc/libmcal.orig/files/patch-al /usr/ports/misc/libmcal/files/patch-al
--- /usr/ports/misc/libmcal.orig/files/patch-al	Tue Dec 11 12:39:13 2001
+++ /usr/ports/misc/libmcal/files/patch-al	Sun Jan 20 13:38:13 2002
@@ -1,13 +1,14 @@
 --- mstore/mstore.c.orig	Mon Mar 27 06:07:12 2000
-+++ mstore/mstore.c	Tue Dec 11 08:56:58 2001
-@@ -1,4 +1,4 @@
++++ mstore/mstore.c	Sun Jan 20 13:36:14 2002
+@@ -1,31 +1,39 @@
 -/* $Id: mstore.c,v 1.11 2000/03/27 04:07:12 zircote Exp $ */
-+/* $Id: mstore.c,v 1.21 2001/05/07 17:37:10 chuck Exp $ */
++/* $Id: mstore.c,v 1.22 2001/12/25 02:41:44 chuck Exp $ */
  
  #include <stdlib.h>
  #include <string.h>
-@@ -6,26 +6,33 @@
+ #include <errno.h>
  #include <pwd.h>
++#include <sys/time.h>
  #include <unistd.h>
  #include <crypt.h>
 +
@@ -43,7 +44,7 @@
  static bool		mstore_search_range(	CALSTREAM *stream,
  						const datetime_t *start,
  						const datetime_t *end);
-@@ -44,12 +51,18 @@
+@@ -44,12 +52,18 @@
  					unsigned long id);
  static bool             mstore_store(   CALSTREAM *stream, 
  					const CALEVENT *modified_event);
@@ -62,7 +63,7 @@
  	mstore_search_range,
  	mstore_search_alarm,
  	mstore_fetch,
-@@ -57,6 +70,8 @@
+@@ -57,6 +71,8 @@
  	mstore_remove,
  	mstore_snooze,
  	mstore_store,
@@ -71,7 +72,7 @@
  };
  
  
-@@ -88,13 +103,98 @@
+@@ -88,13 +104,98 @@
  }
  
  
@@ -171,7 +172,7 @@
    if(!mpasswd)
      {
        printf("Error! couldn't open mpasswd file!\n");
-@@ -123,36 +223,31 @@
+@@ -123,36 +224,31 @@
      }
  	fclose(mpasswd);
        return false;
@@ -233,7 +234,7 @@
  }
  
  
-@@ -161,8 +256,6 @@
+@@ -161,8 +257,6 @@
  {
  	if (!addr->proto || strcasecmp(addr->proto, "mstore"))
  		return false;
@@ -242,7 +243,7 @@
  	return true;
  }
  
-@@ -197,10 +290,18 @@
+@@ -197,10 +291,18 @@
  	}
  
  		cc_login(&username, &password);
@@ -263,7 +264,7 @@
  	}
  
  	if (!reopen) {
-@@ -212,13 +313,23 @@
+@@ -212,13 +314,23 @@
  
  	if (options & CAL_LOGIN) {
  		/* Copy login_userbuf, folder. */
@@ -289,7 +290,7 @@
  
  	/* Set up folder_user */
  	if(addr->host)
-@@ -229,8 +340,13 @@
+@@ -229,8 +341,13 @@
  		DATA->login_user=DATA->login_userbuf;
  		if (addr->user) {
  		  /* Copy and split folder_userbuf */
@@ -304,7 +305,7 @@
  		  /* Check for identical folder/login users. */
  		  DATA->folder_user=DATA->folder_userbuf;
  		  if (	!strcmp(DATA->login_user, DATA->folder_user))
-@@ -246,7 +362,6 @@
+@@ -246,7 +363,6 @@
  		DATA->folder_user = DATA->login_user;
  	}
  
@@ -312,7 +313,7 @@
  	return stream;
  fail:
  	mstore_freestream(stream);
-@@ -270,6 +385,36 @@
+@@ -270,6 +386,36 @@
  }
  
  
@@ -349,17 +350,7 @@
  CALEVENT *read_event(FILE *calfile)
  {
  	char		line[100];
-@@ -277,7 +422,8 @@
- 	int		size;
- 	CALEVENT	*event;
- 
--	fgets(line, sizeof(line), calfile);
-+	if (fgets(line, sizeof(line), calfile) == NULL)
-+		return NULL;
- 	if (sscanf(line, "%d", &size) != 1)
- 		return NULL;
- 	buf = malloc(size + 2);
-@@ -334,17 +480,18 @@
+@@ -334,79 +480,75 @@
  	datetime_t	_end = DT_INIT;
  	FILE *calfile;
  	char userpath[1000];
@@ -378,21 +369,74 @@
  	rewind(calfile);
  
  	if (start) {
- 		if (!dt_hasdate(start))
-+//LM:should this be _start = NULL? and again below for end?
- 			start = NULL;
- 		else {
- 			dt_setdate(&_start,
-@@ -358,7 +505,7 @@
- 			dt_setdate(&_end, end->year, end->mon, end->mday);
+-		if (!dt_hasdate(start))
+-			start = NULL;
+-		else {
+-			dt_setdate(&_start,
+-				start->year, start->mon, start->mday);
+-		}
++	    if (!dt_hasdate(start)) {
++		// LM:should this be _start = NULL? and again below for end?
++		start = NULL;
++	    } else {
++		dt_setdate(&_start,
++			   start->year, start->mon, start->mday);
++	    }
  	}
- 
+ 	if (end) {
+-		if (!dt_hasdate(end))
+-			end = NULL;
+-		else
+-			dt_setdate(&_end, end->year, end->mon, end->mday);
+-	}
+-
 -	while((event=read_event(calfile))) {
-+	while((event = read_event(calfile))) {
- 		datetime_t	clamp = DT_INIT;
+-		datetime_t	clamp = DT_INIT;
+-
+-		if (!start)
+-			dt_setdate(&clamp, 1, JANUARY, 1);
+-		else {
+-			dt_setdate(&clamp,
+-				_start.year, _start.mon, _start.mday);
+-		}
++	    if (!dt_hasdate(end))
++	      end = NULL;
++	    else
++	      dt_setdate(&_end, end->year, end->mon, end->mday);
++	}
++    
++	while ((event = read_event(calfile))) {
++	    datetime_t	clamp = DT_INIT;
++	    
++	    if (!start) {
++		dt_setdate(&clamp, 1, JANUARY, 1);
++	    } else {
++		dt_setdate(&clamp,
++			   _start.year, _start.mon, _start.mday);
++	    }
+ 
+-		calevent_next_recurrence(event, &clamp, stream->startofweek);
+-		if (	dt_hasdate(&clamp) &&
+-			!(end && dt_compare(&clamp, &_end) > 0))
+-		{
+-			cc_searched(event->id);
+-		}
++	    calevent_next_recurrence(event, &clamp, stream->startofweek);
++	    if (dt_hasdate(&clamp) &&
++		!(end && dt_compare(&clamp, &_end) > 0)) {
++		cc_searched(event->id);
++	    }
+ 
+-		calevent_free(event);
++	    calevent_free(event);
+ 	}
+-	fclose(calfile);
+-	return true;
++    fclose(calfile);
++    return true;
+ }
+ 
  
- 		if (!start)
-@@ -385,28 +532,24 @@
  bool
  mstore_search_alarm(CALSTREAM *stream, const datetime_t *when)
  {
@@ -409,8 +453,8 @@
 -	if(!calfile)
 -	  {
 +	snprintf(userpath, 900, "%s/%s", DATA->base_path, DATA->folder_user);
-+	calfile=fopen (userpath, "a+");
-+	if(!calfile) {
++	calfile = fopen (userpath, "a+");
++	if (!calfile) {
  	    printf("Error! couldn't open calendar file!\n");
  	    exit(1);
 -	  }
@@ -431,7 +475,7 @@
  		}
  		calevent_free(event);
  	}
-@@ -422,13 +565,12 @@
+@@ -422,13 +564,12 @@
  	FILE		*calfile;
  	char		userpath[1000];
  
@@ -449,19 +493,83 @@
  	rewind(calfile);
  	while((event=read_event(calfile))) {
  		if(event->id==id) {
-@@ -459,8 +601,11 @@
- 	if (strcasecmp(addr->folder, "INBOX"))
- 		return false;
+@@ -445,43 +586,45 @@
+ 
+ 
+ bool
+-mstore_append(	CALSTREAM *stream, const CALADDR *addr,
+-			unsigned long *id, const CALEVENT *event)
++mstore_append(CALSTREAM *stream, const CALADDR *addr,
++              unsigned long *id, const CALEVENT *event)
+ {
+-	CALEVENT myevent;
+-	FILE *calfile;
+-	char userpath[1000];
++    CALEVENT myevent;
++    FILE *calfile;
++    char userpath[1000];
++    
++    if (addr->host) {
++	return false;
++    }
++    if (addr->user) {
++	return false;
++    }
++    if (strcasecmp(addr->folder, "INBOX")) {
++	return false;
++    }
+ 
+-	if (addr->host)
+-		return false;
+-	if (addr->user)
+-		return false;
+-	if (strcasecmp(addr->folder, "INBOX"))
+-		return false;
++    if (!dt_hasdate(&event->start)) {
++	return false;
++    }
+ 
+-	if (DATA->folder_userbuf)
+-		return false;
+-	if (!dt_hasdate(&event->start))
+-		return false;
++    snprintf(userpath, 900, "%s/%s", DATA->base_path, DATA->folder_user);
++    calfile = fopen(userpath, "a");
++    if (!calfile) {
++        printf("Error! couldn't open calendar file %s\n",userpath);
++	perror("mstore_append");
++        return false;
++    }
+ 
+-	snprintf(userpath,900,"%s/%s",DATA->base_path,DATA->folder_user);
+-	calfile=fopen (userpath,"a");
+-        if(!calfile)
+-          {
+-            printf("Error! couldn't open calendar file %s\n",userpath);
+-	    perror("mstore_append");
+-            return false;
+-          }
+-
+-	myevent = *event;
+-	myevent.id = time(NULL);
+-	write_event(calfile, &myevent);
++    myevent = *event;
++    myevent.id = time(NULL);
++    
++    write_event(calfile, &myevent);
+ 
+-	fclose(calfile);
++    fclose(calfile);
+ 
+-	*id = myevent.id;
++    *id = myevent.id;
+ 
+-	return true;
++    return true;
+ }
  
-+	/* comment this out so that we can share calendars
- 	if (DATA->folder_userbuf)
- 		return false;
-+	*/
-+	
- 	if (!dt_hasdate(&event->start))
- 		return false;
  
-@@ -609,3 +754,15 @@
+@@ -609,3 +752,15 @@
          return true;
  }
  

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020120153351.3AF677511>