update from an ancient version to 1.2.1 which contains some security

fixes

ok ajacoutot sthen
This commit is contained in:
jcs 2019-10-14 21:05:07 +00:00
parent 347f66dd31
commit 21553158b2
10 changed files with 79 additions and 89 deletions

View File

@ -1,15 +1,12 @@
# $OpenBSD: Makefile,v 1.57 2019/07/12 20:43:47 sthen Exp $
# $OpenBSD: Makefile,v 1.58 2019/10/14 21:05:07 jcs Exp $
COMMENT= handle external logins, send and receive faxes
VERSION= 1.1.37
RELEASE= Jun05
DISTNAME= mgetty${VERSION}-${RELEASE}
VERSION= 1.2.1
DISTNAME= mgetty-${VERSION}
PKGNAME= mgetty+sendfax-${VERSION}
CATEGORIES= comms
REVISION= 5
HOMEPAGE= http://mgetty.greenie.net/
# GPLv2
@ -17,8 +14,7 @@ PERMIT_PACKAGE= Yes
WANTLIB= c m util
MASTER_SITES= ftp://mgetty.greenie.net/pub/mgetty/source/1.2/ \
ftp://mgetty.greenie.net/pub/mgetty/source/1.1/
MASTER_SITES= ftp://mgetty.greenie.net/pub/mgetty/source/${VERSION:R}/
RUN_DEPENDS= print/ghostscript/gnu \
graphics/netpbm
@ -44,6 +40,7 @@ pre-install:
sed -i "s,usage\: faxrm,usage\: mgetty-faxrm,g" ${WRKSRC}/fax/faxrm.in
.endfor
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/mgetty+sendfax
chmod a+x ${WRKSRC}/mkidirs
post-install:
mv ${PREFIX}/bin/faxrm ${PREFIX}/bin/mgetty-faxrm

View File

@ -1,2 +1,2 @@
SHA256 (mgetty1.1.37-Jun05.tar.gz) = b/jLxPiqzT3X8kf/lnFRQbxhc3ReqRbdmLg4GoXs3w4=
SIZE (mgetty1.1.37-Jun05.tar.gz) = 1057939
SHA256 (mgetty-1.2.1.tar.gz) = yKcvXKQULjBietFnJcQGkvsJ5ihFFDkrlawCBiysmok=
SIZE (mgetty-1.2.1.tar.gz) = 1077415

View File

