pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

spamd pkgsrc issues



Using the spamd package I had two issues:

Mar 29 23:32:25 pilchuck spamd[1046]: cannot chdir to /var/empty.

Mar 29 23:51:13 pilchuck spamd[1173]: can't exec /sbin/pfctl:No such file 
or directory

/var/empty should be ${VARBASE}/chroot/spamd

and

PATH_PFCTL should be ${PREFIX}/sbin/pfctl if using the package

I started making patches and was thinking about the config directory too, 
and then I saw you used sed (SUBST_*) for some of this.

Anyways, this is what I have, maybe some of this would be useful for you. 
Or you can just use the SUBST_STAGES for this also.

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/spamd/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile    7 Mar 2006 22:32:23 -0000       1.7
+++ Makefile    30 Mar 2006 08:29:57 -0000
@@ -1,6 +1,7 @@
 # $NetBSD: Makefile,v 1.7 2006/03/07 22:32:23 peter Exp $
 
 DISTNAME=              spamd-20060307
+PKGREVISION=           1
 CATEGORIES=            mail
 MASTER_SITES=          http://nedbsd.nl/~ppostma/pf/
 
@@ -15,12 +16,16 @@
 PKG_USERS=             _spamd:_spamd::Spam\ 
Daemon:${VARBASE}/chroot/spamd:/sbin/nologin
 PKG_GROUPS=            _spamd
 
+CPPFLAGS+=             -DSPAMD_HOME=\"${VARBASE}/chroot/spamd\"
 OWN_DIRS=              ${VARBASE}/chroot/spamd
 RCD_SCRIPTS=            pfspamd
 
 CONF_FILES=            ${PREFIX}/share/examples/spamd/spamd.conf \
                            ${PKG_SYSCONFDIR}/spamd.conf
 
+# PATH_SPAMD_CONF             "/usr/pkg/etc/spamd.conf"
+
+
 SUBST_CLASSES+=                fix
 SUBST_STAGE.fix=       post-patch
 SUBST_FILES.fix=       spamd/spamd.8
@@ -50,4 +55,13 @@
        ${INSTALL_DATA} ${WRKSRC}/etc/spamd.conf ${PREFIX}/share/examples/spamd
 
 .include "../../security/pflkm/buildlink3.mk"
+
+# Necessary so USE_BUILTIN.pflkm will be defined
+.include "../../security/pflkm/builtin.mk"
+
+# Using LOCALBASE instead of PREFIX, since not defined yet
+.if !empty(USE_BUILTIN.pflkm:M[Nn][Oo]) && exists(${LOCALBASE}/sbin/pfctl)
+CPPFLAGS+=     -DPATH_PFCTL=\"${LOCALBASE}/sbin/pfctl\"
+.endif
+
 .include "../../mk/bsd.pkg.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/mail/spamd/distinfo,v
retrieving revision 1.3
diff -u -r1.3 distinfo
--- distinfo    7 Mar 2006 22:32:23 -0000       1.3
+++ distinfo    30 Mar 2006 08:29:57 -0000
@@ -3,3 +3,6 @@
 SHA1 (spamd-20060307.tar.gz) = 9541b352e604fef27d9eb78c4dd63bb9b35c5894
 RMD160 (spamd-20060307.tar.gz) = 558448cec7aa4d65805b59c3294bfd6c7908182c
 Size (spamd-20060307.tar.gz) = 34303 bytes
+SHA1 (patch-aa) = 90378d3b8d3ff86525713bbbeb593b23befbb3e7
+SHA1 (patch-ab) = 2660196a1c0610242ebd35b7b7e9ab9cec25579a
+SHA1 (patch-ac) = 32ad8487b51ced874d87c4c30a299119c2eb5de1
$NetBSD$

--- spamd/spamd.c.orig  2006-03-29 23:35:44.000000000 -0800
+++ spamd/spamd.c       2006-03-29 23:41:51.000000000 -0800
@@ -1162,8 +1162,8 @@
        }
 
 jail:
-       if (chroot("/var/empty") == -1 || chdir("/") == -1) {
-               syslog(LOG_ERR, "cannot chdir to /var/empty.");
+       if (chroot(SPAMD_HOME) == -1 || chdir("/") == -1) {
+               syslog(LOG_ERR, "cannot chdir to " SPAMD_HOME ".");
                exit(1);
        }
 
--- spamd-setup/spamd-setup.c.orig      2006-03-29 23:55:11.000000000 -0800
+++ spamd-setup/spamd-setup.c   2006-03-29 23:56:12.000000000 -0800
@@ -42,8 +42,12 @@
 #include <zlib.h>
 
 #define PATH_FTP               "/usr/bin/ftp"
+#ifndef PATH_PFCTL
 #define PATH_PFCTL             "/sbin/pfctl"
+#endif
+#ifndef PATH_SPAMD_CONF
 #define PATH_SPAMD_CONF                "/usr/pkg/etc/spamd.conf"
+#endif
 #define SPAMD_ARG_MAX          256 /* max # of args to an exec */
 
 struct cidr {
--- spamd/grey.h.orig   2006-03-29 23:55:23.000000000 -0800
+++ spamd/grey.h        2006-03-29 23:56:36.000000000 -0800
@@ -21,7 +21,9 @@
 #define GREYEXP (60 * 60 * 4) /* remove grey entries after 4 hours */
 #define WHITEEXP (60 * 60 * 24 * 36) /* remove white entries after 36 days */
 #define TRAPEXP (60 * 60 * 24) /* hitting a spamtrap blacklists for a day */
+#ifndef PATH_PFCTL
 #define PATH_PFCTL "/sbin/pfctl"
+#endif
 #define DB_SCAN_INTERVAL 60
 #define PATH_SPAMD_DB "/var/db/spamd"
 


Thanks again for packaging this up. Stopping spam is making me happy :)
 
 Jeremy C. Reed

echo '9,J8HD,fDGG8B@?:536FC5=8@I;C5?@H5B0D@5GBIELD54DL>@8L?:5GDEJ8LDG1' |\
sed ss,s50EBsg | tr 0-M 'p.wBt SgiIlxmLhan:o,erDsduv/cyP'



Home | Main Index | Thread Index | Old Index