Penftpd ======= (c) 1995 by Paul Wagland. penguin@tartarus.uwa.edu.au First lets get the copyright out of the way.... You may not disassemble, or reverse-engineer in any other fashion, this program. You may not have multiple copies of this program running at the same time, unless you have a multiple licences, or a site license. You may have multiple copies on this program on many machines, as long as precautions are taken such that only one copy of the program can be running at any one time. THERE ARE NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. DISTRIBUTION CONDITIONS You are free to distribute this shareware version of Penftpd as long as the following conditions are met: 1) The distributed archive must contain ALL the files listed below, and no others. 2) The contents of this archive are NOT MODIFIED in any way. 3) This version is not to be sold. However, a reasonable disk copying fee is permitted. 4) This version is not to be bundled with a commercially sold package without permission from the authors. The contents of this archive should include: convert.doc -- details on how to use convert.exe convert.exe -- Converts from IBM's ftpd files to penftpd ftppass.doc -- details on how to use ftppass.exe ftppass.exe -- Changes passwords in penftpd's ini files penftpd.doc -- details on how to use penftpd.exe penftpd.exe -- The FTP daemon useredit.doc -- details on how to use useredit.exe useredit.exe -- Edit user details. register.doc -- details on how to register penftpd. If you didn't receive all of these parts contact the site from which you received penftpd and ask them to get the full version. Introduction: ============= Penftpd is a FTP daemon, designed to run under OS/2, whilst taking full advantage of the OS/2 programming paradigm. Examples of this include using threads to handle each connection, instead of creating a new process. Penftpd is shareware, so if you use the program you are asked to please register it. See the accompaning file "register.doc" for information. The following table lists the major differences between Penftpd and IBM's ftpd: |Penftpd | IBM ---------------------------------------------------------+--------+-------- Style of directory output |Unix |OS/2 Unified directory structure |Yes |No Uses threads to handle connections |Yes |No Uses encrypted passwords |Yes |No Able to specify both readable and non-readable | | directories |Yes |No Can specify upload directories |Yes |No Limit number of users able to login |Yes |No Limit total number of users able to login |Yes |N/A Limit number of users able to login by user type |Yes |N/A Login messages |Yes |No Directory messages |Yes |No Can turn off long replys |Yes |N/A Variable command logging levels |Yes |No User logging |Yes |No Transfer logging |Yes |No Can signal user when a connection is made with either | | beeping, or by playing a multimedia file |Yes |No Launchable by inetd |Yes |Yes In addition to this Penftpd also offers higher data throughput rates. Also it will work with the IAK offered with Warp. How to run the daemon: ====================== penftpd -option1 -option2 ... where the options are: -b : number of times to beep when a connection is made. -c[r] : turn on cmd logging. The number represents what level of logging you want. 1 - least logging, shows user and transfers 2 - shows almost everything, except for PORT commands 3 - shows everything r is an optional switch which allows replies from penftpd to be logged. -C : The name of the command logfile (default: penftpdDir\"ftpCmd.log") -d : Message of the day file -f : turn on transfer logging -F : transfer log filename (default penftpdDir\"transfer.log") -k : Keep at least bytes free on all disks. If less than bytes are available uploads will be disabled. -I : Name of the file that penftpd will use for user information. (default penftpdDir\"penftpd.ini") -l : number of allowable login failures before the user gets kicked off (default: 3) -m : name of a multimedia file to play when a connection is made. It can be any multimedia file (movie, sound, midi, etc). -n : Max number of users allowed on the system. (default: unlimited) -o : Create an "orphan" program. This is very similar to a detached program. This can be killed by using the -q switch mentioned after. -p : the port at which to run the daemon (default: 21) -q : Terminate penftpd. -R : Reset the connection numbers used in the logs to 0. -t : default timeout for each user (in seconds) (default: 900) -T : maximum timeout value that the user can set for themselves. (in seconds) (default: 7200) -u : turn on user logging -U : user log filename (default penftpdDir\"ftpUser.log") NOTE: 1)Do not leave a space between a parameter and it's argument. 2)Anywhere a number is asked for you can use the letters 'k' and 'm' to represent thousands and millions. Example: penftpd -u -f -c1r -t300 -T900 -k5m This tells penftpd to record all users, and their file transfers. As well it logs the common commands and their replies. The user will time out after 300 seconds of inactivity, but they can set it as high as 900 seconds. Uploads will not be allowed unless there is at least 5Mb free on the disk. If Penftpd is run without arguments, while another copy is already running, that copy will be shown on the screen. How to use PENFTPD with INETD: ============================== To get inetd to start penftpd, you need to edit INETD.LST. This file will be in your ETC directory (typically c:\tcpip\etc). In this file add the line: ftp tcp start /b d:\path\penftpd.exe -option1 -option2 ... where d:\path is the directory that penftpd.exe resides. If the line: ftp tcp ftpd is in the file, then you must replace it with the above line. It is very important that penftpd.exe is started, and not just called, otherwise no other requests from inetd can be serviced until penftpd.exe is finished. How to use directory messages: ============================== If you want to show the user a message when they change into a directory, then place that message into a file called "dir.msg" in the required directory. If you want them to see a message in the "super-root" directory, then place a file called "rootdir.msg" into penftpd's home directory. In these files there are also a number of substitution variables that can be used. These are: %d - users current directory. %h - hostname of the current machine. %i - user ID name. %p - Users password (If they have a password field of E-MAIL) %ng - number of users on globally. %ni - number of users of type ID logged in. %mg - maximum number of users allowed globally. %mi - maximum number of users of type ID allowed. %t - Current time and date, in HH:MM day DD mon YYYY format. %v - Print out Penftpd version notice. The switches supported by penftpd's LIST/NLST commands: ======================================================= -C : display NLST listing in columns. -d : de-reference arguments. -F : indicates directories by appending a slash. -l : give long (LIST) listing regardless of what we were asked to do. -p : indicates directories by appending a slash. -r : reverse sort. -R : do a recursive directory listing. -S : sort by Size (biggest first). -t : sort by date (newest first). -- : signifies end of parameters. Hints: ====== One other thing to note, even though most clients don't support the ALLO command, which allocates space for the file about to be sent, penftpd does. If you find a client which supports this feature, then it _should_ reduce fragmentation caused by uploading files, as OS/2 should try to find a free block big enough to hold it. The other option is to use the "quote cmd" feature of most text based ftp clients, and manually send a ALLO command. Future directions: ================== Planned enhancements to penfptd include: Improvements to the LIST/NLST commands. New FTP commands being added (including SITE INDEX) Lockout times, ie. give it times when people can login, and times when they can't. "Meta-characters" in all of the messages. (ie. %n to give user number) Anything anyone asks for, particularily if they register :-) Trouble-shooting tips: ====================== Q1: When penftpd is started it immediately closes and the last line in the log file is: "Could not initialise FTP Port". A1: This means that the port which you are trying to use is in use by something else, for instance, inetd, or IBM's ftpd. Another problem is that sometimes the ports take a while (anout 30 seconds) to reset. Rectify the problem and restart penftpd. --- Q2: When penftpd is started it immediately closes and the last line in the log file is: "Failed to initialise socket libraries...Daemon is not running" A2: This could be caused by two problems, first make sure that IBM's TCP/IP is installed properly, as this is needed to make penftpd run. Secondly make sure that you have defined a hostname for your computer. --- Q3: I have added pefntpd to my INETD.LST file, but whenever someone ftp's my machine, it changes the active window to the desktop. A3: This is probably because you didn't include the "/b" switch to the start command. This switch tells inetd to start penftpd up in the background, without it inetd starts penftpd up in the foreground, which interrupts whatever you are doing at the time. Thanks: ======= Thanks go to Andrew Williams, Peter Lewis and Quinn (aka the Eskimo) for encouraging me to write the program in the first place. Thanks also go to the beta-testers who tested out the program. Special thanks go to Andrew Williams, Jason Tiller and Tom Sorenson for their voluminous feedback on the various betas (especially Jason). An extra special thanks goes to Jason Tiller and Tom Sorenson for assistance in the distribution of the shareware version of penftpd. Trademarks: =========== IBM and OS/2 are trademarks of International Business Machines Corporation.