home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume10 / callback_hg / part01 / README < prev   
Encoding:
Text File  |  1990-01-06  |  10.5 KB  |  283 lines

  1. $Header: README,v 1.2 89/12/29 10:17:06 howard Exp $
  2.  
  3.       DESCRIPTION
  4.  
  5. The callback system implements callback for dialup login
  6. sessions.  A user dials in and enters a symbolic name for a
  7. stored telephone number.  The line is dropped, and a new call is
  8. placed to the corresponding number.  On connection a normal
  9. login session is established.  Unlike callback firmware in some
  10. modems, the list of phone numbers may be arbitrarily long.
  11. Different lines may use different lists, or any number of lines
  12. may share the same list.
  13.  
  14. The system has two purposes: to charge (almost all of) the cost
  15. of the telephone calls to the host, and to improve security.  I
  16. do no guarantee that callback is secure, but at least you can
  17. look at the source code; it's not firmware burned into a PROM.
  18.  
  19. Callback has been tested on an ALM port on a Sun 3/280 running
  20. SunOS 4.0.3, and on a CPU serial port on a Sun 3/60 runing first
  21. SunOS 4.0.1, then SunOS 4.0.3.  Callback may work on other UNIX
  22. versions that use termio and /dev/cua* special files for dialing
  23. out.  It will not work on SunOS 3.x.  It has been tested with
  24. Octocom OSI8596 modems and Alfanet ANC 8x224TT modems, both of
  25. which are Hayes-compatible.  Callback is designed to be general
  26. enough to operate with most autodial modems.  Extensive logging
  27. shows all traffic to and from the modem, with timestamps.
  28.  
  29. Callback works with the normal getty and login functionality,
  30. including line speed selection.  It allows different modem
  31. commands for each line speed, if necessary.
  32.  
  33. As distributed, callback needs verbose text responses from
  34. modems, e.g. "CONNECT 2400" instead of "10."  This makes it
  35. incompatible with some UUCPs, since they require numeric
  36. response codes.  It should be easy to modify callback to handle
  37. numeric response codes, however.
  38.  
  39.  
  40.       LICENSE
  41.  
  42. Callback is free software under the GNU general public license.
  43.  
  44.  
  45.       HOW IT WORKS (KLUDGEOLOGISTS TAKE NOTE)
  46.  
  47. The /etc/ttytab file is modified for the dialup line.  Instead
  48. of running the usual getty, callback is run.  Callback
  49. immediately execs a special getty, named getty-cb.  Getty-cb
  50. works exactly like the ordinary getty, except that after it has
  51. the tty set up correctly and has read the login name, it does
  52. not exec login but instead execs callback0.  Callback0 does the
  53. actual callback.  It prompts the user for the symbolic name for
  54. the telephone number, hangs up, sends the dialing command to the
  55. modem, waits for answer, turns off the hangup-on-close (HUPCL)
  56. bit, and then simply exits.  Since the getty process has died,
  57. init starts up another one, so another callback is started.  But
  58. this time, callback does not exec getty-cb, it execs login, so
  59. the user can finish logging in.  Callback execs either getty-cb
  60. or login, depending on a state file that callback0 modifies.
  61. And getty-cb is really just the vendor-supplied getty
  62. executable, with "/bin/login" changed to a path to callback0.
  63.  
  64.  
  65.       PREREQUISITES
  66.  
  67. You must have my library of C functions.  It was posted to
  68. comp.sources.misc on 1 October 1989 (volume 8, issues 80-87) and
  69. 28 October 1989 (volume 8, issue 96).  The archive name was
  70. libhoward.
  71.  
  72. You also need some way to change a string in an executable, or
  73. you need source for a getty that will work on your system.  GNU
  74. Emacs is an excellent tool for editing executables; adb will
  75. also work.
  76.  
  77. The libhoward package itself has a number of prerequisites.
  78. ANSI-C float.h and limits.h include files must be on the C
  79. include file search path.  If you don't have them, you can use
  80. Steven Pemberton's config program to make them.  Config was
  81. posted to comp.sources.misc on 30 April 1989 as volume 6 issue
  82. 96, archive name config2.
  83.  
  84. The makefiles use features that may only be in GNU make, version
  85. 3.54 or later.  (There are a lot of different make commands out
  86. there, and I haven't tested them all, so I don't know for sure
  87. which will work and which won't.  GNU make 3.54 will definitely
  88. work.  The make supplied with SunOS 4.0.3 will not work.)
  89.  
  90. Chris Tweed's sets command must be on the command search path.
  91. It was posted to comp.sources.unix on 24 February 1988 as volume
  92. 13, issue 68, archive name sets.
  93.  
  94. Some of the documentation is in LaTeX.  You do not *have* to
  95. read it, but it may be helpful.  If you want to read it, you
  96. will need LaTeX to format it.
  97.  
  98.  
  99.       INSTALLATION
  100.  
  101. It will be easier to understand the installation if you first
  102. read my report "Sharing software in a network of heterogeneous
  103. UNIX hosts."  This comes with libhoward.
  104.  
  105. Install the dialup lines in the normal way, including the
  106. /dev/cua* files.  For Suns, see section 11.4, "Adding a Modem to
  107. Your System," in the System & Network Administration Manual.
  108. Make sure the dialup lines are working in the normal manner,
  109. without callback, before installing callback.
  110.  
  111. Figure out where you want to install various files.  Here I'll
  112. assume a separate directory for everything, but it's easy to
  113. make a different choice.  I discuss an alternative example
  114. below.
  115.  
  116. I'll call the master source directory $DD.
  117.  
  118. Create a directory for compiling on this machine type.  I'll
  119. call it /usr/local/free/callback.
  120.  
  121. Find out the version.  Look at the Header line (typically the
  122. first line) of the FREEZE file.  The version is the first
  123. number, and ends at the period.  The first externally released
  124. version was version 2.
  125.  
  126. Create a subdirectory for this version. e.g.
  127. /usr/local/free/callback/2.
  128.  
  129. Create the following subdirectories for results:
  130.    bin       Installed executables.
  131.    man/man1  Manual entries.
  132.    man/cat1  On-line formatted manual entries.
  133.  
  134. For example:
  135.    % cd /usr/local/free/callback/2
  136.    % mkdir bin man man/{cat,man}1
  137.    
  138. Create a subdirectory for doing the actual compilations.  I'll
  139. call it sun34:
  140.    % mkdir sun34
  141.    % cd sun34
  142.  
  143. Create an mk shell file.  Make it executable.  Here's a starting
  144. point for SunOS 4.x:
  145.   
  146. DD=/usr/local/free-dist/callback/2/dist
  147. SRCS=`cd $DD; echo *`
  148. RM='rm -f'
  149. export DD SRCS RM
  150. make -f uMakefile
  151. exec make \
  152.    CATMAN=catman \
  153.    FMTMAN=mkManPS \
  154.    $*
  155.  
  156. If you don't have a catman command, drop that line.  FMTMAN
  157. should be the name of a command to turn manual entries into
  158. printable form.  Add any local changes you need here.  If your C
  159. compiler doesn't understand different optimization levels, add
  160. CFLAGS=-O as an argument to the last make.
  161.  
  162. Here is an alternate mk file for a system using GCC, and with
  163. results installed in more conventional places.
  164.   
  165. DD=/usr/local/free-dist/callback/2/dist
  166. SRCS=`cd $DD; echo *`
  167. CC=gcc
  168. CFLAGS='-g -O -traditional'
  169. INCLUDES=-I/usr/local/include
  170. RM='rm -f'
  171. export DD SRCS CC CFLAGS INCLUDES RM
  172. make -f uMakefile
  173. exec make \
  174.    CATMAN=catman \
  175.    CID=/usr/local/bin \
  176.    LIBPATH='-L/usr/local/lib' \
  177.    MID=/usr/local/man \
  178.    $*
  179.  
  180. Get MakeCommon and uMakefile from the master source directory,
  181. e.g.
  182.    % mkDistI MakeCommon $DD
  183.    % mkDistI uMakefile  $DD
  184.  
  185. Make any changes you need to make to callback.h.  Near the top
  186. are some absolute path names that you may want to change.
  187.  
  188. If your telephone line has double clearing, and if you're
  189. concerned about security, you should increase the value of the
  190. DROPSEC macro defined near the top of callback.h.  Double
  191. clearing is a telephony feature.  A calls B and B answers.  With
  192. double clearing, B can hang up for a short time and then pick up
  193. the call again.  This is convenient, for example, to walk to a
  194. phone in a different room.  However, double clearing also makes
  195. spoofing possible.  The bad guy calls up and initiates the
  196. callback, but does not hang up.  Instead, the bad guy supplies
  197. dial tone.  The host modem hangs up the line for a while, and
  198. when it goes off hook again it detects the dial tone supplied by
  199. the bad guy.  It dials the number and then waits for answer.
  200. The bad guy removes the dial tone and answers.
  201.  
  202. To avoid spoofing, DROPSEC must be longer than the double
  203. clearing timeout.  This is typically about 90 seconds, but you
  204. can test for yourself by having a partner call you, hanging up,
  205. and timing how long you need to stay on hook before you can go
  206. off hook and get dial tone instead of your partner.
  207. Unfortunately, DROPSEC is the time between when the callback
  208. request is accepted and when it is processed, so making it
  209. longer than a few seconds will annoy your users and lead them to
  210. suspect that the callbacks they request have failed.  It's much
  211. better to get a line with single clearing, if possible.  Most
  212. PABX lines have single clearing.
  213.  
  214. Callback as distributed assumes verbose responses from the
  215. modem.  With Hayes-compatible modems, the command "atv1" puts
  216. them in verbose mode.  If you prefer numeric response codes, you
  217. will need to modify the mrctab[] table in callback.h to handle
  218. them.  You will probably also need to modify the code in main()
  219. in callback0.c to do exact matching on the result codes instead
  220. of prefix matching.
  221.  
  222. When you have the modem programmed with the configuration you
  223. wish, save the configuration in non-volatile memory.  With
  224. Hayes-compatible modems, the command "at&w" does this.
  225.  
  226. Run mk.
  227.  
  228. Run "mk install".
  229.  
  230. Make a getty that execs callback0 instead of login.  If you have
  231. source for getty, you can use that.  If you don't, make a copy
  232. of your vendor-supplied getty executable, and edit it.  I call
  233. the result getty-cb.  It should go where callback and callback0
  234. go.  I used GNU Emacs to edit a copy of /usr/etc/getty.  I used
  235. incremental search to find /bin/login, then I changed it to
  236. /bin/.cb0 followed by an extra NUL (Ctl-Q 000) so the new string
  237. takes up exactly the same space as the old.  I then made
  238. /bin/.cb0 a symbolic link to where callback0 really is:
  239.    # mount -o remount,rw /usr  (If /usr is mounted read-only)
  240.    # ln -s /usr/local/free/callback/0/bin/callback0 /bin/.cb0
  241.  
  242. Set up control, log, and state files.
  243. I put these in /etc/local/callback.  In this example there's
  244. only one callback line, ttyd1:
  245.    # cd /etc
  246.    # mkdir local
  247.    # chmod g+s local
  248.    # cd local
  249.    # mkdir callback
  250.    # chmod o= callback
  251.    # cd callback
  252.    # mkdir control log state
  253.    # chmod o= *
  254.    # touch {control,log}/ttyd1
  255.    # chmod o= control/* log/*
  256.  
  257. Edit the control files.  See callback(1) for an example.
  258.  
  259. The log files grow without bound, so you should include them in
  260. your periodic log file trimming scripts.
  261.  
  262. Edit /etc/ttytab.  The lines that use callback should have
  263. /usr/etc/getty replaced by a full path to callback, e.g.:
  264.  
  265.    ttyd1   "/usr/local/free/callback/0/bin/callback 2400-baud" dialup          on
  266.  
  267. Make the newly installed version of callback version 0:
  268.    # cd /usr/local/free/callback
  269.    # /bin/rm -f 0; ls -s 2 0
  270.  
  271. Have init read the changed /etc/ttytab:
  272.    # kill -1 1
  273. --
  274. Howard Gayle
  275. TN/ETX/TT/HL
  276. Ericsson Telecom AB
  277. S-126 25 Stockholm
  278. Sweden
  279. howard@ericsson.se
  280. uunet!ericsson.se!howard
  281. Phone: +46 8 719 5565
  282. FAX  : +46 8 719 8439
  283.