diff --git a/.gitignore b/.gitignore index 5dbf5d9..27f5542 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -milter-regex-1.7.tar.gz +milter-regex-1.8.tar.gz diff --git a/milter-regex-1.8-strlcat.patch b/milter-regex-1.8-strlcat.patch new file mode 100644 index 0000000..314655c --- /dev/null +++ b/milter-regex-1.8-strlcat.patch @@ -0,0 +1,96 @@ +This is the strlcat function from openbsd: +http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/string/strlcat.c + +It is of course BSD-licensed, just like milter-regex itself. + +--- /dev/null 2010-08-02 01:13:15.113045120 +0100 ++++ strlcat.c 2005-08-08 09:05:37.000000000 +0100 +@@ -0,0 +1,55 @@ ++/* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */ ++ ++/* ++ * Copyright (c) 1998 Todd C. Miller ++ * ++ * Permission to use, copy, modify, and distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#include ++#include ++ ++/* ++ * Appends src to string dst of size siz (unlike strncat, siz is the ++ * full size of dst, not space left). At most siz-1 characters ++ * will be copied. Always NUL terminates (unless siz <= strlen(dst)). ++ * Returns strlen(src) + MIN(siz, strlen(initial dst)). ++ * If retval >= siz, truncation occurred. ++ */ ++size_t ++strlcat(char *dst, const char *src, size_t siz) ++{ ++ char *d = dst; ++ const char *s = src; ++ size_t n = siz; ++ size_t dlen; ++ ++ /* Find the end of dst and adjust bytes left but don't go past end */ ++ while (n-- != 0 && *d != '\0') ++ d++; ++ dlen = d - dst; ++ n = siz - dlen; ++ ++ if (n == 0) ++ return(dlen + strlen(s)); ++ while (*s != '\0') { ++ if (n != 1) { ++ *d++ = *s; ++ n--; ++ } ++ s++; ++ } ++ *d = '\0'; ++ ++ return(dlen + (s - src)); /* count does not include NUL */ ++} +--- Makefile.linux.orig 2007-01-11 15:49:52.000000000 +0000 ++++ Makefile.linux 2010-08-13 09:55:38.047330128 +0100 +@@ -11,8 +11,8 @@ + + all: milter-regex milter-regex.cat8 + +-milter-regex: milter-regex.o eval.o strlcpy.o y.tab.o +- gcc -o milter-regex milter-regex.o eval.o strlcpy.o y.tab.o $(LDFLAGS) ++milter-regex: milter-regex.o eval.o strlcat.o strlcpy.o y.tab.o ++ gcc -o milter-regex milter-regex.o eval.o strlcat.o strlcpy.o y.tab.o $(LDFLAGS) + + milter-regex.o: milter-regex.c eval.h + gcc $(CFLAGS) -c milter-regex.c +@@ -20,6 +20,9 @@ + eval.o: eval.c eval.h + gcc $(CFLAGS) -c eval.c + ++strlcat.o: strlcat.c ++ gcc $(CFLAGS) -c strlcat.c ++ + strlcpy.o: strlcpy.c + gcc $(CFLAGS) -c strlcpy.c + +--- milter-regex.c.orig 2010-08-13 09:18:07.433332449 +0100 ++++ milter-regex.c 2010-08-13 09:58:12.098393196 +0100 +@@ -135,6 +135,7 @@ + + #if __linux__ || __sun__ + #define ST_MTIME st_mtime ++extern size_t strlcat(char *, const char *, size_t); + extern size_t strlcpy(char *, const char *, size_t); + #else + #define ST_MTIME st_mtimespec diff --git a/milter-regex-initscript b/milter-regex-initscript index a320a1b..a22935a 100644 --- a/milter-regex-initscript +++ b/milter-regex-initscript @@ -11,6 +11,7 @@ # Provides: milter-regex # Required-Start: $local_fs $network $syslog $named # Required-Stop: $local_fs $network $syslog $named +# Default-Stop: 0 1 6 # Short-Description: Start or stop Regex Milter # Description: Milter-regex allows regular expression based filtering of mail # messages as they arrive in sendmail diff --git a/milter-regex.spec b/milter-regex.spec index 50c256e..2837bdf 100644 --- a/milter-regex.spec +++ b/milter-regex.spec @@ -1,7 +1,7 @@ Name: milter-regex -Version: 1.7 -Release: 6%{?dist} -Summary: Sendmail milter plugin for regular expression filtering +Version: 1.8 +Release: 1%{?dist} +Summary: Sendmail milter plug-in for regular expression filtering Group: System Environment/Daemons License: BSD URL: http://www.benzedrine.cx/milter-regex.html @@ -10,10 +10,14 @@ Source1: milter-regex-initscript Source2: milter-regex-options Source3: milter-regex.conf Patch0: milter-regex-1.6-gcc.patch +Patch1: milter-regex-1.8-strlcat.patch Buildroot: %{_tmppath}/%{name}-%{release}-root-%(%{__id_u} -n) Buildrequires: sendmail-devel >= 8.13, byacc, groff Requires: sendmail +# This macro only defined by default around Fedora 10 time +%{?!_initddir:%global _initddir %{_initrddir}} + Requires(pre): shadow-utils Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig @@ -25,6 +29,7 @@ emails using regular expressions. %prep %setup -q %patch0 -p1 -b .gcc +%patch1 -p0 -b .strlcat %{__sed} -i -e 's|/etc/milter-regex\.conf|%{_sysconfdir}/mail/milter-regex.conf|; s|_milter-regex|mregex|' milter-regex.[8c] /usr/bin/head -n +31 milter-regex.c > LICENSE @@ -35,14 +40,14 @@ emails using regular expressions. %install %{__rm} -rf %{buildroot} %{__mkdir} -p \ - %{buildroot}%{_initrddir} \ + %{buildroot}%{_initddir} \ %{buildroot}%{_localstatedir}/spool/milter-regex \ %{buildroot}%{_mandir}/man8 \ %{buildroot}%{_sbindir} \ %{buildroot}%{_sysconfdir}/{mail,sysconfig} %{__install} -p -m 755 milter-regex %{buildroot}%{_sbindir}/ %{__install} -p -m 644 milter-regex.8 %{buildroot}%{_mandir}/man8/ -%{__install} -p -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/milter-regex +%{__install} -p -m 755 %{SOURCE1} %{buildroot}%{_initddir}/milter-regex %{__install} -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/milter-regex %{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/mail/milter-regex.conf @@ -61,12 +66,12 @@ exit 0 %preun if [ $1 -eq 0 ] ; then - %{_initrddir}/milter-regex stop &> /dev/null || : + %{_initddir}/milter-regex stop &> /dev/null || : /sbin/chkconfig --del milter-regex || : fi %postun -[ $1 -eq 0 ] && %{_initrddir}/milter-regexp try-restart &> /dev/null || : +[ $1 -ge 1 ] && %{_initddir}/milter-regex try-restart &> /dev/null || : %clean %{__rm} -rf %{buildroot} @@ -75,7 +80,7 @@ fi %defattr(-,root,root,-) %doc LICENSE %{_sbindir}/milter-regex -%{_initrddir}/milter-regex +%{_initddir}/milter-regex %config(noreplace) %{_sysconfdir}/sysconfig/milter-regex %config(noreplace) %{_sysconfdir}/mail/milter-regex.conf %dir %attr(755,mregex,mregex) %{_localstatedir}/spool/milter-regex/ @@ -83,14 +88,20 @@ fi %{_mandir}/man8/milter-regex.8* %changelog +* Fri Aug 13 2010 Paul Howarth - 1.8-1 +- update to 1.8 (log symbolic host name together with numeric IP address) +- add missing function strlcat from openbsd libc +- fix %%postun to restart the milter properly on package upgrades +- use %%{_initddir} rather than the deprecated %%{_initrddir} where possible + * Sat Jul 25 2009 Fedora Release Engineering - 1.7-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild +- rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Wed Feb 25 2009 Fedora Release Engineering - 1.7-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild +- rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Fri Feb 13 2009 Paul Howarth - 1.7-4 -- Rebuild for shared libmilter in Fedora 11 development +- rebuild for shared libmilter in Fedora 11 development * Mon Feb 18 2008 Paul Howarth - 1.7-3 - support config files with more than 507 rules (#304071) diff --git a/sources b/sources index b04d751..0f38c0d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0bef59aee17d7c87e36d9944b9665947 milter-regex-1.7.tar.gz +cd3a6753a7cebc74630136cd52503dad milter-regex-1.8.tar.gz