home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume7 / oracle / Notes < prev    next >
Text File  |  1989-08-05  |  3KB  |  77 lines

  1. Lib directory:
  2. ORACLEDIR (defined in Makefile) is a
  3. question directory with one file per question.
  4. Filename is q_username_time_hostname_processid for each file.
  5. One file is called "record" and contains the directory listing.
  6. The command system("ls -rt q_* > record") fills this file.
  7. Another file is "lockfile", whose existence means an oracle process is
  8. using the directory to the exclusion of others.
  9.  
  10. Process when somebody runs *oracle*:
  11.     A. Say "Please type in your question."  Save question in a file in
  12.         question directory, with x_ prefix.
  13.     B. Lock questions directory.
  14.         Update "record" file.
  15.         Get least recent question file -- that is the first file listed
  16.         in "record" -- which did not come from the current user.
  17.         Move that file to t_blahblahblah. (t for temp)
  18.         Unlock directory.
  19.     C. Print the question and get answer from user.
  20.         Save to file a_blahblahblah.  Mail to original
  21.         questioner -- system("mail user < a_blablabla").
  22.         Move the x_ file (created in A) to q_whatever.
  23.         Remove the t_ and a_ files -- unless the LOG flag is #defined
  24.         in which case the a_ files are left around.
  25.     D. Tell user the answer will reach them in a short while.  Ask user
  26.         to encourage friends to Ask The Oracle.
  27.  
  28. Prefix summary:
  29.     q_ A question file that has been stored by a previous oracle, or
  30.        is created from the current user's question just before current
  31.        oracle terminates.
  32.  
  33.     t_ A question file from a different user that has been selected
  34.        to be shown to and answered by the current user.
  35.  
  36.     x_ Temporary file to which the question of the current user is written
  37.        as it is being typed.  Gets moved to q_ if everything goes smoothly.
  38.  
  39.     a_ Answer file, exactly as the final answer message will be sent
  40.        to the Other User whose question was selected.  So it contains
  41.        introductory remarks, a copy of the Other User's question,
  42.        and the answer given by the current user.  This answer is written
  43.        line-by-line as the user types it in.
  44.  
  45.  
  46. Permissions:
  47.     All files will be readable and writable only by the owner.
  48. The *oracle* program will have the setuid bit set, so that
  49. users will "become" the owner while the program is running.
  50. In order to have mail messages appear to be from the owner of oracle,
  51. the real uid of the process is set to the effective uid just before
  52. mailing occurs.
  53.  
  54.  
  55.  
  56. Accessing the directory:
  57.     Attempt to cd there before anything starts.  If we fail, quit.
  58.  
  59. Log:
  60.     If a certain flag LOG is #defined, q_ and a_ files will
  61. be left undeleted in the oracle directory.
  62.  
  63.  
  64. To do:
  65.     After the question is entered, the oracle should have the person
  66. confirm, "Do you still want to send this question to the oracle?"
  67.     If DEBUG is defined, check upon startup (a) whether the file
  68. argv[0] has the setuid bit set, and (b) whether it has worked (on some
  69. filesystems it may be ignored for security reasons).
  70.     Enter cbreak mode so that if the user tries ^C, the program can
  71. exit gracefully, restoring any q_file it might have moved to t_, and
  72. removing any created files that are to be abandoned (including lockfile,
  73. x_whatever, and a_whatever).
  74.     Allow a file to be specified as a command-line argument, that oracle
  75. will read the question from.
  76.  
  77.