From: mark@alsvid.une.edu.au (Mark Andrew Garrett)
Newsgroups: comp.infosystems.gopher
Subject: BUG in gopher1.1b1
Date: 15 Nov 92 10:18:45 GMT
Organization: University of New England - Northern Rivers (Lismore)

I've been try gopher1.1b1 + wais-8-b5 out on ultrix4.2 gcc2.3.1 (and gcc2.2.2)

I've added an extra secure mode Securemode == VERY
which disallows the mail option as well for the client.

I've also been having crash problems with memory aborts.
I've found at least on bug in the STRstring.c but not the one
giving me crashes in side of STRinit()

	Here are my diffs for gopher and wais
Any comments gratefully recieved.

		Cheers
			Mark :)


diff -cr gopher1.1b1-DIST/doc/gopher.1 gopher1.1b1/doc/gopher.1
*** gopher1.1b1-DIST/doc/gopher.1	Sat Aug  1 03:34:16 1992
--- gopher1.1b1/doc/gopher.1	Sun Nov 15 19:44:30 1992
***************
*** 3,9 ****
  gopher \- connect to gopher document server
  .SH SYNOPSIS
  .B gopher
! .RI [ -sb ]
  .RI [ -t
  .IR title]
  .RI [ -p 
--- 3,9 ----
  gopher \- connect to gopher document server
  .SH SYNOPSIS
  .B gopher
! .RI [ -sSb ]
  .RI [ -t
  .IR title]
  .RI [ -p 
***************
*** 23,28 ****
--- 23,31 ----
  .PP
  -s means "secure mode" which means that you can't save or print the
  files that you browse.
+ .PP
+ -S means "very secure mode" which means that you can't save,  print or
+ mail the files that you browse.
  .PP
  -b starts the client on the bookmark page.
  
diff -cr gopher1.1b1-DIST/gopher/globals.h gopher1.1b1/gopher/globals.h
*** gopher1.1b1-DIST/gopher/globals.h	Wed Oct 14 18:07:16 1992
--- gopher1.1b1/gopher/globals.h	Sun Nov 15 19:40:12 1992
***************
*** 79,81 ****
--- 79,83 ----
  int  Load_Index_or_Dir();
  void GetOneOption(/* */);
  void check_sock(/* int, char* */);
+ 
+ #define VERY (-1)
Only in gopher1.1b1/gopher: globals.h-DIST
Only in gopher1.1b1/gopher: globals.o
Only in gopher1.1b1/gopher: gopher

diff -cr gopher1.1b1-DIST/gopher/gopher.c gopher1.1b1/gopher/gopher.c
*** gopher1.1b1-DIST/gopher/gopher.c	Thu Nov  5 11:33:02 1992
--- gopher1.1b1/gopher/gopher.c	Sun Nov 15 19:45:56 1992
***************
*** 809,819 ****
  
       sTmp[0] = '\0';
  
!      while ((c = getopt(argc, argv, "Dsbp:t:")) != -1)
  	  switch (c) {
  	  case 's':
  	       SecureMode = TRUE;
  	       break;
  	  case 'p':
  	       GSsetPath(RootGophers[0], optarg);
  	       GSsetPath(RootGophers[1], optarg);
--- 809,822 ----
  
       sTmp[0] = '\0';
  
!      while ((c = getopt(argc, argv, "DsSbp:t:")) != -1)
  	  switch (c) {
  	  case 's':
  	       SecureMode = TRUE;
  	       break;
+ 	  case 'S':
+ 	       SecureMode = VERY;
+ 	       break;
  	  case 'p':
  	       GSsetPath(RootGophers[0], optarg);
  	       GSsetPath(RootGophers[1], optarg);
***************
*** 834,840 ****
  
  
       if (errflag) {
! 	  fprintf(stderr, "Usage: %s [-sb] [-p path] [-t title] [hostname port]+\n", argv[0]);
  	  exit(-1);
       }
  
--- 837,843 ----
  
  
       if (errflag) {
! 	  fprintf(stderr, "Usage: %s [-sSb] [-p path] [-t title] [hostname port]+\n", argv[0]);
  	  exit(-1);
       }
  
diff -cr gopher1.1b1-DIST/gopher/ourutils.c gopher1.1b1/gopher/ourutils.c
*** gopher1.1b1-DIST/gopher/ourutils.c	Sat Oct 31 07:48:38 1992
--- gopher1.1b1/gopher/ourutils.c	Sun Nov 15 19:31:25 1992
***************
*** 131,138 ****
  
       if (!SecureMode)
  	  printf(", <m> to mail, 
 to save, or <p> to print:");
!      else
  	  printf(", <m> to mail:");
  
       fflush(stdout);
       noecho();
--- 131,142 ----
  
       if (!SecureMode)
  	  printf(", <m> to mail, 
 to save, or <p> to print:");
!      else {
! 	if (SecureMode == VERY)
! 	  printf(":");
! 	else
  	  printf(", <m> to mail:");
+      }
  
       fflush(stdout);
       noecho();
***************
*** 153,158 ****
--- 157,163 ----
  	       case ' ':
  		    break;
  	       case 'm':
+ 		  if (SecureMode != VERY)
  		    mail_file(Filename, Realname);
  		    break;
  
diff -cr gopher1.1b1-DIST/object/STRstring.c gopher1.1b1/object/STRstring.c
*** gopher1.1b1-DIST/object/STRstring.c	Sat Oct 31 07:18:46 1992
--- gopher1.1b1/object/STRstring.c	Sun Nov 15 20:48:32 1992
***************
*** 18,24 ****
       if (in == NULL)
  	  return(temp);
  
!      len = strlen(in);
  
       temp->data = (char *) malloc(len * sizeof(char*));
       strcpy(temp->data, in);
--- 18,24 ----
       if (in == NULL)
  	  return(temp);
  
!      len = strlen(in) + 1; /* THIS WAS A BUG!allow for null termination.... */
  
       temp->data = (char *) malloc(len * sizeof(char*));
       strcpy(temp->data, in);
diff -cr gopher1.1b1-DIST/object/compatible.c gopher1.1b1/object/compatible.c
*** gopher1.1b1-DIST/object/compatible.c	Sat Nov  7 05:21:39 1992
--- gopher1.1b1/object/compatible.c	Thu Nov 12 04:54:26 1992
***************
*** 9,19 ****
  
  /*** For machines that don't have strstr ***/
  
! #if defined(NOSTRSTR) || defined(mips) || defined(sequent) || defined(n16)
  
  char *
  strstr(host_name, cp)
!   char host_name[256];
    char *cp;
  {
       int i, j;
--- 9,19 ----
  
  /*** For machines that don't have strstr ***/
  
! #if defined(NOSTRSTR) || (defined(mips) && !defined(ultrix)) || defined(sequent) || defined(n16)
+ /* this was also a problem in 1.03 DEC mips have strstr and this wont compile */
  char *
  strstr(host_name, cp)
! char host_name[256];
    char *cp;
  {
       int i, j;


And the changes for WAIS-8-B5 .... diffs


diff -cr wais-8-b5-DIST/ir/irretrvl.c wais-8-b5/ir/irretrvl.c
*** wais-8-b5-DIST/ir/irretrvl.c	Mon May 11 07:43:57 1992
--- wais-8-b5/ir/irretrvl.c	Sat Nov 14 21:00:41 1992
***************
*** 76,88 ****
  
   */
  
! #include "irretrvl.h"
  #include "irfiles.h" /* for filename_table_ext */
  #include <string.h>
! #include "futil.h"
  #include <ctype.h>  /* for isspace */
! #include "irext.h"
! #include "irdirent.h"
  #include <sys/stat.h>
  
  #ifdef Mach
--- 76,89 ----
  
   */
  
! #include "irretrvl.h" /* */
  #include "irfiles.h" /* for filename_table_ext */
  #include <string.h>
! #include "futil.h" /* */
  #include <ctype.h>  /* for isspace */
! #include "irext.h" /* */
! #include "irdirent.h" /* */
! #include <sys/types.h> /* must include for ultrix gcc for stat.h */
  #include <sys/stat.h>
  
  #ifdef Mach
diff -cr wais-8-b5-DIST/ui/util.h wais-8-b5/ui/util.h
*** wais-8-b5-DIST/ui/util.h	Wed Mar 18 08:29:40 1992
--- wais-8-b5/ui/util.h	Sat Nov 14 21:39:28 1992
***************
*** 17,24 ****
  #define _H_UTIL
  
  #include <cdialect.h>
  
! int charlistlength _AP((char** list));
! void listlength _AP((List list));
  void find_value _AP((char* source, char* key, char* value, int value_size));
  #endif
--- 17,25 ----
  #define _H_UTIL
  
  #include <cdialect.h>
+ #include <list.h>	/* MG attempt to keep gcc happy about listlength */
  
! int charlistlength _AP((char ** list));
! /* void listlength _AP(( List list)); Now way could i get this to compile
so its comment it out, everything works ok with our this profile */
  void find_value _AP((char* source, char* key, char* value, int value_size));
  #endif
diff -cr wais-8-b5-DIST/x/qcommands.c wais-8-b5/x/qcommands.c
*** wais-8-b5-DIST/x/qcommands.c	Fri May  8 07:51:26 1992
--- wais-8-b5/x/qcommands.c	Sat Aug 22 18:30:12 1992
***************
*** 386,392 ****
  void
  AddResponseToQuestion(w, closure, call_data)
  Widget w;
! caddr_t closure, call_data;
  {
    int numdocs, document_number, i;
    Question q = the_Question->q;
--- 386,393 ----
  void
  AddResponseToQuestion(w, closure, call_data)
  Widget w;
! /* caddr_t closure, call_data; */
! XtPointer closure, call_data; 
  {
    int numdocs, document_number, i;
    Question q = the_Question->q;