#504367 libmilter-dev: should use const when appropriate in interfaces

Package:
libmilter-dev
Source:
sendmail
Description:
Sendmail Mail Filter API (Milter) (development files)
Submitter:
Russell Coker
Date:
2013-10-19 12:00:15 UTC
Severity:
wishlist
#504367#5
Date:
2008-11-03 03:53:33 UTC
From:
To:
I am using the following patch to make my milters build without error.
I have extensively tested it on CentOS 5, even though I have tested it
less on Debian I am confident in it's quality (the purpose of the code
is clear).

I have made no attempt to fix all relevant functions, I merely worked on
the functions that I use (and which I can test).

diff -ru sendmail-8.13.8.bak/include/libmilter/mfapi.h sendmail-8.13.8/include/libmilter/mfapi.h
--- sendmail-8.13.8.bak/include/libmilter/mfapi.h	2006-05-05 03:02:01.000000000 +1000
+++ sendmail-8.13.8/include/libmilter/mfapi.h	2008-10-12 13:21:09.000000000 +1100
@@ -94,7 +94,7 @@

 struct smfiDesc
 {
-	char		*xxfi_name;	/* filter name */
+	const char	*xxfi_name;	/* filter name */
 	int		xxfi_version;	/* version code -- do not change */
 	unsigned long	xxfi_flags;	/* flags */

@@ -334,7 +334,7 @@
 */

 /* Return the value of a symbol. */
-LIBMILTER_API char * smfi_getsymval __P((SMFICTX *, char *));
+LIBMILTER_API char * smfi_getsymval __P((SMFICTX *, const char *));

 /*
 **  Return the value of a symbol.
@@ -348,7 +348,7 @@
 **  the MTA for use in SMTP replies may call smfi_setreply before returning.
 */

#504367#10
Date:
2009-04-07 21:54:42 UTC
From:
To:
This one makes another function use const.
#504367#15
Date:
2009-10-09 00:39:09 UTC
From:
To:
The attached patch makes smfi_setconn() take a const char * parameter.