home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume7 / gosip2 / notes < prev    next >
Encoding:
Text File  |  1989-07-08  |  14.8 KB  |  314 lines

  1. [  Note for non Warwick readers:  poppy and orchid are the local machines on
  2.    which gosip is installed.  The dubbin directory is the DATA_FILE_DIRECTORY
  3.    which started life as 'dubbin and broken glass', but then changed to simply
  4.    dubbin.  ap.  ]
  5.  
  6.  
  7. Things still to do include:
  8.  
  9. 1.  Check the process is not suspended indefinitely.  (Fork() and alarm.)
  10. 2.  Informing users after going down should be improved, or removed.
  11. 3.  Move history code into history module.
  12. 4.  Add option to skip printing of info.text. (add info.text item first :-)
  13. 5.  Add option to lu to print out details for a given user.
  14. 6.  Maybe keep all history information in one history file?
  15.  
  16.  
  17. [  The above list is really more for my personal benefit, but I leave it here
  18.    for you all to enjoy. Perhaps some enterprising programmer can implement
  19.    some of the things on the list, or some analyst add to them.  ap. ]
  20.  
  21.  
  22. History of changes by version number
  23. ====================================
  24.  
  25. 29  or possibly 30 introduced a better handling of the '-r' option.
  26.  
  27. 31  or thereabouts saw gosip split into several modules.  It was around this
  28.     time that the facility to act as a primitive 'lu' was added.
  29.  
  30. 32  or maybe 33 corrected a bug in the automatic deletion of backup files that
  31.     emacs users might leave around.  This version also saw the catfile()
  32.     option altered, so that it didn't fork 'cat' but opened the file and
  33.     printed it itself.
  34.  
  35. 33  Introduced bug fixes for shutdown messages that were too long.  Previously
  36.     if the message exceeded 80 chars, gosip would segmentation fault.
  37.  
  38. 34  General recompilation after the makefile was hacked around a bit.  No
  39.     functional difference from 33 (I think).  Installed unintentionally.
  40.  
  41. 35  introduced proper handling of non-writable text files.  If text.gosip is
  42.     readable but not writable (someone would have to go and chmod it
  43.     deliberately), gosip will now first attempt to chmod it to 666, and,
  44.     failing that, copy text.gosip into a temporary file and rename it to
  45.     text.gosip, and then chmod it to 666.
  46.  
  47. 36  features a lot of changes, mainly internal.  Lu is hard linked to gosip,
  48.     however it is not yet fully functional.  The history file has changed to
  49.     an internal format.  The extra line feed coming with last edit information
  50.     has gone.
  51.  
  52. 37  has improvements to lu.  Lu can take an unlimited number of args, and will
  53.     print out history details for each gosip file passed as an arg.  The -n
  54.     flag is recognised, but ignored.
  55.  
  56. 38  has some improvements to the history mechanism.  The size of text.gosip is
  57.     now stored even if access was read-only.  History.gosip will have the
  58.     correct permissions if it is created by gosip.  Previously if created by a
  59.     read-only operation, it wouldn't have.
  60.  
  61. 39  has a new version of lu invoked without options.  It now produced roughly
  62.     the same output as the old 'lu -a' did.
  63.  
  64. 40  improved the information held in history.gosip.  Gosip now keeps a copy of
  65.     text.gosip as you edit, and then checks whether you have actually changed
  66.     the file or not.  This information is recorded in the history file.
  67.  
  68. 41  has an improved layout for lu invoked without options.  It now resembles
  69.     the original 'lu -a' much more.
  70.  
  71. 42  has a check on the size of text.gosip.  If it is significantly less than
  72.     at the start of the edit session, gosip asks the user whether he's sure
  73.     that's what he wants, and offers to restore the backup.
  74.  
  75. 43  has better checking of the command line for lu.  It is first scanned for
  76.     any invalid flags, in which case a usage message is given.  Previous
  77.     behaviour was to complain about invalid flags as it came to them.
  78.  
  79. 44  removes a bug: if a file shrinks a lot, and the user confirms he wants to
  80.     keep it, gosip would record the history information as "no change".  This
  81.     has now been corrected.
  82.  
  83. 45  has a minor improvement in that if you just press return in answer to the
  84.     question about whether you want to keep the shorter file, gosip would hang
  85.     until a second return was pressed.  Also, if you chose to restore the old
  86.     version, text.gosip would end up with permission 0400.
  87.  
  88. 46  saw improvements to lu.  It now skips files like "text.gosip~" when
  89.     printing its summary information.
  90.  
  91. 47  has the usercode field in the history struct changed to 12 bytes in
  92.     length, to avoid alignment problems between orchid and poppy.
  93.  
  94. 48  has a few minor redundancies removed.  It also has lu improved such that
  95.     it no longer leaves an unwritable history.gosip file around if one didn't
  96.     exist.
  97.  
  98. 49  has an improved message about reductions in the size of the file.  It now
  99.     tells you the new size when asking you whether to keep it.
  100.  
  101. 50  The summary provided by lu is now sorted alphabetically by gosip file.
  102.  
  103. 51  has quite a few minor changes.  Lu summary mode now checks properly for
  104.     there being too many gosip files.  The 'going down' message has a tab
  105.     replaced by blanks for extra readability, and waiting times before killing
  106.     the editor have been altered slightly.
  107.  
  108. 52  has one minor change (hardly worth a new version number really).  Lu
  109.     summary information now right aligns the size of the files, causing the
  110.     names that follow to be aligned.
  111.  
  112. 53  contains additions to the lock mechanism, using (as previously) flock() on
  113.     the local machine but a lock file for the remote machine.  All lock code
  114.     as been moved to the function lock().
  115.  
  116. 54  has a small bug removed.  If a lock file already exists when someone tries
  117.     to use gosip, it would exit with an error message about not being able to
  118.     create the lock file.
  119.  
  120. 55  has -n option working on lu.
  121.  
  122. 56  Whenever gosip is asked to check whether it is invoked, it will delete any
  123.     local lock file that may exist, if flock() says that gosip's not being
  124.     used locally.  This helps to minimise damage when lock files are left
  125.     around by means I don't fully understand - it never happens to me.
  126.  
  127. 57  The usage 'lu -n <int>' as been replaced by 'lu -<int>'.  This also
  128.     removes the bug whereby 'lu -n gosip' is not caught as an error.
  129.  
  130. 58  introduces 'lu -<int>' which works as 'lu -<int> `allgoss`'.
  131.  
  132. 59  introduces 'lu -n: gosip' which lists entries from the history file that
  133.     are less than n minutes old.
  134.  
  135. 60  now has 'lu -hour:min gosip' working.  Still no checking for invalid
  136.     command line arguments.
  137.  
  138. 61  has proper checking for invalid args to lu.
  139.  
  140. 62  removes the gratuitous blank line at the beginning of 'lu gosip' output.
  141.  
  142. 63  takes default gosip options from the environment variable GOSIP.
  143.  
  144. 64  improves signal handling, trapping SIGTERM and SIGQUIT and calling a tidy
  145.     up routine.
  146.  
  147. 65  prompts for a name when editing, if environment variable NAME is not
  148.     defined.
  149.  
  150. 66  improves handling of the above facility.  fgets() is used to read the
  151.     name, which handles delete correctly, and more info is provided.
  152.  
  153. 67  has alterations to the above (minor), a couple of wording changes and use
  154.     of environment variable EDITOR if VISUAL is undefined.
  155.  
  156. 68  introduces environment variable GOSNAME.  If undefined, NAME is used as
  157.     your name instead.
  158.  
  159. 69  has the lu usage message corrected.  I know it's a pretty minor
  160.     alteration, but I want to try installing a new version, now that I've
  161.     moved the binaries to one of my directories.
  162.  
  163. 70  Gosip prints a list of gosip files when invoked with the name 'allgoss'.
  164.     A few other minor changes have also occurred.
  165.  
  166. 71  has a few internal changes - structure in lu now has a union to ensure the
  167.     correct type, depending on whether a time or line number constraint is
  168.     required.  Previously the same field was used, which worked ok since
  169.     time_t == int on this system.  Main external changes are that
  170.     update_history() now removes from history.gosip entries more than RECENT
  171.     seconds old, and you can now do 'gosip -p<printer>' to specify a printer.
  172.  
  173. 72  removes a small inefficiency from the allgoss section, which meant that
  174.     allgoss() was accidentally called twice.
  175.  
  176. 73  increases RECENT a little.  Introduces a new module, history.[ch], to
  177.     which a couple of functions from lu are moved.
  178.  
  179. 74  The recent religious discussion in events, which meant events was invoked
  180.     much more frequently than is normal, has revealed deficiencies in the
  181.     lock() function.  It has now been rewritten to just use a simple lock
  182.     file.  Since SIGHUP, SIGTERM, SIGQUIT are now trapped, instances of the
  183.     lock file being left around when it shouldn't be, should be rare.
  184.  
  185. 75  Includes the name of the gosip file in the advisory message when SIGHUP,
  186.     etc., are caught.  The message is now sent to stderr rather than stdout.
  187.  
  188. 76  reintroduces flock() to the lock() function.  However, this time the
  189.     lock_file is always checked first, and flock() is only used if lock_file
  190.     is more than 12 seconds old.
  191.  
  192. 77  introduces an extra space in the bytes field of lu summary.  This keeps
  193.     the names aligned, now that xian (Christian) file has exceeded 100K.
  194.  
  195. 78  includes the user's name/alias in the history file information.  A
  196.     function gosname() has been added, similar to usercode(), that returns
  197.     this information.  It is also given by history() in lu.
  198.  
  199. 79  has the function monitor_usage() included.  It keeps a record of how gosip
  200.     is invoked and by whom.  I want to see exactly how many people know about
  201.     which options.
  202.  
  203. 80  If gosip is invoked by SUPER_USER, he is prompted for the removal of any
  204.     files in DATA_FILE_DIRECTORY which do not begin with either "lock.",
  205.     "history.", "last." or "text." and which are older than the oldest lock
  206.     file and at least half an hour old.
  207.  
  208. 81  ups the value of RECENT a little.  Also has a newline added between the
  209.     prompts for whether to delete old files, and old files now need to be at
  210.     least four hours old.
  211.  
  212. 82  has the bit that checks if you want to keep a smaller gosip file altered.
  213.     Since Steve was complaining that he typed 'lu' ahead and so lost his
  214.     changes, I've fixed it so that only responses beginning with 'yes' or 'no'
  215.     are accepted.
  216.  
  217. 83  ensures that history file pruning leaves at least MIN_LINES entries in the
  218.     history file.
  219.  
  220. 84  checks for non-printable characters in the user's name.  If the name came
  221.     from an environment variable, the user is prompted to enter a name.  If he
  222.     entered an invalid name, his name is set to "<UNKNOWN>".  An invalid
  223.     option is no longer treated as '-l'.
  224.  
  225. 85  due to popular demand, the anomaly removed in 84 is partially restored, in
  226.     as much as a single letter is treated as '-l'.
  227.  
  228. 86  features changes to usercode().  The code is obtained from the password
  229.     file entry for getuid(), rather than using getlogin().  This means the
  230.     correct person is returned if the user has used su(1).
  231.  
  232. 87  Changed the fopen(..., "w+") to "a+" when updating history information.
  233.     This means that the history file is created if it doesn't exist.
  234.  
  235. 88  removes a slight bug, in that '-sdfa' would be treated as '-l' rather than
  236.     as an illegal usage.
  237.  
  238. 89  improves the removal of drivel files routine.  Now also files with a legit
  239.     prefix ("text." or "last.") are killed if the rest of their name contains
  240.     non-alphabetic characters (eg. text.gosip~).  Also, history and lock files
  241.     are moved into a non-readable sub-directory of DATA_FILE_DIRECTORY, to
  242.     stop people editing/removing them.
  243.  
  244. 90  corrects the bug which failed to check the return value of lock() for the
  245.     possibility of failure in creating the lock file.
  246.  
  247. 91  corrects clean_directory(), in that files beginning "history." and "lock."
  248.     are no longer valid, now that they are stored in the sub directory.
  249.     Monitor_usage() includes the hostname.
  250.  
  251. 92  Lots of internal changes.  I went through the source to check for errors
  252.     before posting it, and found lots.  In some places, return values weren't
  253.     checked properly for errors, in others harmless errors caused exit()s, and
  254.     in some places, inefficient code was left over from the beginning, when I
  255.     was still relatively inexperienced with C.
  256.  
  257. 93  Installs removal of drivel files.  Now files that do not match the emacs
  258.     regexp "^\(text\.\|last\.\)[a-zA-Z]+$" are automatically removed by anyone
  259.     who uses gosip for editing (that is, not by gosip -v or -l, etc.).  I have
  260.     temporarily arranged to have to have a log kept of all files so deleted.
  261.  
  262. 94  Altered usercode() to strcpy() the code it gets from getpwuid().  Since I
  263.     call getpwuid() again to get the code of the owner of a drivel file so I
  264.     can log it (see version 93), usercode()'s value was previously
  265.     overwritten.
  266.  
  267. 95  Places a limit on the length of a gosip file.  The recent creation of the
  268.     'politics' gosip file messed up lu output a little, and very long names
  269.     would completely destroy it.
  270.  
  271. 96  Removes the bits that keep a records of usage (monitor_usage()) and of
  272.     deleted files.  Alters clean_directory() such that "Makefil" is a valid
  273.     prefix.  This pacifies Mike, who keeps trying to put a Makefile in
  274.     DATA_FILE_DIRECTORY.  MAX_FILES is upped to 14, as we now have 13 gosip
  275.     files.
  276.  
  277. 97  Alters the locking mechanism to use lockf().  Last_file is now just opened
  278.     for writing, not deleted, since all files in dubbin now have to be owned
  279.     by someone on poppy because orchid users don't have a poppy quota.
  280.  
  281. 98  Copies the text file into /tmp, and edits the copy.  This single change is
  282.     so simple and yet so powerful.  It now allows the dubbin directory to be
  283.     unwritable, and at a stroke removes a the need for all the tedious
  284.     checking for text.gosip unwritable, for drivel files in the dubbin
  285.     directory, etc; and allows the restructuring mentioned in version 100.
  286.     Further, chdir() is not called - all filenames are given with a full
  287.     pathname.
  288.  
  289. 99  Moves last_file into the .data directory.
  290.  
  291. 100 Alters the structure of the dubbin directory.  Dubbin is unreadable,
  292.     allowing last, lock and history files to be stored there, while a
  293.     subdirectory of dubbin is readable, in which the text files are stored.
  294.     This means the the directory can be searched, to allow allgoss to work,
  295.     yet the text files cannot be edited directly.
  296.  
  297. 101 Introduces the option 'z' to print out the gosip file directly - no pager
  298.     is invoked, nor is last usage information printed.  Also, page() is
  299.     altered in that it does not fork() a pager if stdout is not connected to a
  300.     terminal.
  301.  
  302. 102 I've discovered that lockf() has a bug: testing for a lock does not work
  303.     on orchid if the lock was applied on poppy.  Therefore I've changed lock()
  304.     so that it applies a lock in order to check, and then removes it.  Also,
  305.     if gosip is smaller, both initial and final sizes are given in the
  306.     confirmation message.
  307.  
  308. 103 Alters the error message produced by catfile() so that it doesn't give
  309.     away the name of the hidden directory in which text.gosip is stored.
  310.  
  311. 104 I found that I'd written the current name of the secret subdirectory of
  312.     DATA_FILE_DIRECTORY directly into the code for allgoss().  I've now
  313.     defined SECRET_DIR and use that instead.
  314.