home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso / altsrc / articles / 11190 < prev    next >
Text File  |  1994-08-28  |  2KB  |  60 lines

  1. Path: wupost!howland.reston.ans.net!agate!darkstar.UCSC.EDU!news.hal.COM!decwrl!vixie!vixie
  2. From: vixie@vix.com (Paul A Vixie)
  3. Newsgroups: alt.sources
  4. Subject: Re: wuftpd-index - SITE INDEX code for wuftpd
  5. Date: 28 Aug 94 02:43:48
  6. Organization: Vixie Enterprises
  7. Lines: 47
  8. Message-ID: <VIXIE.94Aug28024348@office.home.vix.com>
  9. References: <33pd3u$3o2@info.curtin.edu.au>
  10. NNTP-Posting-Host: office.home.vix.com
  11. In-reply-to: ilewisp@info.curtin.edu.au's message of 28 Aug 1994 15:07:42 +0800
  12.  
  13. > This is some very simple code to implement the SITE INDEX 
  14. > command in wuftpd.  The code consists of a very small C
  15. > [...]
  16.  
  17. Sigh.  As the originator of the SITE INDEX idea in DECWRL's ftpd, I am sad as
  18. hell that the WU folks did not include my index builder or my grep interface
  19. when they picked up my code.  (They did pick up my security bug, for which I
  20. hereby apologize to all -- this was the one that was fixed in WU ftpd 2.3 --
  21. but I wish they'd fixed it by importing my new version since my fix was much
  22. cleaner than theirs.)  Anyway, to see the original index makers (which are
  23. still in use on gatekeeper.dec.com), go to gatekeeper:~ftp/pub/DEC/gwtools
  24. and grab "mkindex" and "mkindicies".  
  25.  
  26. Since this is alt.sources, I'll include my own wrapper around "agrep".  You
  27. can use any grep you want, but agrep is fastest and its approximate matching
  28. abilities should make it ideal for this kind of searching.  The file shown
  29. below is "index.c" in my ftp.tar.gz file (see gatekeeper:~ftp/pub/DEC/gwtools
  30. or gatekeeper:~ftp/pub/misc/vixie).
  31.  
  32. #ifndef lint
  33. static char rcsid[] = "$Id: index.c,v 1.1 1992/02/29 22:44:36 vixie Exp $";
  34. #endif
  35.  
  36. #define STDIN 0
  37.  
  38. char _PATH_INDEXFILE[] = "/Index-byname";
  39. char _PATH_GREPCMD[] = "/bin/agrep";
  40.  
  41. main(argc, argv, envp)
  42.         int argc;
  43.         char *argv[], *envp[];
  44. {
  45.         close(STDIN);
  46.         if (open(_PATH_INDEXFILE, 0) < 0) {
  47.                 perror(_PATH_INDEXFILE);
  48.                 exit(1);
  49.         }
  50.         argv[0] = _PATH_GREPCMD;
  51.         execve(_PATH_GREPCMD, argv, envp);
  52.         perror(_PATH_GREPCMD);
  53.         exit(1);
  54. }
  55. --
  56. Paul Vixie
  57. Redwood City, CA
  58. decwrl!vixie!paul
  59. <paul@vix.com>
  60.