Hylafax Developers Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-devel] Re: missing parts of security-patch.sh



--------
Your message dated: Sat, 17 Jun 2000 16:43:57 PDT

>Here are the parts of security-patch.sh that never made it into
>the 4.1 code with some shell portability fixes.

Cool!

Uh, I noticed a few compatibility issues with the port of 4.1b2 I did
recently.

Namely:

i)	Testing shell variables that may not be set is dangerous,
	e.g.:
	
	if [ -f $SYSINIT ]
	...

	is dodgy if 'SYSVINIT' is never set.
	
	Of course, on BSD-ish systems, 'SYSINIT' doesn't get set...
	
	This is somewhat exascerbated by the ambiguity in the
	definition grammer for 'test'. 
	
	A BSD-ish test called as with a unary operator and no operand 
	(e.g. '/bin/test -d') will return 'true' (because it
	interprets it as a single expression, and it is thus true), 
	rather than erroring with 'argument expected', as one might 
	expect from the implementation on Solaris, OSF/1 or whatever.
	
	Quoting the shell variable operand makes this test safe.
	
	Most of the variable usage seems OK, although the test for
	SYSVINIT and the test in 'PickFile()', (both in
	faxsetup.sh.in)	are dodgy.
	
	
ii)	Some systems break the Adobe Font Metrics out of the 
	Ghostscript package altogether and install it as a separate
	dependancy (presumably so that multiple ghostscript installs 
	can be located in versioned directory names, in a similar 
	way to how I can have multiple versions of Tcl/Tk installed 
	on the same system).
	
	On such systems (FreeBSD at least, maybe also the other BSD 
	systems that use the 'ports' system), PATH_AFM would get set 
	just fine by the "last ditch" code if it weren't for the call 
	to the 'getGSFonts' function - which obligingly(?) finds the 
	Ghostscript 'afm' directory instead, thus no further 
	processing is performed.
	
	However, this particular 'afm' directory doesn't have the 
	Courier font definition required for the package to run, 
	thus nothing works when the build is complete.
	
	On 4.1b2, this worked for me:
	
	
@@ -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.


iii)	You might want to add these lines to 'configure' around 
	about the definition settings for the socket API (roughly 
	line 2311 in my copy):
	
        *-freebsd4*)    CONFIG_SOCKARGLENTYPE=u_int32_t;;
        *-freebsd5*)    CONFIG_SOCKARGLENTYPE=u_int32_t;;



Regards,

AS


____________________ HylaFAX(tm) Developers Mailing List ____________________
 To unsub: mail -s unsubscribe hylafax-devel-request@hylafax.org < /dev/null



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services