@ -1,34 +1,27 @@
$OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
--- Makefile.orig Sat Jun 5 11:48:22 2010
+++ Makefile Mon Jun 7 07:56:18 2010
$OpenBSD: patch-Makefile,v 1.7 2019/10/14 21:05:07 jcs Exp $
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -6,7 +6,7 @@
# grok my code, so please use gcc there. On ISC 4.0, use "icc".).
#
# if you are cross-compiling, this is the C compiler for the target platform
-CC=gcc
+#CC=gcc
#CC=cc
-CC=cc
+#CC=cc
#CC=gcc
#
# if you are cross-compiling, *this* needs to be the C compiler that
@@ -109,7 +109,7 @@ HOSTCC=$(CC)
@@ -109,7 +109,8 @@ HOSTCC=$(CC)
# USTAT - ustat(), no statfs etc.
#
#CFLAGS=-Wall -O2 -pipe -DSECUREWARE -DUSE_POLL
-CFLAGS=-O2 -Wall -pipe
-CFLAGS=-Wall -O2 -pipe
+#CFLAGS=-Wall -O2 -pipe
+CFLAGS+=-DAUTO_PPP -DPREFIX=\"${PREFIX}\"
#CFLAGS=-O -DSVR4
#CFLAGS=-O -DSVR4 -DSVR42
#CFLAGS=-O -DUSE_POLL
@@ -151,7 +151,7 @@ CFLAGS=-O2 -Wall -pipe
# For Linux, add "-lutil" if the linker complains about "updwtmp".
#
LDFLAGS=
-LIBS=
+LIBS=-lutil
#LIBS=-lprot -lsocket # SCO Unix
#LIBS=-lsocket
#LIBS=-lbsd # OSF/1
@@ -171,7 +171,7 @@ LIBS=
@@ -171,7 +172,7 @@ LIBS=-lutil # FreeBSD or Linux/GNU libc2
#
# if your systems doesn't have one, use the shell script that I provide
# in "inst.sh" (taken from X11R5). Needed on IRIX5.2
@ -37,7 +30,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
#INSTALL=install -c -o root -g wheel # NeXT/BSD
#INSTALL=/usr/ucb/install -c -o bin -g bin # AIX, Solaris 2.x
#INSTALL=installbsd -c -o bin -g bin # OSF/1, AIX 4.1, 4.2
@@ -179,11 +179,11 @@ INSTALL=install -c -o bin -g bin
@@ -179,11 +180,11 @@ INSTALL=install -c -o bin -g bin
#
# prefix, where most (all?) of the stuff lives, usually /usr/local or /usr
#
@ -51,7 +44,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
#
# where the mgetty + sendfax binaries live (used for "make install")
#
@@ -199,7 +199,7 @@ LIBDIR=$(prefix)/lib/mgetty+sendfax
@@ -199,7 +200,7 @@ LIBDIR=$(prefix)/lib/mgetty+sendfax
#
# where the configuration files (*.config, aliases, fax.allow/deny) go to
#
@ -60,7 +53,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
#CONFDIR=/etc/default/
#
#
@@ -223,7 +223,7 @@ FAX_SPOOL_OUT=$(FAX_SPOOL)/outgoing
@@ -223,7 +224,7 @@ FAX_SPOOL_OUT=$(FAX_SPOOL)/outgoing
# (it's possible to run faxrunq(d) as root, but the FAX_OUT_USER
# MUST NOT BE root or any other privileged account).
#
@ -69,7 +62,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
#
#
# Where section 1 manual pages should be placed
@@ -270,7 +270,7 @@ PERL="/usr/bin/perl -w"
@@ -270,7 +271,7 @@ PERL="/usr/bin/perl -w"
# If you have Perl with TK extentions, define it here. This may be the
# same as PERL=... above, or different, if you have TkPerl statically
# linked.
@ -78,7 +71,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
#
#
# An echo program that understands escapes like "\n" for newline or
@@ -292,7 +292,7 @@ ECHO="echo"
@@ -292,7 +293,7 @@ ECHO="echo -e"
# To maintain security, I recommend creating a new group for
# users who are allowed to manipulate the recorded voice messages.
@ -87,7 +80,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
PHONE_PERMS=770
# Add -DNO_STRSTR to CFLAGS if you don't have strstr().
@@ -324,7 +324,7 @@ SFAXOBJ=sendfax.o logfile.o locks.o modem.o \
@@ -325,7 +326,7 @@ SFAXOBJ=sendfax.o logfile.o locks.o modem.o \
all: bin-all doc-man-only
@ -96,7 +89,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
# a few C files need extra compiler arguments
@@ -585,7 +585,7 @@ bindist: all doc-all sedscript
@@ -585,7 +586,7 @@ bindist: all doc-all sedscript
cd bindist; gtar cvvfz mgetty$(MR).$(SR)-bin.tgz *
@ -105,7 +98,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
install.bin: mgetty sendfax newslock \
login.config mgetty.config sendfax.config
@@ -593,32 +593,22 @@ install.bin: mgetty sendfax newslock \
@@ -593,32 +594,22 @@ install.bin: mgetty sendfax newslock \
# binaries
#
-test -d $(BINDIR) || ( ./mkidirs $(BINDIR) ; chmod 755 $(BINDIR) )
@ -147,7 +140,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
#
# test for outdated stuff
#
@@ -632,28 +622,17 @@ install.bin: mgetty sendfax newslock \
@@ -632,28 +623,17 @@ install.bin: mgetty sendfax newslock \
#
# fax spool directories
#
@ -179,7 +172,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
FAX_OUT_USER=$(FAX_OUT_USER) \
BINDIR=$(BINDIR) SBINDIR=$(SBINDIR) \
LIBDIR=$(LIBDIR) CONFDIR=$(CONFDIR)
@@ -663,14 +642,14 @@ install.bin: mgetty sendfax newslock \
@@ -663,14 +643,14 @@ install.bin: mgetty sendfax newslock \
if [ ! -z "$(INSTALL_MECHO)" ] ; then \
cd compat ; \
$(CC) $(CFLAGS) -o mg.echo mg.echo.c && \
@ -196,7 +189,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
MAN1DIR=$(MAN1DIR) \
MAN4DIR=$(MAN4DIR) \
MAN5DIR=$(MAN5DIR) \
@@ -681,7 +660,7 @@ install.doc:
@@ -681,7 +661,7 @@ install.doc:
# WWW frontend stuff
#
install.www:
@ -205,7 +198,7 @@ $OpenBSD: patch-Makefile,v 1.6 2010/06/07 05:59:27 ajacoutot Exp $
BINDIR=$(BINDIR) \
LIBDIR=$(LIBDIR) CONFDIR=$(CONFDIR)
#
@@ -699,7 +678,7 @@ vgetty:
@@ -699,7 +679,7 @@ vgetty:
vgetty-install: sedscript
cd voice; $(MAKE) CFLAGS="$(CFLAGS)" CC="$(CC)" LDFLAGS="$(LDFLAGS)" \

