Upgrade to 4.26

(working, but not cleanly configured)
This commit is contained in:
Andrey A. Chernov 2001-10-03 04:56:34 +00:00
parent ac92c41e6b
commit 438a732497
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=48380
7 changed files with 133 additions and 74 deletions

View file

@ -6,8 +6,7 @@
#
PORTNAME= drweb_sendmail
PORTVERSION= 4.25
PORTREVISION= 2
PORTVERSION= 4.26
CATEGORIES= security mail
MASTER_SITES= http://www.drweb.ru/ftp/web_pub/
DISTNAME= drwebd-${PORTVERSION}-freebsd4
@ -18,16 +17,20 @@ MAINTAINER= anton@urc.ac.ru
RUN_DEPENDS= ${LOCALBASE}/drweb/drwebd:${PORTSDIR}/security/drweb
WRKSRC= ${WRKDIR}/${DISTNAME}/clients/drwebdc
MAKEFILE= Makefile.unix
.include <bsd.port.pre.mk>
INST_PREFIX= ${PREFIX}/${PORTNAME}
SENDMAIL_DIR= /usr/src/contrib/sendmail
MF_INCDIR= ${SENDMAIL_DIR}/include/libmilter
LIBSMUTIL_DIR= /usr/src/lib/libsmutil
DOC_DIR= ${PREFIX}/share/doc/drweb-sendmail
.if defined(BATCH)
HOSTNAME= your.domain.name
.else
HOSTNAME!= hostname
.endif
.if exists( ${MF_INCDIR}/mfapi.h )
.if exists( ${SENDMAIL_DIR}/include/libmilter/mfapi.h )
SENDMAIL_VERSION!= ${AWK} '/^sendmail [0-9.]+$$/{print $$2}' ${SENDMAIL_DIR}/FREEBSD-upgrade
SENDMAIL_MAJOR!= ${ECHO} ${SENDMAIL_VERSION} | ${AWK} 'BEGIN{ FS="." }{ print $$1 }'
@ -47,30 +50,69 @@ IGNORE= "depends on the system sources. Please place them under /usr/src first"
post-extract:
cd ${WRKDIR}/${DISTNAME} && ${TAR} -xzf ${WRKDIR}/${DISTNAME}/${DISTNAME}.tar.gz clients/drwebdc clients/sendmail
pre-build:
${MKDIR} ${WRKSRC}/libmilter
post-configure:
${MKDIR} ${WRKSRC}/libmilter ${WRKSRC}/libsmutil
${CP} ${FILESDIR}/Makefile ${WRKSRC}/libmilter
${CP} ${LIBSMUTIL_DIR}/Makefile ${WRKSRC}/libsmutil
.if ${SENDMAIL_VERSION} == "8.11.1"
${CP} ${SENDMAIL_DIR}/libmilter/listener.c ${WRKSRC}/libmilter
${LN} -s ${SENDMAIL_DIR}/libmilter/libmilter.h ${WRKSRC}/libmilter
cd ${WRKSRC}/libmilter && ${PATCH} < ${WRKSRC}/../sendmail/listener.patch
cd ${WRKSRC}/libmilter && ${PATCH} < ${WRKSRC}/../sendmail/listener-8.11.1.patch
.elif ${SENDMAIL_VERSION} == "8.12.0"
${CP} ${SENDMAIL_DIR}/libmilter/listener.c ${WRKSRC}/libmilter
${LN} -s ${SENDMAIL_DIR}/libmilter/libmilter.h ${WRKSRC}/libmilter
cd ${WRKSRC}/libmilter && ${PATCH} < ${WRKSRC}/../sendmail/listener-8.12.0.patch
.endif
cd ${WRKSRC}/libmilter && ${MAKE} clean && ${MAKE}
cd ${WRKSRC}/libsmutil && ${MAKE} clean && ${MAKE} SENDMAIL_DIR=${SENDMAIL_DIR}
cd ${WRKSRC} && { \
${ECHO} ; \
${ECHO} ${MF_INCDIR} ; \
${ECHO} libmilter ; \
${ECHO} y; \
${ECHO} n; \
${ECHO} y; \
${ECHO} ${SENDMAIL8_12} ; \
${ECHO} ${SENDMAIL_DIR} ; \
${ECHO} ${CFLAGS} ; \
${ECHO} y; \
} | ./configure
# Not fully used yet
post-build:
cd ${WRKSRC}/../sendmail && { \
${ECHO} y; \
${ECHO} "${PREFIX}/sbin"; \
${ECHO} ; \
${ECHO} u; \
${ECHO} /var/run/drweb-smf.sock; \
${ECHO} root; \
${ECHO} "${PREFIX}/drweb/infected.!!!"; \
${ECHO} y; \
${ECHO} /tmp; \
${ECHO} y; \
${ECHO} ; \
${ECHO} postmaster@${HOSTNAME}; \
${ECHO} y; \
${ECHO} y; \
${ECHO} d; \
${ECHO} a; \
${ECHO} t; \
${ECHO} t; \
${ECHO} a; \
${ECHO} r; \
${ECHO} 160000; \
${ECHO} ${SENDMAIL8_12} ; \
${ECHO} n; \
${ECHO} y; \
${ECHO} ; \
} | ./configure
do-install:
${MKDIR} ${DOC_DIR}
${INSTALL_PROGRAM} ${WRKSRC}/drweb-smf ${PREFIX}/sbin/
${INSTALL_PROGRAM} ${WRKSRC}/drwebdc ${PREFIX}/drweb/
${INSTALL_DATA} ${WRKSRC}/../sendmail/readme.sendmail ${DOC_DIR}
${INSTALL_DATA} ${WRKSRC}/../sendmail/readme.sendmail.rus ${DOC_DIR}
${SED} 's#!!PREFIX!!#${PREFIX}#' < ${FILESDIR}/drweb-smf.sh >${WRKSRC}/drweb-smf.sh
cd ${WRKSRC}/../sendmail; \
${INSTALL_DATA} readme.* sendmail.*.addon ${DOC_DIR}
${SED} 's#!!PREFIX!!#${PREFIX}#g;s#!!HOSTNAME!!#${HOSTNAME}#g' \
< ${FILESDIR}/drweb-smf.sh >${WRKSRC}/drweb-smf.sh
# drwebsmf.sh instead drweb-smf.sh to start after drwebd.sh
${INSTALL_DATA} ${WRKSRC}/drweb-smf.sh ${PREFIX}/etc/rc.d/drwebsmf.sh-dist

