[milters] Archive

Lists Index Date Thread Search

Article: 983
From: Rob McMahon
Date: 2006-06-21 11:28:09 -0400
Subject: milter-ahead on Solaris

Removal...........: milters-request@milter.info?subject=remove
More information..: http://www.milter.info/#Support

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I'm trying to get milter-ahead working on Solaris (9, x86), and I 
thought I'd share a few things.  I've had to configure libsnert with


-D__unix__ because Sun's compiler doesn't define __unix__, only __unix.
-D_POSIX_PTHREAD_SEMANTICS to get the two argument form of sigwait

(Interesting that the CHANGES.TXT mentions:
   !    Socket.c: fixed sigwait() function signature issues for:
        SunOS sbox 5.9 Generic_118558-05 sun4u sparc SUNW,Sun-Fire-480R
the manual says this:

     #include <signal.h>

     int sigwait(sigset_t *set);

     cc [ flag ... ] file ... -D_POSIX_PTHREAD_SEMANTICS [ library...]
     #include <signal.h>

     int sigwait(const sigset_t *set, int *sig);

In milter-ahead, the makefile was created with virtually no compiler 
options.  I had to edit it to say

CC      = cc -mt
CC_E    = -o
CC_O    =
CFLAGS  = -O -D__unix__ -I$(SNERT_INCDIR) -I/usr/local/include 
LDFLAGS = -L$(SNERT_LIBDIR) -L/usr/local/lib -L/usr/local/BerkeleyDB/lib 
LIBS    = -lsnert -lmilter -ldb -lresolv -lsocket -lnsl
TAR_I   =

It then compiled, but dumped core on virtually any use.  There's a lot 
of logging of NULL character pointers going on, which Solaris 
deliberately SEGV's on (you can preload 0@0, but that's horrible).  
Anyway, the attached patch to lib/mail/smf.c seems to have fixed the 
problem.  Now to try it in production ...

Hope this helps someone.



E-Mail:	Rob.McMahon@warwick.ac.uk		PHONE:  +44 24 7652 3037
Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England

Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

RCS file: smf.c,v
retrieving revision 1.1
diff -u1 -r1.1 smf.c
--- smf.c	2006/06/21 09:22:02	1.1
+++ smf.c	2006/06/21 10:57:15
@@ -447,3 +447,5 @@
 		TAG_FORMAT "enter smfAccessPattern(%lx, %s, %s, %lx)", TAG_ARGS,
-		(long) work, hay, pins, (long) actionp
+		(long) work, hay,
+		pins == NULL ? "(null)" : pins,
+		(long) actionp
@@ -672,3 +674,5 @@
 		TAG_FORMAT "exit  smfAccessPattern(%lx, %s, %s, %lx) rc=%d action='%s'",
-		(long) work, hay, pins, (long) actionp, access,
+		(long) work, hay,
+		pins == NULL ? "(null)" : pins,
+		(long) actionp, access,
 		actionp == NULL ? "(no action)" : (*actionp == NULL ? "NULL" :
@@ -1319,3 +1323,4 @@
 		TAG_ARGS, path->address.string, path->localLeft.string,
-		path->localRight.string, path->domain.string, auth_authen
+		path->localRight.string, path->domain.string,
+		auth_authen == NULL ? "(null)" : auth_authen


Lists Index Date Thread Search