home *** CD-ROM | disk | FTP | other *** search
- A Gopher Server for DOS
- (c) Gunter Hille 1993
- Hille@informatik.uni-hamburg.de
- 22-FEB-1993
-
- GOPHSERV.EXE is a very small (less than 30 KB) GOPHER server program
- for a PC with DOS or MS-WINDOWS operating system. The program was created
- by using the TCP/IP library from the University of Minnesota Gopher project
- (I obtained and made development with version 1.02).
-
- If your Gopher client works with the IBMTCP.DVR driver (22-APR-92),
- this server should work as well, if you do the following things:
-
- 1. Set the two environment variables
- MYIP= <your internet address>
- NETMASK=<your mask>
- The first is necessary for the Server to start, the netmask will be set
- to 255.255.255.0 if it is missing.
-
- 2. Load the packet driver for your ethernet card.
- If you want to run the server as a Window 3.1 background job, install the
- WINPKT driver as well before you start your Windows session.
-
- 3. create a file with the extension .GOP in the same directory where the
- Gopher server program is located and fill it with information about the
- files which shall be readable by the client programs. You may use my
- Gopher tool GOPMKDIR.EXE to create this file. This is the root information
- sent to a Gopher client.
-
- Here is an example of a typical root file 00ROOT.GOP:
-
- 0About this Gopher Server<TAB>0About.doc<TAB>134.100.9.162<TAB>70
- 1Documents at this site<TAB>1\DOCS<TAB>134.100.9.164<TAB>70
-
- Please notice that the server looks for all files with "GOP" extension.
- This is useful when different programs are creating Gopher files.
-
- 4. Do not use symbolic names for internet hosts, just type in the internet
- address (this will be most likely your own IP address). Then the Gopher
- server does not call a nameserver, and you can run it on your PC network
- without the use of a nameserver.
- The Gopher server does not connect a nameserver if the dotted numbers are
- given as addresses. It was developed on a Novell Lite network with no
- nameserver available.
-
- Do not use the packet drivers when running other network software which
- accesses your ethernet card (e.g. DEC PATHWORKS, Novell, Novell Lite).
- If you use the IPXPKT shim packet driver, you will lose access to the
- Internet, but you can run the client/server package locally on your
- Novell net.
-
- The server supports only the following Gopher types:
-
- 0 (file)
- 1 (directory)
- 7 (search engine).
-
- A directory entry (type 1) points to a directory (in MS-DOS notation).
- If there are files with the extension .GOP in this directory,
- the contents of these files will be returned to the client process.
- All files with extension ".GOP" must contain valid Gopher lines.
-
- The last type needs a few comments. In this Gopher server a search engine
- is just another program, which will be executed by the server program. The
- executed program returns exactly two files, one (RESULTS.PDX) containing a
- list in Gopher notation. The first and only entry in this list points to a
- file which contains information from the executed program (results, infos
- or error messages).
-
- Here is an example of a file 00ROOT.GOP in the Gopher root directory,
- where the search engine is just a batch program:
-
- 0About this Gopher <TAB> 0ABOUT.DOC <TAB> 134.100.9.161 <TAB> 70
- 1Documents <TAB> 1\DOCS <TAB> 134.100.9.161 <TAB> 70
- 7Search Engine <TAB> 7\DOCS\DOSEARCH.BAT <TAB> 134.100.9.161 <TAB> 70
-
- <TAB> is the ASCII tab character.
-
- The first line means: "send file ABOUT.DOC (in this directory) to the client"
-
- The second line returns the contents of all files with the extension .GOP
- in the subdirectory \DOCS on host 134.100.9.161
-
- The last line executes a batch program. After finishing the batch file, the
- server looks for a file named RESULTS.PDX and sends this file to the client.
- And here comes the trick: the server sends this file as a list of files to
- the client (and the contents of the file must be valid Gopher info). As the
- Gopher server executes the search engine, this file may be modified by the
- search engine. Or the file(s) specified in RESULT.PDX may change after each
- execution of the search engine.
-
- Here is a sample batch file DOSEARCH.BAT, which returns a directory list of
- all requested files on my machine:
-
- REM dosearch.bat for Gunter's PC
- DIR %1 > RESULTS.DIR
- COPY DUMMY.PDX RESULTS.PDX
-
- where DUMMY.PDX contains the following Gopher info line:
-
- 0Directory search results<TAB>0\RESULTS.DIR<TAB>134.100.9.161<TAB>70
-
- A path to a file must be specified absolute, because the server changes
- it's working directory after each request from the client.
-
- The server writes all requests to a logfile GOPHSERV.LOG. The format of this
- file is in QUIS-format (described in PXCREATE.DOC). It can easily be
- converted and then analyzed by database programs like PARADOX or DBASE.
-
-
- Known bugs:
-
- The server is unable to report the internet address of the caller, this might
- be a bug in the TCP/IP lib of the UoM or it may be just my unability to
- understand it. I hope to fix this soon.
-
-
- The server is available via anonymous ftp from
-
- ftp.informatik.uni-hamburg.de
-
-
- Caveat!!!
-
- The Gopher server allows remote users to execute programs on your machine
- (like the batch program shown above). There is no security on accessing
- files or executing batchfiles. When a naughty client requests such a file
- or batch program, he can inspect any file he wants or execute any batch
- procedure, if he has information or guesses about the location of these
- files. Even worse, if he is doing a TELNET session to the Gopher port,
- he can send the DOS-command "DELETE *.*". So please, don't use it on the
- Internet (there are enough Gophers running on more powerful machines than
- a PC). On the other side, this Gopher server gives you the ability of
- remote program execution in a network.
-
- The possibilities you will get by such an universal GOPHER server
- will - hopefully - outnumber the evil doings.
-
-
-
- Remarks (15-FEB-1993):
-
- I added a security option to the distributed version 1.13 of the PC Gopher
- server. Executable programs must be listed in a file GOPHPROG.DAT, this
- file will be read at startup. Only program names (no extension) appearing
- in this list may be executed by the server. So it is up to you giving
- your server the necessary security.
-
-
- Please send comments and bug reports to:
-
- hille@informatik.uni-hamburg.de
-
-
- Gunter Hille
- Computer Science Dept.
- University Hamburg
- Vogt-Koelln-Str. 30
- D-2000 Hamburg 54
- Germany
-