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 openpkg-web          Date:   30-Mar-2003 21:23:33
  Branch: HEAD                             Handle: 2003033020233101

  Added files:
    openpkg-src/procmail    procmail.patch
  Modified files:
    openpkg-src/procmail    procmail.spec
    openpkg-web             news.txt

  Log:
    - apply selected parts of the Debian procmail patch set
      which especially fixed three potential segmentation faults.
    - install mailstat command (plus patched-in manual page)
    - enable optional LTMP support
    - speclint cleanups

  Summary:
    Revision    Changes     Path
    1.1         +255 -0     openpkg-src/procmail/procmail.patch
    1.24        +10 -4      openpkg-src/procmail/procmail.spec
    1.3894      +1  -0      openpkg-web/news.txt
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/procmail/procmail.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1 procmail.patch
  --- /dev/null 2003-03-30 21:23:33.000000000 +0200
  +++ procmail.patch    2003-03-30 21:23:33.000000000 +0200
  @@ -0,0 +1,255 @@
  +--- man/procmail.man Tue Sep 11 06:54:43 2001
  ++++ man/procmail.man Sun Mar 30 21:13:44 2003
  +@@ -166,7 +166,8 @@
  + accept an unlimited number of [EMAIL PROTECTED]@
  + For some advanced usage of this option you should look in the
  + .B EXAMPLES
  +-section [EMAIL PROTECTED]@.SH ARGUMENTS
  ++section [EMAIL PROTECTED]@
  ++.SH ARGUMENTS
  + Any arguments containing an '=' are considered to be environment variable
  + assignments, they will
  + .I all
  +@@ -720,6 +721,15 @@
  + .na
  + .nf
  + @FW_content@
  ++.fi
  ++.ad
  ++.PP
  ++Some mailers (notably exim) do not currently accept the above syntax.
  ++In such case use this instead:
  ++.PP
  ++.na
  ++.nf
  ++|/usr/bin/procmail
  + .fi
  + .ad
  + .PP
  +--- man/procmailrc.man       Tue Sep 11 06:55:03 2001
  ++++ man/procmailrc.man       Sun Mar 30 21:13:44 2003
  +@@ -779,7 +779,7 @@
  + .PP
  + Some non-optimal and non-obvious regexps set MATCH to an incorrect
  + value.  The regexp can be made to work by removing one or more unneeded
  +-'*', '+', or '?' operator on the left-hand side of the \e/ token.
  ++\&'*', '+', or '?' operator on the left-hand side of the \e/ token.
  + .SH MISCELLANEOUS
  + If the regular expression contains [EMAIL PROTECTED]@\fP' it will be substituted by
  + .na
  +--- new/mailstat.1   Thu Jan  1 01:00:00 1970
  ++++ new/mailstat.1   Sun Mar 30 21:13:44 2003
  +@@ -0,0 +1,40 @@
  ++.TH MAILSTAT 1
  ++.SH NAME
  ++mailstat \- shows mail-arrival statistics
  ++.SH SYNOPSIS
  ++.B mailstat
  ++[\-klmots] [logfile]
  ++.SH DESCRIPTION
  ++.B mailstat
  ++parses a procmail-generated $LOGFILE and displays
  ++a summary about the messages delivered to all folders
  ++(total size, average size, nr of messages).
  ++The $LOGFILE is truncated to zero length, unless the
  ++.B -k
  ++option is used.
  ++Exit code 0 if mail arrived, 1 if no mail arrived.
  ++.SH OPTIONS
  ++.TP
  ++.I \-k
  ++keep logfile intact
  ++.TP
  ++.I \-l
  ++long display format
  ++.TP
  ++.I \-m
  ++merge any errors into one line
  ++.TP
  ++.I \-o
  ++use the old logfile
  ++.TP
  ++.I \-t
  ++terse display format
  ++.TP
  ++.I \-s
  ++silent in case of no mail
  ++.SH NOTES
  ++Customise to your heart's content, this program is only provided as a
  ++guideline.
  ++.SH AUTHOR
  ++This manual page was written by Santiago Vila <[EMAIL PROTECTED]>
  ++for the Debian GNU/Linux distribution (but may be used by others).
  +--- src/comsat.c     Tue Sep 11 06:55:46 2001
  ++++ src/comsat.c     Sun Mar 30 21:13:45 2003
  +@@ -92,7 +92,7 @@
  +    }
  +   if(newvalid)                                                /* so far, so good */
  +    { int s;
  +-     if(!*chp)                                                     /* no service */
  ++     if(!chad||!*chp)                                              /* no service */
  +     chp=BIFF_serviceport;                           /* new balls please! */
  +      s=strtol(chp,&chad,10);
  +      if(chp!=chad)                         /* the service is not numeric */
  +@@ -120,7 +120,7 @@
  + { int s;const char*p;
  +   if(!csvalid||!buf)                  /* is comat on and set to a valid address? */
  +      return;
  +-  if(!*cslgname||strlen(cslgname)+2>linebuf)               /* is $LOGNAME bogus? */
  ++  if(!cslgname||!*cslgname||strlen(cslgname)+2>linebuf)/* is $LOGNAME bogus? */
  +      return;
  +   if(!(p=folder?folder:cslastf))                 /* do we have a folder? */
  +      return;
  +--- src/foldinfo.h   Tue Dec  5 07:34:25 2000
  ++++ src/foldinfo.h   Sun Mar 30 21:13:45 2003
  +@@ -10,7 +10,7 @@
  + 
  + #define ft_lock(type)          ((type)>ft_MAILDIR)             /* kernel lock fd */
  + #define ft_atime(type)         ((type)==ft_FILE)          /* force atime < mtime */
  +-#define ft_dotlock(type)   ((type)==ft_FILE)                 /* dotlock $DEFAULT */
  ++#define ft_dotlock(type)   ((type)>ft_MAILDIR)               /* dotlock $DEFAULT */
  + #define ft_delim(type)         ((type)==ft_FILE)               /* add MMDF delim */
  + #define ft_checkcloser(type) ((type)>ft_MH)
  + #define ft_forceblank(type) ((type)!=ft_MAILDIR)  /* force blank line at end */
  +--- src/mailfold.c   Tue Sep 11 06:58:34 2001
  ++++ src/mailfold.c   Sun Mar 30 21:13:45 2003
  +@@ -378,7 +378,8 @@
  +     dfilled=mailread=0;
  +      else if(rhead)                         /* only read in a new header */
  +       { memblk new;
  +-    dfilled=mailread=0;makeblock(&new,0);readdyn(&new,&dfilled,0);
  ++    dfilled=mailread=0;makeblock(&new,0);
  ++    readdyn(&new,&dfilled,thebody-themail.p);
  +     if(tobesent>dfilled&&isprivate)              /* put it in place here */
  +      { tmemmove(themail.p+dfilled,thebody,filled-=tobesent);
  +        tmemmove(themail.p,new.p,dfilled);
  +--- src/manconf.c    Tue Sep 11 06:58:34 2001
  ++++ src/manconf.c    Sun Mar 30 21:13:44 2003
  +@@ -139,7 +139,7 @@
  + sh before procmail ever sees it; it is however a necessary kludge against\1\
  + overoptimising sendmail programs:\1");
  + #else
  +-  ps("FW_content","\"|exec @BINDIR@/procmail\"");
  ++  ps("FW_content","\"|exec @BINDIR@/procmail || exit 75\"");
  +   ps("FW_comment","");
  + #endif
  + #else
  +@@ -233,7 +233,7 @@
  +  [EMAIL PROTECTED]@\1and\1.BR [EMAIL PROTECTED]@ .\1");
  +   pc("LMTPOPT",LMTPOPT);
  + #else
  +-  ps("LMTPOPTdesc","");ps("LMTPusage","");
  ++  ps("LMTPOPTdesc","");ps("LMTPusage","\1");
  + #endif
  +   pname("INIT_UMASK",0);printf("0%lo/g\n",(unsigned long)INIT_UMASK);lines--;
  +   pn("DEFlinebuf",DEFlinebuf);
  +--- src/memblk.c     Fri Jun 29 04:20:56 2001
  ++++ src/memblk.c     Sun Mar 30 21:13:44 2003
  +@@ -51,11 +51,11 @@
  + {
  + #ifdef USE_MMAP
  +   if(mb->fd>=0)
  +-   { long len=mb->len+1;
  +-     if(munmap(mb->p,len))
  +-    mmapfailed(len);                      /* don't want to continue here */
  +-     if((mb->p=mmap(0,len,PROT_READ,MAP_PRIVATE,mb->fd,(off_t)0))==MAP_FAILED)
  +-    mmapfailed(len);
  ++   { long mlen=mb->len+1;
  ++     if(munmap(mb->p,mlen))
  ++    mmapfailed(mlen);                     /* don't want to continue here */
  ++     if((mb->p=mmap(0,mlen,PROT_READ,MAP_PRIVATE,mb->fd,(off_t)0))==MAP_FAILED)
  ++    mmapfailed(mlen);
  +      close(mb->fd);
  +      mb->fd=ropen(devnull,O_RDWR,0);                /* XXX Perhaps -1 is better? */
  +    }
  +@@ -77,8 +77,8 @@
  +      strcpy(filename,MMAP_DIR);
  +      if(unique(filename,strchr(filename,'\0'),MMAP_FILE_LEN,MMAP_PERM,0,0)&&
  +     (mb->fd=ropen(filename,O_RDWR,MMAP_PERM),unlink(filename),mb->fd>=0))
  +-      { mb->filelen=len;
  +-    if(lseek(mb->fd,mb->filelen-1,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
  ++      { mb->filelen=len+1;
  ++    if(lseek(mb->fd,len,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
  + dropf:       { close(mb->fd);mb->fd= -1;
  +        if(verbose)nlog("Unable to extend or use tempfile");
  +      }
  +@@ -98,9 +98,9 @@
  +       }
  +    }
  +   if(mb->fd>=0)
  +-   { if(len>mb->filelen)                              /* need to extend? */
  +-      { mb->filelen=len;
  +-    if(lseek(mb->fd,mb->filelen-1,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
  ++   { if(len>=mb->filelen)                             /* need to extend? */
  ++      { mb->filelen=len+1;
  ++    if(lseek(mb->fd,len,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
  +      { char*p=malloc(len+1);           /* can't extend, switch to malloc */
  +        tmemmove(p,mb->p,mb->len);
  +        munmap(mb->p,mb->len+1);
  +@@ -124,9 +124,9 @@
  +    }
  +   else
  +      mb->p=realloc(mb->p,len+1);
  +-  mb->len=len+1;
  +-  mb->p[len]='\0';
  ++  mb->len=len;
  + ret1:
  ++  mb->p[len]='\0';
  +   return 1;
  + }
  + 
  +--- src/memblk.h     Sat Jun 30 06:12:18 2001
  ++++ src/memblk.h     Sun Mar 30 21:13:44 2003
  +@@ -1,6 +1,6 @@
  + typedef struct memblk {
  +     char*p;                                           /* where it starts */
  +-    long len;                                        /* currently allocated size */
  ++    long len;                        /* current size, not including trailing NUL */
  + #ifdef USE_MMAP
  +     off_t filelen;                               /* how long is the file */
  +     int fd;                                    /* file which is mmap()ed */
  +--- src/pipes.c      Tue Sep 11 06:58:44 2001
  ++++ src/pipes.c      Sun Mar 30 21:13:45 2003
  +@@ -145,7 +145,9 @@
  +   if(Stdout)
  +    { *(eq=strchr(Stdout,'\0')-1)='\0';                           /* chop the '=' */
  +      if(!(backblock=getenv(Stdout)))                        /* no current value? */
  +-    PRDB=PWRB= -1;
  ++      { PRDB=PWRB= -1;
  ++    backlen=0;
  ++      }
  +      else
  +       { backlen=strlen(backblock);
  +     goto pip;
  +@@ -155,9 +157,7 @@
  + pip: rpipe(pbackfd);
  +   rpipe(pinfd);                                              /* main pipes setup */
  +   if(!(pidchild=sfork()))                   /* create a sending procmail */
  +-   { if(Stdout&&backblock)
  +-    backlen=strlen(backblock);
  +-     else
  ++   { if(!Stdout)
  +     backblock=source,backlen=len;
  +      childsetup();rclose(PRDI);rclose(PRDB);
  +      rpipe(poutfd);rclose(STDOUT);
  +@@ -194,7 +194,7 @@
  +      makeblock(&temp,Stdfilled);
  +      tmemmove(temp.p,Stdout,Stdfilled);
  +      readdyn(&temp,&Stdfilled,Stdfilled+backlen+1);
  +-     Stdout=realloc(Stdout,&Stdfilled+1);
  ++     Stdout=realloc(Stdout,Stdfilled+1);
  +      tmemmove(Stdout,temp.p,Stdfilled+1);
  +      freeblock(&temp);
  +      retStdout(Stdout,pwait&&pipw,!backblock);
  +--- src/procmail.c   Tue Sep 11 06:59:14 2001
  ++++ src/procmail.c   Sun Mar 30 21:13:45 2003
  +@@ -652,8 +652,7 @@
  +           nrcond= -1;
  +        if(tolock)            /* clear temporary buffer for lockfile name */
  +           free(tolock);
  +-       for(i=maxindex(flags);i;i--)                   /* clear the flags */
  +-          flags[i]=0;
  ++       bbzero(flags,sizeof(flags));           /* clear the flags */
  +        for(tolock=0,locknext=0;;)
  +         { chp=skpspace(chp);
  +           switch(i= *chp++)
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/procmail/procmail.spec
  ============================================================================
  $ cvs diff -u -r1.23 -r1.24 procmail.spec
  --- openpkg-src/procmail/procmail.spec        3 Jan 2003 10:54:21 -0000       1.23
  +++ openpkg-src/procmail/procmail.spec        30 Mar 2003 19:23:32 -0000      1.24
  @@ -33,11 +33,12 @@
   Group:        Mail
   License:      GPL
   Version:      3.22
  -Release:      20020206
  +Release:      20030330
   
   #   list of sources
   Source0:      ftp://ftp.procmail.org/pub/procmail/procmail-%{version}.tar.gz
   Source1:      procmailrc
  +Patch0:       procmail.patch
   
   #   build information
   Prefix:       %{l_prefix}
  @@ -58,6 +59,7 @@
   
   %prep
       %setup -q
  +    %patch -p0
   
   %build
       %{l_shtool} subst \
  @@ -65,6 +67,7 @@
           Makefile
       %{l_shtool} subst \
           -e 's;^/\*\(#define NO_fcntl_LOCK\);\1;' \
  +        -e 's;^/\*\(#define LMTP\);\1;' \
           -e 
's;\(#define.*ETCRC[^"]"\)[^"]*\(".*\);\1%{l_prefix}/etc/procmail/procmailrc\2;' \
           -e 's;\(#define.*ETCRCS[^"]"\)[^"]*\(".*\);\1%{l_prefix}/etc/procmail/\2;' \
           config.h
  @@ -93,9 +96,12 @@
           $RPM_BUILD_ROOT%{l_prefix}/etc/procmail \
           $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
           $RPM_BUILD_ROOT%{l_prefix}/man/man5
  -    %{l_shtool} install -c -s \
  +    %{l_shtool} install -c -s -m 755 \
           new/procmail new/lockfile new/formail \
           $RPM_BUILD_ROOT%{l_prefix}/bin/
  +    %{l_shtool} install -c -m 755 \
  +        new/mailstat \
  +        $RPM_BUILD_ROOT%{l_prefix}/bin/
       %{l_shtool} install -c -m 644 \
           new/*.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
       %{l_shtool} install -c -m 644 \
  @@ -106,8 +112,8 @@
   
       %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
           %{l_files_std} \
  -        '%attr(6755,root,mail)       %{l_prefix}/bin/procmail' \
  -        '%attr(2755,%{l_mgrp},mail) %{l_prefix}/bin/lockfile' \
  +        '%attr(6755,%{l_susr},mail) %{l_prefix}/bin/procmail' \
  +        '%attr(2755,%{l_mgrp},mail) %{l_prefix}/bin/lockfile'
   
   %files -f files
   
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-web/news.txt
  ============================================================================
  $ cvs diff -u -r1.3893 -r1.3894 news.txt
  --- openpkg-web/news.txt      30 Mar 2003 17:22:49 -0000      1.3893
  +++ openpkg-web/news.txt      30 Mar 2003 19:23:31 -0000      1.3894
  @@ -1,3 +1,4 @@
  +30-Mar-2003: Upgraded package: P<procmail-3.22-20030330>
   30-Mar-2003: Upgraded package: P<gd-2.0.12-20030330>
   30-Mar-2003: Upgraded package: P<gmime-2.0.4-20030330>
   30-Mar-2003: Upgraded package: P<spamassassin-2.53-20030330>
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to