View file

@ -1 +1 @@
MD5 (drwebd-4.25-freebsd4.tgz) = 6bbd1b39fb39cfd63bff42c2491d2272
MD5 (drwebd-4.26-freebsd4.tgz) = 4a58e3b573135558e1fe2da60c72bde4

View file

@ -9,8 +9,9 @@ start)
if [ -x $drwebfilter ] ; then
echo -n ' drweb-smf'
$drwebfilter -u/var/run/drwebd -m/var/run/drweb-smf.sock \
-a!!PREFIX!!/drweb/infected.!!! -f/tmp -r -x -h -l -ba \
-gpostmaster -epostmaster@your.domain.name
-a!!PREFIX!!/drweb/infected.!!! -f/tmp -r -x -h -l \
-t 160000 -bt -yt -ka -jr -zd \
-gpostmaster -epostmaster@!!HOSTNAME!!
fi
;;
stop)

View file

@ -1,12 +1,55 @@
--- configure.bak Fri Jun 29 09:06:30 2001
+++ configure Fri Aug 24 23:19:25 2001
@@ -21,6 +21,9 @@
"Linux"*)
OS="Linux"
;;
+ "FreeBSD 5"*)
+ OS="FreeBSD"
+ ;;
"FreeBSD 4"*)
OS="FreeBSD"
;;
--- configure.orig Thu Sep 27 01:00:45 2001
+++ configure Wed Oct 3 07:59:17 2001
@@ -105,6 +105,9 @@
if [ $MILTER_VER = "STD" ] ; then
SM_LIB="libsm"
SM_LIB_CMD="-lsm"
+ elif [ $OS = "FreeBSD_DW" ] ; then
+ SM_LIB="libsmutil"
+ SM_LIB_CMD="-lsmutil"
elif [ $OS = "Linux_DW" ] ; then
SM_LIB="libsmutil"
SM_LIB_CMD="-lsmutil"
@@ -140,40 +143,13 @@
rm -f configure.cache
echo $n "${SM_DIR}${c}" >> configure.cache
- OBJ_DIR=`ls -1 "$SM_DIR" | grep "obj.*"`
- if [ ! -d "$SM_DIR/$OBJ_DIR" ] ; then
- echo
- echo "Cannot found directory in that Sendmail puts results of compilation"
- echo "Please re-build Sendmail or enter name (not a path) of this directory"
- echo $n ">$c"
- read INPUT
- if [ "x$INPUT" = "x" ] ; then
- echo "Try later."
- exit 2
- elif [ ! -d "$SM_DIR/$INPUT" ] ; then
- echo "$SM_DIR/$INPUT not found"
- exit 1
- fi
- OBJ_DIR="$INPUT"
- fi
-
- if [ ! -f "$SM_DIR/$OBJ_DIR/libmilter/libmilter.a" ] ; then
- echo "Cannot found Milter library (libmilter.a)"
- echo "Please go to $SM_DIR/libmilter and build it"
- exit 1
- fi
- if [ "x$SM_LIB" != "x" -a ! -f "$SM_DIR/$OBJ_DIR/$SM_LIB/$SM_LIB.a" ] ; then
- echo "Cannot found additional library ($SM_LIB.a)"
- echo "Please go to $SM_DIR and check it"
- exit 1
- fi
rm -dfr include/libmilter
rm -f lib/libmilter.a
ln -s "$SM_DIR/include/libmilter" include/libmilter
- ln -s "$SM_DIR/$OBJ_DIR/libmilter/libmilter.a" lib/libmilter.a
+ ln -s "../libmilter/libmilter.a" lib/libmilter.a
if [ "x$SM_LIB" != "x" ] ; then
rm -f "lib/$SM_LIB.a"
- ln -s "$SM_DIR/$OBJ_DIR/$SM_LIB/$SM_LIB.a" "lib/$SM_LIB.a"
+ ln -s "../libsmutil/$SM_LIB.a" "lib/$SM_LIB.a"
fi
else
DRWEB_SM=""