View File

@ -1,9 +1,13 @@
$OpenBSD: patch-doc_Makefile,v 1.4 2010/06/07 05:59:27 ajacoutot Exp $
--- doc/Makefile.orig Wed Feb 18 09:15:59 2009
+++ doc/Makefile Mon Jun 7 07:51:55 2010
@@ -26,7 +26,7 @@ MAN_FMT_PRG=$(NROFF) -man
$OpenBSD: patch-doc_Makefile,v 1.5 2019/10/14 21:05:07 jcs Exp $
Index: doc/Makefile
--- doc/Makefile.orig
+++ doc/Makefile
@@ -24,9 +24,9 @@ INFODIR=/usr/local/info
MAN_FMT_PRG=$(NROFF) -man
all: manpages fmt-manpages mgetty.texi
-all: manpages fmt-manpages mgetty.texi
+all: manpages mgetty.texi
-doc-all: mgetty.asc mgetty.info mgetty.dvi mgetty.ps fmt-manpages $(MANSRC)
+doc-all: mgetty.info fmt-manpages $(MANSRC)
@ -11,7 +15,7 @@ $OpenBSD: patch-doc_Makefile,v 1.4 2010/06/07 05:59:27 ajacoutot Exp $
manpages: $(MANSRC)
@@ -43,7 +43,7 @@ mgetty.html: mgetty.texi
-texi2html -verbose mgetty.texi
-texi2any --verbose --html --force --no-split mgetty.texi
mgetty.info: mgetty.texi
- -makeinfo mgetty.texi

View File

@ -1,6 +1,7 @@
$OpenBSD: patch-doc_mgetty_texi_in,v 1.3 2007/03/23 20:28:28 ajacoutot Exp $
--- doc/mgetty.texi-in.orig Fri Dec 30 22:43:49 2005
+++ doc/mgetty.texi-in Fri Mar 23 20:32:36 2007
$OpenBSD: patch-doc_mgetty_texi_in,v 1.4 2019/10/14 21:05:07 jcs Exp $
Index: doc/mgetty.texi-in
--- doc/mgetty.texi-in.orig
+++ doc/mgetty.texi-in
@@ -17,6 +17,11 @@ This is the online documentation for the mgetty + send
package.
@ -13,7 +14,7 @@ $OpenBSD: patch-doc_mgetty_texi_in,v 1.3 2007/03/23 20:28:28 ajacoutot Exp $
@end ifinfo
@titlepage
@@ -1480,7 +1485,7 @@ FAX_NOTIFY_PROGRAM @var{<hangup code>} '@var{<sender i
@@ -1517,7 +1522,7 @@ FAX_NOTIFY_PROGRAM @var{<hangup code>} '@var{<sender i
@var{<hangup code>} is 0 if the receive was successful, non-zero
otherwise. @var{<sender id>} is the fax identification string received

