home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso
/
altsrc
/
articles
/
11190
< prev
next >
Wrap
Text File
|
1994-08-28
|
2KB
|
60 lines
Path: wupost!howland.reston.ans.net!agate!darkstar.UCSC.EDU!news.hal.COM!decwrl!vixie!vixie
From: vixie@vix.com (Paul A Vixie)
Newsgroups: alt.sources
Subject: Re: wuftpd-index - SITE INDEX code for wuftpd
Date: 28 Aug 94 02:43:48
Organization: Vixie Enterprises
Lines: 47
Message-ID: <VIXIE.94Aug28024348@office.home.vix.com>
References: <33pd3u$3o2@info.curtin.edu.au>
NNTP-Posting-Host: office.home.vix.com
In-reply-to: ilewisp@info.curtin.edu.au's message of 28 Aug 1994 15:07:42 +0800
> This is some very simple code to implement the SITE INDEX
> command in wuftpd. The code consists of a very small C
> [...]
Sigh. As the originator of the SITE INDEX idea in DECWRL's ftpd, I am sad as
hell that the WU folks did not include my index builder or my grep interface
when they picked up my code. (They did pick up my security bug, for which I
hereby apologize to all -- this was the one that was fixed in WU ftpd 2.3 --
but I wish they'd fixed it by importing my new version since my fix was much
cleaner than theirs.) Anyway, to see the original index makers (which are
still in use on gatekeeper.dec.com), go to gatekeeper:~ftp/pub/DEC/gwtools
and grab "mkindex" and "mkindicies".
Since this is alt.sources, I'll include my own wrapper around "agrep". You
can use any grep you want, but agrep is fastest and its approximate matching
abilities should make it ideal for this kind of searching. The file shown
below is "index.c" in my ftp.tar.gz file (see gatekeeper:~ftp/pub/DEC/gwtools
or gatekeeper:~ftp/pub/misc/vixie).
#ifndef lint
static char rcsid[] = "$Id: index.c,v 1.1 1992/02/29 22:44:36 vixie Exp $";
#endif
#define STDIN 0
char _PATH_INDEXFILE[] = "/Index-byname";
char _PATH_GREPCMD[] = "/bin/agrep";
main(argc, argv, envp)
int argc;
char *argv[], *envp[];
{
close(STDIN);
if (open(_PATH_INDEXFILE, 0) < 0) {
perror(_PATH_INDEXFILE);
exit(1);
}
argv[0] = _PATH_GREPCMD;
execve(_PATH_GREPCMD, argv, envp);
perror(_PATH_GREPCMD);
exit(1);
}
--
Paul Vixie
Redwood City, CA
decwrl!vixie!paul
<paul@vix.com>