Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Feb 1998 01:00:02 -0800 (PST)
From:      Ian Vaudrey <i.vaudrey@bigfoot.com>
To:        freebsd-ports
Subject:   Re: ports/5821: Swish-e port
Message-ID:  <199802240900.BAA00990@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/5821; it has been noted by GNATS.

From: Ian Vaudrey <i.vaudrey@bigfoot.com>
To: "'doconnor@gsoft.com.au'" <doconnor@gsoft.com.au>
Cc: "FreeBSD-gnats-submit@FreeBSD.ORG" <FreeBSD-gnats-submit@FreeBSD.ORG>
Subject: Re: ports/5821: Swish-e port
Date: Tue, 24 Feb 1998 08:50:43 -0000

 I think that this might be one of those ports that we should
 make our own tarball for. This should include the manual page
 from the Swish-E web site and possibly a copy of the GPL. I'd
 also like to see it include at least one of the rather nice
 animated gifs located at the web site, but I admit this is
 icing on the cake.
 
 The comment and descr files could do with some work, comment
 is supposed to be a single sentence describing the port while
 descr refers to autoswish, which you haven't ported (wisely,
 I think - it may constitute a security hole).
 
 There are other cgi-type ports tied to apache, so I think a
 port of one of the search scripts that use Swish-E (e.g.
 ftp://qz.to/pub/search.cgi) would not be too specific and
 would make the Swish-E port more obviously useful. This
 would be a separate port, though.
 
 Finally, the current version of Swish-E has a bug that can
 make it crash in certain circumstances: here is a description
 of the problem and a suggested fix that you might like to
 incorporate in the port.
 
 **************************************************************
 
 ----------
 From: 	Marcus Haebler <mh@muenster.net>
 Sent: 	14 January 1998 17:55
 To: 	Multiple recipients of list
 Subject: 	[SWISH-E:118] Dots in directory names can make swish-e crash
 
 Hi everyone,
 
 I believe, I just found a bug in swish-e. To reproduce it do this:
 
 	mkdir 13sys.tem6
 	touch 13sys.tem6/changes
 	touch 13sys.tem6/release-notes
 
 	swish-e -i 13sys.tem6
 
 This results in a segmentation fault. I confirmed this kind of behaviour
 on Linux and FreeBSD. Even on other systems you should be able confirm
 this since swish-e looks pretty much like pure C to me.
 
 I used gcc version 2.7.2.1 on Linux and FreeBSD. No -O2 but -g to get some
 debugable code.
 
 I believe that there must be something wrong in the way swish-e handles
 directory names. The problem is the dot. Replace the dot with an '_' and
 it works fine. Amazing is that "13system.6"  works!  Any other position
 of the dot in the name makes it crash. 
 
 This bug also exists in the old non-enhanced swish version.
 
 Can someone confirm this behaviour? Since I am not familiar with the source:
 could someone either give me a hint, where to look for it or come up with a
 fix?
 
 Thanks in advance,
 
 Marcus Haebler
 
 ----------
 From: 	Jim Winstead <jimw@dev.adventure.com>
 Sent: 	15 January 1998 04:29
 To: 	Multiple recipients of list
 Subject: 	[SWISH-E:121] Re: Dots in directory names can make swish-e crash
 
 
 --FL5UXtIhxfXey3p5
 Content-Type: text/plain; charset=us-ascii
 
 Attached is a patch to fix the problem, and also avoid the problem with
 suffix-length overfilling that buffer entirely.
 
 This has only been lightly tested, so use at your own peril.
 
 Jim
 
 --FL5UXtIhxfXey3p5
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=diff
 
 Index: check.c
 ===================================================================
 RCS file: /repository/swish-e/check.c,v
 retrieving revision 1.1.1.1
 retrieving revision 1.2
 diff -c -r1.1.1.1 -r1.2
 *** check.c	1998/01/15 03:12:49	1.1.1.1
 --- check.c	1998/01/15 04:15:05	1.2
 ***************
 *** 184,206 ****
   int ishtml(filename)
        char *filename;
   {
 ! 	char *c, suffix[MAXSUFFIXLEN];
   
   	c = (char *) strrchr(filename, '.');
   
   	if (c == NULL)
   		return 0;
 ! 	strcpy(suffix, c + 1);
 ! 	if (suffix[0] == '\0')
   		return 0;
   
 ! 	if (!strncmp(suffix, "htm", 3))
   		return 1;
 ! 	else if (!strncmp(suffix, "HTM", 3))
   		return 1;
 ! 	else if (!strncmp(suffix, "shtml", 5))
   		return 1;
 ! 	else if (!strncmp(suffix, "SHTML", 5))
   		return 1;
   	return 0;
   }
 --- 184,211 ----
   int ishtml(filename)
        char *filename;
   {
 ! 	char *c, *d;
   
 + 	d = (char *) strrchr(filename, '/');
   	c = (char *) strrchr(filename, '.');
   
 + 	/* make sure the . is part of the filename */
 + 	if (d != NULL && c < d) {
 + 		return 0;
 + 	}
 + 
   	if (c == NULL)
   		return 0;
 ! 	if (c++ == '\0')
   		return 0;
   
 ! 	if (!strncmp(c, "htm", 3))
   		return 1;
 ! 	else if (!strncmp(c, "HTM", 3))
   		return 1;
 ! 	else if (!strncmp(c, "shtml", 5))
   		return 1;
 ! 	else if (!strncmp(c, "SHTML", 5))
   		return 1;
   	return 0;
   }
 
 --FL5UXtIhxfXey3p5--
 
 **************************************************************
 
 This is all just my 2 cents of course!
 
  - Ian
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802240900.BAA00990>