aboutsummaryrefslogtreecommitdiff
path: root/comms
diff options
context:
space:
mode:
authorAlexander Langer <alex@FreeBSD.org>2000-06-27 11:59:36 +0000
committerAlexander Langer <alex@FreeBSD.org>2000-06-27 11:59:36 +0000
commit3f08af39e0424e72fbd67fc8bc307a37ce140d38 (patch)
tree7004f848d743675c1fec9984511aea9548d0fe48 /comms
parent4c48f0e44d775497426638ffe0e8a110e4c8a2c5 (diff)
downloadports-3f08af39e0424e72fbd67fc8bc307a37ce140d38.tar.gz
ports-3f08af39e0424e72fbd67fc8bc307a37ce140d38.zip
Notes
Diffstat (limited to 'comms')
-rw-r--r--comms/hylafax/Makefile39
-rw-r--r--comms/hylafax/distinfo5
-rw-r--r--comms/hylafax/files/patch-aa73
-rw-r--r--comms/hylafax/files/patch-ab81
-rw-r--r--comms/hylafax/files/patch-ac12
-rw-r--r--comms/hylafax/files/patch-ad347
-rw-r--r--comms/hylafax/files/patch-ae264
-rw-r--r--comms/hylafax/files/patch-af22
-rw-r--r--comms/hylafax/files/patch-ag82
-rw-r--r--comms/hylafax/files/patch-ai12
-rw-r--r--comms/hylafax/files/patch-aj345
-rw-r--r--comms/hylafax/pkg-message6
-rw-r--r--comms/hylafax/pkg-plist9
13 files changed, 1002 insertions, 295 deletions
diff --git a/comms/hylafax/Makefile b/comms/hylafax/Makefile
index 4ee8ccc63a82..fcefae554424 100644
--- a/comms/hylafax/Makefile
+++ b/comms/hylafax/Makefile
@@ -6,17 +6,14 @@
#
PORTNAME= hylafax
-PORTVERSION= 4.0.2
+PORTVERSION= 4.1.b2
CATEGORIES= comms
-MASTER_SITES= ftp://ftp.sgi.com/sgi/fax/source/ \
- ftp://ftp.leo.org/pub/comp/os/unix/networking/fax/hylafax/source/ \
- ftp://ftp.sisis.de/pub/hylafax/source/
-DISTNAME= ${PORTNAME}-v4.0pl2
-EXTRACT_SUFX= -tar.gz
+MASTER_SITES= ftp://ftp.hylafax.org/hylafax/source/BETA/
+DISTNAME= ${PORTNAME}-4.1beta2
PATCH_SITES= http://www.hylafax.org/patches/
-PATCHFILES= gcc-2.8.x.patch
-PATCH_DIST_STRIP= -p1
+PATCHFILES= tiff-3.5-interfaces.patch cvtDateTime.patch
+PATCH_DIST_STRIP= -p0
MAINTAINER= ports@FreeBSD.org
@@ -28,12 +25,8 @@ RUN_DEPENDS= bash:${PORTSDIR}/shells/bash2
LIB_DEPENDS= tiff.4:${PORTSDIR}/graphics/tiff \
jpeg.9:${PORTSDIR}/graphics/jpeg
-FORBIDDEN= "Security hole (buffer overflow yielding setuid uucp)"
-
DIST_SUBDIR= hylafax
-Y2K= http://www.hylafax.org/HylaFAQ/Q189.html
-
USE_GMAKE= yes
CONFIGURE_ARGS= --with-INSTALL="" \
--with-MAKE=gmake --with-CC=/usr/bin/cc \
@@ -41,18 +34,18 @@ CONFIGURE_ARGS= --with-INSTALL="" \
--with-TIFFINC="${LOCALBASE}/include"
HAS_CONFIGURE= yes
-MAN1= hylafax.1 faxalter.1 faxcover.1 faxmail.1 faxrm.1 faxstat.1 sendfax.1 \
+MAN1= hylafax.1 faxalter.1 faxcover.1 faxmail.1 faxrm.1 faxstat.1 sendfax.1 \
sendpage.1 sgi2fax.1 textfmt.1
-MAN5= pagesizes.5f typerules.5f \
- hylafax.5f cid.5f config.5f destctrls.5f dialrules.5f hosts.5f \
- info.5f log.5f pagermap.5f recvq.5f sendq.5f shutdown.5f status.5f \
- tsi.5f xferlog.5f
-MAN8= cqtest.8c choptest.8c dialtest.8c faxabort.8c faxaddmodem.8c \
- faxanswer.8c faxconfig.8c faxmodem.8c faxstate.8c faxcron.8c \
- faxgetty.8c faxinfo.8c faxq.8c faxqclean.8c faxquit.8c faxrcvd.8c \
- faxsend.8c faxsetup.8c faxwatch.8c hfaxd.8c mkcover.8c notify.8c \
- pagesend.8c pollrcvd.8c ps2fax.8c recvstats.8c tagtest.8c tiff2fax.8c \
- tiffcheck.8c tsitest.8c wedged.8c xferstats.8c
+MAN5= pagesizes.5f typerules.5f hosts.hfaxd.5f xferfaxlog.5f \
+ hylafax.5f cid.5f config.5f destctrls.5f dialrules.5f info.5f \
+ log.5f pagermap.5f recvq.5f sendq.5f shutdown.5f status.5f tsi.5f
+MAN8= cqtest.8c choptest.8c dialtest.8c faxabort.8c faxaddmodem.8c \
+ faxadduser.8c faxanswer.8c faxconfig.8c faxdeluser.8c faxmodem.8c \
+ faxstate.8c faxcron.8c faxgetty.8c faxinfo.8c faxq.8c faxqclean.8c \
+ faxquit.8c faxrcvd.8c faxsend.8c faxsetup.8c faxwatch.8c hfaxd.8c \
+ mkcover.8c notify.8c pagesend.8c pollrcvd.8c ps2fax.8c recvstats.8c \
+ tagtest.8c tiff2fax.8c tiffcheck.8c tsitest.8c wedged.8c \
+ xferfaxstats.8c
SUID_EXES= ${PREFIX}/sbin/faxgetty ${PREFIX}/sbin/faxq \
${PREFIX}/bin/faxrm ${PREFIX}/bin/faxalter
diff --git a/comms/hylafax/distinfo b/comms/hylafax/distinfo
index c9d5f43065e4..dac7d83400c1 100644
--- a/comms/hylafax/distinfo
+++ b/comms/hylafax/distinfo
@@ -1,2 +1,3 @@
-MD5 (hylafax/hylafax-v4.0pl2-tar.gz) = 59966e41f769770134b2c80c84245874
-MD5 (hylafax/gcc-2.8.x.patch) = 87175988e93d94c01325a8ea77cf24e2
+MD5 (hylafax/hylafax-4.1beta2.tar.gz) = d8560726e4f75093b9d6c7d1403694ce
+MD5 (hylafax/tiff-3.5-interfaces.patch) = c1d2847c9967a10961bb7fe123ecd8e6
+MD5 (hylafax/cvtDateTime.patch) = 57b2d1218e83504c85cf31c1e3746e4e
diff --git a/comms/hylafax/files/patch-aa b/comms/hylafax/files/patch-aa
new file mode 100644
index 000000000000..714f015fe18f
--- /dev/null
+++ b/comms/hylafax/files/patch-aa
@@ -0,0 +1,73 @@
+diff -ruN config/skel.orig config/skel
+--- config/skel.orig Sun Jan 10 01:09:38 1999
++++ config/skel Mon Jun 12 21:59:13 2000
+@@ -41,8 +41,8 @@
+ SessionTracing: 11 # log server-related operations
+ RecvFileMode: 0600 # recvd facsimile are not public
+ LogFileMode: 0600 # private log files
+-DeviceMode: 0600 # device is accessible only to uucp/fax
+-GettyArgs: "-h %l dx_%s" # requires modem to auto-detect fax/data
++DeviceMode: 0660 # device is accessible only to uucp/fax
++GettyArgs: "std.%s" # requires modem to auto-detect fax/data
+ QualifyTSI: "" # do not restrict inbound facsimile
+ SpeakerVolume: off # machine's are already too loud
+ RingsBeforeAnswer: 1 # answer on first ring
+diff -ruN configure.orig configure
+--- configure.orig Mon Jul 26 07:57:29 1999
++++ configure Mon Jun 12 22:07:43 2000
+@@ -247,7 +247,7 @@
+ test -d /usr/ucb && PATH=$PATH:/usr/ucb # Sun and others
+ test -d /usr/contrib/bin && PATH=$PATH:/usr/contrib/bin # BSDi
+ test -d /usr/5bin && PATH=/usr/5bin:$PATH:/usr/etc # Sun and others
+-test -d /usr/local/bin && PATH=/usr/local/bin:$PATH # for GNU stuff
++test -d /usr/local/bin && PATH=$PATH:/usr/local/bin # for GNU stuff
+ PATH=$PATH:$OPATH
+
+ POSIXLY_CORRECT=1; export POSIXLY_CORRECT # disable GNU extensions
+@@ -2312,6 +2312,8 @@
+ case $TARGET in
+ # XXX fill in for busted systems
+ *-univel-*) CONFIG_SOCKARGLENTYPE=size_t;;
++ *-freebsd4*) CONFIG_SOCKARGLENTYPE=u_int32_t;;
++ *-freebsd5*) CONFIG_SOCKARGLENTYPE=u_int32_t;;
+ *sysv4.2uw2*) CONFIG_SOCKARGLENTYPE=size_t;;
+ *-UnixWare*) CONFIG_SOCKARGLENTYPE=size_t;;
+ *-aix4*) CONFIG_SOCKARGLENTYPE=size_t;;
+@@ -2865,7 +2867,7 @@
+ printf("old include files: version %u\n", TIFFLIB_VERSION);
+ exit(-1);
+ }
+- if (strncmp(TIFFGetVersion(), "LIBTIFF, Version 3.4", 20) != 0) {
++ if (strncmp(TIFFGetVersion(), "LIBTIFF, Version 3.5", 20) != 0) {
+ printf("old library: version %s\n", TIFFGetVersion());
+ exit(-1);
+ } else
+@@ -3591,10 +3593,14 @@
+ return 0
+ }
+
+-if [ -z "$FONTMAP" ]; then
+- FONTMAP=`getGSFonts`
+-fi
+-Note "Setting the Fontmap path to $FONTMAP"
++case $TARGET in
++ *-freebsd*) PATH_AFM=/usr/local/lib/afm ;;
++ *) if [ -z "$FONTMAP" ]; then
++ FONTMAP=`getGSFonts`;
++ fi
++ Note "Setting the Fontmap path to $FONTMAP";;
++esac
++
+
+ #
+ # Location of Adobe Font Metric files.
+@@ -4044,7 +4050,8 @@
+ printConfig
+ checkForExecutable $PATH_SENDMAIL
+ checkForExecutable $PATH_GETTY
+- prompt "Are these ok [yes]?"; read ok
++ #prompt "Are these ok [yes]?"; read ok
++ ok=yes
+ test -z "$ok" && ok=yes
+ case "$ok" in
+ [1-9]|1[0-6]) promptForParameter $ok;;
diff --git a/comms/hylafax/files/patch-ab b/comms/hylafax/files/patch-ab
index 68a0e647df19..971ec8648ad8 100644
--- a/comms/hylafax/files/patch-ab
+++ b/comms/hylafax/files/patch-ab
@@ -1,37 +1,48 @@
---- configure.orig Sat Feb 14 04:46:28 1998
-+++ configure Sun Sep 5 13:47:48 1999
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/usr/local/bin/bash
- # $Id: configure,v 1.407 1998/02/07 14:35:55 guru Rel $
+diff -ruN etc/faxsetup.sh.in.orig etc/faxsetup.sh.in
+--- etc/faxsetup.sh.in.orig Thu Aug 5 04:11:42 1999
++++ etc/faxsetup.sh.in Mon Jun 12 21:52:46 2000
+@@ -1660,7 +1660,7 @@
#
- # HylaFAX Facsimile Software
-@@ -248,7 +248,7 @@
- test -d /usr/ucb && PATH=$PATH:/usr/ucb # Sun and others
- test -d /usr/contrib/bin && PATH=$PATH:/usr/contrib/bin # BSDi
- test -d /usr/5bin && PATH=/usr/5bin:$PATH:/usr/etc # Sun and others
--test -d /usr/local/bin && PATH=/usr/local/bin:$PATH # for GNU stuff
-+test -d /usr/local/bin && PATH=$PATH:/usr/local/bin # for GNU stuff
- PATH=$PATH:$OPATH
+ if onServer; then
+ signalINETD=no
+- if [ -f $SYSVINIT ]; then
++ if [ -f "$SYSVINIT" ]; then
+ # started by init at boot time
+ if [ $FAXQ_SERVER -eq 0 ]; then
+ cat <<EOF
+@@ -1674,7 +1674,7 @@
+ $FAXQ_SERVER=0
+ $HFAXD_SERVER=0
+ fi
+- if [ -f $INETDCONF -a $HFAXD_SERVER -eq 0 ]; then
++ if [ -f "$INETDCONF" -a $HFAXD_SERVER -eq 0 ]; then
+ E="hylafax stream tcp nowait $FAX $DIR_LIBEXEC/hfaxd hfaxd -I"
+ editInetdConf()
+ {
+@@ -1753,7 +1753,7 @@
+ isOK "$x" && editInetdConf
+ fi
+ fi
+- elif [ ! -f $INETDCONF -a $HFAXD_SERVER -eq 0 ]; then
++ elif [ ! -f "$INETDCONF" -a $HFAXD_SERVER -eq 0 ]; then
+ cat<<EOF
- POSIXLY_CORRECT=1; export POSIXLY_CORRECT # disable GNU extensions
-@@ -2820,7 +2820,8 @@
- printf("old include files: version %u\n", TIFFLIB_VERSION);
- exit(-1);
- }
-- if (strncmp(TIFFGetVersion(), "LIBTIFF, Version 3.4", 20) != 0) {
-+ if (strncmp(TIFFGetVersion(), "LIBTIFF, Version 3.4", 20) != 0 &&
-+ strncmp(TIFFGetVersion(), "LIBTIFF, Version 3.5", 20) != 0) {
- printf("old library: version %s\n", TIFFGetVersion());
- exit(-1);
- } else
-@@ -3966,7 +3967,8 @@
- printConfig
- checkForExecutable $PATH_SENDMAIL
- checkForExecutable $PATH_GETTY
-- prompt "Are these ok [yes]?"; read ok
-+# prompt "Are these ok [yes]?"; read ok
-+ ok=yes
- test -z "$ok" && ok=yes
- case "$ok" in
- [1-9]|1[0-9]) promptForParameter $ok;;
+
+@@ -1775,7 +1775,7 @@
+ #
+ if onServer; then
+ x=`(ypcat -k aliases) 2>/dev/null | $GREP -i '^faxmaster'` 2>/dev/null
+- if [ -z "$x" -a -f $ALIASES ]; then
++ if [ -z "$x" -a -f "$ALIASES" ]; then
+ x=`$GREP -i '^faxmaster' $ALIASES`
+ fi
+ if [ -z "$x" ]; then
+@@ -2160,7 +2160,7 @@
+ prompt "Should I restart the HylaFAX server processes [yes]?"; read x
+ if isOK "$x"; then
+ echo ""
+- if [ -x $SYSVINIT ]; then
++ if [ -x "$SYSVINIT" ]; then
+ echo $SYSVINIT start
+ $SYSVINIT start
+ else
diff --git a/comms/hylafax/files/patch-ac b/comms/hylafax/files/patch-ac
new file mode 100644
index 000000000000..5cdf85ba2edd
--- /dev/null
+++ b/comms/hylafax/files/patch-ac
@@ -0,0 +1,12 @@
+diff -ruN faxalter/faxalter.c++.orig faxalter/faxalter.c++
+--- faxalter/faxalter.c++.orig Sun Jun 13 00:40:58 1999
++++ faxalter/faxalter.c++ Mon Jun 12 21:52:37 2000
+@@ -185,7 +185,7 @@
+ va_list ap;
+ va_start(ap, fmt0);
+ char fmt[1024];
+- sprintf(fmt, "%s %s\n", groups ? "JGPARM" : "JPARM", fmt0);
++ snprintf(fmt, sizeof(fmt), "%s %s\n", groups ? "JGPARM" : "JPARM", fmt0);
+ script.append(fxStr::vformat(fmt, ap));
+ va_end(ap);
+ }
diff --git a/comms/hylafax/files/patch-ad b/comms/hylafax/files/patch-ad
index ee3f0c4529df..aa3c2c17026a 100644
--- a/comms/hylafax/files/patch-ad
+++ b/comms/hylafax/files/patch-ad
@@ -1,78 +1,269 @@
-To fit the FreeBSD tty device handling scheme.
-
-*** faxd/Getty.c++.orig Sun Apr 20 16:40:07 1997
---- faxd/Getty.c++ Sun Apr 20 16:40:31 1997
-***************
-*** 218,224 ****
- // NB: this is executed in the parent
- fxStr device = fxStr::format("%s/" | line, _PATH_DEV);
- Sys::chown(device, UUCPLock::getUUCPUid(), UUCPLock::getUUCPGid());
-! Sys::chmod(device, 0600); // reset protection
- }
-
- extern void vlogError(const char* fmt, va_list ap);
---- 218,224 ----
- // NB: this is executed in the parent
- fxStr device = fxStr::format("%s/" | line, _PATH_DEV);
- Sys::chown(device, UUCPLock::getUUCPUid(), UUCPLock::getUUCPGid());
-! Sys::chmod(device, 0660); // reset protection
- }
-
- extern void vlogError(const char* fmt, va_list ap);
-*** faxd/UUCPLock.c++.orig Wed Nov 27 08:21:38 1996
---- faxd/UUCPLock.c++ Sun Apr 20 17:09:21 1997
-***************
-*** 37,42 ****
---- 37,43 ----
- }
- #endif
- #include <pwd.h>
-+ #include <grp.h>
-
- /*
- * UUCP Device Locking Support.
-***************
-*** 146,153 ****
- if (!pwd)
- faxApp::fatal("Can not deduce identity of UUCP");
- UUCPuid = pwd->pw_uid;
-- UUCPgid = pwd->pw_gid;
- endpwent(); // paranoia
- }
- }
- uid_t UUCPLock::getUUCPUid() { setupIDs(); return UUCPuid; }
---- 147,159 ----
- if (!pwd)
- faxApp::fatal("Can not deduce identity of UUCP");
- UUCPuid = pwd->pw_uid;
- endpwent(); // paranoia
-+
-+ const group *grp = getgrnam("dialer");
-+ if (!grp)
-+ faxApp::fatal("Can not deduce identity of DIALER");
-+ UUCPgid = grp->gr_gid;
-+ endgrent(); // paranoia
- }
- }
- uid_t UUCPLock::getUUCPUid() { setupIDs(); return UUCPuid; }
-*** config/skel.orig Sun Apr 20 21:53:58 1997
---- config/skel Sun Apr 20 21:54:30 1997
-***************
-*** 41,48 ****
- SessionTracing: 11 # log server-related operations
- RecvFileMode: 0600 # recvd facsimile are not public
- LogFileMode: 0600 # private log files
-! DeviceMode: 0600 # device is accessible only to uucp/fax
-! GettyArgs: "-h %l dx_%s" # requires modem to auto-detect fax/data
- QualifyTSI: "" # do not restrict inbound facsimile
- SpeakerVolume: off # machine's are already too loud
- RingsBeforeAnswer: 1 # answer on first ring
---- 41,48 ----
- SessionTracing: 11 # log server-related operations
- RecvFileMode: 0600 # recvd facsimile are not public
- LogFileMode: 0600 # private log files
-! DeviceMode: 0660 # device is accessible only to uucp/fax
-! GettyArgs: "std.%s" # requires modem to auto-detect fax/data
- QualifyTSI: "" # do not restrict inbound facsimile
- SpeakerVolume: off # machine's are already too loud
- RingsBeforeAnswer: 1 # answer on first ring
+diff -ruN faxd/ClassModem.c++.orig faxd/ClassModem.c++
+--- faxd/ClassModem.c++.orig Sun Jun 13 00:41:02 1999
++++ faxd/ClassModem.c++ Mon Jun 12 21:52:37 2000
+@@ -169,7 +169,7 @@
+ {
+ protoTrace("DIAL %s", number);
+ char buf[256];
+- sprintf(buf, (const char*) conf.dialCmd, number);
++ snprintf(buf, sizeof(buf), (const char*) conf.dialCmd, number);
+ emsg = "";
+ CallStatus cs = (atCmd(buf, AT_NOTHING) ? dialResponse(emsg) : FAILURE);
+ if (cs != OK && emsg == "")
+diff -ruN faxd/FaxMachineLog.c++.orig faxd/FaxMachineLog.c++
+--- faxd/FaxMachineLog.c++.orig Mon Oct 12 13:47:49 1998
++++ faxd/FaxMachineLog.c++ Mon Jun 12 21:52:37 2000
+@@ -75,9 +75,13 @@
+ int oerrno = errno; // save errno on entry
+ char buf[16*1024];
+ timeval tv;
++ int len;
++
+ (void) gettimeofday(&tv, 0);
+ strftime(buf, sizeof (buf), "%h %d %T", localtime((time_t*) &tv.tv_sec));
+- sprintf(buf+strlen(buf), ".%02u: [%5d]: ", tv.tv_usec / 10000, pid);
++ len = strlen(buf);
++ snprintf(buf+len, sizeof(buf) - len, ".%02u: [%5d]: ",
++ tv.tv_usec / 10000, pid);
+ /*
+ * Copy format string into a local buffer so
+ * that we can substitute for %m, a la syslog.
+@@ -96,6 +100,7 @@
+ fmt.put(fp[0]);
+ }
+ fmt.put('\n'); fmt.put('\0');
+- vsprintf(buf+strlen(buf), (const char*) fmt, ap);
++ len = strlen(buf);
++ vsnprintf(buf+len, sizeof(buf) - len, (const char*) fmt, ap);
+ (void) Sys::write(fd, buf, strlen(buf));
+ }
+diff -ruN faxd/FaxRecv.c++.orig faxd/FaxRecv.c++
+--- faxd/FaxRecv.c++.orig Sun Jun 13 00:41:03 1999
++++ faxd/FaxRecv.c++ Mon Jun 12 21:52:37 2000
+@@ -139,7 +139,7 @@
+ * number file to reflect the allocation.
+ */
+ (void) flock(ftmp, LOCK_EX|LOCK_NB);
+- sprintf(line, "%u", seqnum);
++ snprintf(line, sizeof(line), "%u", seqnum);
+ (void) lseek(fseqf, 0, SEEK_SET);
+ if (Sys::write(fseqf, line, strlen(line)) != strlen(line) ||
+ ftruncate(fseqf,strlen(line))) {
+diff -ruN faxd/FaxRequest.c++.orig faxd/FaxRequest.c++
+--- faxd/FaxRequest.c++.orig Sun Jun 13 00:41:03 1999
++++ faxd/FaxRequest.c++ Mon Jun 12 21:52:38 2000
+@@ -679,7 +679,8 @@
+ FaxRequest::error(const char* fmt0 ...)
+ {
+ char fmt[128];
+- sprintf(fmt, "%s: line %u: %s", (const char*) qfile, (u_int) lineno, fmt0);
++ snprintf(fmt, sizeof(fmt), "%s: line %u: %s", (const char*) qfile,
++ (u_int) lineno, fmt0);
+ va_list ap;
+ va_start(ap, fmt0);
+ vlogError(fmt, ap);
+diff -ruN faxd/Getty.c++.orig faxd/Getty.c++
+--- faxd/Getty.c++.orig Sun Jun 13 00:41:03 1999
++++ faxd/Getty.c++ Mon Jun 12 21:54:22 2000
+@@ -218,7 +218,7 @@
+ // NB: this is executed in the parent
+ fxStr device = fxStr::format("%s/" | line, _PATH_DEV);
+ Sys::chown(device, UUCPLock::getUUCPUid(), UUCPLock::getUUCPGid());
+- Sys::chmod(device, 0600); // reset protection
++ Sys::chmod(device, 0660); // reset protection
+ }
+
+ extern void vlogError(const char* fmt, va_list ap);
+diff -ruN faxd/ModemServer.c++.orig faxd/ModemServer.c++
+--- faxd/ModemServer.c++.orig Sun Jun 13 00:41:04 1999
++++ faxd/ModemServer.c++ Mon Jun 12 21:52:38 2000
+@@ -324,7 +324,7 @@
+ if (seteuid(0) >= 0) { // must be done as root
+ const SchedInfo& si = schedInfo[s];
+ pcinfo_t pcinfo;
+- strcpy(pcinfo.pc_clname, si.clname);
++ strlcpy(pcinfo.pc_clname, si.clname, sizeof(pcinfo.pc_clname));
+ if (priocntl((idtype_t)0, 0, PC_GETCID, (caddr_t)&pcinfo) >= 0) {
+ pcparms_t pcparms;
+ pcparms.pc_cid = pcinfo.pc_cid;
+@@ -604,7 +604,7 @@
+ } while (ftmp < 0 && errno == EEXIST && --ntry >= 0);
+ umask(omask);
+ if (ftmp >= 0) {
+- sprintf(line, "%u", seqnum);
++ snprintf(line, sizeof(line), "%u", seqnum);
+ (void) lseek(fseqf, 0, SEEK_SET);
+ if (Sys::write(fseqf, line, strlen(line)) != strlen(line) ||
+ ftruncate(fseqf,strlen(line)))
+@@ -806,7 +806,7 @@
+ va_list ap;
+ va_start(ap, fmt0);
+ char fmt[256];
+- sprintf(fmt, "MODEM %s", fmt0);
++ snprintf(fmt, sizeof(fmt), "MODEM %s", fmt0);
+ vtraceStatus(FAXTRACE_MODEMOPS, fmt, ap);
+ va_end(ap);
+ }
+diff -ruN faxd/ServerConfig.c++.orig faxd/ServerConfig.c++
+--- faxd/ServerConfig.c++.orig Sun Jun 13 00:41:04 1999
++++ faxd/ServerConfig.c++ Mon Jun 12 21:52:38 2000
+@@ -373,9 +373,9 @@
+ {
+ char fmt[128];
+ if (module != NULL)
+- sprintf(fmt, "%s: Warning, %s.", module, fmt0);
++ snprintf(fmt, sizeof(fmt), "%s: Warning, %s.", module, fmt0);
+ else
+- sprintf(fmt, "Warning, %s.", fmt0);
++ snprintf(fmt, sizeof(fmt), "Warning, %s.", fmt0);
+ vlogError(fmt, ap);
+ }
+
+@@ -384,9 +384,9 @@
+ {
+ char fmt[128];
+ if (module != NULL)
+- sprintf(fmt, "%s: Warning, %s.", module, fmt0);
++ snprintf(fmt, sizeof(fmt), "%s: Warning, %s.", module, fmt0);
+ else
+- sprintf(fmt, "Warning, %s.", fmt0);
++ snprintf(fmt, sizeof(fmt), "Warning, %s.", fmt0);
+ vlogWarning(fmt, ap);
+ }
+
+diff -ruN faxd/UUCPLock.c++.orig faxd/UUCPLock.c++
+--- faxd/UUCPLock.c++.orig Sun Jun 13 00:41:05 1999
++++ faxd/UUCPLock.c++ Mon Jun 12 21:56:52 2000
+@@ -37,6 +37,7 @@
+ }
+ #endif
+ #include <pwd.h>
++#include <grp.h>
+
+ /*
+ * UUCP Device Locking Support.
+@@ -148,6 +149,13 @@
+ UUCPuid = pwd->pw_uid;
+ UUCPgid = pwd->pw_gid;
+ endpwent(); // paranoia
++
++
++ const group *grp = getgrnam("dialer");
++ if (!grp)
++ faxApp::fatal("Can not deduce identity of DIALER");
++ UUCPgid = grp->gr_gid;
++ endgrent(); // paranoia
+ }
+ }
+ uid_t UUCPLock::getUUCPUid() { setupIDs(); return UUCPuid; }
+@@ -307,7 +315,7 @@
+ AsciiUUCPLock::setPID(pid_t pid)
+ {
+ // XXX should this be %d or %ld? depends on pid_t
+- sprintf((char*) data, "%*d\n", UUCP_PIDDIGITS, pid);
++ snprintf((char*) data, sizeof(data), "%*d\n", UUCP_PIDDIGITS, pid);
+ }
+
+ bool
+diff -ruN faxd/faxApp.c++.orig faxd/faxApp.c++
+--- faxd/faxApp.c++.orig Sun Jun 13 00:41:05 1999
++++ faxd/faxApp.c++ Mon Jun 12 21:52:39 2000
+@@ -231,7 +231,7 @@
+ logError("fcntl: %m");
+ }
+ char msg[4096];
+- vsprintf(msg, fmt, ap);
++ vsnprintf(msg, sizeof(msg), fmt, ap);
+ u_int len = strlen(msg)+1;
+ if (Sys::write(faxqfifo, msg, len) != len) {
+ if (errno == EBADF || errno == EPIPE) // reader expired
+@@ -263,7 +263,7 @@
+ faxApp::sendModemStatus(const char* devid, const char* fmt0 ...)
+ {
+ char fmt[2*1024];
+- sprintf(fmt, "+%s:%s", devid, fmt0);
++ snprintf(fmt, sizeof(fmt), "+%s:%s", devid, fmt0);
+ va_list ap;
+ va_start(ap, fmt0);
+ bool ok = vsendQueuer(fmt, ap);
+@@ -278,7 +278,7 @@
+ faxApp::sendJobStatus(const char* jobid, const char* fmt0 ...)
+ {
+ char fmt[2*1024];
+- sprintf(fmt, "*%s:%s", jobid, fmt0);
++ snprintf(fmt, sizeof(fmt), "*%s:%s", jobid, fmt0);
+ va_list ap;
+ va_start(ap, fmt0);
+ bool ok = vsendQueuer(fmt, ap);
+@@ -293,7 +293,7 @@
+ faxApp::sendRecvStatus(const char* devid, const char* fmt0 ...)
+ {
+ char fmt[2*1024];
+- sprintf(fmt, "@%s:%s", devid, fmt0);
++ snprintf(fmt, sizeof(fmt), "@%s:%s", devid, fmt0);
+ va_list ap;
+ va_start(ap, fmt0);
+ bool ok = vsendQueuer(fmt, ap);
+diff -ruN faxd/faxQueueApp.c++.orig faxd/faxQueueApp.c++
+--- faxd/faxQueueApp.c++.orig Sat Jul 10 07:23:05 1999
++++ faxd/faxQueueApp.c++ Mon Jun 12 21:52:39 2000
+@@ -971,10 +971,10 @@
+ * -m <maxpages> max pages to generate
+ * -1|-2 1d or 2d encoding
+ */
+- char rbuf[20]; sprintf(rbuf, "%u", params.verticalRes());
+- char wbuf[20]; sprintf(wbuf, "%u", params.pageWidth());
+- char lbuf[20]; sprintf(lbuf, "%d", params.pageLength());
+- char mbuf[20]; sprintf(mbuf, "%u", dci.getMaxSendPages());
++ char rbuf[20]; snprintf(rbuf, sizeof(rbuf), "%u", params.verticalRes());
++ char wbuf[20]; snprintf(wbuf, sizeof(wbuf), "%u", params.pageWidth());
++ char lbuf[20]; snprintf(lbuf, sizeof(lbuf), "%d", params.pageLength());
++ char mbuf[20]; snprintf(mbuf, sizeof(mbuf), "%u", dci.getMaxSendPages());
+ const char* argv[30];
+ int ac = 0;
+ switch (req.op) {
+@@ -2726,9 +2726,9 @@
+ {
+ char fmt[128];
+ if (module != NULL)
+- sprintf(fmt, "%s: Warning, %s.", module, fmt0);
++ snprintf(fmt, sizeof(fmt), "%s: Warning, %s.", module, fmt0);
+ else
+- sprintf(fmt, "Warning, %s.", fmt0);
++ snprintf(fmt, sizeof(fmt), "Warning, %s.", fmt0);
+ vlogError(fmt, ap);
+ }
+
+@@ -2737,9 +2737,9 @@
+ {
+ char fmt[128];
+ if (module != NULL)
+- sprintf(fmt, "%s: Warning, %s.", module, fmt0);
++ snprintf(fmt, sizeof(fmt), "%s: Warning, %s.", module, fmt0);
+ else
+- sprintf(fmt, "Warning, %s.", fmt0);
++ snprintf(fmt, sizeof(fmt), "Warning, %s.", fmt0);
+ vlogWarning(fmt, ap);
+ }
+
+diff -ruN faxd/trigtest.c++.orig faxd/trigtest.c++
+--- faxd/trigtest.c++.orig Sun Jun 13 00:41:08 1999
++++ faxd/trigtest.c++ Mon Jun 12 21:52:39 2000
+@@ -296,7 +296,7 @@
+ int fd, n;
+ char msg[256];
+
+- sprintf(fifoName, "client/%u", getpid());
++ snprintf(fifoName, sizeof(fifoname), "client/%u", getpid());
+ if (Sys::mkfifo(fifoName, 0666) < 0 && errno != EEXIST) {
+ perror("mkfifo");
+ exit(-1);
+@@ -309,7 +309,7 @@
+ unlink(fifoName);
+ exit(-1);
+ }
+- sprintf(msg, "T%s:N%s", fifoName, trigger);
++ snprintf(msg, sizeof(msg), "T%s:N%s", fifoName, trigger);
+ send(msg, strlen(msg)+1);
+ for (;;) {
+ FD_ZERO(&rd);
diff --git a/comms/hylafax/files/patch-ae b/comms/hylafax/files/patch-ae
index 9b5f246ea875..489c4eb290e1 100644
--- a/comms/hylafax/files/patch-ae
+++ b/comms/hylafax/files/patch-ae
@@ -1,129 +1,135 @@
-For multilingualization (iso-2022 variant encodings).
-Some part of this is biased to Japanization, however, it should
-give some hints to asian people.
-
-*** util/TypeRules.c++.orig Wed Nov 27 08:20:45 1996
---- util/TypeRules.c++ Sun Apr 20 23:43:42 1997
-***************
-*** 48,54 ****
- }
-
- static const char* typeNames[] =
-! { "ascii", "string", "address", "byte", "short", "long" };
- static const char* opNames[] =
- { "<any>", "=", "!=", "<", "<=", ">", ">=", "&", "^", "!" };
- static const char* resultNames[] = { "tiff", "postscript", "error" };
---- 48,54 ----
- }
-
- static const char* typeNames[] =
-! { "ascii", "asciiesc", "string", "address", "byte", "short", "long" };
- static const char* opNames[] =
- { "<any>", "=", "!=", "<", "<=", ">", ">=", "&", "^", "!" };
- static const char* resultNames[] = { "tiff", "postscript", "error" };
-***************
-*** 65,71 ****
- );
- if (type == STRING)
- printf(" \"%s\"", value.s);
-! else if (type != ASCII) {
- if (op == ANY)
- printf(" <any value>");
- else
---- 65,71 ----
- );
- if (type == STRING)
- printf(" \"%s\"", value.s);
-! else if (type != ASCII && type != ASCIIESC) {
- if (op == ANY)
- printf(" <any value>");
- else
-***************
-*** 83,88 ****
---- 83,89 ----
- const u_char* cp = (const u_char*) data;
- switch (type) {
- case ASCII:
-+ {
- u_int i;
- for (i = 0; i < size; i++)
- if (!isprint(cp[i]) && !isspace(cp[i])) {
-***************
-*** 92,97 ****
---- 93,111 ----
- }
- ok = TRUE;
- goto done;
-+ }
-+ case ASCIIESC:
-+ {
-+ u_int i;
-+ for (i = 0; i < size; i++)
-+ if (!isprint(cp[i]) && !isspace(cp[i]) && cp[i] != '\033') {
-+ if (verbose)
-+ printf("failed (unprintable char %#x)\n", cp[i]);
-+ return (FALSE);
-+ }
-+ ok = TRUE;
-+ goto done;
-+ }
- case STRING:
- ok = (strncmp((const char*)(cp+off), value.s,
- fxmin((u_int) strlen(value.s), (u_int)(size-off))) == 0);
-***************
-*** 307,312 ****
---- 321,328 ----
- rule.type = TypeRule::STRING;
- else if (strncasecmp(tp, "ascii", cp-tp) == 0)
- rule.type = TypeRule::ASCII;
-+ else if (strncasecmp(tp, "asciiesc", cp-tp) == 0)
-+ rule.type = TypeRule::ASCIIESC;
- else if (strncasecmp(tp, "addr", cp-tp) == 0)
- rule.type = TypeRule::ADDR;
- else {
-***************
-*** 317,323 ****
- cp++;
- rule.op = TypeRule::EQ; // default is '='
- const char* vp = cp;
-! if (rule.type != TypeRule::STRING && rule.type != TypeRule::ASCII) {
- // numeric value
- switch (*vp) {
- case '=': rule.op = TypeRule::EQ; cp++; break;
---- 333,340 ----
- cp++;
- rule.op = TypeRule::EQ; // default is '='
- const char* vp = cp;
-! if (rule.type != TypeRule::STRING && rule.type != TypeRule::ASCII
-! && rule.type != TypeRule::ASCIIESC) {
- // numeric value
- switch (*vp) {
- case '=': rule.op = TypeRule::EQ; cp++; break;
-*** util/TypeRules.h.orig Sun Apr 20 23:22:28 1997
---- util/TypeRules.h Sun Apr 20 23:21:11 1997
-***************
-*** 130,135 ****
---- 130,136 ----
- fxBool cont; // continuation
- enum {
- ASCII, // ascii-only string
-+ ASCIIESC, // ascii-only string + escape char (iso-2022 variants)
- STRING, // byte string
- ADDR, // address of match
- BYTE, // 8 bits
-*** util/typerules.orig Sun Apr 20 23:22:49 1997
---- util/typerules Sun Apr 20 23:24:45 1997
-***************
-*** 128,133 ****
---- 128,138 ----
- >15 string ascii ps %F/textfmt -B -f Courier-Bold\
- -p 11 -s %s >%o <%i
- #
-+ # Japanization (should help other iso-2022 variants too)
-+ #
-+ #>15 string asciiesc ps a2ps-j -l '' -p -ns -nt <%i >%o
-+ #0 asciiesc x ps a2ps-j -l '' -p -ns -nt <%i >%o
-+ #
- # This causes anything else with ascii-only data to be treated as text.
- #
- 0 ascii x ps %F/textfmt -B -f Courier-Bold\
+diff -ruN hfaxd/HylaFAXServer.c++.orig hfaxd/HylaFAXServer.c++
+--- hfaxd/HylaFAXServer.c++.orig Sun Jun 13 00:41:13 1999
++++ hfaxd/HylaFAXServer.c++ Mon Jun 12 21:52:40 2000
+@@ -161,9 +161,9 @@
+ {
+ char fmt[128];
+ if (module != NULL)
+- sprintf(fmt, "%s: Warning, %s.", module, fmt0);
++ snprintf(fmt, sizeof(fmt), "%s: Warning, %s.", module, fmt0);
+ else
+- sprintf(fmt, "Warning, %s.", fmt0);
++ snprintf(fmt, sizeof(fmt), "Warning, %s.", fmt0);
+ vlogError(fmt, ap);
+ }
+
+@@ -172,9 +172,9 @@
+ {
+ char fmt[128];
+ if (module != NULL)
+- sprintf(fmt, "%s: Warning, %s.", module, fmt0);
++ snprintf(fmt, sizeof(fmt), "%s: Warning, %s.", module, fmt0);
+ else
+- sprintf(fmt, "Warning, %s.", fmt0);
++ snprintf(fmt, sizeof(fmt), "Warning, %s.", fmt0);
+ vlogWarning(fmt, ap);
+ }
+
+@@ -530,7 +530,7 @@
+ filename, line);
+ seqnum = 1;
+ }
+- sprintf(line, "%u", NEXTSEQNUM(seqnum+count));
++ snprintf(line, sizeof(line), "%u", NEXTSEQNUM(seqnum+count));
+ lseek(fd, 0, SEEK_SET);
+ if (Sys::write(fd, line, strlen(line)) != strlen(line) ||
+ ftruncate(fd,strlen(line))) {
+diff -ruN hfaxd/Jobs.c++.orig hfaxd/Jobs.c++
+--- hfaxd/Jobs.c++.orig Sun Jun 13 00:41:14 1999
++++ hfaxd/Jobs.c++ Mon Jun 12 21:52:40 2000
+@@ -1646,7 +1646,8 @@
+ fprintf(fd, fspec, (const char*) job.company);
+ break;
+ case 'D':
+- sprintf(tmpbuf, "%2u:%-2u", job.totdials, job.maxdials);
++ snprintf(tmpbuf, sizeof(tmpbuf), "%2u:%-2u", job.totdials,
++ job.maxdials);
+ fprintf(fd, fspec, tmpbuf);
+ break;
+ case 'E':
+@@ -1683,7 +1684,8 @@
+ fprintf(fd, fspec, "N "[job.useccover]);
+ break;
+ case 'P':
+- sprintf(tmpbuf, "%2u:%-2u", job.npages, job.totpages);
++ snprintf(tmpbuf, sizeof(tmpbuf), "%2u:%-2u", job.npages,
++ job.totpages);
+ fprintf(fd, fspec, tmpbuf);
+ break;
+ case 'Q':
+@@ -1696,11 +1698,12 @@
+ fprintf(fd, fspec, (const char*) job.sender);
+ break;
+ case 'T':
+- sprintf(tmpbuf, "%2u:%-2u", job.tottries, job.maxtries);
++ snprintf(tmpbuf, sizeof(tmpbuf), "%2u:%-2u", job.tottries,
++ job.maxtries);
+ fprintf(fd, fspec, tmpbuf);
+ break;
+ case 'U':
+- sprintf(tmpbuf, "%.1f", job.chopthreshold);
++ snprintf(tmpbuf, sizeof(tmpbuf), "%.1f", job.chopthreshold);
+ fprintf(fd, fspec, tmpbuf);
+ break;
+ case 'V':
+diff -ruN hfaxd/OldProtocol.c++.orig hfaxd/OldProtocol.c++
+--- hfaxd/OldProtocol.c++.orig Sun Jun 13 00:41:15 1999
++++ hfaxd/OldProtocol.c++ Mon Jun 12 21:52:40 2000
+@@ -352,8 +352,8 @@
+ OldProtocolServer::vsendClient(const char* tag, const char* fmt, va_list ap)
+ {
+ char buf[2048];
+- sprintf(buf, "%s:", tag);
+- vsprintf(strchr(buf,'\0'), fmt, ap);
++ snprintf(buf, sizeof(buf), "%s:", tag);
++ vsnprintf(strchr(buf,'\0'), sizeof(buf) - (strchr(buf,'\0') - buf), fmt, ap);
+ fprintf(stdout, "%s\n", buf);
+ if (TRACE(PROTOCOL))
+ logDebug("%s", buf);
+@@ -472,19 +472,19 @@
+ buf[0] = '\0';
+ if (pwd->pw_gecos) {
+ if (pwd->pw_gecos[0] == '&') {
+- strcpy(buf, pwd->pw_name);
+- strcat(buf, pwd->pw_gecos+1);
++ strlcpy(buf, pwd->pw_name, sizeof(buf));
++ strlcat(buf, pwd->pw_gecos+1, sizeof(buf));
+ if (islower(buf[0]))
+ buf[0] = toupper(buf[0]);
+ } else
+- strcpy(buf, pwd->pw_gecos);
++ strlcpy(buf, pwd->pw_gecos, sizeof(buf));
+ if ((cp = strchr(buf,',')) != 0)
+ *cp = '\0';
+ /* see FaxClient::setupUserIdentity; strip SysV junk */
+ if ((cp = strchr(buf,'(')) != 0)
+ *cp = '\0';
+ } else
+- strcpy(buf, pwd->pw_name);
++ strlcpy(buf, pwd->pw_name, sizeof(buf));
+ if (TRACE(PROTOCOL)) {
+ if (*buf)
+ logDebug("%s user: \"%s\"", pwd->pw_name, buf);
+diff -ruN hfaxd/Status.c++.orig hfaxd/Status.c++
+--- hfaxd/Status.c++.orig Sun Jun 13 00:41:16 1999
++++ hfaxd/Status.c++ Mon Jun 12 21:52:40 2000
+@@ -260,16 +260,16 @@
+ break;
+ case 'r':
+ if (config.maxRecvPages == (u_int) -1)
+- strcpy(tmpbuf, "INF");
++ strlcpy(tmpbuf, "INF", sizeof(tmpbuf));
+ else
+- sprintf(tmpbuf, "%u", config.maxRecvPages);
++ snprintf(tmpbuf, sizeof(tmpbuf), "%u", config.maxRecvPages);
+ fprintf(fd, fspec, config.maxRecvPages);
+ break;
+ case 's':
+ fprintf(fd, fspec, (const char*) config.status);
+ break;
+ case 't':
+- sprintf(tmpbuf, "%05x:%05x",
++ snprintf(tmpbuf, sizeof(tmpbuf), "%05x:%05x",
+ config.tracingLevel&0xfffff,
+ config.logTracingLevel&0xfffff);
+ fprintf(fd, fspec, tmpbuf);
diff --git a/comms/hylafax/files/patch-af b/comms/hylafax/files/patch-af
index 078980afbb1a..d1f01109a497 100644
--- a/comms/hylafax/files/patch-af
+++ b/comms/hylafax/files/patch-af
@@ -1,10 +1,12 @@
---- configure.old Mon Jan 17 09:53:40 2000
-+++ configure Mon Jan 17 09:52:44 2000
-@@ -1874,6 +1874,7 @@
- case $TARGET in
- # XXX fill in for busted systems
- *-univel-*) CONFIG_SOCKARGLENTYPE=size_t;;
-+ *-freebsd4*) CONFIG_SOCKARGLENTYPE=u_int32_t;;
- *) CONFIG_SOCKARGLENTYPE=int;;
- esac
- }
+diff -ruN man/config.4f.orig man/config.4f
+--- man/config.4f.orig Mon Jan 4 23:48:18 1999
++++ man/config.4f Mon Jun 12 21:52:41 2000
+@@ -1446,7 +1446,7 @@
+ The command to place a phone call.
+ The string is assumed to be suitable for use
+ as a parameter to the
+-.IR sprintf (3S)
++.IR snprintf (3S)
+ function; so the ``%'' character should be escaped as ``%%''.
+ The dial command must include a single ``%s'' where the number
+ that is to be dialed is to be substituted.
diff --git a/comms/hylafax/files/patch-ag b/comms/hylafax/files/patch-ag
index 07b830d5d1aa..e9f3537998b6 100644
--- a/comms/hylafax/files/patch-ag
+++ b/comms/hylafax/files/patch-ag
@@ -1,13 +1,69 @@
---- util/xferstats.sh.in.orig Sun Jan 23 19:45:49 2000
-+++ util/xferstats.sh.in Sun Jan 23 19:45:29 2000
-@@ -186,7 +186,9 @@
- #
- function cvtDateTime(s)
- {
-- yday = substr(s,7,2)*365 + substr(s,4,2) - 1;
-+ y = substr(s,7,2);
-+ if ( y < 50) y += 100;
-+ yday = y*365 + substr(s,4,2) - 1;
- mon = substr(s,0,2) + 0;
- for (i = 0; i < mon; i++)
- yday += daysInMonth[i];
+diff -ruN port/syslog.c.orig port/syslog.c
+--- port/syslog.c.orig Mon Oct 12 13:47:50 1998
++++ port/syslog.c Mon Jun 12 21:52:41 2000
+@@ -88,7 +88,7 @@
+ register int cnt;
+ register char *p;
+ time_t now, time();
+- int fd, saved_errno;
++ int fd, saved_errno, n;
+ char tbuf[2048], fmt_cpy[1024], *stdp, *ctime();
+
+ /* check for invalid bits or no priority set */
+@@ -104,21 +104,21 @@
+
+ /* build the message */
+ (void)time(&now);
+- (void)sprintf(tbuf, "<%d>%.15s ", pri, ctime(&now) + 4);
+- for (p = tbuf; *p; ++p);
++ (void)snprintf(tbuf, sizeof(tbuf), "<%d>%.15s ", pri, ctime(&now) + 4);
++ for (p = tbuf; *p; ++p, n++);
+ if (LogStat & LOG_PERROR)
+ stdp = p;
+ if (LogTag) {
+- (void)strcpy(p, LogTag);
++ (void)strlcpy(p, LogTag, sizeof(tbuf) - n);
+ for (; *p; ++p);
+ }
+ if (LogStat & LOG_PID) {
+- (void)sprintf(p, "[%d]", getpid());
++ (void)snprintf(p, sizeof(tbuf) - n, "[%d]", getpid());
+ for (; *p; ++p);
+ }
+ if (LogTag) {
+- *p++ = ':';
+- *p++ = ' ';
++ *p++ = ':'; n++;
++ *p++ = ' '; n++;
+ }
+
+ /* substitute error message for %m */
+@@ -137,7 +137,7 @@
+ *t1 = '\0';
+ }
+
+- (void)vsprintf(p, fmt_cpy, ap);
++ (void)vsnprintf(p, sizeof(tbuf) - n, fmt_cpy, ap);
+
+ cnt = strlen(tbuf);
+
+@@ -170,7 +170,7 @@
+ * is the one from the syslogd failure.
+ */
+ if ((fd = open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0) {
+- (void)strcat(tbuf, "\r\n");
++ (void)strlcat(tbuf, "\r\n", sizeof(tbuf));
+ cnt += 2;
+ p = index(tbuf, '>') + 1;
+ (void)write(fd, p, cnt - (p - tbuf));
+diff -ruN port/vsyslog.c.orig port/vsyslog.c
+--- port/vsyslog.c.orig Mon Oct 12 13:47:50 1998
++++ port/vsyslog.c Mon Jun 12 21:52:41 2000
+@@ -49,6 +49,6 @@
+ *cp++ = c;
+ *cp = '\0';
+ }
+- (void) vsprintf(tbuf, fmt_cpy, ap);
++ (void) vnsprintf(tbuf, sizeof(tbuf), fmt_cpy, ap);
+ (void) syslog(pri, "%s", tbuf);
+ }
diff --git a/comms/hylafax/files/patch-ai b/comms/hylafax/files/patch-ai
new file mode 100644
index 000000000000..2d7cd13321ee
--- /dev/null
+++ b/comms/hylafax/files/patch-ai
@@ -0,0 +1,12 @@
+diff -ruN sgi2fax/imgtofax.c.orig sgi2fax/imgtofax.c
+--- sgi2fax/imgtofax.c.orig Mon Oct 12 13:47:50 1998
++++ sgi2fax/imgtofax.c Mon Jun 12 21:52:42 2000
+@@ -214,7 +214,7 @@
+ TIFFSetField(tif, TIFFTAG_PAGENUMBER, pn, npages);
+ TIFFSetField(tif, TIFFTAG_CLEANFAXDATA, CLEANFAXDATA_CLEAN);
+ { char buf[1024];
+- sprintf(buf, "Ditherered B&W version of %s", input);
++ snprintf(buf, sizeof(buf), "Ditherered B&W version of %s", input);
+ TIFFSetField(tif, TIFFTAG_IMAGEDESCRIPTION, buf);
+ }
+ TIFFSetField(tif, TIFFTAG_SOFTWARE, "sgi2fax");
diff --git a/comms/hylafax/files/patch-aj b/comms/hylafax/files/patch-aj
new file mode 100644
index 000000000000..85961957e85e
--- /dev/null
+++ b/comms/hylafax/files/patch-aj
@@ -0,0 +1,345 @@
+diff -ruN util/Class2Params.c++.orig util/Class2Params.c++
+--- util/Class2Params.c++.orig Sun Jun 13 00:41:19 1999
++++ util/Class2Params.c++ Mon Jun 12 21:52:43 2000
+@@ -59,14 +59,15 @@
+ }
+
+ static char*
+-addParam(char* cp, u_int v)
++addParam(char* cp, u_int v, int *maxn)
+ {
+ if (v != (u_int)-1) {
+- sprintf(cp, ",%u", v);
+- while (*cp != '\0') cp++;
++ snprintf(cp, *maxn, ",%u", v);
++ while (*cp != '\0') { cp++; (*maxn)++; }
+ } else {
+ *cp++ = ',';
+ *cp = '\0';
++ (*maxn)++;
+ }
+ return (cp);
+ }
+@@ -76,18 +77,19 @@
+ {
+ char buf[1024];
+ char* cp = buf;
++ int n = sizeof(buf);
+
+ if (vr != (u_int) -1) {
+- sprintf(cp, "%u", vr);
+- while (*cp != '\0') cp++;
++ snprintf(cp, n, "%u", vr);
++ while (*cp != '\0') { cp++; n--; }
+ }
+- cp = addParam(cp, br);
+- cp = addParam(cp, wd);
+- cp = addParam(cp, ln);
+- cp = addParam(cp, df);
+- cp = addParam(cp, ec);
+- cp = addParam(cp, bf);
+- cp = addParam(cp, st);
++ cp = addParam(cp, br, &n);
++ cp = addParam(cp, wd, &n);
++ cp = addParam(cp, ln, &n);
++ cp = addParam(cp, df, &n);
++ cp = addParam(cp, ec, &n);
++ cp = addParam(cp, bf, &n);
++ cp = addParam(cp, st, &n);
+ return fxStr(buf);
+ }
+
+diff -ruN util/FaxClient.c++.orig util/FaxClient.c++
+--- util/FaxClient.c++.orig Thu Jun 17 04:05:38 1999
++++ util/FaxClient.c++ Mon Jun 12 21:52:43 2000
+@@ -623,7 +623,7 @@
+ traceServer("-> ADMIN XXXX");
+ } else {
+ char buf[128];
+- sprintf(buf, "-> %s", fmt);
++ snprintf(buf, sizeof(buf), "-> %s", fmt);
+ vtraceServer(buf, ap);
+ }
+ }
+diff -ruN util/PageSize.c++.orig util/PageSize.c++
+--- util/PageSize.c++.orig Sun Jun 13 00:41:23 1999
++++ util/PageSize.c++ Mon Jun 12 21:52:43 2000
+@@ -72,7 +72,7 @@
+ PageSizeInfo::readPageInfoFile()
+ {
+ char file[1024];
+- sprintf(file, "%s/%s", FAX_LIBDATA, FAX_PAGESIZES);
++ snprintf(file, sizeof(file), "%s/%s", FAX_LIBDATA, FAX_PAGESIZES);
+ PageInfoArray* info = new PageInfoArray;
+ FILE* fp = fopen(file, "r");
+ u_int lineno = 0;
+diff -ruN util/SNPPClient.c++.orig util/SNPPClient.c++
+--- util/SNPPClient.c++.orig Sun Jun 13 00:41:24 1999
++++ util/SNPPClient.c++ Mon Jun 12 21:52:43 2000
+@@ -638,7 +638,7 @@
+ traceServer("-> LOGI XXXX");
+ else {
+ char buf[128];
+- sprintf(buf, "-> %s", fmt);
++ snprintf(buf, sizeof(buf), "-> %s", fmt);
+ vtraceServer(buf, ap);
+ }
+ }
+diff -ruN util/StackBuffer.c++.orig util/StackBuffer.c++
+--- util/StackBuffer.c++.orig Fri Jan 1 20:12:43 1999
++++ util/StackBuffer.c++ Mon Jun 12 21:52:44 2000
+@@ -105,7 +105,7 @@
+ fxStackBuffer::vput(const char* fmt, va_list ap)
+ {
+ char buf[8*1024];
+- vsprintf(buf, fmt, ap);
++ vsnprintf(buf, sizeof(buf), fmt, ap);
+ put(buf);
+ }
+
+diff -ruN util/Str.c++.orig util/Str.c++
+--- util/Str.c++.orig Sun Jun 13 00:41:25 1999
++++ util/Str.c++ Mon Jun 12 21:52:44 2000
+@@ -91,7 +91,7 @@
+ {
+ char buffer[NUMBUFSIZE];
+ if (!format) format = "%d";
+- sprintf(buffer,format,a);
++ snprintf(buffer,sizeof(buffer),format,a);
+ slength = strlen(buffer) + 1;
+ data = (char*) malloc(slength);
+ memcpy(data,buffer,slength);
+@@ -101,7 +101,7 @@
+ {
+ char buffer[NUMBUFSIZE];
+ if (!format) format = "%ld";
+- sprintf(buffer,format,a);
++ snprintf(buffer,sizeof(buffer),format,a);
+ slength = strlen(buffer) + 1;
+ data = (char*) malloc(slength);
+ memcpy(data,buffer,slength);
+@@ -111,7 +111,7 @@
+ {
+ char buffer[NUMBUFSIZE];
+ if (!format) format = "%g";
+- sprintf(buffer,format,a);
++ snprintf(buffer,sizeof(buffer),format,a);
+ slength = strlen(buffer) + 1;
+ fxAssert(slength>1, "Str::Str(float): bogus conversion");
+ data = (char*) malloc(slength);
+@@ -122,7 +122,7 @@
+ {
+ char buffer[NUMBUFSIZE];
+ if (!format) format = "%lg";
+- sprintf(buffer,format,a);
++ snprintf(buffer,sizeof(buffer),format,a);
+ slength = strlen(buffer) + 1;
+ fxAssert(slength>1, "Str::Str(double): bogus conversion");
+ data = (char*) malloc(slength); // XXX assume slength>1
+@@ -141,7 +141,7 @@
+ char buf[4096];
+ va_list ap;
+ va_start(ap, fmt);
+- vsprintf(buf, fmt, ap);
++ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ return fxStr(buf);
+ }
+@@ -150,7 +150,7 @@
+ fxStr::vformat(const char* fmt, va_list ap)
+ {
+ char buf[4096];
+- vsprintf(buf, fmt, ap);
++ vsnprintf(buf, sizeof(buf), fmt, ap);
+ return fxStr(buf);
+ }
+
+diff -ruN util/Str.h.orig util/Str.h
+--- util/Str.h.orig Sun Jun 13 00:41:25 1999
++++ util/Str.h Mon Jun 12 21:52:44 2000
+@@ -93,8 +93,8 @@
+ fxStr(const fxTempStr&);
+ ~fxStr();
+
+- static fxStr format(const char* fmt ...); // sprintf sort of
+- static fxStr vformat(const char* fmt, va_list ap); // vsprintf sort of
++ static fxStr format(const char* fmt ...); // snprintf sort of
++ static fxStr vformat(const char* fmt, va_list ap); // vsnprintf sort of
+ static fxStr null; // null string for general use
+ /////////////////////////////////////////////////////
+ u_long hash() const;
+diff -ruN util/faxadduser.c.orig util/faxadduser.c
+--- util/faxadduser.c.orig Wed Aug 11 04:59:28 1999
++++ util/faxadduser.c Mon Jun 12 21:52:44 2000
+@@ -81,7 +81,7 @@
+ }
+ hf = fopen(hostfile, "a+");
+ if (hf == NULL) {
+- sprintf(buff, "Error - cannot open hosts file: %s", hostfile);
++ snprintf(buff, sizeof(buff), "Error - cannot open hosts file: %s", hostfile);
+ perror(buff);
+ return 0;
+ }
+diff -ruN util/faxconfig.c.orig util/faxconfig.c
+--- util/faxconfig.c.orig Fri Jan 1 20:04:28 1999
++++ util/faxconfig.c Mon Jun 12 21:52:45 2000
+@@ -81,12 +81,12 @@
+ }
+ if (devid != NULL) {
+ if (devid[0] == FAX_FIFO[0])
+- strcpy(fifoname, devid);
++ strlcpy(fifoname, devid, sizeof(fifoname));
+ else
+- sprintf(fifoname, "%s.%.*s", FAX_FIFO,
++ snprintf(fifoname, sizeof(fifoname), "%s.%.*s", FAX_FIFO,
+ sizeof (fifoname) - sizeof (FAX_FIFO), devid);
+ } else
+- strcpy(fifoname, FAX_FIFO);
++ strlcpy(fifoname, FAX_FIFO, sizeof(fifoname));
+ for (cp = fifoname; cp = strchr(cp, '/'); *cp++ = '_')
+ ;
+ if (chdir(spooldir) < 0)
+@@ -99,6 +99,8 @@
+ do {
+ int quote;
+ char *cmd;
++ int len;
++
+
+ if (argc - optind < 2)
+ fatal("Missing value for \"%s\" parameter.\n", argv[optind]);
+@@ -109,12 +111,13 @@
+ quote = (*cp != '\0');
+ } else
+ quote = 1;
+- cmd = malloc(strlen(argv[optind])+strlen(argv[optind+1])+10);
++ len = strlen(argv[optind])+strlen(argv[optind+1])+10;
++ cmd = malloc(len);
+ if (quote)
+- sprintf(cmd, "C%s%s:\"%s\"",
++ snprintf(cmd, len, "C%s%s:\"%s\"",
+ isQueuer ? ":" : "", argv[optind], argv[optind+1]);
+ else
+- sprintf(cmd, "C%s%s:%s",
++ snprintf(cmd, len, "C%s%s:%s",
+ isQueuer ? ":" : "", argv[optind], argv[optind+1]);
+ if (write(fifo, cmd, strlen(cmd)) != strlen(cmd))
+ fatal("%s: FIFO write failed for command (%s)",
+diff -ruN util/faxdeluser.c.orig util/faxdeluser.c
+--- util/faxdeluser.c.orig Thu Aug 5 02:46:06 1999
++++ util/faxdeluser.c Mon Jun 12 21:52:45 2000
+@@ -64,14 +64,14 @@
+ }
+ }
+ if ((hf = fopen(hostfile, "r+")) == NULL) {
+- sprintf(buff, "Error - cannot open file: %s", hostfile);
++ snprintf(buff, sizeof(buff), "Error - cannot open file: %s", hostfile);
+ perror(buff);
+ return 0;
+ }
+- sprintf(newhostfile, "%s.%i", hostfile, (int)getpid());
++ snprintf(newhostfile, sizeof(newhostfile), "%s.%i", hostfile, (int)getpid());
+ fd = open(newhostfile, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IWUSR);
+ if (fd == -1) {
+- sprintf(buff, "Error cannot open file %s", newhostfile);
++ snprintf(buff, sizeof(buff), "Error cannot open file %s", newhostfile);
+ perror(buff);
+ return 0;
+ }
+@@ -87,7 +87,7 @@
+ }
+ if (!skip) {
+ if (write(fd, buff, strlen(buff)) == -1) {
+- sprintf(buff, "Error writing to file %s", newhostfile);
++ snprintf(buff, sizeof(buff), "Error writing to file %s", newhostfile);
+ perror(buff);
+ return 0;
+ }
+diff -ruN util/faxmodem.c.orig util/faxmodem.c
+--- util/faxmodem.c.orig Fri Jan 1 20:04:28 1999
++++ util/faxmodem.c Mon Jun 12 21:52:45 2000
+@@ -243,9 +243,9 @@
+ if (optind != argc-1)
+ fatal("Missing modem device.\nusage: %s %s modem", argv[0], usage);
+ if (strncmp(argv[optind], _PATH_DEV, strlen(_PATH_DEV)) == 0)
+- strcpy(devname, argv[optind]+strlen(_PATH_DEV));
++ strlcpy(devname, argv[optind]+strlen(_PATH_DEV), sizeof(devname));
+ else
+- strcpy(devname, argv[optind]);
++ strlcpy(devname, argv[optind], sizeof(devname));
+ for (cp = devname; cp = strchr(cp, '/'); *cp++ = '_')
+ ;
+ if (chdir(spooldir) < 0)
+@@ -254,9 +254,10 @@
+ if (fifo < 0)
+ fatal("%s: open: %s", FAX_FIFO, strerror(errno));
+ if (priority != -1)
+- sprintf(cmd, "+%s:R%c%08x:%x", devname, canpoll, caps, priority);
++ snprintf(cmd, sizeof(cmd), "+%s:R%c%08x:%x", devname, canpoll, caps,
++ priority);
+ else
+- sprintf(cmd, "+%s:R%c%08x", devname, canpoll, caps);
++ snprintf(cmd, sizeof(cmd), "+%s:R%c%08x", devname, canpoll, caps);
+ if (write(fifo, cmd, strlen(cmd)) != strlen(cmd))
+ fatal("%s: FIFO write failed for command (%s)",
+ argv[0], strerror(errno));
+diff -ruN util/faxmsg.c.orig util/faxmsg.c
+--- util/faxmsg.c.orig Fri Jan 1 20:04:28 1999
++++ util/faxmsg.c Mon Jun 12 21:52:45 2000
+@@ -108,12 +108,12 @@
+ }
+ if (optind == argc-1) {
+ if (argv[optind][0] == FAX_FIFO[0])
+- strcpy(fifoname, argv[optind]);
++ strlcpy(fifoname, argv[optind], sizeof(fifoname));
+ else
+- sprintf(fifoname, "%s.%.*s", FAX_FIFO,
++ snprintf(fifoname, sizeof(fifoname), "%s.%.*s", FAX_FIFO,
+ sizeof (fifoname) - sizeof (FAX_FIFO), argv[optind]);
+ } else if (!modemRequired) {
+- strcpy(fifoname, FAX_FIFO);
++ strlcpy(fifoname, FAX_FIFO, sizeof(fifoname));
+ } else
+ fatal("usage: %s %s", argv[0], usage);
+ for (cp = fifoname; cp = strchr(cp, '/'); *cp++ = '_')
+@@ -123,7 +123,7 @@
+ fifo = open(fifoname, O_WRONLY|O_NDELAY);
+ if (fifo < 0)
+ fatal("%s: open: %s", fifoname, strerror(errno));
+- sprintf(cmd, cmdfmt, arg);
++ snprintf(cmd, sizeof(cmd), cmdfmt, arg);
+ if (write(fifo, cmd, strlen(cmd)) != strlen(cmd))
+ fatal("FIFO write failed for command (%s)", strerror(errno));
+ (void) close(fifo);
+diff -ruN util/faxstate.c.orig util/faxstate.c
+--- util/faxstate.c.orig Fri Jan 1 20:04:28 1999
++++ util/faxstate.c Mon Jun 12 21:52:46 2000
+@@ -113,7 +113,7 @@
+ }
+ if (optind != argc-1)
+ fatal("Bad option `%c'; usage: %s %s modem", c, argv[0], usage);
+- strcpy(devid, argv[optind]);
++ strlcpy(devid, argv[optind], sizeof(devid));
+ for (cp = devid; cp = strchr(cp, '/'); *cp++ = '_')
+ ;
+ if (chdir(spooldir) < 0)
+@@ -126,16 +126,16 @@
+ fifo = open(FAX_FIFO, O_WRONLY|O_NDELAY);
+ if (fifo < 0)
+ fatal("%s: open: %s", FAX_FIFO, strerror(errno));
+- sprintf(cmd, "+%s:%s", devid, arg);
++ snprintf(cmd, sizeof(cmd), "+%s:%s", devid, arg);
+ if (write(fifo, cmd, strlen(cmd)) != strlen(cmd))
+ fatal("FIFO write failed for command (%s)", strerror(errno));
+ } else {
+- sprintf(fifoname, "%s.%.*s", FAX_FIFO,
++ snprintf(fifoname, sizeof(fifoname), "%s.%.*s", FAX_FIFO,
+ sizeof (fifoname) - sizeof (FAX_FIFO), devid);
+ fifo = open(fifoname, O_WRONLY|O_NDELAY);
+ if (fifo < 0)
+ fatal("%s: open: %s", fifoname, strerror(errno));
+- sprintf(cmd, "S%s", arg);
++ snprintf(cmd, sizeof(cmd), "S%s", arg);
+ if (write(fifo, cmd, strlen(cmd)) != strlen(cmd))
+ fatal("FIFO write failed for command (%s)", strerror(errno));
+ }
diff --git a/comms/hylafax/pkg-message b/comms/hylafax/pkg-message
index f24970a8ada2..3dbe78f24854 100644
--- a/comms/hylafax/pkg-message
+++ b/comms/hylafax/pkg-message
@@ -2,7 +2,9 @@ Hylafax was installed. You'll need manual configurations to actually
activate it.
Setting up: (for impatients)
- Invoke /usr/local/sbin/faxsetup, and answer what she asks.
+ Invoke /usr/local/sbin/faxsetup, and answer the questions.
+ Mostly, accepting the defaults should work well.
+
When you are asked to specify the name of tty device, use "cuaa1"
instead of "ttyd1". Otherwise it does not work well.
@@ -15,4 +17,4 @@ Setting up: (for impatients)
Documentation:
On Line Manuals: man hylafax.
- World Wide Web site: http://www.vix.com/flexfax/
+ World Wide Web site: http://www.hylafax.org/
diff --git a/comms/hylafax/pkg-plist b/comms/hylafax/pkg-plist
index a6b2cef6748a..1cca4f3418ef 100644
--- a/comms/hylafax/pkg-plist
+++ b/comms/hylafax/pkg-plist
@@ -17,9 +17,11 @@ sbin/cqtest
sbin/dialtest
sbin/faxabort
sbin/faxaddmodem
+sbin/faxadduser
sbin/faxanswer
sbin/faxconfig
sbin/faxcron
+sbin/faxdeluser
sbin/faxgetty
sbin/faxinfo
sbin/faxmodem
@@ -35,6 +37,7 @@ sbin/faxsetup.linux
sbin/faxstate
sbin/faxwatch
sbin/hfaxd
+sbin/hylafax
sbin/lockname
sbin/ondelay
sbin/pagesend
@@ -45,7 +48,7 @@ sbin/textfmt
sbin/tiffcheck
sbin/tsitest
sbin/typetest
-sbin/xferstats
+sbin/xferfaxstats
@dirrm lib/fax
@cwd /var/spool
fax/COPYRIGHT
@@ -105,9 +108,9 @@ fax/etc/dialrules
fax/etc/dialrules.europe
fax/etc/dialrules.sf-ba
fax/etc/dpsprinter.ps
-fax/etc/hosts
+fax/etc/hosts.hfaxd
fax/etc/lutRS18.pcf
-fax/etc/xferlog
+fax/etc/xferfaxlog
@exec chown uucp:dialer %D/fax
@comment pkg_* can't deal with fifos if specified as a file
@exec mkfifo %D/fax/FIFO