View File

@ -1,7 +1,8 @@
$OpenBSD: patch-fax_faxspool_in,v 1.3 2010/06/07 05:59:27 ajacoutot Exp $
--- fax/faxspool.in.orig Fri Jun 4 15:01:49 2010
+++ fax/faxspool.in Mon Jun 7 07:51:55 2010
@@ -417,11 +417,11 @@ fs_cvt_pdf()
$OpenBSD: patch-fax_faxspool_in,v 1.4 2019/10/14 21:05:07 jcs Exp $
Index: fax/faxspool.in
--- fax/faxspool.in.orig
+++ fax/faxspool.in
@@ -432,11 +432,11 @@ fs_cvt_pdf()
# user name (for fax header only! auth is done by faxq-helper via getuid())
##########

View File

@ -1,35 +1,36 @@
$OpenBSD: patch-g3_g3cat_c,v 1.1 2017/04/25 22:56:25 jca Exp $
--- g3/g3cat.c.orig Wed Apr 26 00:53:07 2017
+++ g3/g3cat.c Wed Apr 26 00:54:07 2017
@@ -43,6 +43,7 @@ static int padding = 0; /* default: no padding done
$OpenBSD: patch-g3_g3cat_c,v 1.2 2019/10/14 21:05:07 jcs Exp $
Index: g3/g3cat.c
--- g3/g3cat.c.orig
+++ g3/g3cat.c
@@ -60,6 +60,7 @@ static int padding = 0; /* default: no padding done
static int b_written = 0; /* bytes of a line already */
/* written */
+static
#ifdef __GNUC__
inline
static inline
#endif
@@ -66,6 +67,7 @@ void putcode _P2( (code, len), int code, int len )
@@ -83,6 +84,7 @@ void putcode _P2( (code, len), int code, int len )
}
}
+static
#ifdef __GNUC__
inline
static inline
#endif
@@ -97,6 +99,7 @@ void putwhitespan _P1( (l), int l )
@@ -114,6 +116,7 @@ void putwhitespan _P1( (l), int l )
putcode( t_white[l].bit_code, t_white[l].bit_length );
}
+static
#ifdef __GNUC__
inline
static inline
#endif
@@ -128,6 +131,7 @@ void putblackspan _P1( (l), int l )
@@ -145,6 +148,7 @@ void putblackspan _P1( (l), int l )
putcode( t_black[l].bit_code, t_black[l].bit_length );
}
+static
#ifdef __GNUC__
inline
static inline
#endif

View File

