Bug 23578

Summary: faxspool bug in mgetty-sendfax-1.1.22-1.6.x
Product: [Retired] Red Hat Linux Reporter: Thomas J Pinkl <thomas.pinkl>
Component: mgettyAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: gert
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-08 17:31:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Thomas J Pinkl 2001-01-08 16:15:50 UTC
The faxspool script produces this error:

    Unknown device: faxg3 -r204x196

This is because of the way "$device" is quoted 
within the 'gs' commands inside the script. 

This patch illustrates one solution to the problem:

--- /usr/bin/faxspool   Thu Sep  7 15:37:09 2000
+++ /home/tom/bin/faxspool.sh   Mon Jan  8 10:50:35 2001
@@ -88,8 +88,9 @@
 # these are the drivers used in Ghostscript - choose dfaxhig/low or faxg3
 #GS_DRIVER_HI="-sDEVICE=dfaxhigh"
 #GS_DRIVER_LO="-sDEVICE=dfaxlow"
-GS_DRIVER_HI="-sDEVICE=faxg3 -r204x196"
-GS_DRIVER_LO="-sDEVICE=faxg3 -r204x98"
+GS_DRIVER="-sDEVICE=faxg3"
+GS_RES_HI="-r204x196"
+GS_RES_LO="-r204x98"
 #
 # program that will generate fax coverpage (see "man coverpg")
@@ -234,11 +235,12 @@
 #
 fs_cvt_ps()
 {
-    driver="$GS_DRIVER_HI"
-    test X$3 = X-n && driver="$GS_DRIVER_LO"
+    driver="$GS_DRIVER"
+    resolution="$GS_RES_HI"
+    test X$3 = X-n && resolution="$GS_RES_LO"
 
     cat "$1" |
-       gs $driver -sOutputFile="$2"%03d -dNOPAUSE -q -dSAFER -
+       gs $driver $resolution -sOutputFile="$2"%03d -dNOPAUSE -q -dSAFER -
 }
        
@@ -251,10 +253,11 @@
 #####
 # via Ghostscript:
 
-    driver="$GS_DRIVER_HI"
-    test X$3 = X-n && driver="$GS_DRIVER_LO"
+    driver="$GS_DRIVER"
+    resolution="$GS_RES_HI"
+    test X$3 = X-n && resolution="$GS_RES_LO"
 
-    gs "$driver" -sOutputFile="$2"%03d -dNOPAUSE \
+    gs "$driver" $resolution -sOutputFile="$2"%03d -dNOPAUSE \
                        -- gslp.ps -fCourier-Bold10 -B "$1"
 
 #####
@@ -290,18 +293,19 @@
 #
 fs_cvt_dvi()
 {
+       driver="$GS_DRIVER"
     if [ X"$3" = X-n ]
     then 
-       driver="$GS_DRIVER_LO" ; dvipscfg="-P dfaxlo"
+       resolution="$GS_RES_LO" ; dvipscfg="-P dfaxlo"
     else
-       driver="$GS_DRIVER_HI" ; dvipscfg="-P dfaxhigh"
+       resolution="$GS_RES_HI" ; dvipscfg="-P dfaxhigh"
     fi
 
 # if you do not have the dfaxlo(w)/dfaxhigh dvips modes configured, 
 # remove "$dvipscfg" from the dvips command line below [or configure
them!]
 
     dvips "$dvipscfg" "$1" -o \
-        !"gs "$driver" -sOutputFile="$2"%03d -dNOPAUSE -dSAFER -q -"
+        !"gs "$driver" $resolution -sOutputFile="$2"%03d -dNOPAUSE -dSAFER
-q -"
 
 # for those that only have the old "dvialw":
 #
@@ -324,12 +328,13 @@
 #
 fs_cvt_pdf()
 {
-    driver="$GS_DRIVER_HI"
-    test X"$3" = X-n && driver="$GS_DRIVER_LO"
+    driver="$GS_DRIVER"
+    resolution="$GS_RES_HI"
+    test X"$3" = X-n && resolution="$GS_RES_LO"
 
     cat "$1" |
        acroread -toPostScript |
-       gs "$driver" -sOutputFile="$2"%03d -dNOPAUSE -q -dSAFER -
+       gs "$driver" $resolution -sOutputFile="$2"%03d -dNOPAUSE -q -dSAFER
-
 }

Comment 1 Gert Doering 2001-01-08 17:31:37 UTC
I'm not sure who did the quoting in the RedHat package ("gs $driver"),
but it's the cause of the error, not the upstream source.

The upstream source does NOT quote $driver when passing it to ghostscript,
and that's the way it has to be.

RedHat: we have discussed this in the past.  Please do not introduce
"fixes" that break functionality (and do not improve *anything*).

Also, 1.1.22 is pretty old.  An upgrade to 1.1.23 or 1.1.24 would be 
a reasonable thing to do.  What about issueing an upgrade to the mgetty
package in 7.0 that's still severely broken (concerning logging and
seemingly faxspool as well)?

Comment 2 Nalin Dahyabhai 2001-04-20 15:27:57 UTC
1.1.25 errata packages which fix this will be going out shortly.