Hello community, here is the log from the commit of package hylafax+ for openSUSE:Factory checked in at 2020-02-15 22:25:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hylafax+ (Old) and /work/SRC/openSUSE:Factory/.hylafax+.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hylafax+" Sat Feb 15 22:25:45 2020 rev:30 rq:774423 version:7.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/hylafax+/hylafax+.changes 2019-11-24 00:33:56.731250274 +0100 +++ /work/SRC/openSUSE:Factory/.hylafax+.new.26092/hylafax+.changes 2020-02-15 22:25:56.147326448 +0100 @@ -1,0 +2,9 @@ +Fri Feb 14 17:31:40 UTC 2020 - Axel Braun <axel.br...@gmx.de> + +- Version 7.0.2 +* change FIXEDWIDTH default to better accommodate auto-rotation (13 Dec 2019) +* prevent SSL_accept() from blocking (5 Dec 2019) +* support libtiff v4.1 (5 Dec 2019) +* fix ignoremodembusy feature broken by ModemGroup limits feature (16 Nov 2019) + +------------------------------------------------------------------- Old: ---- hylafax-7.0.1.tar.gz New: ---- hylafax-7.0.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hylafax+.spec ++++++ --- /var/tmp/diff_new_pack.jwW119/_old 2020-02-15 22:25:56.871326839 +0100 +++ /var/tmp/diff_new_pack.jwW119/_new 2020-02-15 22:25:56.875326841 +0100 @@ -19,7 +19,7 @@ %global faxspool %{_localstatedir}/spool/hylafax %define lib_version %(echo %{version} | tr \. _) Name: hylafax+ -Version: 7.0.1 +Version: 7.0.2 Release: 0 Summary: A fax server License: BSD-3-Clause ++++++ hylafax-7.0.1.tar.gz -> hylafax-7.0.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-7.0.1/CHANGES new/hylafax-7.0.2/CHANGES --- old/hylafax-7.0.1/CHANGES 2019-09-27 04:47:27.000000000 +0200 +++ new/hylafax-7.0.2/CHANGES 2020-01-30 00:48:37.000000000 +0100 @@ -2,6 +2,13 @@ New Changes +* change FIXEDWIDTH default to better accommodate auto-rotation (13 Dec 2019) +* prevent SSL_accept() from blocking (5 Dec 2019) +* support libtiff v4.1 (5 Dec 2019) +* fix ignoremodembusy feature broken by ModemGroup limits feature (16 Nov 2019) + +(7.0.1) + * create a client timeout setting and change the default from 60 to 3600 seconds (26 Sep 2019) * extend timeout for receiving ECM frames (21 Aug 2019) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-7.0.1/VERSION new/hylafax-7.0.2/VERSION --- old/hylafax-7.0.1/VERSION 2019-09-27 04:47:27.000000000 +0200 +++ new/hylafax-7.0.2/VERSION 2020-01-30 18:14:27.000000000 +0100 @@ -1 +1 @@ -7.0.1 +7.0.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-7.0.1/configure new/hylafax-7.0.2/configure --- old/hylafax-7.0.1/configure 2019-09-27 04:47:27.000000000 +0200 +++ new/hylafax-7.0.2/configure 2019-12-06 00:45:31.000000000 +0100 @@ -2581,7 +2581,7 @@ echo '#define TIFFSTRIPBYTECOUNTS uint32' echo '#define TIFFVERSION TIFF_VERSION' echo '#define TIFFHEADER TIFFHeader';; - 4.0) tiff_runlen_t="uint32" + 4.[01]) tiff_runlen_t="uint32" tiff_offset_t="uint64" echo '#define TIFFSTRIPBYTECOUNTS uint64' echo '#define TIFFVERSION TIFF_VERSION_CLASSIC' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-7.0.1/faxd/Class1Recv.c++ new/hylafax-7.0.2/faxd/Class1Recv.c++ --- old/hylafax-7.0.1/faxd/Class1Recv.c++ 2019-09-27 04:47:27.000000000 +0200 +++ new/hylafax-7.0.2/faxd/Class1Recv.c++ 2019-12-05 23:23:24.000000000 +0100 @@ -804,7 +804,7 @@ setSSLFaxFd(0); } else { protoTrace("SSL Fax connection detected."); - sslfax.acceptClient(sslFaxProcess, sslFaxPasscode, conf.class1SSLFaxClientTimeout); + sslfax.acceptClient(sslFaxProcess, sslFaxPasscode, getModemFd(), conf.class1SSLFaxClientTimeout); if (sslFaxProcess.emsg != "") protoTrace("SSL Fax accept client: %s", (const char*) sslFaxProcess.emsg); if (!sslFaxProcess.server) { protoTrace("SSL Fax client accept failure. Expecting a traditional fax now."); @@ -1345,7 +1345,7 @@ setSSLFaxFd(0); } else { protoTrace("SSL Fax connection detected."); - sslfax.acceptClient(sslFaxProcess, sslFaxPasscode, conf.class1SSLFaxClientTimeout); + sslfax.acceptClient(sslFaxProcess, sslFaxPasscode, getModemFd(), conf.class1SSLFaxClientTimeout); if (sslFaxProcess.emsg != "") protoTrace("SSL Fax accept client: %s", (const char*) sslFaxProcess.emsg); if (!sslFaxProcess.server) { protoTrace("SSL Fax client accept failure. Expecting a traditional fax now."); @@ -1495,7 +1495,7 @@ setSSLFaxFd(0); } else { protoTrace("SSL Fax connection detected."); - sslfax.acceptClient(sslFaxProcess, sslFaxPasscode, conf.class1SSLFaxClientTimeout); + sslfax.acceptClient(sslFaxProcess, sslFaxPasscode, getModemFd(), conf.class1SSLFaxClientTimeout); if (sslFaxProcess.emsg != "") protoTrace("SSL Fax accept client: %s", (const char*) sslFaxProcess.emsg); if (!sslFaxProcess.server) { protoTrace("SSL Fax client accept failure. Expecting a traditional fax now."); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-7.0.1/faxd/Class1Send.c++ new/hylafax-7.0.2/faxd/Class1Send.c++ --- old/hylafax-7.0.1/faxd/Class1Send.c++ 2019-09-27 04:47:27.000000000 +0200 +++ new/hylafax-7.0.2/faxd/Class1Send.c++ 2019-12-05 23:23:24.000000000 +0100 @@ -933,7 +933,7 @@ setSSLFaxFd(0); } else { protoTrace("SSL Fax connection detected."); - sslfax.acceptClient(sslFaxProcess, sslFaxPasscode, conf.class1SSLFaxClientTimeout); + sslfax.acceptClient(sslFaxProcess, sslFaxPasscode, getModemFd(), conf.class1SSLFaxClientTimeout); if (sslFaxProcess.emsg != "") protoTrace("SSL Fax accept client: %s", (const char*) sslFaxProcess.emsg); if (!sslFaxProcess.server) { protoTrace("SSL Fax client accept failure. Proceeding with a traditional fax now."); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-7.0.1/faxd/faxQueueApp.c++ new/hylafax-7.0.2/faxd/faxQueueApp.c++ --- old/hylafax-7.0.1/faxd/faxQueueApp.c++ 2019-09-27 04:47:27.000000000 +0200 +++ new/hylafax-7.0.2/faxd/faxQueueApp.c++ 2019-11-17 03:29:18.000000000 +0100 @@ -3188,7 +3188,7 @@ sendViaProxy(job, *req); delete req; } - } else if (Modem::modemAvailable(job) && assignModem(job, (allowIgnoreModemBusy && req->ignoremodembusy))) { + } else if ((Modem::modemAvailable(job) || (allowIgnoreModemBusy && req->ignoremodembusy)) && assignModem(job, (allowIgnoreModemBusy && req->ignoremodembusy))) { lastCall = now; if (job.isOnList()) job.remove(); // remove from run queue job.breq = req; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-7.0.1/faxd/sslfax.c++ new/hylafax-7.0.2/faxd/sslfax.c++ --- old/hylafax-7.0.1/faxd/sslfax.c++ 2019-09-27 04:47:27.000000000 +0200 +++ new/hylafax-7.0.2/faxd/sslfax.c++ 2019-12-06 01:02:00.000000000 +0100 @@ -286,7 +286,7 @@ * SSL_ERROR_WANT_WRITE means "wait for the socket to be writeable, then * call this function again.". * - * We do this same thing with SSL_connect(), also. + * We do this same thing with SSL_connect() and SSL_accept(), also. * * In the event that we do turn to a select() then here we also monitor the * modem for activity, since that would indicate failure of the SSL Fax @@ -298,6 +298,10 @@ * will be at an EOF if it is in command mode after an "OK" after a command * completed. We can only select() it when we're waiting for a response. */ + + + int sslfd = sfp.client ? sfp.client : sfp.server; + struct timeval start = currentTime(); int cerror; int ret; @@ -316,20 +320,20 @@ tv.tv_usec = (ms % 1000)*1000; tv = tv - (currentTime() - start); if (cerror == SSL_ERROR_WANT_READ) { // wait for the socket to be readable - FD_SET(sfp.server, &rfds); + FD_SET(sslfd, &rfds); #if CONFIG_BADSELECTPROTO - selret = select((modemFd > sfp.server) ? modemFd+1 : sfp.server+1, (int*) &rfds, NULL, NULL, &tv); + selret = select((modemFd > sslfd) ? modemFd+1 : sslfd+1, (int*) &rfds, NULL, NULL, &tv); #else - selret = select((modemFd > sfp.server) ? modemFd+1 : sfp.server+1, &rfds, NULL, NULL, &tv); + selret = select((modemFd > sslfd) ? modemFd+1 : sslfd+1, &rfds, NULL, NULL, &tv); #endif } else { // SSL_ERROR_WANT_WRITE, wait for the socket to be writable fd_set wfds; FD_ZERO(&wfds); - FD_SET(sfp.server, &wfds); + FD_SET(sslfd, &wfds); #if CONFIG_BADSELECTPROTO - selret = select((modemFd > sfp.server) ? modemFd+1 : sfp.server+1, (int*) &rfds, (int*) &wfds, NULL, &tv); + selret = select((modemFd > sslfd) ? modemFd+1 : sslfd+1, (int*) &rfds, (int*) &wfds, NULL, &tv); #else - selret = select((modemFd > sfp.server) ? modemFd+1 : sfp.server+1, &rfds, &wfds, NULL, &tv); + selret = select((modemFd > sslfd) ? modemFd+1 : sslfd+1, &rfds, &wfds, NULL, &tv); #endif } if (!selret) { @@ -379,6 +383,7 @@ struct timeval start = currentTime(); int cerror; int ret = 0; + int sslfd = sfp.client ? sfp.client : sfp.server; for (pos = 0; pos < count; pos++) { do { cerror = 0; @@ -395,20 +400,20 @@ tv.tv_usec = (ms % 1000)*1000; tv = tv - (currentTime() - start); if (cerror == SSL_ERROR_WANT_READ) { // wait for the socket to be readable - FD_SET(sfp.server, &rfds); + FD_SET(sslfd, &rfds); #if CONFIG_BADSELECTPROTO - selret = select((modemFd > sfp.server) ? modemFd+1 : sfp.server+1, (int*) &rfds, NULL, NULL, &tv); + selret = select((modemFd > sslfd) ? modemFd+1 : sslfd+1, (int*) &rfds, NULL, NULL, &tv); #else - selret = select((modemFd > sfp.server) ? modemFd+1 : sfp.server+1, &rfds, NULL, NULL, &tv); + selret = select((modemFd > sslfd) ? modemFd+1 : sslfd+1, &rfds, NULL, NULL, &tv); #endif } else { // SSL_ERROR_WANT_WRITE, wait for the socket to be writable fd_set wfds; FD_ZERO(&wfds); - FD_SET(sfp.server, &wfds); + FD_SET(sslfd, &wfds); #if CONFIG_BADSELECTPROTO - selret = select((modemFd > sfp.server) ? modemFd+1 : sfp.server+1, (int*) &rfds, (int*) &wfds, NULL, &tv); + selret = select((modemFd > sslfd) ? modemFd+1 : sslfd+1, (int*) &rfds, (int*) &wfds, NULL, &tv); #else - selret = select((modemFd > sfp.server) ? modemFd+1 : sfp.server+1, &rfds, &wfds, NULL, &tv); + selret = select((modemFd > sslfd) ? modemFd+1 : sslfd+1, &rfds, &wfds, NULL, &tv); #endif } if (!selret) { @@ -598,7 +603,7 @@ return (sfp); } if (fcntl(sfp.server, F_SETFL, fcntl(sfp.server, F_GETFL, 0) | O_NONBLOCK) == -1) { - sfp.emsg.append("Unable to set SSL Fax socket to non-blocking."); + sfp.emsg.append("Unable to set server SSL Fax socket to non-blocking."); cleanup(sfp); return (sfp); } @@ -606,7 +611,7 @@ return (sfp); } -void SSLFax::acceptClient(SSLFaxProcess& sfp, fxStr passcode, long ms) +void SSLFax::acceptClient(SSLFaxProcess& sfp, fxStr passcode, int modemFd, long ms) { /* Now we wait for the client to connect. */ /* We can use select() here without SSL telling us to because SSL hasn't started yet. */ @@ -629,6 +634,11 @@ struct sockaddr_in addr; socklen_t len = sizeof (addr); sfp.client = accept(sfp.server, (struct sockaddr*) &addr, &len); /* accept connection as usual */ + if (fcntl(sfp.client, F_SETFL, fcntl(sfp.client, F_GETFL, 0) | O_NONBLOCK) == -1) { + sfp.emsg.append("Unable to set client SSL Fax socket to non-blocking."); + cleanup(sfp); + return; + } char address[50]; if (inet_ntop(addr.sin_family, &addr.sin_addr, address, 50)) { if (addr.sin_family == AF_INET6) { @@ -641,15 +651,73 @@ } sfp.ssl = SSL_new(sfp.ctx); /* get new SSL state with context */ SSL_set_fd(sfp.ssl, sfp.client); /* set connection socket to SSL state */ - if (SSL_accept(sfp.ssl) == -1) { /* do SSL-protocol accept */ - sfp.emsg = fxStr::format("OpenSSL handshake failure: %s", ssl_err_string()); + + struct timeval start = currentTime(); + int cerror; + int ret; + do { + cerror = 0; + ret = SSL_accept(sfp.ssl); /* do SSL-protocol accept */ + if (ret <= 0) { + cerror = SSL_get_error(sfp.ssl, ret); + if (cerror == SSL_ERROR_WANT_READ || cerror == SSL_ERROR_WANT_WRITE) { + int selret; + fd_set rfds; + FD_ZERO(&rfds); + if (modemFd) FD_SET(modemFd, &rfds); + struct timeval tv; + tv.tv_sec = (int) ms / 1000; + tv.tv_usec = (ms % 1000)*1000; + tv = tv - (currentTime() - start); + if (cerror == SSL_ERROR_WANT_READ) { // wait for the socket to be readable + FD_SET(sfp.client, &rfds); +#if CONFIG_BADSELECTPROTO + selret = select((modemFd > sfp.client) ? modemFd+1 : sfp.client+1, (int*) &rfds, NULL, NULL, &tv); +#else + selret = select((modemFd > sfp.client) ? modemFd+1 : sfp.client+1, &rfds, NULL, NULL, &tv); +#endif + } else { // SSL_ERROR_WANT_WRITE, wait for the socket to be writable + fd_set wfds; + FD_ZERO(&wfds); + FD_SET(sfp.client, &wfds); +#if CONFIG_BADSELECTPROTO + selret = select((modemFd > sfp.client) ? modemFd+1 : sfp.client+1, (int*) &rfds, (int*) &wfds, NULL, &tv); +#else + selret = select((modemFd > sfp.client) ? modemFd+1 : sfp.client+1, &rfds, &wfds, NULL, &tv); +#endif + } + if (!selret) { + sfp.emsg = fxStr::format("Timeout in waiting for SSL Fax accept (wanting to %s).", (cerror == SSL_ERROR_WANT_READ ? "read" : "write")); + cleanup(sfp); + return; + } else if (selret < 0) { + sfp.emsg = fxStr::format("Error in waiting for SSL Fax accept (wanting to %s): %s", (cerror == SSL_ERROR_WANT_READ ? "read" : "write"), strerror(errno)); + cleanup(sfp); + return; + } + if (modemFd && FD_ISSET(modemFd, &rfds)) { + // The modem got a signal. This probably means that SSL Fax is not happening. + sfp.emsg = "Modem has data when waiting for SSL Fax accept. Terminating SSL Fax."; + cleanup(sfp); + return; + } + } + } + } while (cerror == SSL_ERROR_WANT_READ || cerror == SSL_ERROR_WANT_WRITE); + if (ret <= 0) { + if (cerror == SSL_ERROR_SYSCALL) { + sfp.emsg = fxStr::format("Unable to accept SSL Fax connection (syscall). Error %d: %s", ret, strerror(ret)); + } else { + sfp.emsg = fxStr::format("Unable to accept SSL Fax connection. Error %d: %s", cerror, ssl_err_string()); + } cleanup(sfp); return; } + // Now read the passcode. u_char p[1]; for (u_int i = 0; i < passcode.length(); i++) { - if (read(sfp, p, 1, 0, 1000) <= 0) { + if (read(sfp, p, 1, modemFd, 1000) <= 0) { sfp.emsg.append(" (passcode)"); cleanup(sfp); return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-7.0.1/faxd/sslfax.h new/hylafax-7.0.2/faxd/sslfax.h --- old/hylafax-7.0.1/faxd/sslfax.h 2019-09-27 04:47:27.000000000 +0200 +++ new/hylafax-7.0.2/faxd/sslfax.h 2019-12-05 23:23:24.000000000 +0100 @@ -58,7 +58,7 @@ SSLFaxProcess null(); SSLFaxProcess startServer(fxStr info, fxStr pemFile); SSLFaxProcess startClient(fxStr info, fxStr passcode, const u_char* bitrev, long ms); - void acceptClient(SSLFaxProcess& sfp, fxStr passcode, long ms); + void acceptClient(SSLFaxProcess& sfp, fxStr passcode, int modemFd, long ms); void cleanup(SSLFaxProcess& sfp); int pending(SSLFaxProcess& sfp); int read(SSLFaxProcess& sfp, void *buf, size_t count, int modemFd, long ms); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hylafax-7.0.1/util/common-functions.sh.in new/hylafax-7.0.2/util/common-functions.sh.in --- old/hylafax-7.0.1/util/common-functions.sh.in 2019-09-27 04:47:27.000000000 +0200 +++ new/hylafax-7.0.2/util/common-functions.sh.in 2019-12-13 22:35:28.000000000 +0100 @@ -190,24 +190,25 @@ esac # # The image must end up with a pixel width according to T.32 Table 21. - # Ghostscript contains code to fixate a4 and letter to 1728 pixels + # Ghostscript contains code to fixate A4 and letter to 1728 pixels # when using 196-204 dpi and tiffg3/4. It supposedly does the same for # B4 but not for A3, thus the floats are needed (for A3's benefit). # However, this behavior does nothing for US legal as well as the myriad # other page sizes (other than A4, US Letter, and B4) that we sometimes # see. So we have to carefully ensure that our formatting will be right. # - # Depending on which Ghostcript version is being used our default approach - # in getting all pages sized properly varies by default. We either use a - # combination of -dEPSFitPage and -dPDFFitPage, or for newer Ghostscript - # versions we use -dAdjustWidth, instead. These make it so that the image - # is resized to fit the page media and prevents page sizing within the - # documents from altering the command-line page-size specification. (In - # the past -dFIXEDMEDIA was used for this purpose, but -dFIXEDMEDIA doesn't - # resize documents, it just cuts them.) The benefit to -dAdjustWidth is - # that it permits TIFFs to be made with pages of varied length (such as - # mixed letter and legal) whereas -dEPSFitPage and -dPDFFitPage will create - # pages of all the same length. + # How we go about using Ghostscript to accomplish that requirement can + # be tricky, complicated, and sometimes problematic. Depending on which + # Ghostcript version is being used there are various approaches in getting + # all pages sized properly. We generally either use a combination of + # -dEPSFitPage and -dPDFFitPage, and for newer Ghostscript versions we can + # also use -dAdjustWidth. These make it so that the image is resized + # to fit the page media and prevents page sizing within the documents from + # altering the command-line page-size specification. (In the past + # -dFIXEDMEDIA was used for this purpose, but -dFIXEDMEDIA doesn't resize + # documents, it just cuts them.) The benefit to -dAdjustWidth is that it + # permits TIFFs to be made with pages of varied length (such as mixed letter + # and legal). # # We use -dUseCropBox to prevent utilization of the full MediaBox (as they # can differ). Remove this if there is regularly desireable content @@ -220,7 +221,16 @@ FIXEDWIDTH="-dUseCropBox" fi if [ "$GSMAJVER" -gt 9 ] || [ "$GSMAJVER" -eq 9 ] && [ "$GSMINVER" -ge 4 ]; then - FIXEDWIDTH="$FIXEDWIDTH -dAdjustWidth=$pagewidth" + # We shouldn't need to use the "FitPage" options with AdjustWidth, but if we + # don't then some PDFs won't auto-rotate for some unknown reason. (Ghostscript + # bug?) Unfortunately, with the "FitPage" options there is no possibility for + # faxes with pages of mixed lengths. This will, for example, cause legal-sized + # pages to be reduced to fit on A4. As the need for mixed lengths is probably + # less-common than the need to auto-rotate the problematic PDFs we opt to + # serve the more common case here by default. If mixed lengths are + # specifically desired then remove the "FitPage" options here and test that + # the input PDFs you use do not trip on the auto-rotate problem. + FIXEDWIDTH="$FIXEDWIDTH -dEPSFitPage -dPDFFitPage -dAdjustWidth=$pagewidth" else FIXEDWIDTH="$FIXEDWIDTH -dEPSFitPage -dPDFFitPage" fi