@ -1,13 +1,14 @@
$OpenBSD: patch-g3_pbm2g3_c,v 1.1 2017/04/25 22:56:25 jca Exp $
--- g3/pbm2g3.c.orig Wed Apr 26 00:51:45 2017
+++ g3/pbm2g3.c Wed Apr 26 00:54:34 2017
$OpenBSD: patch-g3_pbm2g3_c,v 1.2 2019/10/14 21:05:07 jcs Exp $
Index: g3/pbm2g3.c
--- g3/pbm2g3.c.orig
+++ g3/pbm2g3.c
@@ -39,6 +39,7 @@ static unsigned int out_hibit = 0;
static int out_byte_tab[ 256 ]; /* for g3 byte reversal */
+static
#ifdef __GNUC__
inline
static inline
#endif
@@ -59,6 +60,7 @@ void putcode _P2( (code, len), int code, int len )
}
@ -15,7 +16,7 @@ $OpenBSD: patch-g3_pbm2g3_c,v 1.1 2017/04/25 22:56:25 jca Exp $
+static
#ifdef __GNUC__
inline
static inline
#endif
@@ -68,6 +70,7 @@ void puteol _P0( void ) /* write byte-aligned EOL */
putcode( 0x800, 12 );
@ -23,7 +24,7 @@ $OpenBSD: patch-g3_pbm2g3_c,v 1.1 2017/04/25 22:56:25 jca Exp $
+static
#ifdef __GNUC__
inline
static inline
#endif
@@ -99,6 +102,7 @@ void putwhitespan _P1( (l), int l )
putcode( t_white[l].bit_code, t_white[l].bit_length );
@ -31,5 +32,5 @@ $OpenBSD: patch-g3_pbm2g3_c,v 1.1 2017/04/25 22:56:25 jca Exp $
+static
#ifdef __GNUC__
inline
static inline
#endif

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-mgetty_h,v 1.2 2017/12/26 06:08:48 jca Exp $
$OpenBSD: patch-mgetty_h,v 1.3 2019/10/14 21:05:07 jcs Exp $
Add mips64 and arm64 to the list of arches where pointers are longs, otherwise
char gets typedef'd to an int as p_int and breaks in conf_mg.c.
@ -6,7 +6,7 @@ char gets typedef'd to an int as p_int and breaks in conf_mg.c.
Index: mgetty.h
--- mgetty.h.orig
+++ mgetty.h
@@ -198,7 +198,7 @@ typedef unsigned char uch;
@@ -220,7 +220,7 @@ typedef unsigned char uch;
*/
#if defined(__alpha__) || defined(__sparc64__) || \
defined(__ia64__) || defined(__s390x__) || defined(__x86_64__) || \

View File

@ -1,6 +1,7 @@
$OpenBSD: patch-policy_h_dist,v 1.4 2007/03/23 20:28:28 ajacoutot Exp $
--- policy.h-dist.orig Wed Feb 22 14:56:31 2006
+++ policy.h-dist Fri Mar 23 20:33:12 2007
$OpenBSD: patch-policy_h_dist,v 1.5 2019/10/14 21:05:07 jcs Exp $
Index: policy.h-dist
--- policy.h-dist.orig
+++ policy.h-dist
@@ -48,7 +48,7 @@
* Normally, this is "/bin/login", just a few systems put "login"
* elsewhere (e.g. Free/NetBSD in "/usr/bin/login").
@ -10,7 +11,7 @@ $OpenBSD: patch-policy_h_dist,v 1.4 2007/03/23 20:28:28 ajacoutot Exp $
/* FidoNet mailer support
*
@@ -85,7 +85,7 @@
@@ -94,7 +94,7 @@
* ZyXELs use S40.2=1.
* If the path doesn't start with "/", it's relative to CONFDIR.
*/
@ -19,7 +20,7 @@ $OpenBSD: patch-policy_h_dist,v 1.4 2007/03/23 20:28:28 ajacoutot Exp $
/* If you want to use /etc/gettydefs to set tty flags, define this
@@ -114,7 +114,7 @@
@@ -123,7 +123,7 @@
/* group id that the device is chown()ed to. If not defined, the
* primary group of "DEVICE_OWNER" is used.
*/
@ -28,7 +29,7 @@ $OpenBSD: patch-policy_h_dist,v 1.4 2007/03/23 20:28:28 ajacoutot Exp $
/* access mode for the line while getty has it - it should be accessible
* by uucp / uucp, but not by others (imagine someone dialing into your
@@ -249,7 +249,7 @@
@@ -259,7 +259,7 @@
# ifdef linux
# define LOCK "/var/lock/LCK..%s"
# endif
@ -37,12 +38,3 @@ $OpenBSD: patch-policy_h_dist,v 1.4 2007/03/23 20:28:28 ajacoutot Exp $
# define LOCK "/var/spool/lock/LCK..%s"
# endif
#endif
@@ -564,7 +564,7 @@
#endif
#ifndef MAILER
-# define MAILER "/usr/lib/sendmail"
+# define MAILER "/usr/sbin/sendmail"
# define NEED_MAIL_HEADERS
#endif