I am working on the 5.3.24 release now that I'm back from vacation. I wanted to post two patches though, that correct two big problems in 5.3.23.

The first is related to the timezone variable I used in vdelivermail. I've removed it and just use GMT time now. timezone-patch.txt fixed that problem.

Attachment: timezone-patch.txt
Description: application/applefile

diff -u vpopmail-5.3.23/vdelivermail.c vpopmail-5.3.24/vdelivermail.c
--- vpopmail-5.3.23/vdelivermail.c      Fri Jul 25 04:49:27 2003
+++ vpopmail-5.3.24/vdelivermail.c      Sun Aug  3 08:02:14 2003
@@ -1318,7 +1318,6 @@
 {
   time_t now;
   struct tm *tm;
-  unsigned int tz;
 
   static char *montab[12] = {
   "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
@@ -1328,19 +1327,14 @@
   };
   static char dh[39];
 
-  /* set timezone variable (seconds west of GMT) */
-  tzset();
-  tz = (unsigned int) abs(timezone / 60);
-
   /* look up current time and fill tm structure */
   time(&now);
-  tm = localtime(&now);
+  tm = gmtime(&now);
 
   snprintf (dh, sizeof(dh),
-    "Date: %s, %02u %s %u %02u:%02u:%02u %s%02u%02u\n",
+    "Date: %s, %02u %s %u %02u:%02u:%02u +0000\n",
     wday[tm->tm_wday], tm->tm_mday, montab[tm->tm_mon], tm->tm_year + 1900,
-    tm->tm_hour, tm->tm_min, tm->tm_sec, timezone > 0 ? "-" : "+",
-    tz / 60, tz % 60 * 100 / 60);
+    tm->tm_hour, tm->tm_min, tm->tm_sec);
 
   return dh;
 }


The second was segfaults in vadddomain and vdeldomain (and probably other code). patch-vget_assign.txt corrects the bug I introduced to vget_assign() in vpopmail.c

--- vpopmail-5.3.23/vpopmail.c  Thu Jul 24 07:35:10 2003
+++ vpopmail-5.3.24/vpopmail.c  Mon Aug  4 07:47:01 2003
@@ -1892,8 +1892,14 @@
   }
 
   /* this is a new lookup, free memory from last lookup if necc. */
-  if ( in_domain != NULL ) free(in_domain);
-  if ( in_dir != NULL ) free(in_dir);
+  if ( in_domain != NULL ) {
+    free(in_domain);
+    in_domain = NULL;
+  }
+  if ( in_dir != NULL ) {
+    free(in_dir);
+    in_dir = NULL;
+  }
 
   in_domain_size = 156;
   in_domain = malloc(in_domain_size);
@@ -1941,17 +1947,15 @@
     in_dir = malloc(in_dir_size);
     strncpy( in_dir, ptr, in_dir_size);
 
-    free(tmpstr);
     free(tmpbuf);
-    fclose(fs);
-    return(in_dir);
   } else {
     free(in_domain);
+    in_domain = NULL;
     in_domain_size = 0;
   }
   fclose(fs);
   free(tmpstr);
-  return(NULL);
+  return(in_dir);
 }
 
 int vget_real_domain(char *domain, int len )


--
Tom Collins
[EMAIL PROTECTED]
http://sniffter.com/ - info on the Sniffter hand-held Network Tester

Reply via email to