OpenDKIM icon indicating copy to clipboard operation
OpenDKIM copied to clipboard

patch to opendkim.c --- ld: error: duplicate symbol: smfi_insheader

Open hdatma opened this issue 5 years ago • 2 comments

This is with libmiter (sendmail) 8.16.1

ld: error: duplicate symbol: smfi_insheader
>>> defined at opendkim.c
>>>            opendkim-opendkim.o:(smfi_insheader)
>>> defined at smfi.c:120
>>>            smfi.o:(.text+0x1D0) in archive /opt/libmilter/lib/libmilter.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error 1 in opendkim (Makefile:984 'opendkim')
*** Error 1 in opendkim (Makefile:1805 'all-recursive')
*** Error 1 in . (Makefile:537 'all-recursive')
*** Error 2 in /opt/src/opendkim-2.11.0-Beta2 (Makefile:425 'all')

hdatma avatar Jul 09 '20 10:07 hdatma

--- opendkim/opendkim.c.orig	2020-07-09 14:15:55.000000000 +0200
+++ opendkim/opendkim.c	2020-07-09 14:32:00.000000000 +0200
@@ -791,11 +791,12 @@
 **  BEGIN private section
 */
 
-#ifndef HAVE_SMFI_INSHEADER
 /*
 **  SMFI_INSHEADER -- stub for smfi_insheader() which didn't exist before
 **                    sendmail 8.13.0
 **
+**  It exists now, in sendmail's libmilter mfapi.h, so...
+**
 **  Parameters:
 **  	ctx -- milter context
 **  	idx -- insertion index
@@ -806,17 +807,6 @@
 **  	An sfsistat.
 */
 
-sfsistat 
-smfi_insheader(SMFICTX *ctx, int idx, char *hname, char *hvalue)
-{
-	assert(ctx != NULL);
-	assert(hname != NULL);
-	assert(hvalue != NULL);
-
-	return smfi_addheader(ctx, hname, hvalue);
-}
-#endif /* ! HAVE_SMFI_INSHEADER */
-
 /*
 **  DKIMF_GETPRIV -- wrapper for smfi_getpriv()
 **
@@ -882,11 +872,7 @@
 	if (testmode)
 		return dkimf_test_insheader(ctx, idx, hname, hvalue);
 	else
-#ifdef HAVE_SMFI_INSHEADER
 		return smfi_insheader(ctx, idx, hname, hvalue);
-#else /* HAVE_SMFI_INSHEADER */
-		return smfi_addheader(ctx, hname, hvalue);
-#endif /* HAVE_SMFI_INSHEADER */
 }
 
 /*

hdatma avatar Jul 09 '20 12:07 hdatma

Acknowledged. I'm working on the new release right now and will look at this as it gets debugged.

martinbogo avatar Jul 13 '20 15:07 martinbogo