View file

@ -1,38 +1,20 @@
--- dw_filter.c.orig Mon Jul 30 05:12:02 2001
+++ dw_filter.c Sun Sep 16 15:32:15 2001
@@ -239,7 +239,7 @@
{
priv->from = strdup( "<>" );
--- dw_filter.c.orig Thu Sep 27 01:00:46 2001
+++ dw_filter.c Wed Oct 3 06:25:53 2001
@@ -606,7 +606,7 @@
}
- syslog( LOG_MAIL | LOG_INFO, "Start proccessing from %s", priv->from );
+ syslog( LOG_MAIL | LOG_INFO, "Start processing from %s", priv->from );
else
{
- wprintLib( "block proccessing from <>" );
+ wprintLib( "block processing from <>" );
free_private_data( priv );
if( set_private_data( context, NULL ) != MI_SUCCESS )
{
@@ -621,7 +621,7 @@
wprintLib( "%s(%d) - no memory for private data", __FILE__, __LINE__ );
FAIL_EXIT( context, priv );
}
- wprintLib( "start proccessing from %s", priv->from );
+ wprintLib( "start processing from %s", priv->from );
priv->fname_tmp = strdup( ShareTemplate );
if( !priv->fname_tmp )
{
@@ -549,7 +549,7 @@
syslog( LOG_MAIL | LOG_DEBUG, "can not replace message" );
FAIL_EXIT( context, priv );
}
- if( bSenderNotify && priv->from && (strlen(priv->from) > 0) )
+ if( bSenderNotify && priv->from && *(priv->from) && strcmp(priv->from, "<>") != 0)
{
if( smfi_addrcpt( context, priv->from ) != MI_SUCCESS )
{
@@ -585,7 +585,7 @@
syslog( LOG_MAIL | LOG_ERR, "daemon return error (%s) - possible problem with daemon", getDaemonCode( status ) );
FAIL_EXIT( context, priv );
} /* else - normal message */
- syslog( LOG_MAIL | LOG_INFO, "Complite proccessing message from %s", priv->from );
+ syslog( LOG_MAIL | LOG_INFO, "Complete processing message from %s", priv->from );
free_private_data( priv );
if( set_private_data( context, NULL ) != MI_SUCCESS )
{
@@ -643,7 +643,7 @@
priv = get_private_data( context );
if( priv )
{
- syslog( LOG_MAIL | LOG_INFO, "Abort proccessing message from %s", priv->from );
+ syslog( LOG_MAIL | LOG_INFO, "Abort processing message from %s", priv->from );
free_private_data( priv );
if( set_private_data( context, NULL ) != MI_SUCCESS )
{

View file

@ -1,11 +0,0 @@
--- dwf_main.c.orig Mon Jul 30 05:14:43 2001
+++ dwf_main.c Sat Aug 25 19:44:40 2001
@@ -251,7 +251,7 @@
wprintLib( "can not change directory to root" );
return -1;
}
- umask( 0 );
+ umask( 0117 );
if( getrlimit( RLIMIT_NOFILE, &filelimit ) < 0 )
{
wprintLib( "can not get system limits" );

View file

@ -3,4 +3,6 @@ etc/rc.d/drwebsmf.sh-dist
sbin/drweb-smf
share/doc/drweb-sendmail/readme.sendmail
share/doc/drweb-sendmail/readme.sendmail.rus
share/doc/drweb-sendmail/sendmail.cf.addon
share/doc/drweb-sendmail/sendmail.mc.addon
@dirrm share/doc/drweb-sendmail