home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / ftpser076.zip / ftpserver.INF (.txt) < prev    next >
OS/2 Help File  |  1999-09-23  |  54KB  |  1,533 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  3.  
  4. FtpServer is an ftp daemon for OS/2.  It is distributed as optional shareware. 
  5. This documentation is for version 0.76. 
  6.  
  7. Disclaimer of Warranty 
  8.  
  9.       This Product is provided "as-is", without warranty of any kind, either 
  10.       expressed or implied, including, but not limited to, the implied 
  11.       warranties of merchantability and fitness for a particular purpose.  The 
  12.       entire risk as to the quality and performance of the Product is with you. 
  13.       Should the Product prove defective, the full cost of repair, servicing, 
  14.       or correction lies with you. 
  15.  
  16.  The author of FtpServer is Peter Moylan, peter@ee.newcastle.edu.au. 
  17.  
  18.  The latest version of FtpServer is normally kept at 
  19.  ftp://eepjm.newcastle.edu.au/software 
  20.  Information about other software on this site may be found at 
  21.  http://eepjm.newcastle.edu.au/html/software.html. 
  22.  
  23.  I keep a mailing list of people who receive e-mail notification of new 
  24.  versions of my software.  If you want to be put on this list, let me know by 
  25.  e-mail to peter@ee.newcastle.edu.au. The mailing list is not used for any 
  26.  other purposes, and the addresses will not be passed on to anyone else. 
  27.  
  28.  
  29. ΓòÉΓòÉΓòÉ 2. Registration ΓòÉΓòÉΓòÉ
  30.  
  31.  Registration 
  32.  
  33. This software is "optional shareware".  What this means is that you decide 
  34. whether you want to register as a paid owner of the software. The software is 
  35. not crippled in any way, and I will continue to provide support and free 
  36. releases of new versions to all users, whether or not they are registered, for 
  37. at least the short-term future. 
  38.  
  39. If you decide that this software is worth supporting, you have the following 
  40. payment options. 
  41.  
  42. Payment through BMT Micro 
  43.  
  44. This is likely to be the most convenient method for most people, because BMT 
  45. Micro has a number of different payment methods, including credit cards.  It 
  46. also has agents in several countries.  For full details, see the BMTMicro 
  47. folder included in the FtpServer distribution. (This includes a program that 
  48. simplifies registration by e-mail, if you want to do it that way.)  The price 
  49. is $20 (US dollars). 
  50.  
  51. From Europe 
  52.  
  53. This works best for people living in the European Union.  (Warning: check first 
  54. whether your bank is going to charge you transfer fees. They shouldn't, but 
  55. I've heard of exceptions.)  You have two options: 
  56.  
  57.      Transfer 750 Belgian francs to the following bank account 
  58.  
  59.            Marion Gevers 
  60.            Account number 220-0586389-60 
  61.            G╨Æn╨Ærale de Banque (Belgium) 
  62.            Mention: FtpServer 
  63.  
  64.       and send an e-mail to peter@ee.newcastle.edu.au to confirm that you've 
  65.       done it. 
  66.  
  67.      Send a Eurocheque for 750 Belgian francs to 
  68.  
  69.            Peter Moylan 
  70.            91 Harriet Street 
  71.            Waratah, NSW 2298 
  72.            Australia 
  73.  
  74.  Payment directly to me in Australia 
  75.  
  76.  This is a more attractive option for people in Australia.  From other 
  77.  countries, it's not a good idea because of the bank charges on international 
  78.  transfers.  (Please don't send non-Australian currency to an Australian bank, 
  79.  because then I get hit with exorbitant bank fees.) You can do it in either of 
  80.  two ways. 
  81.  
  82.      Send a cheque, or equivalent, for $25 (Australian dollars) to 
  83.  
  84.            Peter Moylan 
  85.            91 Harriet Street 
  86.            Waratah, NSW 2298 
  87.            Australia 
  88.  
  89.      Transfer the amount of $25 (Australian dollars) to the following bank 
  90.       account. 
  91.  
  92.            Marion Gevers 
  93.            Account number (06 2831) 00626468 
  94.            Commonwealth Bank 
  95.            University of Newcastle, Australia 
  96.  
  97.  
  98. ΓòÉΓòÉΓòÉ 3. Documentation in other languages ΓòÉΓòÉΓòÉ
  99.  
  100. Documentation in other languages 
  101.  
  102. To simplify the distribution, the FtpServer zip file normally contains only 
  103. English-language documentation.  To get documentation in another language, go 
  104. to ftp://eepjm.newcastle.edu.au/inf and look for a file called 
  105. ftpserver.inf.xxx, where xxx indicates the language. If you want to volunteer 
  106. to do another translation, you will find the original document source 
  107. (FtpServer.IPF) in source.zip, which is included as part of the FtpServer 
  108. distribution. 
  109.  
  110. The copyright on the translations belongs to the people who did the 
  111. translations. 
  112.  
  113. The versions that are now available are 
  114.  
  115. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  116. ΓöéItaliano/Italian   Γöéftpserver.inf.it   ΓöéAndrea Brancatelli     Γöé
  117. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  118. ΓöéPyccku╨º/Russian    Γöéftpserver.inf.866  ΓöéKonstantin Boyandin    Γöé
  119. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  120.  
  121.  
  122. ΓòÉΓòÉΓòÉ 4. Server features ΓòÉΓòÉΓòÉ
  123.  
  124.  FtpServer is an ftp server program that implements most of the ftp standard, 
  125. RFC 959.  It supports re-get and passive mode transfers.  The system manager 
  126. can control which directories are visible to users, and the kind of access 
  127. (read, write, delete) allowed in each directory. 
  128.  
  129. For further details, see 
  130.  
  131.      What's special about FtpServer 
  132.      Limitations and missing features 
  133.      Quirks 
  134.      Troublesome clients 
  135.      Nonstandard features 
  136.  
  137.  
  138. ΓòÉΓòÉΓòÉ 4.1. What's special about FtpServer? ΓòÉΓòÉΓòÉ
  139.  
  140.      Supports most of what's in the FTP standard, including re-get and passive 
  141.       mode. 
  142.  
  143.      Fast and compact. 
  144.  
  145.      Compatible with all FTP clients that I've been able to test. 
  146.  
  147.      Separate read, write, and delete permission for each directory the user 
  148.       can see.  You can also make directories invisible. Users can be given 
  149.       access to multiple drives or network drives, if desired. 
  150.  
  151.      The directories seen by a user can include symbolic links. 
  152.  
  153.      You can restrict the IP addresses from which clients can log in, and you 
  154.       can restrict the number of simultaneous logins from the same address. 
  155.  
  156.      Can be run from inetd. 
  157.  
  158.      Can be run detached. 
  159.  
  160.  
  161. ΓòÉΓòÉΓòÉ 4.2. Limitations and missing features ΓòÉΓòÉΓòÉ
  162.  
  163. LIMITATIONS AND MISSING FEATURES 
  164.  
  165. These are things I might fix up when I have the time, though some have higher 
  166. priority than others. 
  167.  
  168.      Transfer types: only Ascii, Image, and "Local 8" are supported. Support 
  169.       for Fortran carriage control and EBCDIC will probably never be added. 
  170.  
  171.      Page-structured files will probably never be supported. (As far as I 
  172.       know, only PDP-10 systems support this feature.) 
  173.  
  174.      The only supported transmission mode is stream mode.  I might or might 
  175.       not add support for block mode and compressed mode at a later stage.  For 
  176.       the moment, there doesn't seem to be any demand for these extras - I 
  177.       haven't come across any ftp client that uses them. 
  178.  
  179.  The only command from RFC 959 that is not implemented is STAT. 
  180.  
  181.  
  182. ΓòÉΓòÉΓòÉ 4.3. Quirks ΓòÉΓòÉΓòÉ
  183.  
  184. QUIRKS 
  185.  
  186. These might be seen as errors, but there's no need to fix them because they 
  187. don't have a harmful effect. 
  188.  
  189.      Can CD to a directory that doesn't exist, if that directory is shown as 
  190.       visible in the user's permission file.  Not a real problem, because the 
  191.       user sees an empty listing and can't do any operations in that directory. 
  192.  
  193.  
  194. ΓòÉΓòÉΓòÉ 4.4. Troublesome clients ΓòÉΓòÉΓòÉ
  195.  
  196. TROUBLESOME CLIENTS 
  197.  
  198. Different ftp clients work differently, and some of them don't bother to adhere 
  199. to the standards, so there will probably always be some client 
  200. incompatibilities.  The ones I know about so far are: 
  201.  
  202.    1. One of the MS-Windows ftp clients (for the moment I've forgotten which 
  203.       one) gives unreasonable time delays when listing a short directory, 
  204.       although long listings are quite fast.  The tests I've been able to do 
  205.       suggest that this problem occurs only when the client and server machines 
  206.       are physically close to each other.  Once the network delays rise to more 
  207.       typical values, the problem goes away. 
  208.  
  209.    2. I've been told of a problem when using ws-ftp, involving a "can't change 
  210.       directory" symptom when fetching the entire contents of a directory; but 
  211.       I've been unable to reproduce the problem and I'm still not quite sure of 
  212.       the precise nature of the problem. 
  213.  
  214.    3. Apparently some proxy servers can't handle multiline responses to FTP 
  215.       commands. If you hit this problem, you might be able to solve it by 
  216.       deleting the file WELCOME.MSG. 
  217.  
  218.  
  219. ΓòÉΓòÉΓòÉ 4.5. Non-standard features ΓòÉΓòÉΓòÉ
  220.  
  221. NON-STANDARD FEATURES 
  222.  
  223. The program violates RFC959 in the following ways: 
  224.  
  225.    1. Extra commands SIZE and MDTM are implemented. 
  226.  
  227.    2. The SYST command returns a reply of UNIX rather than OS/2. I had to do 
  228.       this because the "correct" reply causes WebExplorer to misinterpret the 
  229.       directory listings, and I'm told that at least one Microsoft ftp client 
  230.       will refuse to connect to a server that identifies itself as OS/2. 
  231.  
  232.    3. The obsolete and non-official commands XMKD, XRMD, XPWD, XCUP, and XCWD 
  233.       are implemented.  (These became obsolete more than 10 years ago, and most 
  234.       ftp clients don't use them; but apparently one of the clients for Windows 
  235.       NT hasn't yet been updated to the current standard.) 
  236.  
  237.  
  238. ΓòÉΓòÉΓòÉ 5. Installation ΓòÉΓòÉΓòÉ
  239.  
  240. Installation 
  241.  
  242. See also De-installation 
  243.  
  244. You should have received this package in the form of a zip file. To install it, 
  245. simply unzip the file into a directory of your choice. (Presumably you've 
  246. already done this.)  The server is now ready to run. 
  247.  
  248. The server itself is the program called ftpd.exe.  You can run it either by 
  249. double-clicking on the desktop icon, or by entering the command "ftpd" in a 
  250. command-line session.  (In the latter case, make sure you're in the right 
  251. directory, otherwise you'll end up running the ftpd that was supplied with 
  252. OS/2.)  Most people will want to put a program object or shadow for ftpd into 
  253. the startup folder, so that the server will run each time the system is booted; 
  254. but that's up to you. 
  255.  
  256. Even though the server will work "out of the box", you still need to define the 
  257. user permissions so that clients can connect to the server. You can do this 
  258. either before running the server, or while it's running.  See Setting up the 
  259. User Permissions. 
  260.  
  261. The file source.zip is optional.  If you're not interested in the source code, 
  262. you can delete it. 
  263.  
  264. For some other options, see 
  265.  
  266.      Command line parameters 
  267.      Running from inetd 
  268.      Running FtpServer detached 
  269.      Welcome messages 
  270.  
  271.  
  272. ΓòÉΓòÉΓòÉ 6. De-installation ΓòÉΓòÉΓòÉ
  273.  
  274. De-installation 
  275.  
  276. FtpServer does not tamper with CONFIG.SYS or with other system files. If you 
  277. decide that you don't want to keep FtpServer, simply delete the directory into 
  278. which you installed it. 
  279.  
  280.  
  281. ΓòÉΓòÉΓòÉ 7. Setting up the User Permissions ΓòÉΓòÉΓòÉ
  282.  
  283.  User Permissions 
  284.  
  285.      General concepts 
  286.      Setting up users with the Setup program 
  287.      Manual configuration 
  288.  
  289.  
  290. ΓòÉΓòÉΓòÉ 7.1. User permissions: General concepts ΓòÉΓòÉΓòÉ
  291.  
  292.  GENERAL CONCEPTS 
  293.  
  294. Each user of the server has a login name (username), a password, and a tree of 
  295. accessible directories.  Typically this tree consists of one home directory and 
  296. all of its subdirectories, but more complex arrangements are possible.  The 
  297. system manager may, by the use of symbolic links, allow the tree to cross 
  298. multiple drives or even multiple nodes on the local area network.  The system 
  299. manager may also allow access to a directory but block access to specified 
  300. subdirectories of that directory.  In all cases, a user is restricted to using 
  301. the directories that the system manager has specified for that user.  Users 
  302. cannot get at, or even see, any other directories in the machine's file system. 
  303. Furthermore, users are not told the true physical paths of those directories 
  304. that they are allowed to see. 
  305.  
  306. Note:  In this context, "user" refers to a username rather than to a person. 
  307. For example, you might have a number of different people all accessing the 
  308. server via the username "anonymous". As far as the server is concerned, they 
  309. are not separate users, but rather separate instances of the user called 
  310. "anonymous". 
  311.  
  312. The server looks up the user information in an INI file called FTPD.INI, which 
  313. should be in the same directory as ftpd.exe. This INI file is created and 
  314. maintained by the Setup utility, as explained below. 
  315.  
  316. There are two ways to create and edit the user permissions. 
  317.  
  318.    1. By using the Setup program that is supplied with FtpServer. This is the 
  319.       recommended method, for compatibility with future releases of FtpServer, 
  320.       and also because this method ensures that you produce syntactically 
  321.       correct permission data.  The procedure is described in the section Using 
  322.       the Setup utility. 
  323.  
  324.    2. Manually, using any text editor.  The details can be found in the section 
  325.       Manual configuration.  Manual configuration is supported for the benefit 
  326.       of existing FtpServer users who have become used to doing it this way; 
  327.       but it is not the recommended method, because it's too easy to make 
  328.       mistakes. 
  329.  
  330.  User categories 
  331.  
  332.  Each user is classified as one of the following. 
  333.  
  334.    G       Guest user, who has to provide an e-mail address as a password. 
  335.  
  336.    U       Normal user, who has to supply a password 
  337.  
  338.    N       User who does not need a password. 
  339.  
  340.    M       Manager: same as U, except that a manager gets some extra 
  341.            privileges. 
  342.  
  343.  Normally you would create one "manager" account for yourself, and use the G or 
  344.  U categories for all other users.  The N category is for those rare cases 
  345.  where you don't need to control access with a password. 
  346.  
  347.  Directory permissions 
  348.  
  349.  Each directory that is accessible to the user is described by some combination 
  350.  of the following four permission attributes. 
  351.  
  352.    V       Directory visible.  This should be set in most cases.  When it's not 
  353.            set, the client can't do a "change directory" to this directory, and 
  354.            it won't appear in directory listings. 
  355.  
  356.    R       Read permission.  If this is set then the client can download files 
  357.            from this directory. 
  358.  
  359.    W       Write permission.  If this is set then the client can upload files 
  360.            to this directory. 
  361.  
  362.    D       Delete permission.  If this is set then the client can delete files 
  363.            from this directory.  Note: to overwrite an existing file, both W 
  364.            and D permissions are needed. 
  365.  
  366.  Remark  It is possible for a user to be given read, write, and/or delete 
  367.          privileges to an invisible directory.  In such cases the users can 
  368.          perform the permitted operations only if they know the correct file 
  369.          name, including the directory name, because they won't see the 
  370.          directory name in a directory listing. 
  371.  
  372.  It's also possible for an invisible directory to have visible subdirectories. 
  373.  Users can get to those directories only if they know the path name, including 
  374.  the name of the invisible directory. 
  375.  
  376.  Symbolic links 
  377.  
  378.  A symbolic link is a pointer to some other part of the machine's file system. 
  379.  You - the system manager - can insert symbolic links in any directory. From 
  380.  the user's point of view, a symbolic link looks like just another 
  381.  subdirectory. 
  382.  
  383.  A symbolic link has a name (which is what the user sees) and a physical path 
  384.  (which is known only to the system manager).  The physical path must be either 
  385.  a null string, or a full path name including the drive letter. 
  386.  
  387.  A symbolic link normally points to a directory, but it is also possible to 
  388.  create a symbolic link to a file that is not a directory. 
  389.  
  390.  Note that the user cannot see any difference between a symbolic link and an 
  391.  ordinary file or subdirectory name.  All that the user sees is a single 
  392.  directory tree that starts with a root node called "/". 
  393.  
  394.  Pseudo-directories 
  395.  
  396.  It is possible to specify a symbolic link whose physical path is unspecified. 
  397.  (That is, it is an empty string.)  This creates a pseudo-directory: something 
  398.  that ftp clients will see as a directory, but which does not correspond to any 
  399.  physical directory.  A pseudo-directory cannot hold any real files, but it can 
  400.  contain symbolic links. 
  401.  
  402.  The main use for a pseudo-directory is for the case where you want to give a 
  403.  user access to several unrelated directories, possibly on different drives. 
  404.  To do this, you make the user's top-level directory a pseudo-directory, and 
  405.  then put links in that directory to the directories that the user is allowed 
  406.  to see. 
  407.  
  408.  
  409. ΓòÉΓòÉΓòÉ 7.2. Manual configuration ΓòÉΓòÉΓòÉ
  410.  
  411.  Manual configuration of users 
  412.  
  413. This section describes how to edit a permission file.  It can be skipped by 
  414. most people, because in most cases it's better to use the Setup program to 
  415. automate the editing. 
  416.  
  417. If the user information is already in the server's INI file (e.g. because you 
  418. used the Setup utility to add this user), then the first thing you need to do 
  419. is to use the StorePRM utility to create a PRM file for this user. (Of course 
  420. this step is not needed if you have an existing PRM file for the user.)  After 
  421. editing the PRM file, which you can do with any text editor, you can use the 
  422. LoadPRM utility to load the information back into the INI file. 
  423.  
  424. A PRM file is free-format, i.e. the exact formatting is not important; but, for 
  425. the sake of readability, I suggest that you use indentation etc. to make its 
  426. structure clearer. 
  427.  
  428. The file can include comments.  A comment is anything from the '%' sign to the 
  429. end of the current line.  Note, however, that comments will be stripped out 
  430. when the LoadPRM program loads the data into the server's INI file. 
  431.  
  432. File names containing spaces or special characters should be delimited by 
  433. either double quote marks ("...") or single quote marks ('...').  For "normal" 
  434. file names the quotation marks are optional.  (But see the warning later in 
  435. this page.) 
  436.  
  437. The first three things in a permission file are: 
  438.  
  439.    1. The user category code (G, U, N, M), as described in the General concepts 
  440.       section. 
  441.  
  442.    2. The password.  For a guest user, put "@" as the password. For an 'N' 
  443.       user, just supply a dummy entry here. 
  444.  
  445.    3. The user limit (a numeric value). 
  446.  
  447.  After that, you specify the directory information, in the format 
  448.  
  449.      <directory name> <directory descriptor> 
  450.  
  451.  where <directory name> specifies the user's root directory.  There are two 
  452.  possible ways to specify a <directory name>: 
  453.  
  454.      <namestring> 
  455.      <namestring> = <namestring> 
  456.  
  457.  where a <namestring> is any string of characters, optionally enclosed in 
  458.  quotation marks.  The first alternative - the one without the '=' sign - would 
  459.  not normally be used in specifying the root directory, but it is the normal 
  460.  form for specifying a subdirectory (see below). The second alternative 
  461.  specifies a symbolic link.  In that case the <namestring> before the '=' sign 
  462.  is the directory name as seen by the ftp client, and the <namestring> after 
  463.  the '=' sign is a full path name, starting with a drive letter. 
  464.  
  465.  At the root level, the directory name is not seen by the user in any case, and 
  466.  the full path name is very often a null string, in order to specify a 
  467.  pseudo-directory.  Thus, a very common form of specification for the 
  468.  root-level directory is simply 
  469.  
  470.      ""="" 
  471.  
  472.  A <directory descriptor> gives the permissions for this home directory and all 
  473.  of its subdirectories.  It has the form 
  474.  
  475.      <code> <subdirectory info> 
  476.  
  477.  Both of these are optional.  The <code> can be any combination of 
  478.  
  479.    V+      Directory visible 
  480.    V-      Directory invisible 
  481.    R+      Allow reads (i.e. downloads) of files in this directory 
  482.    R-      Deny read 
  483.    W+      Allow write 
  484.    W-      Deny write 
  485.    D+      Allow delete 
  486.    D-      Deny delete 
  487.  
  488.  The permission codes are always to be interpreted relative to the parent 
  489.  directory's permission code.  That is, a directory has the same permissions as 
  490.  its parent, unless explicitly changed by adding and/or deleting permissions. 
  491.  
  492.  (For the root directory, the default permissions are: visible, read, no write, 
  493.  no delete.) 
  494.  
  495.  The <subdirectory info> is defined recursively.  It has the form 
  496.  
  497.      (  <item> ,  <item> ,  ...  , <item> ) 
  498.  
  499.  i.e. it is a comma-separated list of items, surrounded by parentheses.  Each 
  500.  <item> has the form 
  501.  
  502.      <directory name>  <directory descriptor> 
  503.  
  504.  That is, it follows exactly the same rules as described above for the root 
  505.  directory.  The recursive nature of the rules means, of course, that the 
  506.  <directory descriptor> for any subdirectory may contain specifications of 
  507.  further subdirectories, down to any desired level. 
  508.  
  509.  If this sounds complicated, take a look at the supplied *.PRM files, and 
  510.  you'll soon pick up the pattern. 
  511.  
  512.  Note:  You don't have to list all of the subdirectories - only the ones whose 
  513.  permissions are different from the permissions of the parent directory. 
  514.  
  515.  Example 1 
  516.  
  517.  Suppose you want the user "anonymous" to have read access to the directory 
  518.  C:\users\pub; read and write access to C:\users\pub\upload; no access at all 
  519.  to C:\users\pub\private; and read access to all other subdirectories of 
  520.  C:\users\pub.  Then the permission file ANONYMOUS.PRM should have the 
  521.  following contents. 
  522.  
  523.       G                         % user category = guest
  524.       @                         % password = e-mail address
  525.       pub="C:/users/pub/" V+R+  % user's root directory
  526.         ( upload W+,            % allow write access to upload directory
  527.           private V-R- )        % deny all access to private directory
  528.  
  529.  Example 2 
  530.  
  531.  Suppose you want the user "user1" to have read and write access to drive A:; 
  532.  read-only access to directory C:\users\pub and all of its subdirectories; read 
  533.  and write access to D:\abc and all of its subdirectories; and read and delete 
  534.  access to E:\Apps. To make the example more interesting, let us suppose that 
  535.  we want to make the directory on E: look like a subdirectory of D:\abc\def. 
  536.  You can do this by creating a permission file USER1.PRM with the following 
  537.  contents. 
  538.  
  539.       U                         % normal user
  540.       secret                    % password
  541.       ""="" W+                  % root directory is a pseudo-directory
  542.          ("A"="A:",
  543.           "pub"="C:/users/pub" W-,
  544.           "dir1"="D:/abc"
  545.             (def
  546.               ("apps"="E:/Apps" W-D+)
  547.             )
  548.          )
  549.  
  550.  Remark: FtpServer considers the forward slash (/) and backslash (\) to be 
  551.  equivalent in filename strings. 
  552.  
  553.  Warning about potential syntax errors 
  554.  
  555.  The software that parses a permission file tries to be as non-rigid as 
  556.  possible; for example, it does not insist that the characters in passwords, 
  557.  directory names, etc. be alphanumeric characters.  This flexibility comes at a 
  558.  price: you can write permission files that seem to be correct, but which are 
  559.  syntactically ambiguous. 
  560.  
  561.  To avoid problems, it is a good idea always to enclose directory and file 
  562.  names in quotation marks. 
  563.  
  564.  Converting from older formats 
  565.  
  566.  The rules for specifying directories, as described on this page, were 
  567.  introduced in version 0.71 of FtpServer.  For version 0.70 and earlier, the 
  568.  rules were slightly different.  Both the old and new formats will be supported 
  569.  in versions 0.71 up to 0.80, but after that the old format will no longer be 
  570.  accepted.  Thus, you should convert all your old PRM files to the new format. 
  571.  
  572.  The conversion can be done with the LoadPRM utility, which can read PRM files 
  573.  in either the old or new format but will store the data (in FTPD.INI) in the 
  574.  new format.  A quick way to convert all your PRM files into the new format is 
  575.  to execute the two commands 
  576.  
  577.           loadprm *
  578.           storeprm *
  579.  
  580.  Note that this will strip all comments out of the files.  If you want to keep 
  581.  the comments, you will have to do some manual editing. 
  582.  
  583.  
  584. ΓòÉΓòÉΓòÉ 7.3. Manager privileges ΓòÉΓòÉΓòÉ
  585.  
  586. Manager privileges 
  587.  
  588. A manager account is the same as a normal user account, except that a manager 
  589. has a few extra privileges. 
  590.  
  591.      Managers can see system and hidden files in directory listings; other 
  592.       users cannot. 
  593.  
  594.      Managers are allowed to use the SITE MNGR commands. 
  595.  
  596.  
  597. ΓòÉΓòÉΓòÉ 8. The Setup utility ΓòÉΓòÉΓòÉ
  598.  
  599. The Setup utility 
  600.  
  601. The program SETUP.EXE has three functions: 
  602.  
  603.      To set the parameters that the server will use when it starts up. 
  604.      To place controls on which IP addresses may access the server. 
  605.      To create and edit user permissions. 
  606.  
  607.  Use the F4 and F5 function keys on the keyboard to toggle among these 
  608.  functions. 
  609.  
  610.  The parameter settings are stored in a file FTPD.INI.  The server reads its 
  611.  INI file as it starts up, so any changes you make will not take effect until 
  612.  the next time you start the server. 
  613.  
  614.  Exception: the user permissions are not read until a user attempts to log in. 
  615.  You may therefore alter the user permissions while the server is running, and 
  616.  the alterations will affect the next user to log in. 
  617.  
  618.  Now read 
  619.  
  620.      Setting the server parameters 
  621.      Security settings 
  622.      More setup options 
  623.      Modifying user permissions 
  624.  
  625.  
  626. ΓòÉΓòÉΓòÉ 8.1. Setting the server parameters ΓòÉΓòÉΓòÉ
  627.  
  628. Setting the server parameters 
  629.  
  630. When you run SETUP.EXE, you get a screen showing the following items. 
  631.  
  632.  Server port 
  633.            Unless you are doing something nonstandard (for example, running two 
  634.            ftp servers on the same machine) this should always be 21. 
  635.  
  636.  Maximum number of users 
  637.            This specifies how many clients will be allowed to use the server 
  638.            simultaneously. I usually set this to 10.  Higher values will, of 
  639.            course, increase the load on your processor. 
  640.  
  641.            Note: this is a global maximum.  You may also set this to a high 
  642.            value, and then control the number of users on a per-username basis. 
  643.  
  644.  Maximum number of guest users 
  645.            This typically should be slightly less than the number specified for 
  646.            the maximum number of users, to reserve one or more login slots for 
  647.            the system manager and other non-guest users. 
  648.  
  649.  Free space threshold (MB) 
  650.            This specifies the amount of free space that must be available on a 
  651.            drive for uploads to be enabled.  If the free space, in megabytes, 
  652.            falls below this level then uploads will be disabled. 
  653.  
  654.  User logging level 
  655.            The server creates a log file called FTPUSERS.LOG.  (If you delete 
  656.            the file, it will be re-created.  It would be a good idea to delete 
  657.            it, or move it to an archive, every month or so, so that it does not 
  658.            grow too large.)  The user logging level controls how much detail 
  659.            gets written to this file. 
  660.  
  661.               0           No logging 
  662.  
  663.               1           Log successful file transfers 
  664.  
  665.               2           Log successful and unsuccessful file transfers 
  666.  
  667.               3           Log all users, even those who didn't transfer any 
  668.                           files 
  669.  
  670.  Timeout (seconds) 
  671.            The time that a client session may remain idle before the user is 
  672.            evicted. You will find that many ftp clients, especially web 
  673.            browsers, don't log out properly, so their sessions have to be 
  674.            killed with the timeout mechanism. 
  675.  
  676.  Transaction logging 
  677.            You can choose to send a detailed log to the screen, or to a disk 
  678.            file, or both. The disk file is called FTPTRANS.LOG, and it is 
  679.            updated approximately once every 15 minutes if this feature is 
  680.            enabled. 
  681.  
  682.            Warning: Transaction logging can create very large log files.  I 
  683.            suggest that you don't enable this feature unless you're trying to 
  684.            track down a problem. 
  685.  
  686.  To modify any of these parameters, use the up/down arrow keys to get to the 
  687.  desired item, then type in the new value.  (The backspace, Insert, Delete, 
  688.  Home, and End keys will also work during editing.)  The new value is accepted 
  689.  when you type the Enter key, or when you use the function keys to go to 
  690.  another field. 
  691.  
  692.  When you've finished editing, use the Esc key to exit from the Setup program, 
  693.  or type F5 to get to the security screen. 
  694.  
  695.  
  696. ΓòÉΓòÉΓòÉ 8.2. Security settings ΓòÉΓòÉΓòÉ
  697.  
  698. Security settings 
  699.  
  700. To modify the security settings, run SETUP.EXE, and then type the F5 function 
  701. key on the keyboard to get to the "Security" screen page. 
  702.  
  703. At the top of this page there is a field called the "Same IP limit".  This 
  704. specifies the maximum number of users that can be connected simultaneously from 
  705. the same IP address.  It is primarily a protection against users who hog the 
  706. server by logging in more than once. 
  707.  
  708. Set this value to whatever you want, finishing with the "Enter" or "cursor 
  709. down" key to confirm the new value.  The "cursor down" key will take you to the 
  710. IP address controls, as described below.  When you've finished setting the 
  711. values on this page, type F5 to get to more setup options. 
  712.  
  713. Restricting access to certain IP addresses 
  714.  
  715. The large box on this screen page defines a filter for IP addresses.  This is 
  716. for putting restrictions on which remote hosts are allowed to log into the 
  717. server. (If you don't need this feature, just use a single "Allow all" entry.) 
  718. When a client tries to connect, the server searches this list, starting at the 
  719. beginning, for the first entry that matches the client's IP address.  There 
  720. will always be a match, because the last entry is always an "everything else" 
  721. entry. The allow/refuse flag on the matching entry is used to decide whether 
  722. the client should be allowed to connect.  If the flag value is "refuse", the 
  723. connection attempt is rejected. 
  724.  
  725. Each list entry has an allow/refuse flag and two numeric components, an address 
  726. and a mask.  Each of these is expressed in "dotted quad" notation: a four-byte 
  727. value where each byte has its value written out in decimal. (This is a standard 
  728. convention for writing IP addresses.) A client address matches an entry if 
  729.  
  730.     (client IP address) AND mask = (IP address in the list) 
  731.  
  732. where AND means the bit-by-bit Boolean "logical AND" operation. 
  733.  
  734. Note, in particular, the two extreme cases: 
  735.  
  736.      If the mask is 255.255.255.255, then we are specifying an exact match 
  737.       between the client IP address and the address in the list. 
  738.  
  739.      If the mask is 0.0.0.0, then any IP address will match this entry. You 
  740.       can use this to specify an "everything else" condition. 
  741.  
  742.  Example 1. If you want to lock out all machines with IP address in the range 
  743.  123.45.67.0 to 123.45.67.127, your list would look like this. 
  744.  
  745.       Refuse  123.45.67.0  255.255.255.128 
  746.       Allow   all others 
  747.  
  748.  Example 2. Suppose you want to give access only to your local network, which 
  749.  has addresses in the range 123.45.66.0 to 123.45.67.255.  You can do this as 
  750.  follows. 
  751.  
  752.       Allow   123.45.66.0  255.255.254.0 
  753.       Refuse  all others 
  754.  
  755.  Example 3. To allow access to 123.45.67.89, but to lock out everyone else in 
  756.  123.45.67.*, you can use the rules 
  757.  
  758.       Allow   123.45.67.89  255.255.255.255 
  759.       Refuse  123.45.67.0   255.255.255.0 
  760.       Allow   all others 
  761.  
  762.  Notice that the list always finishes with an "all others" entry.  The Setup 
  763.  program will allow you to change the allow/refuse flag on this final entry, 
  764.  but it will not allow you to delete it. 
  765.  
  766.  
  767. ΓòÉΓòÉΓòÉ 8.3. More setup options ΓòÉΓòÉΓòÉ
  768.  
  769. More setup options 
  770.  
  771. In the present version, the only option on this page is a choice between 
  772. binding to all interfaces, or binding to a specific IP address.  Use the cursor 
  773. left/right keys to highlight the option you want.  If you highlight "specific 
  774. address", you will be given the opportunity to edit the address. After editing 
  775. it, use the Enter key or a cursor up/down key to confirm that you've finished 
  776. editing.  When you've finished setting the values on this page, type F5 to get 
  777. to the user permission editor. 
  778.  
  779. For most applications, the best choice is "all interfaces".  With this choice 
  780. the server listen for ftp requests on all your network interfaces, even if your 
  781. machine has multiple IP addresses. 
  782.  
  783. The "specific address" option is for the case where you have two or more IP 
  784. addresses, but you want the server to respond to only one of them.  In this 
  785. case you could, if you wished, run several independent ftp servers on the same 
  786. machine, each responding to a different address. 
  787.  
  788. (Another way to run several ftp servers is to make each one listen on a 
  789. different port.  That's a less attractive option, however, because most ftp 
  790. clients expect to find the server on the standard port 21.) 
  791.  
  792. If you do run multiple copies of ftpd.exe, put each of them in a different 
  793. directory.  This is because ftpd.exe expects to find its INI file in the same 
  794. directory as the executable, and for multiple copies you would want to have a 
  795. different INI file for each one. 
  796.  
  797.  
  798. ΓòÉΓòÉΓòÉ 8.4. Modifying user permissions ΓòÉΓòÉΓòÉ
  799.  
  800. Modifying user permissions 
  801.  
  802. To modify the user permissions, run SETUP.EXE, and then type the F4 function 
  803. key - or type F5 twice - to get to the "Users" screen page.  This will give you 
  804. a list of all existing users.  The first time you run the program, the list 
  805. will probably be empty. 
  806.  
  807. From this screen, you can add, delete, or modify users.  When you've finished, 
  808. use the F4 or F5 function key to get to the other Setup screens, or type X to 
  809. exit from the Setup program. 
  810.  
  811. Deleting a user 
  812.  
  813. Use the up/down arrow keys to get to the user you want to delete, and type the 
  814. Del (delete) key. 
  815.  
  816. Adding a new user 
  817.  
  818. Type A, and then proceed as for Editing a user's permissions. 
  819.  
  820. Cloning an existing user 
  821.  
  822. Type C, and then proceed as for Editing a user's permissions. This is the same 
  823. as adding a new user, except that the new user's attributes are copied from 
  824. those for the user that was selected when the C command was typed. 
  825.  
  826. Editing the permissions of an existing user 
  827.  
  828. Type E, and then follow the instructions in the section Editing a user's 
  829. permissions. 
  830.  
  831.  
  832. ΓòÉΓòÉΓòÉ 8.5. Editing a user's permissions ΓòÉΓòÉΓòÉ
  833.  
  834. Editing a user's permissions 
  835.  
  836. You get to this point by running the Setup program, typing F4 or F5 to get to 
  837. the user editor, and then using one of the "A" (add user) or "E" (edit user) 
  838. options. 
  839.  
  840. By now you should have five fields near the top of the screen. 
  841.  
  842.    User name 
  843.            The name that the user will use when logging in. 
  844.  
  845.    Category 
  846.            One of User, Guest, NoPassword, or Manager. 
  847.  
  848.    Password 
  849.            This user's password. 
  850.  
  851.    User limit 
  852.            The maximum number of simultaneous sessions with this user name. (If 
  853.            you don't want such a control, just make this number larger than the 
  854.            global user limit.) 
  855.  
  856.    Speed limit 
  857.            An approximate upper bound on the file transfer speed for this user, 
  858.            in case you want to restrict how much of the processor power this 
  859.            user can get.  If you don't want such a control, just make this a 
  860.            large number. 
  861.  
  862.  Use the up/down arrow keys to get to the field you want to edit, and then 
  863.  modify it as necessary.  For the "Category" field, use the left/right arrow 
  864.  keys to select a category. 
  865.  
  866.  Warning: If you change the user name, the permissions for the previous user 
  867.  name will be deleted.  You should also avoid using a user name that is the 
  868.  same as for some other user. 
  869.  
  870.  The bottom half of this screen gives a summary - but not a complete 
  871.  description - of the top level of this user's directory tree.  To see the 
  872.  complete details, and to modify those details, use the "cursor down" key to 
  873.  move to this part of the screen. 
  874.  
  875.  Instructions for modifying the user's tree are on the next page of this 
  876.  document. 
  877.  
  878.  Converting from older formats 
  879.  
  880.  Some details of the format of user information in FTPD.INI were changed in 
  881.  version 0.71 of FtpServer.  Both the old and new formats will be supported in 
  882.  versions 0.71 up to 0.80, but after that the old format will no longer be 
  883.  accepted.  Thus, you should convert all your user permission data to the new 
  884.  format. 
  885.  
  886.  The Setup program will automatically perform the conversion each time you edit 
  887.  a user.  If you have a small number of users defined, then the way to do the 
  888.  conversion is to run Setup and edit each user (without necessarily making any 
  889.  changes). 
  890.  
  891.  If you have a large number of users, it is easier to use the LoadPRM program 
  892.  to do the conversion.  This can be done with the following sequence of 
  893.  commands. 
  894.  
  895.           storeprm *
  896.           loadprm *
  897.           del *.prm
  898.  
  899.  (The final deletion can be omitted if you prefer to keep a copy of the PRM 
  900.  files.  If ever your INI file is damaged or destroyed, you can use the LoadPRM 
  901.  utility to re-load user data from PRM files.) 
  902.  
  903.  
  904. ΓòÉΓòÉΓòÉ 8.6. Editing a directory tree ΓòÉΓòÉΓòÉ
  905.  
  906. Editing a directory tree 
  907.  
  908. You get to this point while editing a user's permissions. The picture that is 
  909. shown on the screen is a representation of the directory tree for this user. 
  910. Initially it will show enough subtrees to reveal all symbolic links, and all 
  911. entries for which the user's permissions are different from the parent node's 
  912. permissions.  (For a new user, there will be nothing except an empty root 
  913. node.)  In the course of editing this tree you can expand or collapse nodes to 
  914. control how much detail is shown on the screen. 
  915.  
  916. The top of the screen shows both a physical path and a virtual path for the 
  917. current entry.  The physical path is the true location of the file or directory 
  918. on your disk.  The virtual path is the path as the client sees it. 
  919.  
  920. Each entry describes one directory or file.  At the left of each line, you will 
  921. see a code consisting of one or more of the letters "VRWD". The meanings of 
  922. these user permission codes are explained in the General concepts section. 
  923.  
  924. To the right of the VRWD code, some entries have one or more of the following 
  925. codes. 
  926.  
  927.    +       This directory is collapsed, i.e. its subdirectories (if any) are 
  928.            not at present displayed on the screen. 
  929.  
  930.    *       This entry is a symbolic link. 
  931.  
  932.    #       This entry describes a file rather than a directory. 
  933.  
  934.    ?       There is no file or directory on the disk that matches this entry. 
  935.            This might mean that you have made an error in the name; 
  936.            alternatively, it might mean that you are specifying a directory or 
  937.            file that you haven't yet created. 
  938.  
  939.  To edit the tree, you have the following options. 
  940.  
  941.      You can navigate through the list of directories with the cursor up/down 
  942.       keys, and also with the Home, End, PageUp, and PageDown keys. 
  943.  
  944.      To change a permission, type one of the characters V, R, W, or D. This 
  945.       toggles the state of the corresponding permission code for the currently 
  946.       selected directory. 
  947.  
  948.      Typing the "I" key gives the selected entry a copy of the current 
  949.       permissions of its parent. 
  950.  
  951.      The "P" key copies the permissions of the currently selected directory to 
  952.       all of its subdirectories. Use this if you want to change an entire 
  953.       subtree in one operation. 
  954.  
  955.      The "-" key collapses a directory by removing its subdirectories from the 
  956.       screen listing. (But these subdirectories will still be affected by the 
  957.       "P" option.) To get the subdirectories back, type the "+" key. 
  958.  
  959.      The "A" key adds a new child node under the current node. 
  960.  
  961.      The "Del" key deletes the current node and all of its subtrees. This 
  962.       option is disabled if the current entry describes a file or directory 
  963.       that is physically present on the disk. 
  964.  
  965.      The "E" key allows you to edit the details for the current entry. 
  966.       (Instructions for doing this are given later in this page.) This option 
  967.       is disabled if the current entry describes a file or directory that is 
  968.       physically present on the disk. 
  969.  
  970.  When you've finished editing the permissions, type B to go back to the 
  971.  previous screen, or X to exit completely from Setup. 
  972.  
  973.  Modifying the details for one entry 
  974.  
  975.  The "E" or "A" command will bring up a screen window with three details that 
  976.  you can modify.  Use the cursor up/down keys to go from one field to another. 
  977.  
  978.    1. The Name field gives the subdirectory or file name. 
  979.  
  980.    2. The Link field should have value "no" for an ordinary subdirectory or 
  981.       file, and "yes" for a symbolic link.  Use the cursor left/right keys to 
  982.       change the value of this field. 
  983.  
  984.    3. The Path is the physical path (including drive letter) for this directory 
  985.       or file.  You can modify this only if the Link field is set to "yes".  If 
  986.       you leave the Path blank, you are defining a pseudo-directory. 
  987.  
  988.  When you have finished editing these details, type the Esc key to return to 
  989.  the tree. 
  990.  
  991.  Setting permissions for individual files 
  992.  
  993.  The access permissions used by FtpServer are normally given to directories, 
  994.  and the permissions for a directory apply to all non-directory files in that 
  995.  directory.  However, Setup will let you define an entry for a non-directory 
  996.  file, and give it access permissions.  (It would be tedious to do this for 
  997.  every file, but this feature can be used for special cases.)  This gives you a 
  998.  method for making the permissions for a file different from the permissions of 
  999.  the directory that it is in. 
  1000.  
  1001.  
  1002. ΓòÉΓòÉΓòÉ 9. Running the server ΓòÉΓòÉΓòÉ
  1003.  
  1004. Running the server 
  1005.  
  1006. The server executable is called FTPD.EXE.  You can run this the way you run any 
  1007. other OS/2 program: from the command-line, by clicking on an icon, from the 
  1008. Startup folder, etc.  If you're running several server applications, then the 
  1009. most obvious choice is to put a command to start the server in the command file 
  1010. \TCPIP\BIN\TCPSTART.CMD. 
  1011.  
  1012. Normally the server takes its configurable parameters from the INI file created 
  1013. by the Setup program.  You may, however, override these parameters by 
  1014. specifying command-line parameters. 
  1015.  
  1016. You also have the options of running the server from inetd or running the 
  1017. server as a detached program. 
  1018.  
  1019. Once the server is running, two keyboard commands are available. 
  1020.  
  1021.    G       Gradual shutdown.  No new users are accepted.  The program will 
  1022.            terminate when the existing users have logged off (or timed out), or 
  1023.            when a Q comand is issued. 
  1024.  
  1025.    Q       Quick shutdown.  The program closes down even if there are logged-in 
  1026.            users. 
  1027.  
  1028.  
  1029. ΓòÉΓòÉΓòÉ 9.1. Command line parameters ΓòÉΓòÉΓòÉ
  1030.  
  1031. Command line parameters 
  1032.  
  1033. Normally you don't need any parameters when invoking FTPD.EXE, because the 
  1034. server takes its parameters from the INI file.  (And the contents of the INI 
  1035. file are controlled by the Setup program.)  You may, however, override the 
  1036. parameters in the INI file by giving command-line parameters. 
  1037.  
  1038. There are several optional parameters. These all have the form of a letter 
  1039. followed by a (decimal) number, and they can be given in any order. 
  1040.  
  1041.    D       Detailed transaction logging (default 0). 
  1042.  
  1043.                 0         No logging 
  1044.                 1         Logging to the disk file FTPTRANS.LOG 
  1045.                 2         Logging to the screen 
  1046.                 3         Logging to both the screen and the disk file 
  1047.  
  1048.    F       Free space threshold (megabytes).  Users can't upload to a drive 
  1049.            that has less than this amount of free space available. The default 
  1050.            is 10. 
  1051.  
  1052.    G       Maximum number of guest users.  If you make this smaller than the 
  1053.            value for M (see below), you effectively reserve some slots for 
  1054.            non-guest users.  The default is M-1. 
  1055.  
  1056.    L       User logging option (default 1). 
  1057.  
  1058.                 0         No logging 
  1059.                 1         Logging of successful file transfers 
  1060.                 2         Logging of successful and unsuccessful file transfers 
  1061.                 3         Logging of all users 
  1062.  
  1063.            The log is a text file called FTPUSERS.LOG.  You can edit it or 
  1064.            delete it without doing any harm. 
  1065.  
  1066.    M       Maximum number of simultaneous users.  To limit the number to 12, 
  1067.            for example, use the command 
  1068.                   ftpd m12 
  1069.            The default is 10. 
  1070.  
  1071.    P       The server's port number.  To make the server listen on port 5003, 
  1072.            for example, you start the program with the command 
  1073.                   ftpd p5003 
  1074.            The default port number is 21. 
  1075.  
  1076.    T       Timeout limit, i.e. the time before an inactive user is forcibly 
  1077.            removed.  The value is in seconds, and the default is 900. 
  1078.  
  1079.  
  1080. ΓòÉΓòÉΓòÉ 9.2. Running from inetd ΓòÉΓòÉΓòÉ
  1081.  
  1082. Running the server from inetd 
  1083.  
  1084. Inetd, which is part of the Warp 4 distribution, is a "listener" program that 
  1085. can intercept incoming connection attempts, and start up a server when needed. 
  1086.  
  1087. The advantage is that FtpServer doesn't actually get loaded into main memory 
  1088. until a client wants to connect.  Thus, it might be a good option if you expect 
  1089. clients to connect only occasionally. 
  1090.  
  1091. The disadvantage is that a separate copy of the server is started for each 
  1092. logged-in user.  This makes inetd a bad choice if you expect lots of 
  1093. connections. 
  1094.  
  1095. If you want to run FtpServer from inetd, the way to do it is as follows: 
  1096.  
  1097.    1. Ensure that inetd will be run the next time you boot. The usual way of 
  1098.       doing this is to include the line 
  1099.             start /min inetd 
  1100.       in your TCPSTART.CMD, and to invoke TCPSTART.CMD from your startup 
  1101.       folder.  TCPSTART.CMD may be found in the directory \tcpip\bin. 
  1102.  
  1103.    2. Edit the file \mptn\etc\inetd.lst so that it contains the line 
  1104.          ftp tcp start /C /min d:\Apps2\FtpServer\ftpd.exe 
  1105.       (adjusting the path so that it refers to the directory where you've 
  1106.       installed FtpServer). 
  1107.  
  1108.  Note:  In earlier releases the inetd users had to use a file called ftpd.cmd. 
  1109.  That command file is now obsolete. 
  1110.  
  1111.  You may also include parameters on the inetd.lst line that invokes ftpd.exe, 
  1112.  subject to the following conditions: 
  1113.  
  1114.    1. The M parameter is useless, because in this mode of operation the program 
  1115.       is handling exactly one user. 
  1116.  
  1117.    2. The P parameter, if present, will be ignored.  When running from inetd, 
  1118.       you don't get a choice of ports. 
  1119.  
  1120.  In principle you can now start inetd.  In practice I've found that inetd 
  1121.  doesn't release ports reliably, so if you already have inetd running you'll 
  1122.  probably have to re-boot. 
  1123.  
  1124.  Remark: I'm starting to suspect that inetd adds more overhead than it saves, 
  1125.  so I've reverted to not using it on my own machine. 
  1126.  
  1127.  
  1128. ΓòÉΓòÉΓòÉ 9.3. Running FtpServer detached ΓòÉΓòÉΓòÉ
  1129.  
  1130. Running the server as a detached program 
  1131.  
  1132. If you want to run the server detached, the appropriate command is 
  1133.     DETACH FTPD 
  1134. (with parameters, if desired).  Note that a detached program does not have any 
  1135. way of doing screen output or keyboard input, so you can't get any screen 
  1136. messages in this case.  Nor can you use the keyboard G and Q commands. 
  1137.  
  1138. Although you can't shut down the server from the keyboard in this case, you can 
  1139. still shut it down by using the SITE MNGR commands. 
  1140.  
  1141.  
  1142. ΓòÉΓòÉΓòÉ 9.4. Welcome messages ΓòÉΓòÉΓòÉ
  1143.  
  1144. Welcome messages 
  1145.  
  1146. If you want to give a message to users when they log in, put a plain text file 
  1147. called WELCOME.MSG or WELCOME0.MSG in the same directory as ftpd.exe. 
  1148.  
  1149.      WELCOME0.MSG, if present, is displayed to the user when the initial 
  1150.       connection is made. 
  1151.      WELCOME.MSG, if present, is displayed to the user after the username and 
  1152.       password have been accepted. 
  1153.  
  1154.  You can use both of these options together, if you wish, but it would probably 
  1155.  be less confusing to the users if you had only one message. 
  1156.  
  1157.  You can also put a text file called DIR.MSG in any user directory. Users will 
  1158.  get this message the first time they go to that directory. 
  1159.  
  1160.  There is a limited form of macro expansion available in these message files. 
  1161.  The following macros may be included. 
  1162.  
  1163.    %i"filename" Includes the contents of the given file in the message. Nesting 
  1164.            is permitted; that is, the included file may also contain a %i 
  1165.            macro. 
  1166.  
  1167.    %m      Expands to a character string giving the maximum allowed number of 
  1168.            users with the current username. 
  1169.  
  1170.    %M      Expands to a character string giving the global maximum allowed 
  1171.            number of users. 
  1172.  
  1173.    %t      Expands to a string giving the local time. 
  1174.  
  1175.    %T      For now, this is the same as %t. 
  1176.  
  1177.    %u      Expands to a string giving a user number within this user's group. 
  1178.  
  1179.    %U      Expands to a string giving this user's global user number. 
  1180.  
  1181.    %%      The '%' character. 
  1182.  
  1183.  
  1184. ΓòÉΓòÉΓòÉ 9.5. The SITE commands ΓòÉΓòÉΓòÉ
  1185.  
  1186. The SITE commands 
  1187.  
  1188. The SITE PERM command 
  1189.  
  1190. The command SITE PERM returns a three-character string showing whether you have 
  1191. read, write, and/or delete permission for the current directory. (This command 
  1192. was added while I was testing a new feature.  It might be withdrawn in future 
  1193. versions, because it's not particularly useful for most users.) 
  1194.  
  1195. The SITE MNGR commands 
  1196.  
  1197. Commands in this group may be used only from a manager account. Currently the 
  1198. following options are available. 
  1199.  
  1200.  SITE MNGR EXEC 
  1201.            Runs another program.  See below for further details. 
  1202.  
  1203.  SITE MNGR EXIT 
  1204.            Shuts down the server.  (Don't do this unless you really mean it!) 
  1205.  
  1206.  SITE MNGR GXIT 
  1207.            Shuts down the server after the current users have logged out - i.e. 
  1208.            the same action as for the keyboard G command. 
  1209.  
  1210.  SITE MNGR KILL nnn 
  1211.            Forcibly logs out user number nnn. The number must match the one 
  1212.            returned by the SITE MNGR LIST command. 
  1213.  
  1214.  SITE MNGR LIST 
  1215.            Returns a list of currently logged-in users. The main purpose of 
  1216.            this command is to support the Monitor utility. 
  1217.  
  1218.  The SITE MNGR EXEC command starts a new program in a separate session. (If 
  1219.  FtpServer is running detached, then the new program must also run detached.) 
  1220.  For example, you could zip up the user log with the command 
  1221.  
  1222.         site mngr exec zip.exe today.zip ftpusers.log
  1223.  
  1224.  If you want to run a batch file then you need to start a suitable command 
  1225.  shell.  For OS/2 command files and Rexx programs, the appropriate shell is 
  1226.  cmd.exe, as in the following example. 
  1227.  
  1228.         site mngr exec cmd.exe /c test.cmd parameter1 parameter2
  1229.  
  1230.  
  1231. ΓòÉΓòÉΓòÉ 10. The Monitor utility ΓòÉΓòÉΓòÉ
  1232.  
  1233. The Monitor utility 
  1234.  
  1235. The program MONITOR.EXE allows the system manager to see who is currently 
  1236. logged in, and to kill sessions where necessary.  This program can be run 
  1237. either on the same machine as the server, or remotely. 
  1238.  
  1239. When you start the program, it attempts to connect to the server.  If it fails 
  1240. to establish a connection, this might mean that the server is not running. 
  1241. Alternatively, it might mean that you are attempting to connect to the wrong 
  1242. machine, or to the right machine with the wrong manager account. In the latter 
  1243. case, see the instructions for Setting up the Monitor parameters. 
  1244.  
  1245. To kill a client session, use the cursor up/down keys to get to the desired 
  1246. session, and then type the K key. 
  1247.  
  1248. To shut down the server, type Ctrl/K.  (Hold down the Ctrl key while typing K.) 
  1249. You will be asked to confirm the shutdown by typing either G (for a gradual 
  1250. shutdown) or Q (for a quick shutdown). 
  1251.  
  1252. To close the Monitor program, type the X key. 
  1253.  
  1254. Hint:  If you want to use less screen space, issue the command 
  1255.      MODE CO80,10 
  1256. before running Monitor.exe. 
  1257.  
  1258.  
  1259. ΓòÉΓòÉΓòÉ 10.1. Setting up the Monitor parameters ΓòÉΓòÉΓòÉ
  1260.  
  1261. Setting up the Monitor parameters 
  1262.  
  1263. When running MONITOR.EXE, typing S on the keyboard takes you to the setup 
  1264. screen. There you will see four fields that have to be filled in. 
  1265.  
  1266.   Server hostname 
  1267.            This specifies the machine on which the server is running, for 
  1268.            example mymachine.here.net.  If the machine has a fixed IP address, 
  1269.            you can avoid a nameserver lookup by specifying a numeric address, 
  1270.            for example 123.45.67.89 
  1271.  
  1272.   Server port 
  1273.            This should normally be 21, but you might have set up the server to 
  1274.            accept connections from a non-standard port. 
  1275.  
  1276.   User name 
  1277.            This must be the username for a manager account. 
  1278.  
  1279.   Password 
  1280.            The password for the manager account. 
  1281.  
  1282.  When you've finished filling in these details, press the Esc key to return to 
  1283.  the Monitor main screen. 
  1284.  
  1285.  
  1286. ΓòÉΓòÉΓòÉ 11. The LoadPRM and StorePRM utilities ΓòÉΓòÉΓòÉ
  1287.  
  1288. The LoadPRM utility 
  1289.  
  1290. This utility is needed if you want to manually edit user permission files. It 
  1291. copies information from a PRM file into the server's FTPD.INI.  For example, 
  1292. the command 
  1293.  
  1294.        loadprm example
  1295.  
  1296. takes the information in the file EXAMPLE.PRM and creates or updates an entry 
  1297. in the INI file for a user called "example". 
  1298.  
  1299. Wildcards are permitted. To load the information from all the PRM files in the 
  1300. current directory, use the command 
  1301.  
  1302.        loadprm *
  1303.  
  1304. You do not have to restart the server. The updated user information will take 
  1305. effect the next time a user logs in. 
  1306.  
  1307. The StorePRM utility 
  1308.  
  1309. This utility creates a PRM file by copying the user information from FTPD.INI. 
  1310. You would use it if the INI file already contains user data that you want to 
  1311. edit manually. For example, the command 
  1312.  
  1313.        storeprm example
  1314.  
  1315. takes the information in the INI file for the user called "example", and uses 
  1316. it to create a file EXAMPLE.PRM. (If EXAMPLE.PRM already exists, the original 
  1317. copy is renamed EXAMPLE.BAK.) 
  1318.  
  1319. Wildcards are permitted. To create PRM files for all the existing users, use 
  1320. the command 
  1321.  
  1322.        storeprm *
  1323.  
  1324.  
  1325. ΓòÉΓòÉΓòÉ 12. The LogAnalysis utility ΓòÉΓòÉΓòÉ
  1326.  
  1327. The LogAnalysis utility 
  1328.  
  1329. LogAnalysis.exe is a utility to produce a summary from the FtpServer user log. 
  1330. You run it with the command 
  1331.  
  1332.         LogAnalysis logfilename
  1333.  
  1334. where "logfilename" is the name of the user log file.  If no parameter is 
  1335. supplied, it assumes that the log file name is FTPUSERS.LOG. 
  1336.  
  1337. The results are written to standard output.  You can redirect this to a file, 
  1338. for example 
  1339.  
  1340.         LogAnalysis AUGUST.LOG >August.summary
  1341.  
  1342.  
  1343. ΓòÉΓòÉΓòÉ 13. Development notes ΓòÉΓòÉΓòÉ
  1344.  
  1345.      Development tools 
  1346.  
  1347.      Why Modula-2? 
  1348.  
  1349.      Known bugs 
  1350.  
  1351.      Unresolved issues 
  1352.  
  1353.      Reporting errors 
  1354.  
  1355.      Year 2000 compliance 
  1356.  
  1357.  
  1358. ΓòÉΓòÉΓòÉ 13.1. Development tools ΓòÉΓòÉΓòÉ
  1359.  
  1360. Development tools 
  1361.  
  1362. Some people have asked about the compiler I'm using.  (I guess a lot of people 
  1363. didn't realise that there were Modula-2 compilers for OS/2.)  It's XDS 
  1364. Modula-2, OS/2 native mode version.  You can find out about this, and other 
  1365. Modula-2 compilers for OS/2, at the web page 
  1366.    http://www.ee.newcastle.edu.au/users/staff/peter/os2/os2m2.html 
  1367. (I'm getting a little behind on keeping my web pages up to date, but the 
  1368. information is still basically correct, only the version numbers have changed.) 
  1369.  
  1370. The XDS home page is at 
  1371.    http://www.xds.ru/ 
  1372. This is well worth visiting, because the XDS development team often has "try 
  1373. before you buy" versions of their compilers available for download. 
  1374.  
  1375. FtpServer uses some of the modules from the PMOS/2 library. If you want to know 
  1376. more about PMOS/2, you'll also find that on my web pages.  Source code is 
  1377. available.  My web pages are at 
  1378. http://www.ee.newcastle.edu.au/users/staff/peter/Moylan.html. 
  1379.  
  1380. This documentation was prepared with IBM's IPFC help compiler. 
  1381.  
  1382.  
  1383. ΓòÉΓòÉΓòÉ 13.2. Why Modula-2? ΓòÉΓòÉΓòÉ
  1384.  
  1385. Why Modula-2? 
  1386.  
  1387. I'm often asked why I chose to code FtpServer in Modula-2.  Everyone else seems 
  1388. to be using C or C++, so why don't I? 
  1389.  
  1390. The short answer is that I don't think much of the "everyone else uses it" 
  1391. argument.  If popularity was more important to me than technical merit, I 
  1392. wouldn't be using OS/2. 
  1393.  
  1394. The long answer is contained in a document called "The Case Against C", which 
  1395. can be found at 
  1396. http://murray.newcastle.edu.au/users/ftp/pub/reports/CaseAgainstC.ps.Z. This is 
  1397. a compressed Postscript file.  If you can't handle compressed Postscript, a 
  1398. text-only version (CaseAgainstC.txt) can be found in the same directory. 
  1399.  
  1400. And the medium-length answer is on this page. 
  1401.  
  1402. To begin with, run-time efficiency is not as big an issue as most people seem 
  1403. to think it is.  With modern compiler technology, the main programming 
  1404. languages (apart from things like BASIC and its derivatives) give about the 
  1405. same run-time efficiency.  C and C++ lose out a little because their low-level 
  1406. constructs make it hard for the compiler to do a good job at optimisation; the 
  1407. figures I've seen tend to suggest that a program written in Modula-2 runs a 
  1408. little faster than the same program written in C or C++. However, the 
  1409. difference is typically less than 5%, and hardly worth worrying about. 
  1410.  
  1411. So the big issue is development efficiency.  For a job like this we can rule 
  1412. out languages like BASIC and REXX because they're a little too crude; and we 
  1413. can rule out languages like Fortran because of their poor support for "systems 
  1414. programming" tasks.  We can also rule out a host of lesser-known languages 
  1415. because of the unavailability of OS/2 compilers.  That leaves us with Pascal, 
  1416. Ada, Oberon, Modula-2, C, and C++. 
  1417.  
  1418. I don't use Pascal because Modula-2 is basically an upgraded Pascal, and I 
  1419. might as well use the improved version. 
  1420.  
  1421. I haven't looked into the availability of Ada compilers for OS/2; but in any 
  1422. case I don't like Ada because of its complexity.  The bigger a language is, the 
  1423. more things there are to go wrong. 
  1424.  
  1425. Oberon is a more subjective matter.  Some people will tell you that Oberon is 
  1426. the successor to Modula-2, and is a superior programming language.  My personal 
  1427. opinion is that Oberon has deleted some of the features that make Modula-2 a 
  1428. good language.  I agree, however, that this issue is not entirely clear-cut. 
  1429.  
  1430. That brings us to C and C++.  I've done a lot of C and C++ programming over the 
  1431. years, and it's left me with the feeling that those languages are major 
  1432. barriers to programming efficiency.  It takes me roughly twice the time to get 
  1433. a C or C++ program working as it does to get a comparable Modula-2 program 
  1434. working.  (On some projects I've kept logs to verify this.)  The coding time is 
  1435. roughly the same, but there's a major difference in debugging time.  Everyone I 
  1436. know writes buggy software in C and C++, and then they take forever trying to 
  1437. track down the bugs.  Some developers give up, and sell the software with the 
  1438. bugs still included. 
  1439.  
  1440. There are two main reasons why C software is so bug-prone. 
  1441.  
  1442.    1. Lack of type safety.  C is designed in such a way that the compiler can't 
  1443.       do much error checking, so the compiler gives no warnings for things 
  1444.       that, in a type-safe language, would be reported as errors at compile 
  1445.       time.  You don't see the errors until execution time, and then you're 
  1446.       left wondering what caused the error. 
  1447.  
  1448.    2. Poor support for modular programming.  You can break up a C program into 
  1449.       modules, but they're not truly independent of one another.  A slight 
  1450.       change in one module can have catastrophic effects on other modules. 
  1451.       Once a project grows moderately large, you lose control of your own code. 
  1452.  
  1453.  C++ is a little better in these two respects, but C++ has problems of its own. 
  1454.  The language designers tried to graft high-level features onto a low-level 
  1455.  language, and the result is a mass of inconsistency.  A C++ reference manual 
  1456.  is typically several times as thick as manuals for other programming 
  1457.  languages, because every rule has a maze of exceptions and special cases. 
  1458.  
  1459.  In addition, I've noticed that a lot of C++ programmers seem to have adopted 
  1460.  the philosophy of "let's try this, and hope that it works".  The notion that 
  1461.  you shouldn't write code that you don't understand seems to have become 
  1462.  unfashionable.  Maybe that's the fault of the language (and its libraries), 
  1463.  maybe not.  In any case, it's not the way I prefer to work. 
  1464.  
  1465.  Ultimately, the reason I use Modula-2 is that it lets me get applications 
  1466.  working quickly, it gives me control of large projects, and it doesn't force 
  1467.  me to spend huge amounts of time on debugging.  I'm too old to enjoy the 
  1468.  thrill of tracking down obscure bugs.  I like to get something working, and 
  1469.  then be free to move on to other projects. 
  1470.  
  1471.  Of course, it's difficult to guarantee that any piece of software is bug-free, 
  1472.  no matter what development tools you use.  But I can have the next-best thing, 
  1473.  which is an acceptably small error rate. 
  1474.  
  1475.  
  1476. ΓòÉΓòÉΓòÉ 13.3. Known bugs ΓòÉΓòÉΓòÉ
  1477.  
  1478. KNOWN BUGS IN SERVER 
  1479.  
  1480.      Server shutdown does not work correctly when using version 4.02k of the 
  1481.       TCP/IP stack, although it does work with earlier versions.  Other 
  1482.       information I've received seems to indicate that *ALL* server 
  1483.       applications misbehave with version 4.02k, so it looks as if the fault 
  1484.       lies in the TCP/IP implementation. I have fixed the problem for version 
  1485.       4.02o, but the fix might not work with 4.02k - my impression is that 
  1486.       versions between k and o are seriously buggy. 
  1487.  
  1488.      Uploads not accepted if your free disk space is greater than about 4000 
  1489.       gigabytes.  There doesn't seem to be any urgent need to fix this just 
  1490.       yet, but at the rate disk sizes are growing ... 
  1491.  
  1492.  See also Unresolved issues 
  1493.  
  1494.  
  1495. ΓòÉΓòÉΓòÉ 13.4. Unresolved issues ΓòÉΓòÉΓòÉ
  1496.  
  1497. Unresolved issues 
  1498.  
  1499. These are problems that various people have reported, but which I haven't been 
  1500. able to duplicate. I'd be interested in hearing from anyone who can confirm 
  1501. either that the problem really exists, or that it's now fixed. 
  1502.  
  1503.      Reported: the server can be crashed by a client running JavaScript. This 
  1504.       problem is still a mystery to me, I haven't been able to track down 
  1505.       what's going on. 
  1506.  
  1507.  
  1508. ΓòÉΓòÉΓòÉ 13.5. Year 2000 compliance ΓòÉΓòÉΓòÉ
  1509.  
  1510. Year 2000 compliance 
  1511.  
  1512. According to my tests, FtpServer should continue running correctly until 31 
  1513. December 2079.  (It might also continue working after that; but the OS/2 system 
  1514. clock will not allow me to set the date to 2080 or later.)  This assumes that 
  1515. you are using HPFS disks. 
  1516.  
  1517. Systems using the FAT file system will stop working in 2038. This has nothing 
  1518. to do with FtpServer; it's a fundamental limitation of FAT. 
  1519.  
  1520.  
  1521. ΓòÉΓòÉΓòÉ 13.6. Reporting errors ΓòÉΓòÉΓòÉ
  1522.  
  1523. If you find any error that's not mentioned in this document, please report it 
  1524. to peter@ee.newcastle.edu.au.  The following information would be useful in 
  1525. tracking down the cause of the error: 
  1526.  
  1527.      The version number of the version you are using. 
  1528.  
  1529.      The file errinfo.$$$, if it exists. 
  1530.  
  1531.      Some information about what the server was doing at the time the problem 
  1532.       occurred; for example, the last few lines of the transaction log. 
  1533.