Hello community, here is the log from the commit of package hylafax+ for openSUSE:Factory checked in at 2016-02-18 11:07:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hylafax+ (Old) and /work/SRC/openSUSE:Factory/.hylafax+.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hylafax+" Changes: -------- --- /work/SRC/openSUSE:Factory/hylafax+/hylafax+.changes 2016-01-01 19:50:05.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.hylafax+.new/hylafax+.changes 2016-02-18 12:36:53.000000000 +0100 @@ -1,0 +2,33 @@ +Sun Feb 7 08:48:04 UTC 2016 - [email protected] + +- Fixed file list entry for faxcron + +------------------------------------------------------------------- +Sat Feb 6 19:03:34 UTC 2016 - [email protected] + +- put texfmt manpage into the right package + +------------------------------------------------------------------- +Tue Dec 29 12:12:19 UTC 2015 - [email protected] + +- hylafax 5.5.7 +* fix ntries counter to apply to pages instead of documents (5 Dec 2015) +* reject jobs rejected by the proxy (18-19 Nov 2015) +* add RewriteFaxName and RewriteFaxNumber jobcontrol features (14 Nov 2015) +* improve Chinese translation (7 Oct 2015) +* make faxsetup fix blind references in Fontmap.HylaFAX (3 Oct 2015) +* use the remote time on proxy job submisisons (17 Sep 2015) +* create more-secure hosts.hfaxd passwords by default (28 Aug 2015) +* add admin login feature for faxstat (27 Aug 2015) +* add ProxyJobTag jobcontrol feature (26 Aug 2015) +* fix grevious calculation problem with Class1RestrictPoorSenders and + Class1RestrictPoorDestinations (20 Aug 2015) +* add application/binary MIMEConverter (17 Jul 2015) +* fix DynamicConfig for Class 1 modem data format support (15 Jul 2015) +* fix crash in tagline imaging due to glyph ascent (23 Jun 2015) +* stop messing with the FIFO during installs and uninstalls (16 Jun 2015) +* avoid conflicts with a TTY environment variable (15 Jun 2015) +* fix dataTimeout esp for modems with large buffers in non-ECM (22 May 2015) +* fix dataTimeout primarily affecting 7200 bps ECM sending (15 May 2015) + +------------------------------------------------------------------- Old: ---- hylafax-5.5.6.tar.gz New: ---- hylafax-5.5.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hylafax+.spec ++++++ --- /var/tmp/diff_new_pack.W4Uacz/_old 2016-02-18 12:36:54.000000000 +0100 +++ /var/tmp/diff_new_pack.W4Uacz/_new 2016-02-18 12:36:54.000000000 +0100 @@ -19,7 +19,7 @@ %global faxspool %{_localstatedir}/spool/hylafax %define lib_version %(echo %{version} | tr \. _) Name: hylafax+ -Version: 5.5.6 +Version: 5.5.7 Release: 0 Summary: An enterprise-strength fax server License: BSD-3-Clause @@ -417,6 +417,7 @@ %{_mandir}/man8/ondelay.8c.gz %{_mandir}/man8/probemodem.8c.gz %{_mandir}/man8/typetest.8c.gz +%{_mandir}/man1/textfmt.1.gz %dir %{_sysconfdir}/hylafax %dir %{_sysconfdir}/hylafax/faxmail %dir %{_sysconfdir}/hylafax/faxmail/application @@ -450,7 +451,7 @@ %{_sbindir}/faxadduser %{_sbindir}/faxanswer %{_sbindir}/faxconfig -%config(noreplace) %attr(700,root,root) %{_sbindir}/faxcron +%{_sbindir}/faxcron %{_sbindir}/faxdeluser %{_sbindir}/faxinfo %{_sbindir}/faxlock @@ -496,6 +497,7 @@ %{faxspool}/bin/wedged %{_sysconfdir}/hylafax/faxmail/application/pdf %{_sysconfdir}/hylafax/faxmail/application/octet-stream +%{_sysconfdir}/hylafax/faxmail/application/binary %{_sysconfdir}/hylafax/faxmail/image/tiff %defattr(-,uucp,uucp,-) %dir %{faxspool} @@ -545,6 +547,5 @@ %{_mandir}/man1/sendfax.1.gz %{_mandir}/man1/sendpage.1.gz %{_mandir}/man1/sgi2fax.1.gz -%{_mandir}/man1/textfmt.1.gz %changelog ++++++ hylafax-5.5.6.tar.gz -> hylafax-5.5.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/CHANGES new/hylafax-5.5.7/CHANGES --- old/hylafax-5.5.6/CHANGES 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/CHANGES 2015-12-28 17:26:09.000000000 +0100 @@ -2,6 +2,27 @@ New Changes +* fix ntries counter to apply to pages instead of documents (5 Dec 2015) +* reject jobs rejected by the proxy (18-19 Nov 2015) +* add RewriteFaxName and RewriteFaxNumber jobcontrol features (14 Nov 2015) +* improve Chinese translation (7 Oct 2015) +* make faxsetup fix blind references in Fontmap.HylaFAX (3 Oct 2015) +* use the remote time on proxy job submisisons (17 Sep 2015) +* create more-secure hosts.hfaxd passwords by default (28 Aug 2015) +* add admin login feature for faxstat (27 Aug 2015) +* add ProxyJobTag jobcontrol feature (26 Aug 2015) +* fix grevious calculation problem with Class1RestrictPoorSenders and + Class1RestrictPoorDestinations (20 Aug 2015) +* add application/binary MIMEConverter (17 Jul 2015) +* fix DynamicConfig for Class 1 modem data format support (15 Jul 2015) +* fix crash in tagline imaging due to glyph ascent (23 Jun 2015) +* stop messing with the FIFO during installs and uninstalls (16 Jun 2015) +* avoid conflicts with a TTY environment variable (15 Jun 2015) +* fix dataTimeout esp for modems with large buffers in non-ECM (22 May 2015) +* fix dataTimeout primarily affecting 7200 bps ECM sending (15 May 2015) + +(5.5.6) + * add typerules suggestion for PNG conversion (19 Mar 2015) * support more than 256 pages in Class 1 ECM (26 Feb 2015) * cope with application/pdf being encoded with quoted-printable diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/CONTRIBUTORS new/hylafax-5.5.7/CONTRIBUTORS --- old/hylafax-5.5.6/CONTRIBUTORS 2015-04-22 22:04:43.000000000 +0200 +++ new/hylafax-5.5.7/CONTRIBUTORS 2015-12-28 17:26:08.000000000 +0100 @@ -176,6 +176,7 @@ Brian Postow improved frame checking enhancement Andreas Pretzsch Bernd Proissl + Zesen Qian (钱泽森) improved Chinese translation Andy Rabagliati Jean-Pierre Radley man page corrections, SCO Unix particulars, PCL typerules Nenad Radosavljevic Serbian dictionary translation @@ -197,6 +198,7 @@ Sven Schmidt Steven Schoch faxrcvd faxinfo text parsing John Sellens + Chris Severance documentation fixes, scripting improvements Simon <[email protected]> Blas Rodriguez Somoza Vilmos Soti diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/Makefile.in new/hylafax-5.5.7/Makefile.in --- old/hylafax-5.5.6/Makefile.in 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/Makefile.in 2015-12-28 17:26:09.000000000 +0100 @@ -219,14 +219,7 @@ -rmdir ${SPOOL}/sendq ${SPOOL}/doneq ${SPOOL}/docq ${SPOOL}/tmp ${SPOOL}/pollq ${SPOOL}/archive -rmdir ${SPOOL} -makeDevices:: - ${INSTALL} -u ${FAXUSER} -g ${FAXGROUP} -m 600 -fifo \ - -idb hylafax.sw.server -root ${INSTALLROOT} -F ${SPOOL} FIFO - -rmDevices:: - ${RM} -f ${SPOOL}/FIFO - -install: makeDirs makeDevices +install: makeDirs ${INSTALL} -m 444 -root ${INSTALLROOT} -F ${SPOOL} -idb hylafax.sw.server \ -src ${SRCDIR}/COPYRIGHT -O COPYRIGHT @if [ "@REGEX@" = yes ]; then \ @@ -266,7 +259,7 @@ true; \ fi -uninstall: rmDirs rmDevices +uninstall: rmDirs ${RM} -f ${SPOOL}/COPYRIGHT @for i in ${DIRS}; do \ (${ECHO} "= "$$i; cd $$i; ${MAKE} uninstall) || exit 1; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/VERSION new/hylafax-5.5.7/VERSION --- old/hylafax-5.5.6/VERSION 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/VERSION 2015-12-28 17:26:08.000000000 +0100 @@ -1 +1 @@ -5.5.6 +5.5.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/configure new/hylafax-5.5.7/configure --- old/hylafax-5.5.6/configure 2015-04-22 22:04:45.000000000 +0200 +++ new/hylafax-5.5.7/configure 2015-12-28 17:26:09.000000000 +0100 @@ -4969,6 +4969,7 @@ faxcover/edit-faxcover.sh faxmail/application-pdf.sh faxmail/application-octet-stream.sh + faxmail/application-binary.sh faxmail/image-tiff.sh port/Makefile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/etc/faxaddmodem.sh.in new/hylafax-5.5.7/etc/faxaddmodem.sh.in --- old/hylafax-5.5.6/etc/faxaddmodem.sh.in 2015-04-22 22:04:45.000000000 +0200 +++ new/hylafax-5.5.7/etc/faxaddmodem.sh.in 2015-12-28 17:26:09.000000000 +0100 @@ -54,6 +54,7 @@ SKELFILE= SPEED= DOFUSER=no +TTY= while [ x"$1" != x"" ] ; do case $1 in -s) SPEED=$2; shift;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/etc/faxsetup.sh.in new/hylafax-5.5.7/etc/faxsetup.sh.in --- old/hylafax-5.5.6/etc/faxsetup.sh.in 2015-04-22 22:04:45.000000000 +0200 +++ new/hylafax-5.5.7/etc/faxsetup.sh.in 2015-12-28 17:26:09.000000000 +0100 @@ -1238,9 +1238,37 @@ RUNTIME_PATH_AFM=$PATH_AFM:`getGSFonts` if [ -n "$RUNTIME_PATH_AFM" \ -a "$RUNTIME_PATH_AFM" != "$PATH_AFM" ]; then + Note "" FONTPATHS=`echo $RUNTIME_PATH_AFM | sed 's/:/ /g'` $PATH_GSRIP -q -sDEVICE=tiffg3 -sFONTPATH="$FONTPATHS" $DIR_SPOOL/bin/genfontmap.ps > $DIR_SPOOL/etc/Fontmap.HylaFAX 2>/dev/null # Ghostscript 8.71 segfaults on that, but produces a valid Fontmap file, so we don't test exit code, but examine the product, instead. + { + # + # genfontmap.ps really just gives us a copy of Fontmap.GS, and in later Ghostscript versions there + # are many Fontmap.GS references that are left undefined. This may work for Ghostscript, but + # it does not work for us. So, we need to do what we can to define them. + # + fontmap=$DIR_SPOOL/etc/Fontmap.HylaFAX + newfontmap=$TMPDIR/Fontmap.HylaFAX.new.$$ + tmpfile=$TMPDIR/fontmap-fixup.$$ + $CP $fontmap $newfontmap + for fontname in `$CAT $fontmap | $GREP " /" | $SED -e 's/^[^\/]*\///g' -e 's/ .*//g'`; do + if [ -z "`$GREP "^($fontname)" $fontmap`" ]; then + # There is a blind reference to this font. Fix that. + for fontpath in `$PATH_GSRIP -h | $GREP -A 100 "Search path:" | $GREP " :" | $SED 's/://g'`; do + $GREP -l -d recurse -a "FontDirectory/$fontname known" $fontpath 2>/dev/null; + done | $SED q > $tmpfile + fontfile=`$CAT $tmpfile` + if [ -n "$fontfile" ]; then + echo "($fontname) ($fontfile) ;" >> $newfontmap + else + echo "Warning: No font file found for \"$fontname\" but the font map includes it." + fi + fi + done + $RM -f $tmpfile + $MV -f $newfontmap $fontmap + } if [ -n "`$GREP Courier-Bold $DIR_SPOOL/etc/Fontmap.HylaFAX`" ]; then FONTMAP="$DIR_SPOOL/etc" Note "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/etc/probemodem.sh.in new/hylafax-5.5.7/etc/probemodem.sh.in --- old/hylafax-5.5.6/etc/probemodem.sh.in 2015-04-22 22:04:45.000000000 +0200 +++ new/hylafax-5.5.7/etc/probemodem.sh.in 2015-12-28 17:26:09.000000000 +0100 @@ -54,7 +54,9 @@ ATCMD= DOFUSER=no +OS= SPEED= +TTY= while [ x"$1" != x"" ] ; do case $1 in -c) ATCMD=$2; shift;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/Class1.c++ new/hylafax-5.5.7/faxd/Class1.c++ --- old/hylafax-5.5.6/faxd/Class1.c++ 2015-04-22 22:04:43.000000000 +0200 +++ new/hylafax-5.5.7/faxd/Class1.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -248,7 +248,10 @@ modemParams.vr = conf.class1Resolutions; // bitmapped by configuration if (conf.class1ECMSupport) { modemParams.ec = BIT(EC_DISABLE) | BIT(EC_ENABLE64) | BIT(EC_ENABLE256); - modemParams.df |= (conf.class1MMRSupport ? BIT(DF_2DMMR) : 0); + + if (conf.class1MMRSupport) modemParams.df |= BIT(DF_2DMMR); + else modemParams.df &= ~BIT(DF_2DMMR); + switch (conf.class1JBIGSupport) { case FaxModem::JBIG_FULL: jbigSupported = true; @@ -264,12 +267,18 @@ break; } if (jbigSupported) modemParams.df |= BIT(DF_JBIG); + else modemParams.df &= ~BIT(DF_JBIG); + + modemParams.jp = 0; if (conf.class1GreyJPEGSupport || conf.class1ColorJPEGSupport) modemParams.jp |= BIT(JP_GREY); if (conf.class1ColorJPEGSupport) modemParams.jp |= BIT(JP_COLOR); - } else + } else { modemParams.ec = BIT(EC_DISABLE); + modemParams.df &= ~BIT(DF_2DMMR); + modemParams.jp = 0; + } } /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/Class1.h new/hylafax-5.5.7/faxd/Class1.h --- old/hylafax-5.5.6/faxd/Class1.h 2015-04-22 22:04:43.000000000 +0200 +++ new/hylafax-5.5.7/faxd/Class1.h 2015-12-28 17:26:08.000000000 +0100 @@ -223,7 +223,7 @@ void getDataStats(FaxSetup* setupinfo); void sendSetupPhaseB(const fxStr& pwd, const fxStr& sub); FaxSendStatus sendPhaseB(TIFF* tif, Class2Params&, FaxMachineInfo&, - fxStr& pph, fxStr& emsg, u_int& batched); + fxStr& pph, fxStr& emsg, u_int& batched, u_short& npages); void sendEnd(); void sendAbort(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/Class1Recv.c++ new/hylafax-5.5.7/faxd/Class1Recv.c++ --- old/hylafax-5.5.6/faxd/Class1Recv.c++ 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/Class1Recv.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -114,8 +114,8 @@ dis.setBit(FaxParams::BITNUM_SIGRATE_14, false); // disable V.17 support protoTrace("This sender skips V.29 and has trouble with V.17. Concealing V.17 support."); } - if (conf.class1RestrictPoorSenders && setupinfo && setupinfo->senderDataMissed && - setupinfo->senderDataSent * 100 / setupinfo->senderDataMissed > conf.class1RestrictPoorSenders) { + if (conf.class1RestrictPoorSenders && setupinfo && setupinfo->senderDataSent && + setupinfo->senderDataMissed * 100 / setupinfo->senderDataSent > conf.class1RestrictPoorSenders) { dis.setBit(FaxParams::BITNUM_VR_FINE, false); // disable fine resolution support dis.setBit(FaxParams::BITNUM_VR_R8, false); // disable superfine resolution support dis.setBit(FaxParams::BITNUM_VR_300X300, false);// disable 300x300 dpi support diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/Class1Send.c++ new/hylafax-5.5.7/faxd/Class1Send.c++ --- old/hylafax-5.5.6/faxd/Class1Send.c++ 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/Class1Send.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -305,7 +305,7 @@ */ FaxSendStatus Class1Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info, - fxStr& pph, fxStr& emsg, u_int& batched) + fxStr& pph, fxStr& emsg, u_int& batched, u_short& npages) { int ntrys = 0; // # retraining/command repeats bool morePages = true; // more pages still to send @@ -457,6 +457,7 @@ /* fall thru... */ case FCF_MCF: // ack confirmation case FCF_PIP: // ack, w/ operator intervention + npages++; countPage(); // bump page count notifyPageSent(tif); // update server if (pph[4] == 'Z') @@ -520,6 +521,7 @@ // ignore error and try to send next page // after retraining params.br = (u_int) -1; // force retraining above + npages++; countPage(); // bump page count notifyPageSent(tif); // update server if (pph[4] == 'Z') @@ -2003,6 +2005,19 @@ */ *fp++ = *bp++; *fp++ = *bp++; + + /* + * The modem buffers data. We need to keep track of how much + * data has been sent to the modem and how much time has + * elapsed in order to know a proper dataTimeout setting + * because the modem may have a lot of data buffered to it + * and we can't always rely on a constrained pipe and limited + * buffer to the modem to keep our needed wait-time to under + * the 60-second setting that dataTimeout presently has. + */ + time_t start = Sys::now(); + long pagedatasent = 0; + do { u_char* bol = bp; bool foundEOL; @@ -2023,6 +2038,8 @@ * the current data and reset the pointer into * the zero fill buffer. */ + pagedatasent += fp-fill; + setDataTimeout(pagedatasent, Sys::now() - start, params.br); rc = sendPageData(fill, fp-fill, bitrev, (params.ec != EC_DISABLE), emsg); fp = fill; if (!rc) // error writing data @@ -2034,6 +2051,8 @@ * scanline alone. Flush this scanline * also. lineLen is greater than minLen. */ + pagedatasent += fp-fill; + setDataTimeout(pagedatasent, Sys::now() - start, params.br); rc = sendPageData(bol, lineLen, bitrev, (params.ec != EC_DISABLE), emsg); if (!rc) // error writing break; @@ -2060,13 +2079,17 @@ * Flush anything that was not sent above. */ if (fp > fill && rc) { + pagedatasent += fp-fill; + setDataTimeout(pagedatasent, Sys::now() - start, params.br); rc = sendPageData(fill, fp-fill, bitrev, (params.ec != EC_DISABLE), emsg); } delete[] fill; } else { /* * No EOL-padding needed, just jam the bytes. + * We need to set a timeout appropriate to the data size and bitrate. */ + setDataTimeout(totdata, 0, params.br); rc = sendPageData(dp, (u_int) totdata, bitrev, (params.ec != EC_DISABLE), emsg); } delete[] data; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/Class2.h new/hylafax-5.5.7/faxd/Class2.h --- old/hylafax-5.5.6/faxd/Class2.h 2015-04-22 22:04:43.000000000 +0200 +++ new/hylafax-5.5.7/faxd/Class2.h 2015-12-28 17:26:08.000000000 +0100 @@ -143,7 +143,7 @@ CallStatus dialResponse(fxStr& emsg); FaxSendStatus getPrologue(Class2Params&, bool&, fxStr&, u_int&); FaxSendStatus sendPhaseB(TIFF* tif, Class2Params&, FaxMachineInfo&, - fxStr& pph, fxStr& emsg, u_int& batched); + fxStr& pph, fxStr& emsg, u_int& batched, u_short& npages); void sendAbort(); void getDataStats(FaxSetup* setupinfo); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/Class2Send.c++ new/hylafax-5.5.7/faxd/Class2Send.c++ --- old/hylafax-5.5.6/faxd/Class2Send.c++ 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/Class2Send.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -248,7 +248,7 @@ */ FaxSendStatus Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info, - fxStr& pph, fxStr& emsg, u_int& batched) + fxStr& pph, fxStr& emsg, u_int& batched, u_short& npages) { int ntrys = 0; // # retraining/command repeats u_int ppm, previousppm = 0; @@ -298,6 +298,7 @@ case PPR_PIP: // page good, interrupt requested case PPR_RTP: // page good, retrain requested ignore: + npages++; countPage(); // bump page count notifyPageSent(tif);// update server if (pph[4] == 'Z') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/ClassModem.c++ new/hylafax-5.5.7/faxd/ClassModem.c++ --- old/hylafax-5.5.6/faxd/ClassModem.c++ 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/ClassModem.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -379,21 +379,37 @@ } /* - * Set data transfer timeout and adjust according - * to the negotiated bit rate. + * Set data transfer timeout adjusted proportionately + * according to the negotiated bit rate ("secs" as-given + * is for 14400 bps). This is set to cover the amount + * of time used in transferring a chunk of data. */ void ClassModem::setDataTimeout(long secs, u_int br) { - dataTimeout = secs*1000; // 9600 baud timeout/data write (ms) + dataTimeout = secs*1000; // 14400 bps timeout/data write (ms) switch (br) { - case BR_2400: dataTimeout *= 4; break; - case BR_4800: dataTimeout *= 2; break; - case BR_9600: dataTimeout = (4*dataTimeout)/3; break; - // could shrink timeout for br > 9600 + case BR_2400: dataTimeout *= 6; break; + case BR_4800: dataTimeout *= 3; break; + case BR_7200: dataTimeout *= 2; break; + case BR_9600: dataTimeout = (3*dataTimeout)/2; break; + case BR_12000: dataTimeout = (6*dataTimeout)/5; break; } } +/* + * Set data transfer timeout by calculating + * the timeout period from the data size. + */ +void +ClassModem::setDataTimeout(long datasize, int discount, u_int br) +{ + long secs = datasize*9/10000 + 1; // ~60s per 64KB of data, rounded up + secs -= discount; + setDataTimeout(secs > 15 ? secs : 15, br); // minimum 15-second dataTimeout here +} + + fxStr ClassModem::getCapabilities() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/ClassModem.h new/hylafax-5.5.7/faxd/ClassModem.h --- old/hylafax-5.5.6/faxd/ClassModem.h 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/ClassModem.h 2015-12-28 17:26:08.000000000 +0100 @@ -254,6 +254,7 @@ const fxStr& getCallIDType(int i) const; // data transfer timeout controls void setDataTimeout(long secs, u_int br); + void setDataTimeout(long datasize, int discount, u_int br); long getDataTimeout() const; // miscellaneous void pause(u_int ms); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/FaxModem.h new/hylafax-5.5.7/faxd/FaxModem.h --- old/hylafax-5.5.6/faxd/FaxModem.h 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/FaxModem.h 2015-12-28 17:26:08.000000000 +0100 @@ -266,7 +266,7 @@ bool& hasDoc, fxStr& emsg, u_int& batched) = 0; virtual void sendSetupPhaseB(const fxStr& pwd, const fxStr& sub); virtual FaxSendStatus sendPhaseB(TIFF*, Class2Params&, FaxMachineInfo&, - fxStr& pph, fxStr& emsg, u_int& batched) = 0; + fxStr& pph, fxStr& emsg, u_int& batched, u_short& npages) = 0; virtual void sendEnd(); virtual void sendAbort() = 0; // query interfaces for optional state diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/FaxSend.c++ new/hylafax-5.5.7/faxd/FaxSend.c++ --- old/hylafax-5.5.6/faxd/FaxSend.c++ 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/FaxSend.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -558,7 +558,7 @@ */ u_int prevPages = fax.npages; fax.status = modem->sendPhaseB(tif, clientParams, clientInfo, - fax.pagehandling, fax.notice, batched); + fax.pagehandling, fax.notice, batched, fax.npages); modem->getDataStats(&setupinfo); clientInfo.setDataSent2(clientInfo.getDataSent1()); clientInfo.setDataSent1(clientInfo.getDataSent()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/JobControl.c++ new/hylafax-5.5.7/faxd/JobControl.c++ --- old/hylafax-5.5.6/faxd/JobControl.c++ 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/JobControl.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -78,6 +78,7 @@ proxyreconnects = other.proxyreconnects; proxymailbox = other.proxymailbox; proxynotification = other.proxynotification; + proxyjobtag = other.proxyjobtag; } JobControlInfo::JobControlInfo (const fxStr& buffer) @@ -145,6 +146,8 @@ proxymailbox = value; } else if (streq(tag, "proxynotification")) { proxynotification = value; + } else if (streq(tag, "proxyjobtag")) { + proxyjobtag = value; } else if (streq(tag, "maxconcurrentjobs")) { // backwards compatibility maxConcurrentCalls = getNumber(value); setDefined(DCI_MAXCONCURRENTCALLS); @@ -273,6 +276,12 @@ return proxynotification; } +const fxStr& +JobControlInfo::getProxyJobTag() const +{ + return proxyjobtag; +} + const mode_t JobControlInfo::getProxyLogMode() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/JobControl.h new/hylafax-5.5.7/faxd/JobControl.h --- old/hylafax-5.5.6/faxd/JobControl.h 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/JobControl.h 2015-12-28 17:26:08.000000000 +0100 @@ -55,6 +55,7 @@ fxStr proxypass; // if set, use this as the login password fxStr proxymailbox; // if set, use this as the identity fxStr proxynotification; // if set, use this as the notification + fxStr proxyjobtag; // if set, use this as the jobtag mode_t proxylogmode; // mode for logs retrieved from proxy int proxytries; // if set, specify the number of tries int proxydials; // if set, specify the number of dials @@ -89,6 +90,7 @@ const fxStr& getProxyPass() const; const fxStr& getProxyMailbox() const; const fxStr& getProxyNotification() const; + const fxStr& getProxyJobTag() const; const mode_t getProxyLogMode() const; int getProxyTries() const; int getProxyDials() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/PCFFont.c++ new/hylafax-5.5.7/faxd/PCFFont.c++ --- old/hylafax-5.5.6/faxd/PCFFont.c++ 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/PCFFont.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -572,7 +572,7 @@ continue; int cx = x + ci->lsb; // left edge of glyph int ch = ci->ascent + ci->descent; // glyph height - u_short* rp = raster + (y-ci->ascent)*rowwords + (cx>>4); + u_short* rp = raster + (y > ci->ascent ? y-ci->ascent : 0)*rowwords + (cx>>4); u_short* gp = (u_short*) ci->bits; u_short dx0 = cx&15; // raster word offset u_short rowdelta = rowwords - cwords; // raster row adjust factor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/faxQueueApp.c++ new/hylafax-5.5.7/faxd/faxQueueApp.c++ --- old/hylafax-5.5.6/faxd/faxQueueApp.c++ 2015-04-22 22:04:43.000000000 +0200 +++ new/hylafax-5.5.7/faxd/faxQueueApp.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -733,7 +733,7 @@ */ u_int dataSent = info.getDataSent() + info.getDataSent1() + info.getDataSent2(); u_int dataMissed = info.getDataMissed() + info.getDataMissed1() + info.getDataMissed2(); - if (class1RestrictPoorDestinations && dataMissed && dataSent * 100 / dataMissed > class1RestrictPoorDestinations) { + if (class1RestrictPoorDestinations && dataSent && dataMissed * 100 / dataSent > class1RestrictPoorDestinations) { params.jp = JP_NONE; params.vr = VR_NORMAL; traceJob(job, "This destination exhibits poor call audio quality. Restricting resolution and color support."); @@ -2646,8 +2646,6 @@ /* * Send a fax job via a proxy HylaFAX server. We do this by utilizing SendFaxJob jobWait. - * Retries must be handled by the proxy server as the programming for retries is handled - * by the modem. This server, therefore, only makes one attempt. * * This does not currently work for pager requests or fax polls. * @@ -2671,9 +2669,16 @@ client->readConfig(FAX_SYSCONF); SendFaxJob& rjob = client->addJob(); if (job.getJCI().getDesiredDF() != -1) req.desireddf = job.getJCI().getDesiredDF(); - rjob.setSendTime("now"); + // Since we want to send "now", and because we can't ensure that the remote clock matches ours + // we deliberately do not do the following. The remote will default to its "now". + // rjob.setSendTime("now"); rjob.setPriority(job.pri); - rjob.setKillTime((const char*) fxStr::format("now + %d minutes", (req.killtime - Sys::now())/60)); + // We use a special killtime "!" specifier to indicate that we're providing the raw + // LASTTIME in order to provide a killtime that is relative to the remote clock. + rjob.setKillTime((const char*) fxStr::format("!%02d%02d%02d", + (req.killtime - Sys::now())/(24*60*60), + ((req.killtime - Sys::now())/(60*60))%24, + ((req.killtime - Sys::now())/60)%60 )); rjob.setDesiredDF(req.desireddf); rjob.setMinSpeed(req.minbr); rjob.setDesiredSpeed(req.desiredbr); @@ -2683,7 +2688,11 @@ if (req.timezone != "") rjob.setTimeZone(req.timezone); rjob.setUseXVRes(req.usexvres); client->setHost(job.getJCI().getProxy()); - rjob.setJobTag(job.jobid); + if (job.getJCI().getProxyJobTag().length()) { + rjob.setJobTag(job.getJCI().getProxyJobTag()); + } else { + rjob.setJobTag(job.jobid); + } rjob.setVResolution(req.resolution); rjob.setDesiredMST(req.desiredst); rjob.setAutoCoverPage(false); @@ -2821,7 +2830,22 @@ req.status = send_done; } else { job.state = FaxRequest::state_failed; - if (req.ndials >= req.maxdials || req.ntries >= req.maxtries) + /* + * The JobRetry* configurations are modem-specific. With a proxy involved the + * getProxyTries() and getProxyDials() are the analogous features. If the configuration + * leaves them unset they are both -1. Such a configuration delegates all authority for + * total job failure to the proxy. So, if the proxy fails a job where our configuration + * has delegated all tries and dials to the proxy, then we must also fail the job else we + * will simply resubmit a job to the proxy that the proxy already has deemed as failed + * as if it were rejected (even if maxdials or maxtries were not exceeded). However, in + * a situation where either configuration is not unset it means the opposite: that we are + * not delegating authority for full job failure to the proxy (e.g. it's only entrusted + * to handle one session at-a-time - or we want the proxy to make a minimum set of attempts + * on each submission). + */ + if ((job.getJCI().getProxyTries() == -1 && job.getJCI().getProxyDials() == -1) || + req.ndials >= req.maxdials || req.ntries >= req.maxtries || + strstr((const char*) req.notice, "REJECT")) req.status = send_failed; else req.status = send_retry; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/faxSendApp.c++ new/hylafax-5.5.7/faxd/faxSendApp.c++ --- old/hylafax-5.5.6/faxd/faxSendApp.c++ 2015-04-22 22:04:43.000000000 +0200 +++ new/hylafax-5.5.7/faxd/faxSendApp.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -173,6 +173,12 @@ if (desiredST != (u_int) -1) req->desiredst = desiredST; + /* Allow for faxname and faxnumber to be rewritten by jobcontrol. */ + if (rewriteFaxName != "") + req->faxname = rewriteFaxName; + if (rewriteFaxNumber != "") + req->faxnumber = rewriteFaxNumber; + req->commid = batchcommid; // pass commid on... if (useJobTSI && req->tsi != "") @@ -193,8 +199,10 @@ ai.jobtag = req->jobtag; ai.user = req->mailaddr; ai.csi = info.getCSI(); - CallID empty_callid; - ai.callid = empty_callid; + CallID callid(2); + callid[0].append(req->faxnumber); + callid[1].append(req->faxname); + ai.callid = callid; ai.owner = req->owner; if (req->status == send_done) ai.status = ""; @@ -396,8 +404,10 @@ ai.status = ri.reason; ai.jobid = req.jobid; ai.jobtag = req.jobtag; - CallID empty_callid; - ai.callid = empty_callid; + CallID callid(2); + callid[0].append(req.faxnumber); + callid[1].append(req.faxname); + ai.callid = callid; ri.params.asciiEncode(ai.faxdcs); ai.jobinfo = fxStr::format("%u/%u/%u/%u/%u/%u/%u", req.totpages, req.ntries, req.ndials, req.totdials, req.maxdials, req.tottries, req.maxtries); @@ -449,6 +459,8 @@ faxSendApp::stringtag faxSendApp::strings[] = { { "pollrcvdcmd", &faxSendApp::pollRcvdCmd, FAX_POLLRCVDCMD }, { "sharecallfailures", &faxSendApp::shareCallFailures, "none" }, +{ "rewritefaxname", &faxSendApp::rewriteFaxName, "" }, +{ "rewritefaxnumber", &faxSendApp::rewriteFaxNumber, "" }, }; faxSendApp::numbertag faxSendApp::numbers[] = { { "desireddf", &faxSendApp::desiredDF, (u_int) -1 }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxd/faxSendApp.h new/hylafax-5.5.7/faxd/faxSendApp.h --- old/hylafax-5.5.6/faxd/faxSendApp.h 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/faxd/faxSendApp.h 2015-12-28 17:26:08.000000000 +0100 @@ -56,6 +56,8 @@ UUCPLock* modemLock; // uucp lockfile handle fxStr pollRcvdCmd; // command for docs received by polling fxStr shareCallFailures; // which call failures should be shared to batched jobs + fxStr rewriteFaxName; // desired faxname identifier + fxStr rewriteFaxNumber; // desired faxnumber identifier u_int desiredDF; // desired data format u_int desiredBR; // desired signalling rate u_int desiredST; // desired min-scanline-time diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxmail/Makefile.in new/hylafax-5.5.7/faxmail/Makefile.in --- old/hylafax-5.5.6/faxmail/Makefile.in 2015-04-22 22:04:42.000000000 +0200 +++ new/hylafax-5.5.7/faxmail/Makefile.in 2015-12-28 17:26:08.000000000 +0100 @@ -66,6 +66,8 @@ -src ${SRCDIR}/application-pdf.sh -O pdf ${INSTALL} -root ${INSTALLROOT} -F ${LIBDATA}/faxmail/application -m 755 -idb ${PRODUCT}.sw.client \ -src ${SRCDIR}/application-octet-stream.sh -O octet-stream + ${INSTALL} -root ${INSTALLROOT} -F ${LIBDATA}/faxmail/application -m 755 -idb ${PRODUCT}.sw.client \ + -src ${SRCDIR}/application-binary.sh -O binary ${INSTALL} -root ${INSTALLROOT} -F ${LIBDATA}/faxmail/image -m 755 -idb ${PRODUCT}.sw.client \ -src ${SRCDIR}/image-tiff.sh -O tiff @@ -74,6 +76,7 @@ ${RM} -f ${LIBDATA}/faxmail.ps ${RM} -f ${LIBDATA}/faxmail/application/pdf ${RM} -f ${LIBDATA}/faxmail/application/octet-stream + ${RM} -f ${LIBDATA}/faxmail/application/binary ${RM} -f ${LIBDATA}/faxmail/image/tiff -rmdir ${LIBDATA}/faxmail/application ${LIBDATA}/faxmail/image ${LIBDATA}/faxmail @@ -81,5 +84,5 @@ # These targets are created during the configuration procedure. # clobberconfig: - -${RM} -f application-pdf.sh image-tiff.sh application-octet-stream.sh + -${RM} -f application-pdf.sh image-tiff.sh application-octet-stream.sh application-binary.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxmail/application-binary.sh.in new/hylafax-5.5.7/faxmail/application-binary.sh.in --- old/hylafax-5.5.6/faxmail/application-binary.sh.in 1970-01-01 01:00:00.000000000 +0100 +++ new/hylafax-5.5.7/faxmail/application-binary.sh.in 2015-12-28 17:26:08.000000000 +0100 @@ -0,0 +1,36 @@ +#! @SCRIPT_SH@ +# +# This file is considered part of the software distribution, +# and any changes made to it may get overwritten in a +# subsequent upgrade or reinstallation. Instead of making +# changes here, directly, consider copying the entire +# default MIMEConverters directory to a custom location, i.e. +# /usr/local/sbin/faxmail.custom, set MIMEConverters in +# hyla.conf to point there, and make changes there instead. +# + +DISCARDMSG="DISCARDED application/binary goes here" +FILECMD=file + +. @SPOOL@/etc/setup.cache + +if [ ! -x $FILECMD ]; then + echo "$DISCARDMSG" | $LIBEXEC/textfmt -B + exit +fi + +MIMETYPE="`$FILECMD -bi "$1" | $SED 's/;.*//g'`" +if [ "$MIMETYPE" != "application/octet-stream" ] && [ "$MIMETYPE" != "application/binary" ] && [ -x $LIBDATA/faxmail/$MIMETYPE ]; then + echo "running: $LIBDATA/faxmail/$MIMETYPE \"$1\"" >&2 + $LIBDATA/faxmail/$MIMETYPE "$1" +else + case "$MIMETYPE" in + "application/postscript") cat "$1";; + "message/rfc822") cat "$1" | $LIBEXEC/textfmt -B;; + text/*) cat "$1" | $LIBEXEC/textfmt -B;; + *) echo "Discarding: \"$@\"" >&2 + echo "$DISCARDMSG" | $LIBEXEC/textfmt -B;; + esac +fi + +exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxmail/application-octet-stream.sh.in new/hylafax-5.5.7/faxmail/application-octet-stream.sh.in --- old/hylafax-5.5.6/faxmail/application-octet-stream.sh.in 2015-04-22 22:04:42.000000000 +0200 +++ new/hylafax-5.5.7/faxmail/application-octet-stream.sh.in 2015-12-28 17:26:07.000000000 +0100 @@ -20,7 +20,7 @@ fi MIMETYPE="`$FILECMD -bi "$1" | $SED 's/;.*//g'`" -if [ "$MIMETYPE" != "application/octet-stream" ] && [ -x $LIBDATA/faxmail/$MIMETYPE ]; then +if [ "$MIMETYPE" != "application/octet-stream" ] && [ "$MIMETYPE" != "application/binary" ] && [ -x $LIBDATA/faxmail/$MIMETYPE ]; then echo "running: $LIBDATA/faxmail/$MIMETYPE \"$1\"" >&2 $LIBDATA/faxmail/$MIMETYPE "$1" else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/faxstat/faxstat.c++ new/hylafax-5.5.7/faxstat/faxstat.c++ --- old/hylafax-5.5.6/faxstat/faxstat.c++ 2015-04-22 22:04:43.000000000 +0200 +++ new/hylafax-5.5.7/faxstat/faxstat.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -60,14 +60,19 @@ char *owner = NULL; char *pass = NULL; + char *adminpass = NULL; fxStrArray dirs; bool checkInfo = false; bool checkStatus = true; bool showSeqfs = false; + bool useadmin = false; int c; - while ((c = Sys::getopt(argc, argv, "h:adgfilnO:o:qrsv")) != -1) + while ((c = Sys::getopt(argc, argv, "h:AadgfilnO:o:qrsv")) != -1) switch (c) { + case 'A': + useadmin = true; // use admin login + break; case 'a': // display archived jobs dirs.append(FAX_ARCHDIR); break; @@ -92,12 +97,19 @@ case 'n': // do not display server status checkStatus = false; break; - case 'o': // specify owner:pass + case 'o': // specify owner[:pass[:adminpass]] { char* pp = strchr(optarg, ':'); if (pp && *(pp + 1) != '\0') { *pp = '\0'; pass = pp + 1; + // check for optional adminpass + pp = strchr(pass, ':'); + if (pp && *(pp + 1) != '\0') { + *pp = '\0'; + adminpass = pp + 1; + useadmin = true; + } } } owner = optarg; @@ -123,7 +135,7 @@ if (checkStatus) dirs.insert(FAX_STATUSDIR, 0); // server status fxStr emsg; if (callServer(emsg)) { - if (login(owner, pass, emsg)) { + if (login(owner, pass, emsg) && (!useadmin || admin(adminpass, emsg))) { if (checkInfo) (void) recvData(writeStdout, NULL, emsg, 0, "RETR " FAX_STATUSDIR "/any." FAX_INFOSUF); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/hfaxd/User.c++ new/hylafax-5.5.7/hfaxd/User.c++ --- old/hylafax-5.5.6/hfaxd/User.c++ 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/hfaxd/User.c++ 2015-12-28 17:26:09.000000000 +0100 @@ -344,6 +344,10 @@ } } +/* + * cvtPasswd is a function meant to be operationally + * identical to one of the same name in util/faxadduser.c + */ bool HylaFAXServer::cvtPasswd(const char* type, const char* pass, fxStr& result) { @@ -360,13 +364,23 @@ return (false); } srandom((int) Sys::now()); - char salt[9]; + char salt[12]; /* - * Contemporary systems use an extended salt that + * Historically crypt() only utilized the first 8 + * characters of a password which made password cracking + * much easier. GNU libc2 provides a more-secure salt + * feature providing for passwords longer than 8 characters. + * Other "contemporary" systems may use an extended salt that * is distinguished by a leading character (``_''). - * Older systems use a 2-character salt that results - * in encrypted strings that are easier to crack. */ +#if defined __GLIBC__ && __GLIBC__ >= 2 + salt[0] = '$'; + salt[1] = '1'; + salt[2] = '$'; + to64(&salt[3], (long)(29 * 25), 4); + to64(&salt[7], random(), 4); + salt[11] = '$'; +#else #ifdef _PASSWORD_EFMT1 salt[0] = _PASSWORD_EFMT1; to64(&salt[1], (long)(29 * 25), 4); @@ -374,6 +388,7 @@ #else to64(&salt[0], random(), 2); #endif +#endif result = crypt(pass, salt); return (true); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/man/faxadduser.1m new/hylafax-5.5.7/man/faxadduser.1m --- old/hylafax-5.5.6/man/faxadduser.1m 2015-04-22 22:04:45.000000000 +0200 +++ new/hylafax-5.5.7/man/faxadduser.1m 2015-12-28 17:26:09.000000000 +0100 @@ -52,8 +52,14 @@ .SH DESCRIPTION .I faxadduser creates a new user for HylaFAX services, updating appropriate -permission files(see +permission files (see .IR hosts.hfaxd (${MANNUM4_5})). +Note that users may also be added through the ``SITE ADDUSER'' feature from +an administrative client. However, +.I faxadduser +works with the +.IR hosts.hfaxd (${MANNUM4_5})) +file directly and does not operate as an administrative client. .PP .SH OPTIONS The following options are available: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/man/faxdeluser.1m new/hylafax-5.5.7/man/faxdeluser.1m --- old/hylafax-5.5.6/man/faxdeluser.1m 2015-04-22 22:04:45.000000000 +0200 +++ new/hylafax-5.5.7/man/faxdeluser.1m 2015-12-28 17:26:09.000000000 +0100 @@ -41,6 +41,12 @@ .I faxdeluser deletes all entries with the supplied username from the HylaFAX permissions database (see .IR hosts.hfaxd (${MANNUM4_5})). +Note that users may also be deleted through the ``SITE DELUSER'' feature from +an administrative client. However, +.I faxdeluser +works with the +.IR hosts.hfaxd (${MANNUM4_5})) +file directly and does not operate as an administrative client. .PP .SH OPTIONS The following options are available: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/man/faxstat.1 new/hylafax-5.5.7/man/faxstat.1 --- old/hylafax-5.5.6/man/faxstat.1 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/man/faxstat.1 2015-12-28 17:26:09.000000000 +0100 @@ -93,6 +93,9 @@ directory on the server machine. .SH OPTIONS .TP 10 +.B \-A +Login with administrative privileges. +.TP 10 .B \-a Display the contents of the .B archive @@ -160,9 +163,9 @@ .TP 10 .BI \-o " login" Specify the fax owner login name. If unspecified, the user's -current login name is used. The login password may also -be provided by separating it from the owner login name with -a colon, like ``owner:pass''. +current login name is used. The login password and admin password may also +be provided by separating them from the owner login name with +colons, like ``owner:pass:adminpass''. .TP 10 .B \-q Display the sequence numbers of the \*(Fx queues. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/man/hosts.hfaxd.4f new/hylafax-5.5.7/man/hosts.hfaxd.4f --- old/hylafax-5.5.6/man/hosts.hfaxd.4f 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/man/hosts.hfaxd.4f 2015-12-28 17:26:09.000000000 +0100 @@ -45,6 +45,21 @@ Note also that this file must be readable only by the ``fax'' user; i.e. it should have mode 600 and be owned by ``fax''. .PP +Usually +.B etc/hosts.hfaxd +is managed through use of the +.IR faxadduser (${MANNUM1_8}) +and +.IR faxdeluser (${MANNUM1_8}) +tools or the ``SITE ADDUSER'' and ``SITE DELUSER'' functions through an administrative client. +However, some features are not accessible through those tools and +.B etc/hosts.hfaxd +will require direct editing to use those features. In particular, the order of entries in +.B etc/hosts.hfaxd +may need manipulation as +.I hfaxd +uses the first-matched entry (read top-down). +.PP Each newline-terminated entry is a set of colon (:) separated fields, all but the first of which are optional. Trailing null fields and their separators may be omitted. @@ -153,6 +168,8 @@ .fi .RE .SH "SEE ALSO" -.IR sendfax (1), +.IR faxadduser (${MANNUM1_8}), +.IR faxdeluser (${MANNUM1_8}), +.IR sendfax (${MANNUM1_8}), .IR hfaxd (${MANNUM1_8}), .IR hylafax-server (${MANNUM4_5}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/man/jobcontrol.1m new/hylafax-5.5.7/man/jobcontrol.1m --- old/hylafax-5.5.6/man/jobcontrol.1m 2015-04-22 22:04:44.000000000 +0200 +++ new/hylafax-5.5.7/man/jobcontrol.1m 2015-12-28 17:26:09.000000000 +0100 @@ -86,11 +86,14 @@ ProxyPass string \- authentication password for the proxy server ProxyMailbox string \- E-Mail address for job notification ProxyNotification string \s-1none\s+1 notification request +ProxyJobTag string \s-1\fIsee below\fP\s+1 jobtag for proxy job ProxyLogMode octal \s-10600\s+1 protection to use for logs retrieved from proxy server ProxyTries integer \s-1\-1\s+1 number of tries proxy should attempt ProxyDials integer \s-1\-1\s+1 number of dials proxy should attempt ProxyReconnects integer \s-1\5\s+1 number of reconnections to proxy for any job submisison RejectNotice string \- rejection notice for transmit job +RewriteFaxname string \- replace faxname in job request with this +RewriteFaxnumber string \- replace faxnumber in job request with this TimeOfDay string \s-1Any\s+1 default time-of-day restrictions VRes integer \- Vertical resolution UseXVRes integer \- Usage of extended resolutions @@ -159,6 +162,11 @@ the originating job.) .PP The +.B ProxyJobTag +sets the jobtag for the job on the proxy server. By default this is the jobid +for the originating job. +.PP +The .B ProxyLogMode parameter specifies the file mode protection that should be used for the logs that are able to be retrieved from the proxy server. (In order to @@ -199,6 +207,13 @@ .fi .PP The +.B RewriteFaxname +and +.B RewriteFaxnumber +parameters allow the ``faxname'' and ``faxnumber'' parameters in the job +request file to be replaced and rewritten with the given values. +.PP +The .B VRes parameter controls the vertical resolution. Possible values are 98 (normal resolution, equivalent to .I sendfax diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/man/ondelay.1m new/hylafax-5.5.7/man/ondelay.1m --- old/hylafax-5.5.6/man/ondelay.1m 2015-04-22 22:04:45.000000000 +0200 +++ new/hylafax-5.5.7/man/ondelay.1m 2015-12-28 17:26:09.000000000 +0100 @@ -30,7 +30,7 @@ .TH ONDELAY ${MANNUM1_8} "Dec 3, 2012" .SH NAME ondelay \- program invoked by faxaddmodem and probemodem to configure a -a modem device for use by those programs +modem device for use by those programs .SH DESCRIPTION .I ondelay is a program invoked by faxaddmodem and probemodem to configure a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/man/sendq.4f new/hylafax-5.5.7/man/sendq.4f --- old/hylafax-5.5.6/man/sendq.4f 2015-04-22 22:04:45.000000000 +0200 +++ new/hylafax-5.5.7/man/sendq.4f 2015-12-28 17:26:09.000000000 +0100 @@ -91,7 +91,7 @@ errorcode string job status error code external string external form of dialstring fax string document ready for transmission -faxnumber string faxnumber to use sending +faxnumber string origin number to use sending faxname string origin name to use sending groupid integer \*(Fx job group identifier ignoremodembusy integer whether or not to ignore a modem busy state @@ -292,7 +292,7 @@ at zero). .TP 14 .B faxnumber -The number to use when sending a fax. Parallel's FAXNumber device config +The originating number to use when sending a fax. Parallels FAXNumber device config option. .TP 14 .B faxname diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/man/xferfaxlog.4f new/hylafax-5.5.7/man/xferfaxlog.4f --- old/hylafax-5.5.6/man/xferfaxlog.4f 2015-04-22 22:04:45.000000000 +0200 +++ new/hylafax-5.5.7/man/xferfaxlog.4f 2015-12-28 17:26:09.000000000 +0100 @@ -46,7 +46,7 @@ Each record of a facsimile transmission is of the form: .sp .5 .ti +0.5i -date \s-1SEND\s+1 commid modem jobid jobtag sender ``dest-number'' ``\s-1CSI\s+1'' params #pages jobtime conntime ``reason'' \fI<null>\fP \fI<null>\fP \fI<null>\fP ``owner'' ``dcs'' jobinfo +date \s-1SEND\s+1 commid modem jobid jobtag sender ``dest-number'' ``\s-1CSI\s+1'' params #pages jobtime conntime ``reason'' ``faxname'' ``faxnumber'' \fI<null>\fP ``owner'' ``dcs'' jobinfo .sp .5 .PP A facsimile document reception record is of the form: @@ -64,7 +64,7 @@ Each facsimile document retrieved by polling has a record of the form: .sp .5 .ti +0.5i -date \s-1POLL\s+1 commid modem jobid jobtag sender ``dest-number'' ``\s-1TSI\s+1'' params #pages jobtime conntime ``reason'' \fI<null>\fP \fI<null>\fP \fI<null>\fP +date \s-1POLL\s+1 commid modem jobid jobtag sender ``dest-number'' ``\s-1TSI\s+1'' params #pages jobtime conntime ``reason'' ``faxname'' ``faxnumber'' \fI<null>\fP .sp .5 .PP An alphanumeric pager request has a record of the form: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/util/FaxClient.c++ new/hylafax-5.5.7/util/FaxClient.c++ --- old/hylafax-5.5.6/util/FaxClient.c++ 2015-04-22 22:04:43.000000000 +0200 +++ new/hylafax-5.5.7/util/FaxClient.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -978,6 +978,12 @@ } bool +FaxClient::jobLastTime(const char* t) +{ + return (command("JPARM LASTTIME %s", t) == COMPLETE); +} + +bool FaxClient::jobRetryTime(u_long tv) { return (command("JPARM RETRYTIME %02d%02d", tv/60, tv%60) == COMPLETE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/util/FaxClient.h new/hylafax-5.5.7/util/FaxClient.h --- old/hylafax-5.5.6/util/FaxClient.h 2015-04-22 22:04:43.000000000 +0200 +++ new/hylafax-5.5.7/util/FaxClient.h 2015-12-28 17:26:08.000000000 +0100 @@ -244,6 +244,7 @@ bool jobParm(const char* name); bool jobSendTime(const struct tm tm); bool jobLastTime(u_long); + bool jobLastTime(const char*); bool jobRetryTime(u_long); bool jobCover(const char* docname); bool jobDocument(const char* docname); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/util/SendFaxJob.c++ new/hylafax-5.5.7/util/SendFaxJob.c++ --- old/hylafax-5.5.6/util/SendFaxJob.c++ 2015-04-22 22:04:42.000000000 +0200 +++ new/hylafax-5.5.7/util/SendFaxJob.c++ 2015-12-28 17:26:08.000000000 +0100 @@ -516,12 +516,16 @@ } else tts = *localtime(&now); if (killTime != "") { - struct tm when; - if (!parseAtSyntax(killTime, tts, when, emsg)) { - emsg.insert(killTime | ": "); - return (false); + if (killTime[0] == '!') { + CHECK(client.jobLastTime((const char*) killTime.cut(1, killTime.length()-1))) + } else { + struct tm when; + if (!parseAtSyntax(killTime, tts, when, emsg)) { + emsg.insert(killTime | ": "); + return (false); + } + CHECK(client.jobLastTime(mktime(&when) - now)) } - CHECK(client.jobLastTime(mktime(&when) - now)) } if (retryTime != (u_int) -1) CHECK(client.jobRetryTime(retryTime)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/util/dict-zh.in new/hylafax-5.5.7/util/dict-zh.in --- old/hylafax-5.5.6/util/dict-zh.in 2015-04-22 22:04:42.000000000 +0200 +++ new/hylafax-5.5.7/util/dict-zh.in 2015-12-28 17:26:08.000000000 +0100 @@ -1,111 +1,111 @@ # $Id: dict-zh.in 1126 2012-12-04 04:52:46Z faxguy $ CHARSET=UTF-8; - DICTRECEIVEAGENT="传真接收程序"; + DICTRECEIVEAGENT="HylaFAX 收取助手"; DICTRECEIVEDFROM="从 \$SENDER 收到传真"; - DICTRETRIEVEDFROM="传真来自 \$SENDER"; - DICTMSGINTRO="文件接收不全,因为:"; + DICTRETRIEVEDFROM="从 \$SENDER 取回传真"; + DICTMSGINTRO="文件接收不全, 因为:"; DICTLOGFOLLOWS=" ---- 会话副本如下 ----"; DICTLOGFOLLOWS2="会话副本如下"; - DICTNOLOGAVAIL=" 没有有效的记录\(可供参考\)"; - DICTDISPATCHEDTO="传真被自动发送到: \$SENDTO."; - DICTPOLLDISPATCHTO="传真被轮询并发送到: \$MAILADDR."; - DICTNOTRECEIVED="传真未接收"; - DICTATTEMPTEDFAXFAILED="\(尝试\)在 \$DEVICE 上接收传真失败,因为:" - DICTATTEMPTEDPOLLFAILED="\(尝试\)在 \$DEVICE 上检索传真失败,因为:"; - DICTFAILEDBECAUSE="失败原因:"; + DICTNOLOGAVAIL=" 没有有效的记录"; + DICTDISPATCHEDTO="该传真被自动分派到: \$SENDTO."; + DICTPOLLDISPATCHTO="该传真被轮询并递送到: \$MAILADDR."; + DICTNOTRECEIVED="传真未被接收"; + DICTATTEMPTEDFAXFAILED="尝试在 \$DEVICE 上接收传真失败, 因为:" + DICTATTEMPTEDPOLLFAILED="尝试在 \$DEVICE 上轮询传真失败, 因为:"; + DICTFAILEDBECAUSE="失败原因:"; DICTUNKNOWNDOCTYPE="未知的文件类型"; DICTNOFILEEXISTS="文件不存在"; - DICTDESTINATION="目标文件"; + DICTDESTINATION="目标"; DICTJOBID="任务ID"; DICTGROUPID="组ID"; DICTSENDER="发件人"; DICTMAILADDR="邮件地址"; DICTMODEM="调制解调器"; DICTCOMMID="命令ID"; - DICTSUBMITTEDFROM="被提交,从"; - DICTPAGEWIDTH="页宽"; - DICTPAGELENGTH="页长"; + DICTSUBMITTEDFROM="提交自"; + DICTPAGEWIDTH="页面宽度"; + DICTPAGELENGTH="页面长度"; DICTRES="分辨率"; - DICTNOTHINGAVAIL="没有可用\(有效\)的"; + DICTNOTHINGAVAIL="没有可用的"; DICTSTATUS="状态"; - DICTREMOTEEXCHANGES="与远程设备交换信息"; - DICTDIALOGS="对话"; - DICTFAILEDCALLS="对目标文件的调用连续失败"; + DICTREMOTEEXCHANGES="与远程设备交流"; + DICTDIALOGS="会话"; + DICTFAILEDCALLS="对目标连续的呼叫失败"; DICTDIALS="拨号"; - DICTTOTALCALLS="total phone calls placed"; - DICTCALLS="调用(呼叫)"; - DICTPAGESTRANSMITTED="传输(完的)页数"; - DICTPAGES="页"; - DICTTOTALPAGES="传输的总页数"; + DICTTOTALCALLS="计划的所有呼叫"; + DICTCALLS="呼叫"; + DICTPAGESTRANSMITTED="已传输页数"; + DICTPAGES="页数"; + DICTTOTALPAGES="需传输的总页数"; DICTTOTPAGES="总页数"; - DICTATTEMPTSPAGE="\(尝试\)发送当前页"; + DICTATTEMPTSPAGE="尝试发送当前页"; DICTATTEMPTS="尝试"; - DICTDIRNEXTPAGE="下一个发送页的目录"; + DICTDIRNEXTPAGE="下一个待发送页的目录"; DICTDIRNUM="目录号"; - DICTDOCSSUBMITTED="提交文档(用于传输)"; - DICTDOCSTEXT1="下列文件是为传输所提交的,并且是"; - DICTDOCSTEXT2="在服务器上再使用是有效的,直到它们自动的"; - DICTDOCSTEXT3="删除任务,当它是 `if [ \"\$doneop\" = archive ]; then echo 'archived'; else echo 'removed'; fi`. 文件可能需要手工\(来删除\)"; - DICTDOCSTEXT4="被faxrm命令删除\; 查阅 faxrm\(1\) 相关信息."; + DICTDOCSSUBMITTED="提交供传输的文档"; + DICTDOCSTEXT1="下列文件被提交传输, 并且"; + DICTDOCSTEXT2="在服务器上可供重用, 直到它们被自动地"; + DICTDOCSTEXT3="清理, 当该任务 `if [ \"\$doneop\" = archive ]; then echo '被存档'; else echo '被删除'; fi`时。 文件也可以手动"; + DICTDOCSTEXT4="被faxrm命令删除\; 查阅 faxrm\(1\) 获取信息."; DICTFILENAME="文件名"; DICTSIZE="大小"; DICTTYPE="类型"; - DICTUNSENTPAGES="\(传输而提交的\)页面未发送"; - DICTUNSENTJOBSTATUS="任务状态未发送"; + DICTUNSENTPAGES="提交传输但未被发送的页面"; + DICTUNSENTJOBSTATUS="未发送任务状态"; DICTPIN="PIN "; DICTMESSAGETEXT="消息正文"; - DICTNOREASON="无相关原因记录"; - DICTYOURJOBTO="你到 \$number 的 \$THISJOBTYPE任务"; + DICTNOREASON="没有记录原因"; + DICTYOURJOBTO="你发至 \$number 的 \$THISJOBTYPE任务"; DICTfacsimile="传真"; DICTpager="页调度程序"; DICTJOB="\$THISJOBTYPE 任务 \$jobid"; DICTAT="在"; DICTTO="向"; DICTCOMPLETED="完成"; - DICTCOMPLETEDSUCCESSFULLY=" 被成功的完成."; + DICTCOMPLETEDSUCCESSFULLY=" 被成功的完成。"; DICTRECEIVER="收件人"; - DICTQUALITY="分辨率(垂直)"; - DICTFINE="好的(98 lines\/inch)"; - DICTNORMAL="正常的(196 lines\/inch)"; + DICTQUALITY="质量"; + DICTFINE="良好"; + DICTNORMAL="标准"; DICTSIGNALRATE="信号率"; DICTDATAFORMAT="数据格式"; DICTREMOTEEQUIPMENT="远程设备"; DICTREMOTESTATION="远程站点"; DICTPROCESSINGTIME="处理时间是"; - DICTADDITIONALINFO=" 其他信息:"; - DICTFAILED="失败(的)"; - DICTREJECTEDBECAUSE="被拒绝的原因是:"; - DICTBLOCKED="块\/数据块"; - DICTDELAYEDBECAUSE="在调度队列中被延迟,因为:"; - DICTASSOONASPOSSIBLE="任务将会被尽快处理."; - DICTREQUEUED="requeued"; - DICTWASNOTSENT="未发送,因为:"; - DICTWILLBERETRIED="任务将被重试,在"; - DICTREMOVEDFROMQUEUE="从队列中移除"; - DICTWASDELETED="被从队列中删除."; - DICTTIMEDOUT="在最大发送时间内没有发送成功."; - DICTCONVERSION1="未发送,因为文档转换"; - DICTCONVERSION2="传真失败. 输出转换程序为:"; - DICTCONVERSION3="为无效标记与非标准字体检查PostScript文件"; - DICTNOFORMATTER1="未发送,因为"; - DICTNOFORMATTER2="未发现用于文档转换的脚本."; - DICTNOTICEABOUT="注视事项"; - DICTPOLLINGFAILED=", 轮询请求,\n未能完成,因为 "; - DICTREMOTEREJECTED="对方拒绝你的请求."; - DICTNODOCTOPOLL="没有有效的文件可供检索."; - DICTUNSPECIFIEDPROBLEM="发生了一个未定义的错误."; - DICTUNKNOWNREASON1="有一些事(问题)发生."; - DICTUNKNOWNREASON2="很不幸, 通知脚本被意外的调用"; - DICTUNKNOWNREASON3="这是一条调试信息:"; - DICTUNKNOWNREASON4="不该发生的错误,请通知管理员."; - DICTRECEIVEDON="收到(于)"; - DICTPOLLFAILED="轮询检索\(传真\)失败"; + DICTADDITIONALINFO=" 其他信息: "; + DICTFAILED="失败"; + DICTREJECTEDBECAUSE="被拒绝,因为:"; + DICTBLOCKED="被阻塞"; + DICTDELAYEDBECAUSE="在调度队列中被延迟, 因为:"; + DICTASSOONASPOSSIBLE="该任务将会被尽快处理。"; + DICTREQUEUED="重新排队"; + DICTWASNOTSENT="未被发送, 因为:"; + DICTWILLBERETRIED="该任务将被重试, 在"; + DICTREMOVEDFROMQUEUE="被从队列中移除"; + DICTWASDELETED="被从队列中删除。"; + DICTTIMEDOUT="无法在预定时间前完成。"; + DICTCONVERSION1="未被发送, 因为文档到"; + DICTCONVERSION2="传真的转换失败。 转换程序的输出为:"; + DICTCONVERSION3="检查所有 PostScript 文档中的非标准字体和非法结构"; + DICTNOFORMATTER1="未被发送, 因为:"; + DICTNOFORMATTER2="找不到文档转换脚本。"; + DICTNOTICEABOUT="注意事项"; + DICTPOLLINGFAILED=", 轮询请求,\n未能完成, 因为 "; + DICTREMOTEREJECTED="远端拒绝了你的请求。"; + DICTNODOCTOPOLL="没有文件可以取回。"; + DICTUNSPECIFIEDPROBLEM="发生了一个未定义的错误。"; + DICTUNKNOWNREASON1="发生了一些问题。"; + DICTUNKNOWNREASON2="很不幸, 通知脚本随着一个未知的原因被调用"; + DICTUNKNOWNREASON3="因此该信息的剩余部分应用于调试:"; + DICTUNKNOWNREASON4="这不应该发生, 请通知管理员。"; + DICTRECEIVEDON="收于"; + DICTPOLLFAILED="轮询收取传真失败"; DICTYES="是"; DICTNO="否"; DICTRECEIVED="收到"; - DICTTIMETORECV="接收的时间"; - DICTERRCORRECT="错误修正"; + DICTTIMETORECV="接收耗时"; + DICTERRCORRECT="错误纠正"; DICTCALLID1="调用\(者\)ID1"; DICTCALLID2="调用\(者\)ID2"; DICTCALLID3="调用\(者\)ID3"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-5.5.6/util/faxadduser.c new/hylafax-5.5.7/util/faxadduser.c --- old/hylafax-5.5.6/util/faxadduser.c 2015-04-22 22:04:43.000000000 +0200 +++ new/hylafax-5.5.7/util/faxadduser.c 2015-12-28 17:26:08.000000000 +0100 @@ -49,7 +49,50 @@ extern int optind; extern char* optarg; -const char passwd_salts[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; +static void +to64(char* cp, long v, int len) +{ + while (--len >= 0) { + *cp++ = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[v&0x3f]; + v >>= 6; + } +} + +/* + * cvtPasswd is a function meant to be operationally + * identical to one of the same name in hfaxd/User.c++ + */ +const char* +cvtPasswd(const char* pass) +{ + srandom(time(NULL)); + char salt[12]; + /* + * Historically crypt() only utilized the first 8 + * characters of a password which made password cracking + * much easier. GNU libc2 provides a more-secure salt + * feature providing for passwords longer than 8 characters. + * Other "contemporary" systems may use an extended salt that + * is distinguished by a leading character (``_''). + */ +#if defined __GLIBC__ && __GLIBC__ >= 2 + salt[0] = '$'; + salt[1] = '1'; + salt[2] = '$'; + to64(&salt[3], (long)(29 * 25), 4); + to64(&salt[7], random(), 4); + salt[11] = '$'; +#else +#ifdef _PASSWORD_EFMT1 + salt[0] = _PASSWORD_EFMT1; + to64(&salt[1], (long)(29 * 25), 4); + to64(&salt[5], random(), 4); +#else + to64(&salt[0], random(), 2); +#endif +#endif + return(crypt(pass, salt)); +} const char* usage = "faxadduser [-c] [-a admin-password] [-f hosts-file] \ [-h host-name] [-p password] [-u uid] username"; @@ -58,12 +101,10 @@ main(int argc, char** argv) { char buff[256]; - char salt_buff[2]; char newhostfile[256]; FILE* hf = NULL; FILE* nhf = NULL; int c; - int salt; int compat_flag = 0; char* hostfile = FAX_SPOOLDIR "/" FAX_PERMFILE; char* password = NULL; @@ -111,7 +152,6 @@ perror(buff); return 0; } - srand(time(NULL)); while (optind < argc) { fprintf(nhf, "^%s@", argv[optind++]); if (hostname != NULL) fprintf(nhf, "%s$", hostname); @@ -121,18 +161,12 @@ fprintf(nhf, ":"); } if (password != NULL) { - salt = (int)(4096.0 * rand() / (RAND_MAX + 1.0)); - salt_buff[0] = passwd_salts[salt / 64]; - salt_buff[1] = passwd_salts[salt % 64]; - fprintf(nhf, ":%s", crypt(password, salt_buff)); + fprintf(nhf, ":%s", cvtPasswd(password)); } else if (adminword != NULL) { fprintf(nhf, ":"); } if (adminword != NULL) { - salt = (int)(4096.0 * rand() / (RAND_MAX + 1.0)); - salt_buff[0] = passwd_salts[salt / 64]; - salt_buff[1] = passwd_salts[salt % 64]; - fprintf(nhf, ":%s", crypt(adminword, salt_buff)); + fprintf(nhf, ":%s", cvtPasswd(adminword)); } fprintf(nhf, "\n"); }
