home *** CD-ROM | disk | FTP | other *** search
/ Handbook of Infosec Terms 2.0 / Handbook_of_Infosec_Terms_Version_2.0_ISSO.iso / text / rfcs / rfc0775.txt < prev    next >
Text File  |  1996-05-07  |  10KB  |  188 lines

  1.  
  2.  
  3.  
  4.  
  5.        RFC 775          Directory oriented FTP commands        Page 1 
  6.  
  7.  
  8.  
  9.                DIRECTORY ORIENTED FTP COMMANDS 
  10.  
  11.              David Mankins (dm@bbn-unix)              Dan Franklin (dan@bbn-unix)               A. D. Owen (ADOwen@bbnd) 
  12.  
  13.        As a part of the Remote Site Maintenance (RSM) project for  ARPA,       BBN  has installed and maintains the software of several DEC PDP-       11s running the Unix operating system.  Since Unix  has  a  tree-       like  directory  structure,  in  which directories are as easy to       manipulate as ordinary files, we  have  found  it  convenient  to       expand  the  FTP  servers  on  these machines to include commands       which deal with the creation of  directories.   Since  there  are       other  hosts  on  the  ARPA net which have tree-like directories,       including Tops-20 and  Multics,  we  have  tried  to  make  these       commands as general as possible. 
  14.  
  15.       We have added four commands to our server: 
  16.  
  17.  
  18.  
  19.        XMKD child              Make a directory with the name "child". 
  20.  
  21.        XRMD child              Remove the directory with the name "child". 
  22.  
  23.        XPWD              Print the current working directory. 
  24.  
  25.        XCUP              Change to the parent of  the  current  working              directory. 
  26.  
  27.  
  28.  
  29.       The  "child"  argument  should  be   created   (removed)   as   a       subdirectory of the current working directory, unless the "child"       string contains sufficient information to  specify  otherwise  to       the server, e.g., "child" is an absolute pathname (in Multics and       Unix), or child is something like "<abso.lute.path>" to Tops-20. 
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.       RFC 775          Directory oriented FTP commands        Page 2 
  45.  
  46.  
  47.  
  48.                  REPLY CODES 
  49.  
  50.       The XCUP command is a special case of XCWD, and  is  included  to       simplify   the   implementation   of  programs  for  transferring       directory  trees  between  operating  systems  having   different       syntaxes for naming the parent directory.  Therefore we recommend       that the reply codes for XCUP be identical to the reply codes  of       XCWD. 
  51.  
  52.       Similarly,  we  recommend  that  the  reply  codes  for  XRMD  be       identical to the reply codes for its file analogue, DELE. 
  53.  
  54.       The reply codes for XMKD, however, are a bit more complicated.  A       freshly created directory will probably be the object of a future       XCWD command.  Unfortunately, the argument to XMKD may not always       be  a suitable argument for XCWD.  This is the case, for example,       when a  Tops-20  subdirectory  is  created  by  giving  just  the       subdirectory  name.   That  is,  with  a  Tops-20 server FTP, the       command sequence 
  55.  
  56.                  XMKD MYDIR                  XCWD MYDIR 
  57.  
  58.       will fail.  The new directory may only  be  referred  to  by  its       "absolute"  name;  e.g.,  if  the  XMKD command above were issued       while  connected  to   the   directory   <DFRANKLIN>,   the   new       subdirectory   could   only   be   referred   to   by   the  name       <DFRANKLIN.MYDIR>. 
  59.  
  60.       Even on Unix and Multics, however, the argument given to XMKD may       not  be  suitable.   If  it  is a "relative" pathname (that is, a       pathname which is interpreted relative to the current directory),       the  user would need to be in the same current directory in order       to reach the subdirectory.  Depending on  the  application,  this       may be inconvenient.  It is not very robust in any case. 
  61.  
  62.       To solve these problems, upon successful completion  of  an  XMKD       command, the server should return a line of the form: 
  63.  
  64.            257<space>"<directory-name>"<space><commentary> 
  65.  
  66.       That is, the server will tell the user what string  to  use  when       referring  to  the  created  directory.   The  directory name can       contain any character; embedded double-quotes should  be  escaped 
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.       RFC 775          Directory oriented FTP commands        Page 3 
  80.  
  81.  
  82.  
  83.       by double-quotes (the "quote-doubling" convention). 
  84.  
  85.       For example, a  user  connects  to  the  directory  /usr/dm,  and       creates a subdirectory, named child: 
  86.  
  87.           XCWD /usr/dm           200 directory changed to /usr/dm           XMKD child           257 "/usr/dm/child" directory created 
  88.  
  89.       An example with an embedded double quote: 
  90.  
  91.           XMKD foo"bar           257 "/usr/dm/foo""bar" directory created           XCWD /usr/dm/foo"bar           200 directory changed to /usr/dm/foo"bar 
  92.  
  93.       We  feel that the prior existence of a subdirectory with the same       name  should be interpreted as an error, and have implemented our       server to give an "access denied" error reply in  that case. 
  94.  
  95.           CWD /usr/dm           200 directory changed to /usr/dm           XMKD child           521-"/usr/dm/child" directory already exists;           521    taking no action. 
  96.  
  97.       We recommend that failure replies for XMKD be  analogous  to  its       file  creating  cousin, STOR.  Also, we recommend that an "access       denied" return be given if a file name with the same name as  the       subdirectory  will conflict with the creation of the subdirectory       (this is a problem on Unix, but shouldn't be one on Tops-20). 
  98.  
  99.       Essentially because the XPWD command returns  the  same  type  of       information  as  the successful XMKD command, we have implemented       the successful XPWD command to use the 257 reply code as well. 
  100.  
  101.       We present here a summary of the proposed  reply  codes  for  the       experimental  commands.   The codes given outside parentheses are       consistent with RFC 691; i.e.,  are  for  the  old  protocol,  as       updated  by  the  suggestions  in  that RFC.  The server and user       programs at BBN-Unix currently implement these codes.  Reply  257       is  the  only new code.  Reply codes shown within parentheses are       for the "new" ftp protocol, most recently documented in RFC  765. 
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.       RFC 775          Directory oriented FTP commands        Page 4 
  115.  
  116.  
  117.  
  118.       The invented code for the RFC 765 Protocol is 251. 
  119.  
  120.       Command: 
  121.  
  122.           reply code      explanation 
  123.  
  124.        XMKD                    create directory 
  125.  
  126.           257 (251) "pathname" created           521 (450) "pathname" already exists           506 (502) action not implemented           521 (450) access denied           550 (501) bad pathname syntax or ambiguous           425 (451) random file system error 
  127.  
  128.       XCUP                    change directory to                       superior of current one 
  129.  
  130.           200 (200) working directory changed           506 (502) action not implemented           507 (551) no superior directory           521 (450) access denied           425 (451) random file system error 
  131.  
  132.       XRMD                    remove directory 
  133.  
  134.           224 (250) deleted ok           506 (502) action not implemented           521 (450) access denied           550 (501) bad pathname syntax or ambiguous           425 (451) random file system error 
  135.  
  136.       XPWD                    print current working                       directory 
  137.  
  138.           257 (251) "pathname"           425 (451) random file system error           506 (502) action not implemented 
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.       RFC 775          Directory oriented FTP commands        Page 5 
  156.  
  157.                   SUBTLETIES 
  158.  
  159.       Because these  commands  will  be  most  useful  in  transferring       subtrees  from  one  machine  to another, we must stress the fact       that the argument to XMKD is to be interpreted as a sub-directory       of  the  current  working  directory,  unless  it contains enough       information for  the  destination  host  to  tell  otherwise.   A       hypothetical example of its use in the Tops-20 world: 
  160.  
  161.           XCWD <some.where>           200 Working directory changed           XMKD overrainbow           257 "<some.where.overrainbow>" directory created           XCWD overrainbow           431 No such directory           XCWD <some.where.overrainbow>           200 Working directory changed 
  162.  
  163.           XCWD <some.where>           200 Working directory changed to <some.where>           XMKD <unambiguous>           257 "<unambiguous>" directory created           XCWD <unambiguous> 
  164.  
  165.       Note that the first example results  in  a  subdirectory  of  the       connected  directory.   In  contrast,  the argument in the second       example contains enough information for Tops-20 to tell that  the       <unambiguous> directory is a top-level directory.  Note also that       in  the  first  example  the  user  "violated"  the  protocol  by       attempting  to  access  the freshly created directory with a name       other than the one returned  by  Tops-20.   Problems  could  have       resulted  in this case had there been an <overrainbow> directory;       this is an ambiguity inherent in  some  Tops-20  implementations.       Similar  considerations  apply to the XRMD command.  The point is       this: except where to do so would violate  a  host's  conventions       for  denoting relative versus absolute pathnames, the host should       treat  the  operands  of  the   XMKD   and   XRMD   commands   as       subdirectories.   The  257  reply to the XMKD command must always       contain the absolute pathname of the created directory. 
  166.  
  167.  
  168.  
  169.                  References 
  170.  
  171.       File Transfer Protocol (RFC 765), Postel,  J., June 1980 
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.       RFC 775          Directory oriented FTP commands        Page 6 
  183.  
  184.  
  185.  
  186.       CWD Command of FTP (RFC 697), Lieb, J., NIC 32963, 14 July 1975       One More Try on the FTP (RFC 691), Harvey, B., NIC 32700, 28  May       1975       Revised FTP Reply Codes (RFC 640),  Postel,  J.,  N.  Neigus,  K.       Pogran, NIC 30843, 5 June 1974       File Transfer Protocol (RFC 542), Neigus, N., NIC 17759,  12 July       1977 
  187.  
  188.