[2866] in testers
Re: sol2.4 answerbook
daemon@ATHENA.MIT.EDU (Marc Horowitz)
Wed May 29 20:06:20 1996
To: Mike Barker <mbarker@MIT.EDU>
Cc: mbarker@MIT.EDU, testers@MIT.EDU, rel-eng@MIT.EDU, sol24@MIT.EDU
Date: Wed, 29 May 1996 20:06:02 EDT
From: Marc Horowitz <marc@MIT.EDU>
>> athena% more /usr/athena/bin/answerbook
>> #!/bin/athena/tcsh
>> set AB_CARDCATALOG=/opt/SUNWabe/ab_cardcatalog
>> xhost `hostname`
>> answerbook &
Wow. Besides the one Mike mentioned, there is at least one bug in
each line of that script. :-)
At wdc's request, I'll enumerate them to lower ghudson's workload.
1a) The script runs the user's dotfiles.
1b) csh is not a programming language. tcsh is not-a-programming-
language with warts :-)
2a) set doesn't do anything outside the shell; use setenv here.
2b) (maybe) In fact, the answerbook itself doesn't seem to use this
variable at all. I cannot determine any difference in behavior.
3) There should be a better workaround (flame sun? :-/ ). Currently,
we go out of our way to keep even localhost out of the access list;
adding the local IP address opens the client up to pretty simple tcp
spoofing attacks.
4a) As previously mentioned, this should be an explicit path.
4b) There's no reason to run it in the background;
/usr/openwin/bin/answerbook is itself a ksh script which runs the
actual program in the background.
4c) If there's no cleanup necessary, use exec in the last line.
There's no reason to keep an extra shell around.
A script with the equivalent functionality, with all but bug 3 fixed:
#!/bin/sh
xhost `hostname`
exec /usr/openwin/bin/answerbook
Marc