Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Sep 2011 01:23:32 +0900
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        Andrey Chernov <ache@FreeBSD.org>, gshapiro@FreeBSD.org
Cc:        stable@FreeBSD.org, current@FreeBSD.org
Subject:   Re: System sendmail build fails with updated cyrus-sasl2 port
Message-ID:  <ygeehz38e7v.wl%ume@mahoroba.org>
In-Reply-To: <20110926115801.GA92276@vniz.net>
References:  <20110926115801.GA92276@vniz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--Multipart_Tue_Sep_27_01:23:32_2011-1
Content-Type: text/plain; charset=US-ASCII

Hi,

>>>>> On Mon, 26 Sep 2011 15:58:03 +0400
>>>>> Andrey Chernov <ache@FreeBSD.org> said:

ache> This is for 9 BETA2 or 10-CURRENT.
ache> Please fix it on either side. Apparently minor types mismatch within 
ache> sasl_callback_t type.

ache> cc -O2 -pipe -march=pentium4 
ache> -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/src 
ache> -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/include -I. -DNEWDB  
ache> -DTCPWRAPPERS -DMAP_REGEX -DDNSMAP -DNETINET6 -DSTARTTLS -D_FFR_TLS_1 
ache> -I/usr/local/include -DSASL=2 -std=gnu99 -fstack-protector 
ache> -Wsystem-headers -Werror -Wno-pointer-sign -c 
ache> /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/main.c
ache> cc1: warnings being treated as errors
ache> /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/main.c:112: warning: 
ache> initialization from incompatible pointer type
ache> /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/main.c:113: warning: 
ache> initialization from incompatible pointer type
ache> *** Error code 1

It seems 2.1.25 requires to cast to sasl_callback_ft.  How about the
attached patch?


--Multipart_Tue_Sep_27_01:23:32_2011-1
Content-Type: text/x-patch; type=patch; charset=US-ASCII
Content-Disposition: attachment; filename="sendmail-sasl-2.1.25.diff"
Content-Transfer-Encoding: 7bit

Index: contrib/sendmail/src/main.c
diff -u -p contrib/sendmail/src/main.c.orig contrib/sendmail/src/main.c
--- contrib/sendmail/src/main.c.orig	2011-06-22 13:00:26.000000000 +0900
+++ contrib/sendmail/src/main.c	2011-09-27 00:32:34.000000000 +0900
@@ -109,8 +109,8 @@ GIDSET_T	InitialGidSet[NGROUPS_MAX];
 #if SASL
 static sasl_callback_t srvcallbacks[] =
 {
-	{	SASL_CB_VERIFYFILE,	&safesaslfile,	NULL	},
-	{	SASL_CB_PROXY_POLICY,	&proxy_policy,	NULL	},
+	{	SASL_CB_VERIFYFILE,	(sasl_callback_ft)&safesaslfile,	NULL	},
+	{	SASL_CB_PROXY_POLICY,	(sasl_callback_ft)&proxy_policy,	NULL	},
 	{	SASL_CB_LIST_END,	NULL,		NULL	}
 };
 #endif /* SASL */
Index: contrib/sendmail/src/sendmail.h
diff -u contrib/sendmail/src/sendmail.h.orig contrib/sendmail/src/sendmail.h
--- contrib/sendmail/src/sendmail.h.orig	2011-06-22 13:00:27.000000000 +0900
+++ contrib/sendmail/src/sendmail.h	2011-09-27 00:57:43.000000000 +0900
@@ -133,10 +133,15 @@
 
 # if SASL == 2 || SASL >= 20000
 #  include <sasl/sasl.h>
+#  include <sasl/saslplug.h>
 #  include <sasl/saslutil.h>
+#  if SASL_VERSION_FULL < 0x020119
+typedef int (*sasl_callback_ft)(void);
+#  endif
 # else /* SASL == 2 || SASL >= 20000 */
 #  include <sasl.h>
 #  include <saslutil.h>
+typedef int (*sasl_callback_ft)(void);
 # endif /* SASL == 2 || SASL >= 20000 */
 # if defined(SASL_VERSION_MAJOR) && defined(SASL_VERSION_MINOR) && defined(SASL_VERSION_STEP)
 #  define SASL_VERSION (SASL_VERSION_MAJOR * 10000)  + (SASL_VERSION_MINOR * 100) + SASL_VERSION_STEP
Index: contrib/sendmail/src/usersmtp.c
diff -u -p contrib/sendmail/src/usersmtp.c.orig contrib/sendmail/src/usersmtp.c
--- contrib/sendmail/src/usersmtp.c.orig	2011-09-27 00:51:44.000000000 +0900
+++ contrib/sendmail/src/usersmtp.c	2011-09-27 00:51:52.000000000 +0900
@@ -524,15 +524,15 @@ static int attemptauth	__P((MAILER *, MC
 
 static sasl_callback_t callbacks[] =
 {
-	{	SASL_CB_GETREALM,	&saslgetrealm,	NULL	},
+	{	SASL_CB_GETREALM,	(sasl_callback_ft)&saslgetrealm,	NULL	},
 #define CB_GETREALM_IDX	0
-	{	SASL_CB_PASS,		&getsecret,	NULL	},
+	{	SASL_CB_PASS,		(sasl_callback_ft)&getsecret,	NULL	},
 #define CB_PASS_IDX	1
-	{	SASL_CB_USER,		&getsimple,	NULL	},
+	{	SASL_CB_USER,		(sasl_callback_ft)&getsimple,	NULL	},
 #define CB_USER_IDX	2
-	{	SASL_CB_AUTHNAME,	&getsimple,	NULL	},
+	{	SASL_CB_AUTHNAME,	(sasl_callback_ft)&getsimple,	NULL	},
 #define CB_AUTHNAME_IDX	3
-	{	SASL_CB_VERIFYFILE,	&safesaslfile,	NULL	},
+	{	SASL_CB_VERIFYFILE,	(sasl_callback_ft)&safesaslfile,	NULL	},
 #define CB_SAFESASL_IDX	4
 	{	SASL_CB_LIST_END,	NULL,		NULL	}
 };

--Multipart_Tue_Sep_27_01:23:32_2011-1
Content-Type: text/plain; charset=US-ASCII


--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

--Multipart_Tue_Sep_27_01:23:32_2011-1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygeehz38e7v.wl%ume>