home *** CD-ROM | disk | FTP | other *** search
/ ftp.microsoft.com / 2002-07-02_ftp.microsoft.com.zip / developr / drg / CIFS / XEXTNP.TXT < prev   
Text File  |  1990-11-30  |  96KB  |  3,247 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                  OOOOppppeeeennnnNNNNEEEETTTT////MMMMiiiiccccrrrroooossssoooofffftttt NNNNeeeettttwwwwoooorrrrkkkkssss
  11.  
  12.               FFFFIIIILLLLEEEE SSSSHHHHAAAARRRRIIIINNNNGGGG PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLL EEEEXXXXTTTTEEEENNNNSSSSIIIIOOOONNNNSSSS
  13.  
  14.  
  15.                   IIIINNNNTTTTEEEELLLL PPPPaaaarrrrtttt NNNNuuuummmmbbbbeeeerrrr 111133338888444444447777
  16.  
  17.  
  18.  
  19.                         VVVVeeeerrrrssssiiiioooonnnn 1111....9999
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.                      SSSSeeeepppptttteeeemmmmbbbbeeeerrrr 5555,,,, 1111999988886666
  27.  
  28.  
  29.                      Intel Corporation
  30.                    Microsoft Corporation
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. Copyright Microsoft Corp., 1985              Intel PN 138447
  65.  
  66.  
  67.  
  68.  
  69.  
  70. File Sharing Protocol Extensions- 2 -          September 5, 1986
  71.  
  72.  
  73. _1.  _I_N_T_R_O_D_U_C_T_I_O_N
  74.  
  75. This   document    defines    the    extensions    to    the
  76. OpenNET/Microsoft  Networks  File Sharing Protocol (Intel PN
  77. 136329-001) that are required to support  Operating  Systems
  78. richer  in  function  than  MS-DOS, and with user based file
  79. protection schemes.  The primary goal of these extensions is
  80. to  allow fully transparent access to remote files for UNIX.
  81. However, they are not intended to be specific to  UNIX.   It
  82. is  anticipated  that other Operating Systems will have many
  83. similar requirements and that they will use  the  same  ser-
  84. vices and protocols to meet them.
  85.  
  86. This extension, when combined with the core protocol, allows
  87. all  file  oriented UNIX functions to be performed on remote
  88. files.
  89.  
  90. The extended protocol defined in this document  is  selected
  91. by  the dialect string "xenix1.1" in the core protocol nego-
  92. tiate command.
  93.  
  94. _2.  _M_E_S_S_A_G_E _F_O_R_M_A_T
  95.  
  96. All messages sent while using the  extended  protocol  (both
  97. the  core  messages used and the additional messages defined
  98. in this document) will have the following format.
  99.  
  100. BYTE   smb_idf[4];   /*contains 0xFF,'SMB' */
  101. BYTE   smb_com;      /*command code */
  102. BYTE   smb_rcls;     /*error class */
  103. BYTE   smb_reh;      /*reserved for future */
  104. WORD   smb_err;      /*error code */
  105. BYTE   smb_flg;      /*flags */
  106. WORD   smb_res[6];   /*reserved for future */
  107. WORD   smb_gid;      /*unauthenticated group id */
  108. WORD   smb_tid;      /*authenticated user/group */
  109. WORD   smb_pid;      /*caller's process id */
  110. WORD   smb_uid;      /*unauthenticated user id */
  111. WORD   smb_mid;      /*multiplex id */
  112. BYTE   smb_wct;      /*count of 16-bit words that follow */
  113. WORD   smb_vwv[];    /*variable number of 16-bit words */
  114. WORD   smb_bcc;      /*count of bytes that follow */
  115. BYTE   smb_buf[];    /*variable number of bytes */
  116.  
  117.  
  118. NOTES:
  119.  
  120. 1.   smb.flg can have the following values:
  121.  
  122.      bit0
  123.                When on, all pathnames in  the  protocol  must  be
  124.                treated  as caseless.  When off, the pathnames are
  125.                case sensitive.
  126.      bits1-7   reserved (MBZ)
  127.  
  128.  
  129.  
  130.  
  131. Copyright Microsoft Corp., 1985              Intel PN 138447
  132.  
  133.  
  134.  
  135.  
  136.  
  137. File Sharing Protocol Extensions- 3 -          September 5, 1986
  138.  
  139.  
  140. 2.   smb_uid is the user identifier.  It will be used by the
  141.      server when determining file access permissions.  It is
  142.      used only when the TID is hex  FFFF.   A  null  UID  is
  143.      indicated by a value of hex FFFE.
  144.  
  145. 3.   smb_gid is the group identifier for the user identified
  146.      by  smb_uid.  It will be used by the server when deter-
  147.      mining file access permissions.  It is used  only  when
  148.      TID is hex FFFF.  A null GID is indicated by a value of
  149.      hex FFFE.
  150.  
  151. 4.   The semantics of smb_tid when interfacing with a server
  152.      with  user based file protection are outlined here.  In
  153.      this environment the tid represents an instance  of  an
  154.      authenticated  user.   smb_tid  must  either  contain a
  155.      valid tid, or contain hex  FFFF  to  indicate  that  an
  156.      unauthenticated  user  ID  and group ID are to be used.
  157.      If a server chooses to accept a request of this  latter
  158.      type,  the  user ID will be passed in the smb_uid field
  159.      and the group ID will be in the smb_gid field.
  160.  
  161. 5.   As in the core, smb_pid uniquely identifies a  consumer
  162.      process.  Consumers inform servers of the creation of a
  163.      new process either with a fork command (for  a  process
  164.      that  is  a  copy of an existing process), or by simply
  165.      introducing a  new  PID  into  the  dialogue  (for  new
  166.      processes).   Process  destruction  must  be explicitly
  167.      indicated to the server.  The "Process Exit" command is
  168.      used for this.
  169.  
  170. 6.   Systems using the extended protocol will  typically  be
  171.      multi-tasked, multi-user systems, therefore a multiplex
  172.      ID (smb_mid) is added to allow multiplexing the  single
  173.      consumer/server   VC   among  the  consumer's  multiple
  174.      processes.  The consumer is  responsible  for  ensuring
  175.      that  every  request includes a system unique MID.  The
  176.      server is responsible for ensuring that every  response
  177.      contains the same MID as its request.  The consumer may
  178.      then use the MID for associating requests and responses
  179.      and  may have any number of requests outstanding at any
  180.      time on any file server VC.
  181.  
  182. 7.   The extended protocol enhances  the  semantics  of  the
  183.      pathname.  Two pathname component delimiters are recog-
  184.      nized -- "\" and "/" -- and a second pathname format is
  185.      added  --  one  incorporating a bind id (BID).  The BID
  186.      identifies a location in  a  server's  file  hierarchy.
  187.      Pathnames  associated  with  a  BID will be relative to
  188.      that BID, i.e., a full pathname must not be passed with
  189.      a  BID, only that portion of the pathname not addressed
  190.      by the BID.  The pathname portion may or may  not  com-
  191.      mence  with  a  delimiter.  BIDs may be used to qualify
  192.      any pathname.
  193.  
  194.  
  195.  
  196.  
  197. Copyright Microsoft Corp., 1985              Intel PN 138447
  198.  
  199.  
  200.  
  201.  
  202.  
  203. File Sharing Protocol Extensions- 4 -          September 5, 1986
  204.  
  205.  
  206.      A pathname of this format is indicated by the  presence
  207.      of  hex  FF in the first byte of the pathname.  In this
  208.      case the following two bytes are the BID and the  path-
  209.      name  portion commences in the fourth byte.  A null BID
  210.      is indicated by a value of -1 (hex FFFF) and is exactly
  211.      equivalent to no BID present in the pathname.  BIDs are
  212.      completely independent of PIDs and are thus  unaffected
  213.      by  the  termination  of  processes.  BIDs will only be
  214.      destroyed  when  an  appropriate  UNBIND   command   is
  215.      received.
  216.  
  217.      All possible combinations of valid and  null  BIDs  and
  218.      pathnames  are  valid.   A  null BID indicates that the
  219.      pathname is relative to  the  server's  root.   A  null
  220.      pathname  indicates  that the BID references the target
  221.      file directly.  A null BID and a null pathname indicate
  222.      the  server's root.  A valid BID and valid pathname are
  223.      combined to indicate the  target  file.   The  pathname
  224.      portion  may  not  be  null  in  commands  that require
  225.      specific access permissions on the target file's parent
  226.      (e.g., Delete Directory and Rename directory).
  227.  
  228.      In addition two special pathname  component  values  --
  229.      "."  and ".." -- must be recognized.  There may be mul-
  230.      tiple of these components in a path name, but they must
  231.      all  precede  all  "non-dot" components.  They have the
  232.      standard UNIX meanings -- "." points to its own  direc-
  233.      tory, ".." points to its directory's parent.  Hence the
  234.      path "BID/." is identical to "BIDnull",  and  the  path
  235.      "BID/.." identifies the directory containing the direc-
  236.      tory identified by "BID".
  237.  
  238.  
  239. These semantic changes apply to all "core" requests used  by
  240. the  extended protocol.  Where there are additional changes,
  241. they are documented with the new  requests.   The  following
  242. core  requests are included in the extended protocol without
  243. further changes.
  244.  
  245.         TREE CONNECT
  246.         TREE DISCONNECT
  247.         CLOSE FILE
  248.         FLUSH FILE
  249.         WRITE
  250.         SEEK
  251.         RENAME FILE
  252.         CREATE TEMPORARY FILE
  253.         PROCESS EXIT
  254.         CHECK PATH
  255.         GET SERVER ATTRIBUTES
  256.  
  257. Support of the following core requests within  the  extended
  258. protocol  is not mandatory.  They may be rejected as invalid
  259. commands.
  260.  
  261.  
  262.  
  263. Copyright Microsoft Corp., 1985              Intel PN 138447
  264.  
  265.  
  266.  
  267.  
  268.  
  269. File Sharing Protocol Extensions- 5 -          September 5, 1986
  270.  
  271.  
  272.  
  273.         FILE_SEARCH
  274.         CREATE PRINT FILE
  275.         WRITE PRINT FILE
  276.         CLOSE PRINT FILE
  277.         GET PRINT QUEUE
  278.         NEGOTIATE (always performed within the core protocol)
  279.  
  280.  
  281. _3.  _A_R_C_H_I_T_E_C_T_U_R_A_L _M_O_D_E_L
  282.  
  283. _3._1.  _U_S_E_R _A_D_M_I_N_I_S_T_R_A_T_I_O_N
  284.  
  285. Systems using the Extended File Sharing Protocol will  typi-
  286. cally  support  user  based protection models.  Two forms of
  287. user administration are accommodated -- consumer  based  and
  288. server  based.   A consumer based system is one in which the
  289. file servers depend on, and trust, the  consumer  processors
  290. to  authenticate users.  In a server based system the server
  291. processors authenticate their own  users.   Essentially  the
  292. difference  is  that  in a consumer based approach the LAN's
  293. security envelope is  drawn  around  the  LAN  as  a  single
  294. entity,  whereas  in  the  server  based approach the LAN is
  295. viewed as a collection of autonomous systems each  with  its
  296. own security envelope.
  297.  
  298. If the server accepts consumer  based  authentication  on  a
  299. given consumer/server connection, it may still accept server
  300. based authentication requests across that connection.   How-
  301. ever,  if the server requires server based authentication on
  302. a connection, it cannot accept requests  based  on  consumer
  303. performed authentications on that connection.
  304.  
  305. The following paragraphs give a brief overview  of  the  two
  306. schemes.
  307.  
  308. 1.   Server Based.
  309.  
  310.      The server based approach is similar  to  the  consumer
  311.      authentication scheme used by the core protocol.  It is
  312.      based on the principle  that  the  consumer  processors
  313.      cannot  be  trusted  to authenticate users.  It assumes
  314.      that the LAN connects autonomous systems that are  wil-
  315.      ling to make some subset of their local files available
  316.      to remote users.
  317.  
  318.      In this environment it is necessary for the consumer to
  319.      log  on  to every server which the user intends to use.
  320.      Each server therefore maintains a list of  valid  users
  321.      and  verifies  every  access  by  these  users.  It can
  322.      therefore accept  any  and  all  transport  connections
  323.      offered.
  324.  
  325.      When a user logs on (or is logged on by his  OS)  to  a
  326.  
  327.  
  328.  
  329. Copyright Microsoft Corp., 1985              Intel PN 138447
  330.  
  331.  
  332.  
  333.  
  334.  
  335. File Sharing Protocol Extensions- 6 -          September 5, 1986
  336.  
  337.  
  338.      server  he  receives  an  identifier  from that server.
  339.      This server unique ID is used to both identify the user
  340.      on all subsequent requests and prove to the server that
  341.      this user has been authenticated. The  consumer  system
  342.      must  remember  the identifier for each of its users at
  343.      each server that they use and determine and include the
  344.      appropriate  identifier  for  all network file accesses
  345.      made.
  346.  
  347.      The identifier is therefore associated with a  particu-
  348.      lar  user  ID  and  group  ID  on both the consumer and
  349.      server sides and this mapping must be synchronized.
  350.  
  351.      The following environments  exist  in  a  server  based
  352.      environment:
  353.  
  354.      a)   Virtual Circuit Environment.  This consists of one
  355.           VC  established  between  a  consumer  system  and
  356.           server system.  A VC  is  formed  using  transport
  357.           services.
  358.  
  359.      b)   Logon Environment.  This is represented by a  Tree
  360.           ID  (TID).  A TID uniquely identifies an authenti-
  361.           cated user (UID+GID) within a VC.  The  TID  field
  362.           in  a  message  must  always  contain  a valid TID
  363.           (except for Tree Connect).
  364.  
  365.      c)   Bind Environment.  This is represented by  a  bind
  366.           ID  (BID).   A  BID  identifies  a location in the
  367.           server's file hierarchy.  It is  unique  within  a
  368.           given VC environment.
  369.  
  370.      d)   Process Environment.  This  is  represented  by  a
  371.           process  ID  (PID).   A  PID uniquely identifies a
  372.           consumer process within a given VC environment.
  373.  
  374.      e)   File Environment.  This is represented by  a  File
  375.           Handle  (FID).   A FID identifies an open file and
  376.           is unique within a given VC+PID environment.  FIDs
  377.           are  obtained  by  the  Open, Create and Fork com-
  378.           mands.
  379.  
  380.      When one  of  these  environments  is  terminated,  all
  381.      environments  contained  within  it will be terminated.
  382.      For example, if a VC is terminated all PIDs, TIDs, BIDs
  383.      and  FIDs  within  it  will be invalidated.  When a PID
  384.      terminates all FIDs within it are closed.
  385.  
  386.  
  387. 2.   Consumer Based.
  388.  
  389.      In this approach a LAN (or "logical LAN") is viewed  as
  390.      a single system.  There is a single logical file system
  391.      and a single user identity for each user throughout the
  392.  
  393.  
  394.  
  395. Copyright Microsoft Corp., 1985              Intel PN 138447
  396.  
  397.  
  398.  
  399.  
  400.  
  401. File Sharing Protocol Extensions- 7 -          September 5, 1986
  402.  
  403.  
  404.      LAN.   When  a user logs on to a participating consumer
  405.      system, that system verifies his identity  and  obtains
  406.      his  user  ID.  All subsequent file accesses (local and
  407.      remote) use this user ID to identify the user.
  408.  
  409.      There is no user "log on" to a  server  processor,  the
  410.      server simply accepts requests from valid consumers and
  411.      uses the user ID  and  group  ID  presented  with  each
  412.      request  to  determine  that user's file access permis-
  413.      sions.
  414.  
  415.      The server can authenticate consumer systems to  ensure
  416.      that only trusted consumers are allowed to participate.
  417.  
  418.      The key to this scheme  is  that  it  is  the  consumer
  419.      "machine"  that  is  validated by the server.  Once the
  420.      consumer is authenticated the server  accepts  all  the
  421.      user  IDs  it  receives as authenticated, but may still
  422.      select which ones it will perform work for.
  423.  
  424.      The following environments exist in  a  consumer  based
  425.      environment:
  426.  
  427.      a)   Virtual Circuit Environment.  This consists of one
  428.           VC  established  between  a  consumer  system  and
  429.           server system.  A VC  is  formed  using  transport
  430.           services.
  431.  
  432.      b)   User Environment.  This is represented by  a  user
  433.           ID (UID) and a group ID (GID).  A UID+GID uniquely
  434.           identifies a user within an administrative  domain
  435.           (or "Logical LAN").
  436.  
  437.      c)   Bind Environment.  This is represented by  a  bind
  438.           ID  (BID).   A  BID  identifies  a location in the
  439.           server's file hierarchy.  It is  unique  within  a
  440.           given VC environment.
  441.  
  442.      d)   Process Environment.  This  is  represented  by  a
  443.           process  ID  (PID).   A  PID uniquely identifies a
  444.           consumer process within a given VC environment.
  445.  
  446.      e)   File Environment.  This is represented by  a  File
  447.           Handle  (FID).   A FID identifies an open file and
  448.           is unique within a given VC+PID environment.  FIDs
  449.           are  obtained  by  the  Open, Create and Fork com-
  450.           mands.
  451.  
  452.      When one  of  these  environments  is  terminated,  all
  453.      environments  contained  within  it will be terminated.
  454.      For example, if a VC is terminated all PIDs,  BIDs  and
  455.      FIDs  within  it  will be invalidated.  When a PID ter-
  456.      minates all FIDs within it are closed.
  457.  
  458.  
  459.  
  460.  
  461. Copyright Microsoft Corp., 1985              Intel PN 138447
  462.  
  463.  
  464.  
  465.  
  466.  
  467. File Sharing Protocol Extensions- 8 -          September 5, 1986
  468.  
  469.  
  470.      Generally it will only  be  practical  for  a  node  to
  471.      belong  to  one consumer based network.  Connections to
  472.      servers of other networks will typically use the server
  473.      based user authentication technique.
  474.  
  475.      Use of the consumer based system is indicated by a  tid
  476.      of  hex FFFF.  In this case, if the request is accepted
  477.      by the server, the user ID and group  ID  are  obtained
  478.      from the smb_uid and smb_gid fields.
  479.  
  480. _3._2.  _F_I_L_E _P_R_O_T_E_C_T_I_O_N
  481.  
  482. The file protection model  enforced  by  the  server  is  an
  483. expanded  version  of  the  standard  Unix protection model.
  484. Files may have specific access permissions  for  the  file's
  485. owner,  three  specified users or groups, and a fifth set of
  486. permissions for at least all users and groups not covered by
  487. the first four.   Xenix will always use the first user/group
  488. set of permissions to indicate the  file's  group's  permis-
  489. sions, the second and third sets will always be null.
  490.  
  491. The following permissions will be supported for each set  of
  492. permissions  (owner,  user/group1,  user/group2, user/group3
  493. and other).
  494.  
  495. _R_E_A_D
  496.  
  497. READ provides read access to the file.   A  user  must  have
  498. this access in order to open the file for read or update.
  499.  
  500. Read permission may be given to the owner of the file, three
  501. other users or groups, and all other users.
  502.  
  503. Support of READ permission is mandatory.
  504.  
  505. _W_R_I_T_E
  506.  
  507. WRITE provides write access to the file.  A user  must  have
  508. this  access  to  a  data file in order to open the file for
  509. write or update, or to create (truncate) an  existing  file.
  510. Write  permission  is  required  to  a directory in order to
  511. create new files  or  destroy  existing  files  within  that
  512. directory.   Write permission is required to both the source
  513. and destination directories when renaming a file.
  514.  
  515. Write permission may be given to  the  owner  of  the  file,
  516. three other users or groups, and to all other users.
  517.  
  518. Support of WRITE permission is mandatory.
  519.  
  520. _S_E_A_R_C_H
  521.  
  522. SEARCH allows a user to traverse the directory.   This  per-
  523. mission may only be given on a directory.  Search permission
  524.  
  525.  
  526.  
  527. Copyright Microsoft Corp., 1985              Intel PN 138447
  528.  
  529.  
  530.  
  531.  
  532.  
  533. File Sharing Protocol Extensions- 9 -          September 5, 1986
  534.  
  535.  
  536. may be given to the owner  of  the  directory,  three  other
  537. users or groups, and to all other users.
  538.  
  539. Support for SEARCH is optional.  Where SEARCH  is  not  sup-
  540. ported  it  will  appear  to  be set ON for all users in all
  541. directories.  Any attempt to reset the SEARCH attribute will
  542. be rejected.
  543.  
  544. _E_X_E_C_U_T_E
  545.  
  546. EXECUTE allows a user to execute the file.  This  permission
  547. may only be given on a data file.  Execute permission may be
  548. given to the owner of the file, three other users or groups,
  549. and to all other users.
  550.  
  551. Support of EXECUTE is optional.  Where EXECUTE is  not  sup-
  552. ported  it  must  be  associated  with READ in the following
  553. manner.  EXECUTE will be always set to  the  same  value  as
  554. READ.   Any attempt to set EXECUTE to a value different from
  555. the READ attribute will be rejected.
  556.  
  557. The EXECUTE permission  is  only  recorded  by  the  server,
  558. enforcement is the consumer system's responsibility.
  559.  
  560. _3._2._1.  _R_E_P_R_E_S_E_N_T_A_T_I_O_N
  561.  
  562. File access permissions have the following representation in
  563. all protocol messages where they appear.
  564.  
  565. The access permissions -- READ, WRITE and SEARCH/EXECUTE  --
  566. are  held  for the file owner, three users or groups and all
  567. other users. The four sets of permissions are carried  in  a
  568. single  word with the following format (bit0 is least signi-
  569. ficant bit):
  570.  
  571.         bit0  -  OTHER_SEARCH/EXECUTE
  572.         bit1  -  OTHER_WRITE
  573.         bit2  -  OTHER_READ
  574.         bit3  -  USER/GROUP1_SEARCH/EXECUTE
  575.         bit4  -  USER/GROUP1_WRITE
  576.         bit5  -  USER/GROUP1_READ
  577.         bit6  -  OWNER_SEARCH/EXECUTE
  578.         bit7  -  OWNER_WRITE
  579.         bit8  -  OWNER_READ
  580.         bit9  -  USER/GROUP2_SEARCH/EXECUTE
  581.         bit10 -  USER/GROUP2_WRITE
  582.         bit11 -  USER/GROUP2_READ
  583.         bit12 -  USER/GROUP3_SEARCH/EXECUTE
  584.         bit13 -  USER/GROUP3_WRITE
  585.         bit14 -  USER/GROUP3_READ
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593. Copyright Microsoft Corp., 1985              Intel PN 138447
  594.  
  595.  
  596.  
  597.  
  598.  
  599. File Sharing Protocol Extensions- 10 -          September 5, 1986
  600.  
  601.  
  602. _3._3.  _F_I_L_E _A_T_T_R_I_B_U_T_E_S
  603.  
  604. The Extended File Sharing Protocol  may  support  additional
  605. attributes  to those specified in the Core File Sharing Pro-
  606. tocol.  The following attributes will be  supported  by  the
  607. Xenix implementation.
  608.  
  609. _S_T_I_C_K_Y
  610.  
  611. STICKY indicates that a file should be retained  in  execut-
  612. able  format  to prevent the overhead of re-loading it every
  613. time it is used.
  614.  
  615. Support for STICKY is optional.  Where it is  not  supported
  616. attempts  to  set  it  will  be rejected, and it will always
  617. appear to be set off.
  618.  
  619. The STICKY  permission  is  only  recorded  by  the  server,
  620. enforcement is the consumer system's responsibility.
  621.  
  622. _S_E_T_U_I_D
  623.  
  624. SETUID indicates that the file must  be  executed  with  the
  625. process's user ID changed to the file's owner's user ID.
  626.  
  627. Support of SETUID is optional.  Where it  is  not  supported
  628. attempts  to  set  it  will  be rejected, and it will always
  629. appear to be set off.
  630.  
  631. The SETUID  permission  is  only  recorded  by  the  server,
  632. enforcement is the consumer system's responsibility.
  633.  
  634. _S_E_T_G_I_D
  635.  
  636. SETGID indicates that the file must  be  executed  with  the
  637. process's group ID changed to the file's group ID.
  638.  
  639. Support of SETGID is optional.  Where it  is  not  supported
  640. attempts  to  set  it  will  be rejected, and it will always
  641. appear to be set off.
  642.  
  643. The SETGID  permission  is  only  recorded  by  the  server,
  644. enforcement is the consumer system's resonsibility.
  645.  
  646. _3._3._1.  _R_E_P_R_E_S_E_N_T_A_T_I_O_N
  647.  
  648. The file attributes STICKY,  SETUID  and  SETGID  are  Xenix
  649. specific  and  are  carried  in  the smb_attribute word.  On
  650. Extended Protocol servers the attribute field has  the  fol-
  651. lowing format (bit0 is least significant bit).
  652.  
  653.      Generic Attributes:
  654.      bit4    - DIRECTORY
  655.  
  656.  
  657.  
  658.  
  659. Copyright Microsoft Corp., 1985              Intel PN 138447
  660.  
  661.  
  662.  
  663.  
  664.  
  665. File Sharing Protocol Extensions- 11 -          September 5, 1986
  666.  
  667.  
  668.      Xenix Attributes:
  669.      bits0-3    - reserved (MBZ)
  670.      bits5-8    - reserved (MBZ)
  671.      bit9       - STICKY
  672.      bit10      - SETGID
  673.      bit11      - SETUID
  674.      bit12-15   - File Type (support is optional)
  675.                      If it is not supported MBZ
  676.                      1 - FIFO (named pipe)
  677.                      2 - Character Special
  678.                      3 - Multiplexed Character
  679.                      4 - Directory
  680.                      5 - Semaphore/Message System
  681.                      6 - Block Special
  682.                      7 - Multiplexed Block
  683.                      8 - Regular
  684.                     10 - Symbolic Link
  685.  
  686.  
  687. _4.  _E_X_T_E_N_D_E_D _P_R_O_T_O_C_O_L
  688.  
  689. The format of enhanced and new commands is defined  commenc-
  690. ing  at  the  smb_wct  field.  All messages will include the
  691. standard header defined in section 1.0.  When  an  error  is
  692. encountered  a  server  may choose to return only the header
  693. portion of the response (i.e., smb_wct and smb_bcc both con-
  694. tain zero).
  695.  
  696. _4._1.  _C_O_R_E _S_E_R_V_I_C_E _E_N_H_A_N_C_E_M_E_N_T_S
  697.  
  698. The extended protocol includes  functional  enhancements  to
  699. some  core  services, and these are defined in this section.
  700. Enhancements to services  can  only  add  to  the  service's
  701. existing  semantics,  i.e., additional values for parameters
  702. may be introduced and new parameters added,  but  parameters
  703. cannot  be  removed  or  used  for a different purpose.  All
  704. "core" requests must continue to function with the  enhanced
  705. command.   If  these  rules cannot be followed a new command
  706. must be defined.
  707.  
  708. _4._1._1.  _O_P_E_N
  709.  
  710. No Message Format Changes
  711.  
  712. Service Enhancement:
  713.  
  714. The open command's scope is extended to include  directories
  715. as  well  as  data files.  A directory must be opened before
  716. the Read command can be used with it.   File  Writes,  Locks
  717. and  Unlocks  are  never allowed on directories. Attempts to
  718. open directories in modes  other  than  read/deny_none  will
  719. fail.
  720.  
  721. The "mode" field for open, referenced as  r/w/share  in  the
  722.  
  723.  
  724.  
  725. Copyright Microsoft Corp., 1985              Intel PN 138447
  726.  
  727.  
  728.  
  729.  
  730.  
  731. File Sharing Protocol Extensions- 12 -          September 5, 1986
  732.  
  733.  
  734. core  protocol  document,  is enhanced to allow open without
  735. delay, append and forced write modes for the  file,  and  to
  736. allow an open for execute.  Systems that do not support exe-
  737. cute mode should treat the execute  mode  as  equivalent  to
  738. read mode.  This word has the following format:
  739.  
  740.         smb_mode format:  ---- -das rxxx yyyy
  741.  
  742.  
  743.  
  744. where:      d   -   if open cannot be completed immediately, return with error (optional).
  745.             a   -   open file in append mode (optional).
  746.             s   -   complete writes before returning (optional).
  747.             r   -   reserved.
  748.           xxx   -   0 -- MS-DOS compatibility mode.
  749.                     1 -- Deny read/write/execute (exclusive).
  750.                     2 -- Deny write.
  751.                     3 -- Deny read/execute (optional).
  752.                     4 -- Deny none.
  753.          yyyy   -   0 -- Open for reading.
  754.                     1 -- Open for writing.
  755.                     2 -- Open for reading and writing.
  756.                     3 -- Open for execute
  757.  
  758.  
  759. The following additional errors may be generated by Open.
  760.  
  761.         Error Class ERRDOS
  762.  
  763.           ERRbadfiletype
  764.           ERRbadaccess
  765.           <implementation specific>
  766.  
  767.  
  768.         Error Class ERRSRV
  769.  
  770.           ERRpathsyntax
  771.           ERRbadbid
  772.           <implementation specific>
  773.  
  774.  
  775.         Error Class ERRHRD
  776.  
  777.           <implementation specific>
  778.  
  779.  
  780.         Error Class ERRXOS
  781.  
  782.           <implementation specific>
  783.  
  784.  
  785.  
  786.  
  787. Copyright Microsoft Corp., 1985              Intel PN 138447
  788.  
  789.  
  790.  
  791.  
  792.  
  793. File Sharing Protocol Extensions- 13 -          September 5, 1986
  794.  
  795.  
  796. _4._1._2.  _D_E_L_E_T_E
  797.  
  798. No Message Format Changes
  799.  
  800. Service Enhancement:
  801.  
  802. When used within the extended protocol, Delete will not des-
  803. troy  the  contents of a file until all FIDs associated with
  804. it have been closed and all its names deleted.  When  Delete
  805. references  a file with active FIDs or other names, only the
  806. referenced name is destroyed.
  807.  
  808. The following additional errors may be generated by Delete.
  809.  
  810.         Error Class ERRDOS
  811.  
  812.           ERRbadfiletype
  813.           <implementation specific>
  814.  
  815.  
  816.         Error Class ERRSRV
  817.  
  818.           ERRpathsyntax
  819.           ERRbadbid
  820.           <implementation specific>
  821.  
  822.  
  823.         Error Class ERRHRD
  824.  
  825.           <implementation specific>
  826.  
  827.  
  828.         Error Class ERRXOS
  829.  
  830.           EREADONLY
  831.           <implementation specific>
  832.  
  833.  
  834. _4._1._3.  _D_E_L_E_T_E _D_I_R_E_C_T_O_R_Y
  835.  
  836. No Message Format Changes
  837.  
  838. Service Enhancement:
  839.  
  840. When used within the  extended  protocol,  Delete  Directory
  841. will  not  destroy  a  directory until it is empty, all FIDs
  842. associated with it  have  been  closed  and  all  its  names
  843. deleted.   When Delete Directory references a directory that
  844. has active FIDs or other names, only the referenced name  is
  845. destroyed.   An attempt to delete a non-empty directory will
  846. be rejected.
  847.  
  848. The following additional errors may be generated  by  Delete
  849. Directory.
  850.  
  851.  
  852.  
  853. Copyright Microsoft Corp., 1985              Intel PN 138447
  854.  
  855.  
  856.  
  857.  
  858.  
  859. File Sharing Protocol Extensions- 14 -          September 5, 1986
  860.  
  861.  
  862.  
  863.         Error Class ERRDOS
  864.  
  865.           ERRbadfiletype
  866.           ERRnoaccess
  867.           <implementation specific>
  868.  
  869.  
  870.         Error Class ERRSRV
  871.  
  872.           ERRpathsyntax
  873.           ERRbadbid
  874.           <implementation specific>
  875.  
  876.  
  877.         Error Class ERRHRD
  878.  
  879.           <implementation specific>
  880.  
  881.  
  882.         Error Class ERRXOS
  883.  
  884.           EREADONLY
  885.           <implementation specific>
  886.  
  887.  
  888. _4._1._4.  _C_R_E_A_T_E
  889.  
  890. Enhanced Request Format:
  891.  
  892.   BYTE   smb_wct;         /* value = 5 */
  893. + WORD   smb_mode;        /* access and sharing modes for open */
  894.   WORD   smb_attribute;   /* STICKY, SETUID, SETGID */
  895.   WORD   smb_time[2];     /* modification time */
  896. + WORD   smb_access;      /* the file's access permissions:
  897.                           OTHER_SEARCH/EXECUTE
  898.                           OTHER_WRITE
  899.                           OTHER_READ
  900.                           USER/GROUP1_SEARCH/EXECUTE
  901.                           USER/GROUP1_WRITE
  902.                           USER/GROUP1_READ
  903.                           OWNER_SEARCH/EXECUTE
  904.                           OWNER_WRITE
  905.                           OWNER_READ
  906.                           USER/GROUP2_SEARCH/EXECUTE
  907.                           USER/GROUP2_WRITE
  908.                           USER/GROUP2_READ
  909.                           USER/GROUP3_SEARCH/EXECUTE
  910.                           USER/GROUP3_WRITE
  911.                           USER/GROUP3_READ */
  912.   WORD   smb_bcc;         /* minimum value = 2 */
  913.   BYTE   smb_ident1;      /* value = ASCII */
  914.   BYTE   smb_path[];      /* [bid+]pathname */
  915.  
  916.  
  917.  
  918.  
  919. Copyright Microsoft Corp., 1985              Intel PN 138447
  920.  
  921.  
  922.  
  923.  
  924.  
  925. File Sharing Protocol Extensions- 15 -          September 5, 1986
  926.  
  927.  
  928. + Additional parameters
  929.  
  930. Response Format (unchanged):
  931.  
  932.   BYTE   smb_wct;   /* value = 1
  933.   WORD   smb_fid;   /* file handle for created file */
  934.   WORD   smb_bcc;   /* value = 0 */
  935.  
  936. Service Enhancement:
  937.  
  938. The file's access permissions may be specified (any combina-
  939. tion).  The OWNER permissions must be specified, the owner's
  940. group's permissions must be  specified  in  the  USER/GROUP1
  941. permissions  and  OTHER permissions must be specified.  Sup-
  942. port of permissions specified in USER/GROUP2 and USER/GROUP3
  943. is optional.
  944.  
  945. When a new file is created this command will open  the  file
  946. in  the  mode  specified by the smb_mode field regardless of
  947. the access mode specified for  the  owner.   This  field  is
  948. identical to the Open command's mode field.
  949.  
  950. Support of the READ and WRITE attributes is mandatory.  Sup-
  951. port  of  all  other attributes is optional.  The rules con-
  952. trolling the supported permissions are specified in  section
  953. 3.2.
  954.  
  955. The access field is ignored if the CREATE request references
  956. an  existing  file  (i.e.,  the  file is truncated to length
  957. zero). The file's permissions are  left  unchanged  and  the
  958. file is opened in the specified mode.
  959.  
  960. Create may generate the following additional errors.
  961.  
  962.         Error Class ERRDOS
  963.  
  964.           ERRnoaccess
  965.           ERRbadaccess
  966.           ERRfilexists
  967.           ERRbadshare
  968.           <implementation specific>
  969.  
  970.  
  971.         Error Class ERRSRV
  972.  
  973.           ERRbadpermits
  974.           ERRbadbid
  975.           ERRpathsyntax
  976.           <implementation specific>
  977.  
  978.  
  979.         Error Class ERRHRD
  980.  
  981.           <implementation specific>
  982.  
  983.  
  984.  
  985. Copyright Microsoft Corp., 1985              Intel PN 138447
  986.  
  987.  
  988.  
  989.  
  990.  
  991. File Sharing Protocol Extensions- 16 -          September 5, 1986
  992.  
  993.  
  994.  
  995.         Error Class ERRXOS
  996.  
  997.           ENOSPC
  998.           <implementation specific>
  999.  
  1000.  
  1001. _4._1._5.  _M_A_K_E _N_E_W _F_I_L_E
  1002.  
  1003. Enhanced Request Format:
  1004.  
  1005.   BYTE   smb_wct;         /* value = 5 */
  1006. + WORD   smb_mode;        /* access and sharing modes for open */
  1007.   WORD   smb_attribute;   /* STICKY, SETUID, SETGID */
  1008.   WORD   smb_time[2];     /* moddification time */
  1009. + WORD   smb_access;      /* the file's access permissions:
  1010.                           OTHER_SEARCH/EXECUTE
  1011.                           OTHER_WRITE
  1012.                           OTHER_READ
  1013.                           USER/GROUP1_SEARCH/EXECUTE
  1014.                           USER/GROUP1_WRITE
  1015.                           USER/GROUP1_READ
  1016.                           OWNER_SEARCH/EXECUTE
  1017.                           OWNER_WRITE
  1018.                           OWNER_READ
  1019.                           USER/GROUP2_SEARCH/EXECUTE
  1020.                           USER/GROUP2_WRITE
  1021.                           USER/GROUP2_READ
  1022.                           USER/GROUP3_SEARCH/EXECUTE
  1023.                           USER/GROUP3_WRITE
  1024.                           USER/GROUP3_READ */
  1025.   WORD   smb_bcc;         /* minimum value = 2 */
  1026.   BYTE   smb_ident1;      /* value = ASCII */
  1027.   BYTE   smb_path[];      /* [bid+]pathname */
  1028.  
  1029. + Additional parameters
  1030.  
  1031. Response Format (unchanged):
  1032.  
  1033.   BYTE   smb_wct;   /* value = 1
  1034.   WORD   smb_fid;   /* file handle for created file */
  1035.   WORD   smb_bcc;   /* value = 0 */
  1036.  
  1037. Service Enhancement:
  1038.  
  1039. As in the Core File Sharing Protocol Make New File is  func-
  1040. tionally identical to Create except that it cannot reference
  1041. an existing file.  Any attempt to do so will  result  in  an
  1042. error response.  The file's access permissions may be speci-
  1043. fied (any  combination).   The  OWNER  permissions  must  be
  1044. specified, the owner's group's permissions must be specified
  1045. in the USER/GROUP1 permissions and OTHER permissions must be
  1046. specified.   Support of permissions specified in USER/GROUP2
  1047. and USER/GROUP3 is optional.
  1048.  
  1049.  
  1050.  
  1051. Copyright Microsoft Corp., 1985              Intel PN 138447
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057. File Sharing Protocol Extensions- 17 -          September 5, 1986
  1058.  
  1059.  
  1060. When a new file is created this command will open  the  file
  1061. in  the  mode  specified by the smb_mode field regardless of
  1062. the access mode specified for  the  owner.   This  field  is
  1063. identical to the Open command's mode field.
  1064.  
  1065. Support of the READ and WRITE attributes is mandatory.  Sup-
  1066. port  of  all  other attributes is optional.  The rules con-
  1067. trolling the supported permissions are specified in  section
  1068. 3.2.
  1069.  
  1070. Make New File may generate the following additional errors.
  1071.  
  1072.         Error Class ERRDOS
  1073.  
  1074.           ERRfilexists
  1075.           ERRbadaccess
  1076.           <implementation specific>
  1077.  
  1078.  
  1079.         Error Class ERRSRV
  1080.  
  1081.           ERRbadpermits
  1082.           ERRbadbid
  1083.           ERRpathsyntax
  1084.           <implementation specific>
  1085.  
  1086.  
  1087.         Error Class ERRHRD
  1088.  
  1089.           <implementation specific>
  1090.  
  1091.  
  1092.         Error Class ERRXOS
  1093.  
  1094.           ENOSPC
  1095.           <implementation specific>
  1096.  
  1097.  
  1098. _4._1._6.  _C_R_E_A_T_E _D_I_R_E_C_T_O_R_Y
  1099.  
  1100. Enhanced Request Format:
  1101.  
  1102.   BYTE   smb_wct;      /* value = 1 */
  1103. + WORD   smb_access;   /* the directory's access permissions:
  1104.                        OTHER_SEARCH/EXECUTE
  1105.                        OTHER_WRITE
  1106.                        OTHER_READ
  1107.                        USER/GROUP1_SEARCH/EXECUTE
  1108.                        USER/GROUP1_WRITE
  1109.                        USER/GROUP1_READ
  1110.                        OWNER_SEARCH/EXECUTE
  1111.                        OWNER_WRITE
  1112.                        OWNER_READ
  1113.                        USER/GROUP2_SEARCH/EXECUTE
  1114.  
  1115.  
  1116.  
  1117. Copyright Microsoft Corp., 1985              Intel PN 138447
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123. File Sharing Protocol Extensions- 18 -          September 5, 1986
  1124.  
  1125.  
  1126.                        USER/GROUP2_WRITE
  1127.                        USER/GROUP2_READ
  1128.                        USER/GROUP3_SEARCH/EXECUTE
  1129.                        USER/GROUP3_WRITE
  1130.                        USER/GROUP3_READ */
  1131.   WORD   smb_bcc;      /* minimum value = 2 */
  1132.   BYTE   smb_ident1;   /* value = ASCII */
  1133.   BYTE   smb_path[];   /* [bid+]pathname */
  1134.  
  1135. + Additional Parameters
  1136.  
  1137. Response Format (unchanged):
  1138.  
  1139.   BYTE   smb_wct;   /* value = 0 */
  1140.   WORD   smb_bcc;   /* value = 0 */
  1141.  
  1142. Service Enhancement:
  1143.  
  1144. The directory's access permissions  may  be  specified  (any
  1145. combination).  The  OWNER permissions must be specified, the
  1146. owner's  group's  permissions  must  be  specified  in   the
  1147. USER/GROUP1 permissions and OTHER permissions must be speci-
  1148. fied.  Support of permissions specified in  USER/GROUP2  and
  1149. USER/GROUP3 is optional.
  1150.  
  1151. Support of the READ and WRITE attributes is mandatory.  Sup-
  1152. port  of  all  other attributes is optional.  The rules con-
  1153. trolling the supported permissions are  defined  in  section
  1154. 3.2.
  1155.  
  1156. Create  Directory  may  generate  the  following  additional
  1157. errors.
  1158.  
  1159.         Error Class ERRDOS
  1160.  
  1161.           ERRfilexists
  1162.           ERRpathsyntax
  1163.           <implementation specific>
  1164.  
  1165.  
  1166.         Error Class ERRSRV
  1167.  
  1168.           ERRbadbid
  1169.           ERRbadpermits
  1170.           <implementation specific>
  1171.  
  1172.  
  1173.         Error Class ERRHRD
  1174.  
  1175.           <implementation specific>
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183. Copyright Microsoft Corp., 1985              Intel PN 138447
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189. File Sharing Protocol Extensions- 19 -          September 5, 1986
  1190.  
  1191.  
  1192.  
  1193.         Error Class ERRXOS
  1194.  
  1195.           ENOSPC
  1196.           <implementation specific>
  1197.  
  1198.  
  1199. _4._1._7.  _R_E_A_D
  1200.  
  1201. No Message Format Enhancement
  1202.  
  1203. Service Enhancement:
  1204.  
  1205. The Read command's scope is extended to directories.  A Read
  1206. of  a  directory  will  return an array of directory entries
  1207. with the following format:
  1208.  
  1209.         WORD  empty_flag;     /* null entry indicator
  1210.                                                0 = EMPTY
  1211.                                      non-zero = VALID_ENTRY */
  1212.         BYTE  file_name[14];  /* the name of the file
  1213.                                        (left justified, null padded) */
  1214.  
  1215.  
  1216. If the offset and length specified by a read  do  not  align
  1217. with  complete  directory entries, then the appropriate par-
  1218. tial entries must be returned.
  1219.  
  1220. The offset and count request parameters indicate the  offset
  1221. and number of bytes in this array to be read.  If a server's
  1222. actual directory format differs from  the  above,  then  the
  1223. server must make the appropriate transformations.
  1224.  
  1225. _4._1._8.  _L_O_C_K
  1226.  
  1227. Enhanced Request Format:
  1228.  
  1229.   BYTE   smb_wct;         /* value = 6 */
  1230.   WORD   smb_fid;         /* file handle */
  1231.   WORD   smb_count[2];    /* length to be locked */
  1232.   WORD   smb_offset[2];   /* offset to be locked */
  1233. + WORD   smb_mode;        /* specifies the mode of the lock
  1234.                           bit0  - READ_ONLY_LOCK
  1235.                           bit1  - SUSPEND_ON_LOCK */
  1236.   WORD   smb_bcc;         /* value = 0 */
  1237.  
  1238. + Additional Parameters
  1239.  
  1240. Response Format (unchanged):
  1241.  
  1242.   BYTE   smb_wct;   /* value = 0 */
  1243.   WORD   smb_bcc;   /* value = 0 */
  1244.  
  1245. Service Enhancement:
  1246.  
  1247.  
  1248.  
  1249. Copyright Microsoft Corp., 1985              Intel PN 138447
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255. File Sharing Protocol Extensions- 20 -          September 5, 1986
  1256.  
  1257.  
  1258. The core Lock function prevents reads, writes and  locks  to
  1259. the  locked  portion of the file and if an attempted lock is
  1260. not possible indication is returned to the user immediately.
  1261. The "mode" field allows the user to choose between this type
  1262. of lock (the default) and a lock that prevents  only  writes
  1263. and   locks   to   the   locked   area   but   allows  reads
  1264. (READ_ONLY_LOCK).    In   addition   a   mode    is    added
  1265. (SUSPEND_ON_LOCK)  to allow the consumer to block on a lock.
  1266. When this option is specified, the server will not  generate
  1267. a  response until the requested lock is obtained.   The mode
  1268. options may be specified in  any  combination;  the  default
  1269. prevails when a zero mode is specified.
  1270.  
  1271. More than one byte range may be  locked  in  a  given  file.
  1272. Locks  are  coercive  in  nature.   They prevent attempts to
  1273. lock, read (optional)  or  write  (including  truncate)  the
  1274. locked  portion  of  the  file.   File  addresses beyond the
  1275. current end of file may be  locked.   Such  locks  will  not
  1276. cause  allocation  of file space.  If the end of the file is
  1277. locked, the file may not be extended by users other than the
  1278. holder of the lock.
  1279.  
  1280. Locks may in whole or in part, contain or be contained by  a
  1281. previously  locked  region  for the same process.  When this
  1282. occurs, or when adjacent regions are locked, the regions are
  1283. combined  into  a  single area if the modes of the locks are
  1284. the same (i.e., either read permitted or regular lock).   If
  1285. the  modes  of the overlapping locks differ, the locked area
  1286. will be assigned assuming that the most recent request  must
  1287. be  satisfied.   Thus  if  a  read only lock is applied to a
  1288. region, or part of a region, that had been previously locked
  1289. by  the  same  process against both reading and writing, the
  1290. area of the file specified by the new lock  will  be  locked
  1291. for  read  only,  while  the  remaining region, if any, will
  1292. remain locked against reading and writing.
  1293.  
  1294. Locks may only be unlocked by the process  (pid)  that  per-
  1295. formed  the  lock.  The ability to perform locks is not tied
  1296. to any file access permission.
  1297.  
  1298. Lock may generate the following additional errors.
  1299.  
  1300.         Error Class ERRDOS
  1301.  
  1302.           ERRbadfiletype
  1303.           ERRbadaccess
  1304.           <implementation specific>
  1305.  
  1306.  
  1307.         Error Class ERRSRV
  1308.  
  1309.           <implementation specific>
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315. Copyright Microsoft Corp., 1985              Intel PN 138447
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321. File Sharing Protocol Extensions- 21 -          September 5, 1986
  1322.  
  1323.  
  1324.  
  1325.         Error Class ERRHRD
  1326.  
  1327.           <implementation specific>
  1328.  
  1329.  
  1330.         Error Class ERRXOS
  1331.  
  1332.           <implementation specific>
  1333.  
  1334.  
  1335. _4._1._9.  _U_N_L_O_C_K
  1336.  
  1337. No Message Format Changes
  1338.  
  1339. Service Enhancement:
  1340.  
  1341. Unlock requests may, in whole or in  part,  release  one  or
  1342. more  locked  regions controlled by the process (PID).  When
  1343. regions are not fully  released,  the  remaining  areas  are
  1344. still  locked  by the process. Only the process which locked
  1345. the file region may unlock it.   An  unlock  request  for  a
  1346. region  that the process does not have locked, or is already
  1347. unlocked, has no effect.  When  a  process  terminates,  all
  1348. locked regions controlled by that process are unlocked.
  1349.  
  1350. If a process has done more than one  open  on  a  file,  all
  1351. locks  put  on  the file by that process will be released on
  1352. the first close of the file.
  1353.  
  1354. Locks may not be applied to a directory.
  1355.  
  1356. _4._1._1_0.  _G_E_T _F_I_L_E _A_T_T_R_I_B_U_T_E_S
  1357.  
  1358. Enhanced Request Format:
  1359.  
  1360.   BYTE   smb_wct;      /* value = 1 */
  1361. + WORD   smb_fid;      /* file handle */
  1362.   WORD   smb_bcc;      /* minimum value = 0 */
  1363.   BYTE   smb_ident1;   /* value = ASCII */
  1364.   BYTE   smb_path[];   /* [bid+]pathname */
  1365.  
  1366. + Additional Parameters
  1367.  
  1368. Enhanced Response Format:
  1369.  
  1370.   BYTE   smb_wct;              /* value = 17 */
  1371.  *WORD   smb_attribute;        /* DIR, STICKY, SETUID, SETGID */
  1372. +*WORD   smb_owner;            /* user ID of file owner */
  1373. +*WORD   smb_id1;              /* group/user ID associated with access1 */
  1374. + WORD   smb_id2;              /* group/user ID associated with access2 */
  1375. + WORD   smb_id3;              /* group/user ID associated with access3 */
  1376. +*WORD   smb_access;           /* access permissions */
  1377. +*WORD   smb_links;            /* number of current links (names) to file */
  1378.  
  1379.  
  1380.  
  1381. Copyright Microsoft Corp., 1985              Intel PN 138447
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387. File Sharing Protocol Extensions- 22 -          September 5, 1986
  1388.  
  1389.  
  1390. +*WORD   smb_create_time[2];   /* file's creation time */
  1391.  *WORD   smb_mod_time[2];      /* file's last modification time */
  1392. +*WORD   smb_access_time[2];   /* file's last access time */
  1393.  *WORD   smb_file_size[2];     /* file size in bytes */
  1394. +*WORD   smb_file_num[2];      /* server unique file identifier */
  1395.   WORD   smb_bcc;              /* minimum value = 0 */
  1396.  
  1397. +  Additional Parameters
  1398.  * Support of these fields is mandatory.
  1399.  
  1400. Service Enhancement:
  1401.  
  1402. Get File Attributes is enhanced to return  more  information
  1403. about  the  queried  file.   The  current values of the file
  1404. attributes listed as output parameters are returned  to  the
  1405. requester.  If a server does not support one of the optional
  1406. attributes, a null value (hex FFFF) is returned.
  1407.  
  1408. The file interrogated may be specified by  either  the  file
  1409. handle  (FID)  or its pathname ([bid+]pathname).  If neither
  1410. or both of these is specified,  the  request  is  considered
  1411. invalid.   A  null  FID is indicated by a value of hex FFFF.
  1412. An omitted pathname is indicated  by  an  smb_bcc  field  of
  1413. zero.
  1414.  
  1415. If multiple groups have access to the file and one of  these
  1416. groups  is  the owner's group, then that group's permissions
  1417. must be returned in access1.
  1418.  
  1419. The sets of access permissions in  smb_access  only  contain
  1420. valid data if the corresponding smb_id field is not null.  A
  1421. null ID is indicated by a value of hex FFFF.  Access permis-
  1422. sions for "other" are always returned.
  1423.  
  1424. The field smb_file_num is a file  identifier  unique  within
  1425. the server.  Word 0 indicates the device containing the file
  1426. and word 1 indicates the file number within that device.
  1427.  
  1428. If a symbolic link is referenced by this command the  attri-
  1429. butes  of  the  ultimate  target  file are returned.  If the
  1430. attributes of the link itself are  required,  the  Get  Link
  1431. Attributes command should be used.
  1432.  
  1433. The contents of response parameters is not guaranteed in the
  1434. case of an error return.
  1435.  
  1436. Get File Attributes may generate  the  following  additional
  1437. errors.
  1438.  
  1439.         Error Class ERRDOS
  1440.  
  1441.           ERRbadfile
  1442.           ERRbadfid
  1443.           <implementation specific>
  1444.  
  1445.  
  1446.  
  1447. Copyright Microsoft Corp., 1985              Intel PN 138447
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453. File Sharing Protocol Extensions- 23 -          September 5, 1986
  1454.  
  1455.  
  1456.  
  1457.         Error Class ERRSRV
  1458.  
  1459.           ERRbadbid
  1460.           ERRfilespecs
  1461.           ERRpathsyntax
  1462.           <implementation specific>
  1463.  
  1464.  
  1465.         Error Class ERRHRD
  1466.  
  1467.           <implementation specific>
  1468.  
  1469.  
  1470.         Error Class ERRXOS
  1471.  
  1472.           <implementation specific>
  1473.  
  1474.  
  1475. _4._1._1_1.  _S_E_T _F_I_L_E _A_T_T_R_I_B_U_T_E_S
  1476.  
  1477. Enhanced Request Format:
  1478.  
  1479.   BYTE   smb_wct;              /* value = 15 */
  1480.   WORD   smb_mode;             /* request mode: bit0 - ATTRIBUTES
  1481.                                           bit1 - ACCESS
  1482.                                           bit2 - ID
  1483.                                           bit3 - TIME */
  1484.   WORD   smb_attribute;        /* DIR, STICKY, SETUID, SETGID */
  1485. +*WORD   smb_owner;            /* user ID of file owner */
  1486. +*WORD   smb_id1;              /* group/user ID associated with access1 */
  1487. + WORD   smb_id2;              /* group/user ID associated with access2 */
  1488. + WORD   smb_id3;              /* group/user ID associated with access3 */
  1489. +*WORD   smb_access;           /* access permissions */
  1490. +*WORD   smb_create_time[2];   /* file's creation time */
  1491.  *WORD   smb_mod_time[2];      /* file's last modification time */
  1492. +*WORD   smb_access_time[2];   /* file's last access time */
  1493.   WORD   smb_reserved[2];      /* reserved */
  1494.   WORD   smb_bcc;              /* minimum value = 2 */
  1495.  *BYTE   smb_ident1;           /* value = ASCII */
  1496.  *BYTE   smb_path[];           /* [bid+]pathname */
  1497.  
  1498. +  Additional Parameters
  1499.  * Support of these fields is mandatory
  1500.  
  1501. Enhanced Response Format:
  1502.  
  1503.   BYTE   smb_wct;   /* value = 0 */
  1504.   WORD   smb_bcc;   /* minimum value = 0 */
  1505.  
  1506. +  Additional Parameters
  1507.  * Support of these fields is mandatory.
  1508.  
  1509. Service Enhancement:
  1510.  
  1511.  
  1512.  
  1513. Copyright Microsoft Corp., 1985              Intel PN 138447
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519. File Sharing Protocol Extensions- 24 -          September 5, 1986
  1520.  
  1521.  
  1522. Set File Attributes will manipulate additional  file  attri-
  1523. butes.   The  attributes  of the file identified by smb_path
  1524. that are selected by the smb_mode field and are supported by
  1525. the server, are changed to the values specified by the input
  1526. parameters.
  1527.  
  1528. Attributes are  changed  in  groups  selected  by  smb_mode.
  1529. These groups may be selected in any combination.
  1530.  
  1531. The smb_mode "ATTRIBUTE" will replace the  files  attributes
  1532. with the set of attributes specified by smb_attribute in the
  1533. request message. Attributes cannot be changed  individually.
  1534. The DIRECTORY attribute cannot be changed.
  1535.  
  1536. The smb_mode "ACCESS" will replace the access permissions of
  1537. the file with the access permissions specified by smb_access
  1538. in  the  request  message.   Access  permissions  cannot  be
  1539. changed individually.
  1540.  
  1541. The smb_mode "ID" replaces the user and group IDs associated
  1542. with  the  file  to  those specified in the request message.
  1543. The  IDs  that  can  be  changed  are  owner,   user/group1,
  1544. user/group2  and  user/group3.  Only IDs containing non-null
  1545. values are changed.  A null ID is indicated by hex FFFF.
  1546.  
  1547. The smb_mode "TIME" replaces the times associated  with  the
  1548. file  to  those specified in the request message.  The times
  1549. that  can  be  changed   are   create_time,   mod_time   and
  1550. access_time.   Only  times  containing  non-null  values are
  1551. changed.  A null time is indicated by hex FFFFFFFF.
  1552.  
  1553. Some attempts to add user permissions or modify access  per-
  1554. missions  may fail due to server resource limitations, e.g.,
  1555. length of Access Control Lists.
  1556.  
  1557. The owner of a file may modify all attributes. Other legiti-
  1558. mate modifications will be server OS dependent.
  1559.  
  1560. Set File Attributes may generate  the  following  additional
  1561. errors.
  1562.  
  1563.         Error Class ERRDOS
  1564.  
  1565.           ERRbadfunc
  1566.           ERRbadfile
  1567.           ERRnoaccess
  1568.           ERRnotables
  1569.           <implementation specific>
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579. Copyright Microsoft Corp., 1985              Intel PN 138447
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585. File Sharing Protocol Extensions- 25 -          September 5, 1986
  1586.  
  1587.  
  1588.  
  1589.         Error Class ERRSRV
  1590.  
  1591.           ERRbadbid
  1592.           ERRpathsyntax
  1593.           ERRbadpermits
  1594.           ERRsetattrmode
  1595.           <implementation specific>
  1596.  
  1597.  
  1598.         Error Class ERRHRD
  1599.  
  1600.           <implementation specific>
  1601.  
  1602.  
  1603.         Error Class ERRXOS
  1604.  
  1605.           <implementation specific>
  1606.  
  1607.  
  1608. _4._2.  _A_D_D_I_T_I_O_N_A_L _S_E_R_V_I_C_E_S
  1609.  
  1610. The Basic Extension Set includes  all  functions  considered
  1611. necessary  to provide transparency for all essential or fre-
  1612. quently used file access functions.  UNIX requirements  have
  1613. been  used  as  a  guide for selecting the services included
  1614. here; when other common operating systems are considered  in
  1615. more detail it may prove necessary to expand this set.
  1616.  
  1617. _4._2._1.  _C_O_N_S_U_M_E_R _L_O_G_O_N
  1618.  
  1619. Request Format:
  1620.  
  1621.   BYTE   smb_wct;          /* value = 0 */
  1622.   WORD   smb_bcc;          /* minimum value = 4 */
  1623.   BYTE   smb_ident1;       /* value = ASCII */
  1624.   BYTE   smb_consumer[];   /* consumer system's name */
  1625.   BYTE   smb_ident2;       /* value = ASCII */
  1626.   BYTE   smb_password[];   /* consumer system's password */
  1627.  
  1628. Response Format:
  1629.  
  1630.   BYTE   smb_wct;             /* value = 1 */
  1631.   WORD   smb_max_xmit_size;   /* maximum server buffer size */
  1632.   WORD   smb_bcc;             /* value = 0 */
  1633.  
  1634. Service:
  1635.  
  1636. This function allows a server to verify the  identity  of  a
  1637. consumer  system.   It  will  typically  be used by networks
  1638. using consumer based user authentication to ensure that only
  1639. trusted  consumer  systems  are  allowed to access a server.
  1640. Once the consumer system has been validated, the server will
  1641. trust  the  consumer to verify its users.  This command will
  1642.  
  1643.  
  1644.  
  1645. Copyright Microsoft Corp., 1985              Intel PN 138447
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651. File Sharing Protocol Extensions- 26 -          September 5, 1986
  1652.  
  1653.  
  1654. normally be the first  sent  following  negotiation  of  the
  1655. extended  protocol.   Use  of the Consumer Logon function is
  1656. not mandatory in the protocol, but servers may insist on its
  1657. use.
  1658.  
  1659. The smb_max_xmit_size field indicates the maximum size  mes-
  1660. sage that the server can handle.  The consumer must not gen-
  1661. erate messages, nor expect responses, larger than this.
  1662.  
  1663. Consumer Logon may generate the following errors.
  1664.  
  1665.         Error Class ERRDOS
  1666.  
  1667.           <implementation specific>
  1668.  
  1669.  
  1670.         Error Class ERRSRV
  1671.  
  1672.           ERRerror
  1673.           ERRbadpw
  1674.           ERRsrverror
  1675.           <implementation specific>
  1676.  
  1677.  
  1678.         Error Class ERRHRD
  1679.  
  1680.           <implementation specific>
  1681.  
  1682.  
  1683.         Error Class ERRXOS
  1684.  
  1685.           <implementation specific>
  1686.  
  1687.  
  1688. _4._2._2.  _B_I_N_D
  1689.  
  1690. Request Format:
  1691.  
  1692.   BYTE   smb_wct;      /* value = 0 */
  1693.   WORD   smb_bcc;      /* minimum value = 2 */
  1694.   BYTE   smb_ident1;   /* value = ASCII */
  1695.   BYTE   smb_path[];   /* [bid+]pathname */
  1696.  
  1697. Response Format:
  1698.  
  1699.   BYTE   smb_wct;           /* value = 5 */
  1700.   WORD   smb_bid;           /* identifier to the file specified by input [bid+]pathname */
  1701.   WORD   smb_file_num[2];   /* server unique file number */
  1702.   WORD   smb_attribute;     /* DIR, STICKY, SETUID, SETGID */
  1703.   WORD   smb_owner;         /* user ID of file's owner (consumer based systems only) */
  1704.   WORD   smb_bcc;           /* value = 0 */
  1705.  
  1706. Service:
  1707.  
  1708.  
  1709.  
  1710.  
  1711. Copyright Microsoft Corp., 1985              Intel PN 138447
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717. File Sharing Protocol Extensions- 27 -          September 5, 1986
  1718.  
  1719.  
  1720. Any point in the file system can be represented by an  iden-
  1721. tifier  (bid). A NULL bid indicates the root of the server's
  1722. file system. The bind service returns a  bid  for  the  file
  1723. represented by [bid+]pathname.
  1724.  
  1725. Upon receiving a [bid+]pathname, the server begins the path-
  1726. name translation from the position in the file system speci-
  1727. fied by bid.  A bid is used only for addressing a  file,  it
  1728. is not associated with file access permissions.
  1729.  
  1730. A bid references a file, not the file  name.   If  the  file
  1731. name  changes  or is deleted, the bid is unaffected.  When a
  1732. file is deleted, any bids referencing it are invalidated for
  1733. all functions except UNBIND.
  1734.  
  1735. Bind may generate the following errors.
  1736.  
  1737.         Error Class ERRDOS
  1738.  
  1739.           ERRbadfile
  1740.           ERRbadpath
  1741.           ERRnotables
  1742.           <implementation specific>
  1743.  
  1744.  
  1745.         Error Class ERRSRV
  1746.  
  1747.           ERRerror
  1748.           ERRinvnid
  1749.           ERRbadbid
  1750.           ERRpathsyntax
  1751.           <implementation specific>
  1752.  
  1753.  
  1754.         Error Class ERRHRD
  1755.  
  1756.           <implementation specific>
  1757.  
  1758.  
  1759.         Error Class ERRXOS
  1760.  
  1761.           <implementation specific>
  1762.  
  1763.  
  1764. _4._2._3.  _U_N_B_I_N_D
  1765.  
  1766. Request Format:
  1767.  
  1768.   BYTE   smb_wct;   /* value = 1 */
  1769.   WORD   smb_bid;   /* pathname prefix */
  1770.   WORD   smb_bcc;   /* value = 0 */
  1771.  
  1772. Response Format:
  1773.  
  1774.  
  1775.  
  1776.  
  1777. Copyright Microsoft Corp., 1985              Intel PN 138447
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783. File Sharing Protocol Extensions- 28 -          September 5, 1986
  1784.  
  1785.  
  1786.   BYTE   smb_wct;   /* value = 0 */
  1787.   WORD   smb_bcc;   /* value = 0 */
  1788.  
  1789. Service:
  1790.  
  1791. Unbind removes the relationship between  the  specified  bid
  1792. and  its associated position in the file system.  A NULL bid
  1793. may not be UNBINDed.
  1794.  
  1795. Unbind may generate the following errors.
  1796.  
  1797.         Error Class ERRDOS
  1798.  
  1799.           <implementation specific>
  1800.  
  1801.  
  1802.         Error Class ERRSRV
  1803.  
  1804.           ERRerror
  1805.           ERRinvnid
  1806.           ERRbadbid
  1807.           <implementation specific>
  1808.  
  1809.  
  1810.         Error Class ERRHRD
  1811.  
  1812.           <implementation specific>
  1813.  
  1814.  
  1815.         Error Class ERRXOS
  1816.  
  1817.           <implementation specific>
  1818.  
  1819.  
  1820. _4._2._4.  _G_E_T _P_A_T_H_N_A_M_E
  1821.  
  1822. Request Format:
  1823.  
  1824.   BYTE   smb_wct;    /* value = 2 */
  1825.   WORD   smb_mode;   /* request mode: bit0 - last component only
  1826.                                 bits1-7 - MBZ */
  1827.   WORD   smb_bid;    /* pathname prefix */
  1828.   WORD   smb_bcc;    /* value = 0 */
  1829.  
  1830. Response Format:
  1831.  
  1832.   BYTE   smb_wct;      /* value = 0 */
  1833.   WORD   smb_bcc;      /* minimum value = 2 */
  1834.   BYTE   smb_ident1;   /* value = ASCII */
  1835.   BYTE   smb_path[];   /* pathname */
  1836.  
  1837. Service:
  1838.  
  1839. Get  Pathname  translates  a  BID  into  the  server   local
  1840.  
  1841.  
  1842.  
  1843. Copyright Microsoft Corp., 1985              Intel PN 138447
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849. File Sharing Protocol Extensions- 29 -          September 5, 1986
  1850.  
  1851.  
  1852. pathname.   The default response is the pathname relative to
  1853. the server's root.  If the "last component" option is speci-
  1854. fied,  only  the last component of the pathname is returned.
  1855. If the BID represents the server's  root,  the  response  is
  1856. "/".
  1857.  
  1858. Get Pathname may generate the following errors.
  1859.  
  1860.         Error Class ERRDOS
  1861.  
  1862.           <implementation specific>
  1863.  
  1864.  
  1865.         Error Class ERRSRV
  1866.  
  1867.           ERRerror
  1868.           ERRinvnid
  1869.           ERRbadbid
  1870.           <implementation specific>
  1871.  
  1872.  
  1873.         Error Class ERRHRD
  1874.  
  1875.           <implementation specific>
  1876.  
  1877.  
  1878.         Error Class ERRXOS
  1879.  
  1880.           <implementation specific>
  1881.  
  1882.  
  1883. _4._2._5.  _M_A_K_E _N_O_D_E
  1884.  
  1885. Request Format:
  1886.  
  1887.   BYTE   smb_wct;          /* value = 3 */
  1888.   WORD   smb_access;       /* the file's access permissions:
  1889.                            OTHER_SEARCH/EXECUTE
  1890.                            OTHER_WRITE
  1891.                            OTHER_READ
  1892.                            USER/GROUP1_SEARCH/EXECUTE
  1893.                            USER/GROUP1_WRITE
  1894.                            USER/GROUP1_READ
  1895.                            OWNER_SEARCH/EXECUTE
  1896.                            OWNER_WRITE
  1897.                            OWNER_READ
  1898.                            USER/GROUP2_SEARCH/EXECUTE
  1899.                            USER/GROUP2_WRITE
  1900.                            USER/GROUP2_READ
  1901.                            USER/GROUP3_SEARCH/EXECUTE
  1902.                            USER/GROUP3_WRITE
  1903.                            USER/GROUP3_READ */
  1904.   WORD   smb_attribute;    /* the type of file to be created:
  1905.                            FIFO (named pipe)
  1906.  
  1907.  
  1908.  
  1909. Copyright Microsoft Corp., 1985              Intel PN 138447
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915. File Sharing Protocol Extensions- 30 -          September 5, 1986
  1916.  
  1917.  
  1918.                            Character Special
  1919.                            Multiplexed Character File
  1920.                            Directory
  1921.                            Named Special File -- Semaphore or Shared Memory
  1922.                            Block Special
  1923.                            Multiplexed Block File
  1924.                            Regular
  1925.                            Symbolic Link
  1926.   WORD   smb_dev;          /* the device for this file,
  1927.                              for named special files:
  1928.                                0 = shared memory
  1929.                                1 = semaphore */
  1930.   WORD   smb_bcc;          /* minimum value = 2 */
  1931.   BYTE   smb_ident1;       /* value = ASCII */
  1932.   BYTE   smb_path[];       /* [bid+]pathname */
  1933.   BYTE   smb_ident2;       /* value = ASCII (symbolic link only) */
  1934.   BYTE   smb_new_path[];   /* new [bid+]pathname for symbolic link */
  1935.  
  1936. Response Format:
  1937.  
  1938.   BYTE   smb_wct;   /* value = 0 */
  1939.   WORD   smb_bcc;   /* value = 0 */
  1940.  
  1941. Service:
  1942.  
  1943. Make Node creates a new file of the type  specified.   If  a
  1944. symbolic  link  is  created  then  both  pathnames  must  be
  1945. present.  All other file types require only a  single  path-
  1946. name.
  1947.  
  1948. The file's access permissions may be specified (any combina-
  1949. tion).  The OWNER permissions must be specified, the owner's
  1950. group's permissions must be  specified  in  the  USER/GROUP1
  1951. permissions  and  OTHER permissions must be specified.  Sup-
  1952. port of permissions specified in USER/GROUP2 and USER/GROUP3
  1953. is optional.
  1954.  
  1955. Support of the READ and WRITE attributes is mandatory.  Sup-
  1956. port  of  all  other attributes is optional.  The rules con-
  1957. trolling the supported permissions are  defined  in  section
  1958. 3.2.
  1959.  
  1960. the field smb_dev identifies the  device  for  character  or
  1961. block  files  and indicates the type for named special file.
  1962. It is ignored for other file types.
  1963.  
  1964. Support of Make Node is optional.
  1965.  
  1966. Make Node may generate the following errors.
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975. Copyright Microsoft Corp., 1985              Intel PN 138447
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981. File Sharing Protocol Extensions- 31 -          September 5, 1986
  1982.  
  1983.  
  1984.  
  1985.         Error Class ERRDOS
  1986.  
  1987.           ERRbadpath
  1988.           ERRnoaccess
  1989.           ERRfilexists
  1990.           ERRpathsyntax
  1991.           <implementation specific>
  1992.  
  1993.  
  1994.         Error Class ERRSRV
  1995.  
  1996.           ERRerror
  1997.           ERRaccess
  1998.           ERRinvnid
  1999.           ERRbadbid
  2000.           ERRbadpermits
  2001.           ERRnosupport
  2002.           <implementation specific>
  2003.  
  2004.  
  2005.         Error Class ERRHRD
  2006.  
  2007.           <implementation specific>
  2008.  
  2009.  
  2010.         Error Class ERRXOS
  2011.  
  2012.           ENOSPC
  2013.           <implementation specific>
  2014.  
  2015.  
  2016. _4._2._6.  _R_E_A_D _A_N_D _H_I_D_E
  2017.  
  2018. Request Format:
  2019.  
  2020.   BYTE   smb_wct;         /* value = 5 */
  2021.   WORD   smb_fid;         /* file handle */
  2022.   WORD   smb_count;       /* number of bytes to be read */
  2023.   WORD   smb_offset[2];   /* offset in file to begin read */
  2024.   WORD   smb_left;        /* count of additional bytes to be read */
  2025.   WORD   smb_bcc;         /* value = 0 */
  2026.  
  2027. Response Format:
  2028.  
  2029.   BYTE   smb_wct;           /* value = 5 */
  2030.   WORD   smb_count;         /* number of bytes read */
  2031.   WORD   smb_reserved[4];   /* reserved */
  2032.   WORD   smb_bcc;           /* minimum value = 4 */
  2033.   BYTE   smb_ident1;        /* value = DATA_BLOCK */
  2034.   BYTE   smb_size[2];       /* length of data returned */
  2035.   BYTE   smb_data[];        /* data */
  2036.  
  2037. Service:
  2038.  
  2039.  
  2040.  
  2041. Copyright Microsoft Corp., 1985              Intel PN 138447
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047. File Sharing Protocol Extensions- 32 -          September 5, 1986
  2048.  
  2049.  
  2050. The read and  hide  request  is  a  variation  of  the  read
  2051. request.   When  used with data files it is identical to the
  2052. read request.  When used to read directories it  differs  in
  2053. its handling of hidden files.
  2054.  
  2055. Each operating system has  its  own  convention  for  hiding
  2056. files,  e.g., XENIX prefixes the files with ".", DOS holds a
  2057. separate attribute.   As the read command returns all  files
  2058. in  a  directory  and  the consumer cannot know the server's
  2059. hiding convention, the consumer has no means of distinguish-
  2060. ing  these  files.   The  read  and hide command masks these
  2061. differences by removing such files from its  responses  when
  2062. directories are read.  The empty_flag field of all directory
  2063. entries for hidden files must be set to zero.
  2064.  
  2065. "Hidden" directory entries  will  only  be  dropped  if  the
  2066. directory  read  commences  on  an  entry boundary and reads
  2067. entire entries.  If any partial entries are  referenced  the
  2068. results will be server dependent.
  2069.  
  2070. Read and hide may generate the following errors:
  2071.  
  2072.         Error Class ERRDOS:
  2073.  
  2074.           ERRnoaccess
  2075.           ERRbadfid
  2076.  
  2077.  
  2078.         Error Class ERRSRV:
  2079.  
  2080.           ERRerror
  2081.           ERRinvdevice
  2082.           ERRinvnid
  2083.           <implementation specific>
  2084.  
  2085.  
  2086.         Error Class ERRHRD:
  2087.  
  2088.           <implementation specific>
  2089.  
  2090.  
  2091.         Error Class ERRXOS:
  2092.  
  2093.           <implementation specific>
  2094.  
  2095.  
  2096. _4._2._7.  _R_E_A_D _W_I_T_H _O_P_T_I_O_N_S
  2097.  
  2098. Request Format:
  2099.  
  2100.   BYTE   smb_wct;           /* value = 12 */
  2101.   WORD   smb_fid;           /* file handle */
  2102.   WORD   smb_timeout;       /* number of seconds to wait for completion */
  2103.   WORD   smb_rmode;         /* read mode
  2104.  
  2105.  
  2106.  
  2107. Copyright Microsoft Corp., 1985              Intel PN 138447
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113. File Sharing Protocol Extensions- 33 -          September 5, 1986
  2114.  
  2115.  
  2116.                                bit0 - READ_AND_LOCK
  2117.                                bit1 - HIDE_FILES
  2118.   WORD   smb_count[2];      /* number of bytes to be read */
  2119.   WORD   smb_offset[2];     /* offset in file to begin read */
  2120.   WORD   smb_left[2];       /* count of additional bytes to be read */
  2121.   WORD   smb_lmode;         /* lock mode
  2122.                                bit0 - READ_ONLY_LOCK
  2123.                                bit1 - SUSPEND_ON_LOCK */
  2124.   WORD   smb_reserved[2];   /* reserved */
  2125.   WORD   smb_bcc;           /* value = 0 */
  2126.  
  2127. Response Format:
  2128.  
  2129.   BYTE   smb_wct;           /* value = 5 */
  2130.   WORD   smb_count;         /* number of bytes read */
  2131.   WORD   smb_reserved[4];   /* reserved */
  2132.   WORD   smb_bcc;           /* minimum value = 4 */
  2133.   BYTE   smb_ident1;        /* value = DATA_BLOCK */
  2134.   BYTE   smb_size[2];       /* length of data returned */
  2135.   BYTE   smb_data[];        /* data */
  2136.  
  2137. Service:
  2138.  
  2139. The read with options command allows reads to be timed  out,
  2140. allows  record reading and locking to be accomplished with a
  2141. single command, and offers a generalized alternative to  the
  2142. other read commands.
  2143.  
  2144. When no smb_rmode options  are  specified,  the  command  is
  2145. identical  in  function  to  the  read  command.   When  the
  2146. HIDE_FILES options is specified and a directory is read, the
  2147. command  is  identical in function to the read and hide com-
  2148. mand.
  2149.  
  2150. When the smb_timeout field is  non-zero,  it  specifies  the
  2151. maximum  time  the  server  is to wait for a response to its
  2152. read command.  This feature is useful when accessing  remote
  2153. devices,  such  as terminals, where indeterminate delays are
  2154. possible.
  2155.  
  2156. When the READ_AND_LOCK option is  specified,  the  specified
  2157. data  is  both locked and read.  The type of lock applied is
  2158. controlled by the smb_lmode  field.   The  options  in  this
  2159. field  are  as described for the mode field in the lock com-
  2160. mand.  The server must always complete the requested locking
  2161. function before reading the data.
  2162.  
  2163. Read with options may generate the following errors:
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173. Copyright Microsoft Corp., 1985              Intel PN 138447
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179. File Sharing Protocol Extensions- 34 -          September 5, 1986
  2180.  
  2181.  
  2182.  
  2183.         Error Class ERRDOS:
  2184.  
  2185.           ERRnoaccess
  2186.           ERRbadfid
  2187.           ERRlock
  2188.           ERRbadfiletype
  2189.           ERRbadaccess
  2190.  
  2191.  
  2192.         Error Class ERRSRV:
  2193.  
  2194.           ERRerror
  2195.           ERRinvdevice
  2196.           ERRinvnid
  2197.           <implementation specific>
  2198.  
  2199.  
  2200.         Error Class ERRHRD:
  2201.  
  2202.           <implementation specific>
  2203.  
  2204.  
  2205.         Error Class ERRXOS:
  2206.  
  2207.           <implementation specific>
  2208.  
  2209.  
  2210. _4._2._8.  _G_E_T _A_C_C_E_S_S _R_I_G_H_T_S
  2211.  
  2212. Request Format:
  2213.  
  2214.   BYTE   smb_wct;      /* value = 0 */
  2215.   WORD   smb_bcc;      /* minimum value = 2 */
  2216.   BYTE   smb_ident1;   /* value = ASCII */
  2217.   BYTE   smb_path[];   /* [bid+]pathname */
  2218.  
  2219. Response Format:
  2220.  
  2221.   BYTE   smb_wct;      /* value = 1 */
  2222.   WORD   smb_access;   /* the requester's access rights
  2223.                        bit0 - Requester is owner
  2224.                        bit1 - Requester is group/user id1
  2225.                        bit2 - Requester is group/user id2
  2226.                        bit3 - Requester is group/user id3
  2227.                        bit4 - Requester is other user
  2228.                        bit5 - Requester is superuser
  2229.                        bit6 - EXECUTE/SEARCH
  2230.                        bit7 - WRITE
  2231.                        bit8 - READ */
  2232.   WORD   smb_bcc;      /* value = 0 */
  2233.  
  2234. Service:
  2235.  
  2236.  
  2237.  
  2238.  
  2239. Copyright Microsoft Corp., 1985              Intel PN 138447
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245. File Sharing Protocol Extensions- 35 -          September 5, 1986
  2246.  
  2247.  
  2248. The requestor's effective access rights on  the  named  data
  2249. file or directory are calculated from the file's permissions
  2250. and returned.  The response also indicates why  the  permis-
  2251. sions  are  available,  e.g.,  because  the user is the file
  2252. owner or the superuser.
  2253.  
  2254. This command is necessary to accommodate variations  in  the
  2255. algorithms servers use to calculate these rights.
  2256.  
  2257. Get Access Rights may generate the following errors.
  2258.  
  2259.         Error Class ERRDOS
  2260.  
  2261.           ERRbadfile
  2262.           ERRbadpath
  2263.           <implementation specific>
  2264.  
  2265.  
  2266.         Error Class ERRSRV
  2267.  
  2268.           ERRerror
  2269.           ERRinvnid
  2270.           ERRbadbid
  2271.           ERRpathsyntax
  2272.           <implementation specific>
  2273.  
  2274.  
  2275.         Error Class ERRHRD
  2276.  
  2277.           <implementation specific>
  2278.  
  2279.  
  2280.         Error Class ERRXOS
  2281.  
  2282.           <implementation specific>
  2283.  
  2284.  
  2285. _4._2._9.  _L_I_N_K
  2286.  
  2287. Request Format:
  2288.  
  2289.   BYTE   smb_wct;          /* value = 1 */
  2290.   WORD   smb_reserved;     /* MBZ */
  2291.   WORD   smb_bcc;          /* minimum value = 4 */
  2292.   BYTE   smb_ident1;       /* value = ASCII */
  2293.   BYTE   smb_path[];       /* [bid+]pathname */
  2294.   BYTE   smb_ident2;       /* value = ASCII */
  2295.   BYTE   smb_new_path[];   /* [bid+]pathname to be added to file */
  2296.  
  2297. Response Format:
  2298.  
  2299.   BYTE   smb_wct;   /* value = 0 */
  2300.   WORD   smb_bcc;   /* value = 0 */
  2301.  
  2302.  
  2303.  
  2304.  
  2305. Copyright Microsoft Corp., 1985              Intel PN 138447
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311. File Sharing Protocol Extensions- 36 -          September 5, 1986
  2312.  
  2313.  
  2314. Service:
  2315.  
  2316. smb_new_path is an alternative path to the  file  referenced
  2317. by  smb_path.  All components in the new pathname except the
  2318. last must exist; the last component must not exist.   Direc-
  2319. tory links may be rejected due to security violations.
  2320.  
  2321. There may be variations between server types on what consti-
  2322. tutes a valid link, including no support of links.
  2323.  
  2324. The new pathname will be reflected in the structure  of  the
  2325. file  system  and  will  be  available  to  all users of the
  2326. server.
  2327.  
  2328. Link may generate the following errors.
  2329.  
  2330.         Error Class ERRDOS
  2331.  
  2332.           ERRbadfile
  2333.           ERRbadpath
  2334.           ERRfilexists
  2335.           <implementation specific>
  2336.  
  2337.  
  2338.         Error Class ERRSRV
  2339.  
  2340.           ERRerror
  2341.           ERRinvnid
  2342.           ERRbadbid
  2343.           ERRpathsyntax
  2344.           ERRbadlink
  2345.           ERRnosupport
  2346.           <implementation specific>
  2347.  
  2348.  
  2349.         Error Class ERRHRD
  2350.  
  2351.           <implementation specific>
  2352.  
  2353.  
  2354.         Error Class ERRXOS
  2355.  
  2356.           EMLINK
  2357.           <implementation specific>
  2358.  
  2359.  
  2360. _4._2._1_0.  _C_O_P_Y
  2361.  
  2362. Request Format:
  2363.  
  2364.   BYTE   smb_wct;          /* value = 1 */
  2365.   WORD   smb_reserved;     /* MBZ */
  2366.   WORD   smb_bcc;          /* minimum value = 4 */
  2367.   BYTE   smb_ident1;       /* value = ASCII */
  2368.  
  2369.  
  2370.  
  2371. Copyright Microsoft Corp., 1985              Intel PN 138447
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377. File Sharing Protocol Extensions- 37 -          September 5, 1986
  2378.  
  2379.  
  2380.   BYTE   smb_path[];       /* [bid+]pathname of source file */
  2381.   BYTE   smb_ident2;       /* value = ASCII */
  2382.   BYTE   smb_new_path[];   /* [bid+]pathname of destination file */
  2383.  
  2384. Response Format:
  2385.  
  2386.   BYTE   smb_wct;   /* value = 0 */
  2387.   WORD   smb_bcc;   /* value = 0 */
  2388.  
  2389. Service:
  2390.  
  2391. The file referenced by smb_path is copied  to  smb_new_path.
  2392. All  components  in the destination pathname except the last
  2393. must exist; the last component may or may  not  exist.   The
  2394. destination  file  is  "created" using the rules defined for
  2395. the "Create" protocol.
  2396.  
  2397. Support of this command is optional.
  2398.  
  2399. Copy may generate the following errors.
  2400.  
  2401.         Error Class ERRDOS
  2402.  
  2403.           ERRbadfile
  2404.           ERRbadpath
  2405.           <implementation specific>
  2406.  
  2407.  
  2408.         Error Class ERRSRV
  2409.  
  2410.           ERRerror
  2411.           ERRinvnid
  2412.           ERRbadbid
  2413.           ERRpathsyntax
  2414.           ERRnosupport
  2415.           <implementation specific>
  2416.  
  2417.  
  2418.         Error Class ERRHRD
  2419.  
  2420.           <implementation specific>
  2421.  
  2422.  
  2423.         Error Class ERRXOS
  2424.  
  2425.           <implementation specific>
  2426.  
  2427.  
  2428. _4._2._1_1.  _M_O_V_E
  2429.  
  2430. Request Format:
  2431.  
  2432.   BYTE   smb_wct;          /* value = 1 */
  2433.   WORD   smb_reserved;     /* MBZ */
  2434.  
  2435.  
  2436.  
  2437. Copyright Microsoft Corp., 1985              Intel PN 138447
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443. File Sharing Protocol Extensions- 38 -          September 5, 1986
  2444.  
  2445.  
  2446.   WORD   smb_bcc;          /* minimum value = 4 */
  2447.   BYTE   smb_ident1;       /* value = ASCII */
  2448.   BYTE   smb_path[];       /* [bid+]pathname of source file */
  2449.   BYTE   smb_ident2;       /* value = ASCII */
  2450.   BYTE   smb_new_path[];   /* [bid+]pathname of destination file */
  2451.  
  2452. Response Format:
  2453.  
  2454.   BYTE   smb_wct;   /* value = 0 */
  2455.   WORD   smb_bcc;   /* value = 0 */
  2456.  
  2457. Service:
  2458.  
  2459. The file referenced by smb_path is  moved  to  smb_new_path.
  2460. All  components  in the destination pathname except the last
  2461. must exist; the last component may or may  not  exist.   The
  2462. destination  file  is  "created" using the rules defined for
  2463. the "Create" protocol.  The source file is deleted.
  2464.  
  2465. Support of this command is optional.
  2466.  
  2467. Move may generate the following errors.
  2468.  
  2469.         Error Class ERRDOS
  2470.  
  2471.           ERRbadfile
  2472.           ERRbadpath
  2473.           <implementation specific>
  2474.  
  2475.  
  2476.         Error Class ERRSRV
  2477.  
  2478.           ERRerror
  2479.           ERRinvnid
  2480.           ERRbadbid
  2481.           ERRpathsyntax
  2482.           ERRnosupport
  2483.           <implementation specific>
  2484.  
  2485.  
  2486.         Error Class ERRHRD
  2487.  
  2488.           <implementation specific>
  2489.  
  2490.  
  2491.         Error Class ERRXOS
  2492.  
  2493.           <implementation specific>
  2494.  
  2495.  
  2496. _4._2._1_2.  _F_O_R_K
  2497.  
  2498. Request Format:
  2499.  
  2500.  
  2501.  
  2502.  
  2503. Copyright Microsoft Corp., 1985              Intel PN 138447
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509. File Sharing Protocol Extensions- 39 -          September 5, 1986
  2510.  
  2511.  
  2512.   BYTE   smb_wct;       /* value = 1 */
  2513.   WORD   smb_new_pid;   /* pid assigned to the new process */
  2514.   WORD   smb_bcc;       /* value = 0 */
  2515.  
  2516. Response Format:
  2517.  
  2518.   BYTE   smb_wct;   /* value = 0 */
  2519.   WORD   smb_bcc;   /* value = 0 */
  2520.  
  2521. Service:
  2522.  
  2523. This command  informs  the  server  that  the  consumer  has
  2524. created  a  new  process with the same characteristics (open
  2525. files, uid and gid) as the process specified  by  PID.   The
  2526. new  process has been assigned the PID specified by new_pid.
  2527. The server ensures that the new PID has FIDs  equivalent  to
  2528. its  parent's.  The  tid,  uid and gid fields in the request
  2529. message  are  ignored.   Following  the  request,  all  file
  2530. accesses  to the affected files on behalf of the new process
  2531. must be honoured.
  2532.  
  2533. Fork may generate the following errors.
  2534.  
  2535.         Error Class ERRDOS
  2536.  
  2537.           ERRnotables
  2538.           <implementation specific>
  2539.  
  2540.  
  2541.         Error Class ERRSRV
  2542.  
  2543.           ERRerror
  2544.           ERRbadpid
  2545.           <implementation specific>
  2546.  
  2547.  
  2548.         Error Class ERRHRD
  2549.  
  2550.           <implementation specific>
  2551.  
  2552.  
  2553.         Error Class ERRXOS
  2554.  
  2555.           <implementation specific>
  2556.  
  2557.  
  2558. _4._2._1_3.  _R_E_A_D _C_H_E_C_K
  2559.  
  2560. Request Format:
  2561.  
  2562.   BYTE   smb_wct;   /* value = 1 */
  2563.   WORD   smb_fid;   /* file handle */
  2564.   WORD   smb_bcc;   /* value = 0 */
  2565.  
  2566.  
  2567.  
  2568.  
  2569. Copyright Microsoft Corp., 1985              Intel PN 138447
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575. File Sharing Protocol Extensions- 40 -          September 5, 1986
  2576.  
  2577.  
  2578. Response Format:
  2579.  
  2580.   BYTE   smb_wct;      /* value = 1 */
  2581.   WORD   smb_status;   /* This may have the following values:
  2582.                          0 = file is empty
  2583.                          1 = file has data
  2584.   WORD   smb_bcc;      /* value = 0 */
  2585.  
  2586. Service:
  2587.  
  2588. Read Check checks to see if  a  process  will  block  if  it
  2589. attempts to read the file designated by the fid.  The status
  2590. field in  the response indicates if there is data to read --
  2591. a zero value indicates that there is no data, non-zero indi-
  2592. cates that there is data.
  2593.  
  2594. Support of this command is optional.
  2595.  
  2596. Read Check may generate the following errors.
  2597.  
  2598.         Error Class ERRDOS
  2599.  
  2600.           ERRbadfile
  2601.           <implementation specific>
  2602.  
  2603.  
  2604.         Error Class ERRSRV
  2605.  
  2606.           ERRerror
  2607.           ERRinvnid
  2608.           ERRnosupport
  2609.           <implementation specific>
  2610.  
  2611.  
  2612.         Error Class ERRHRD
  2613.  
  2614.           <implementation specific>
  2615.  
  2616.  
  2617.         Error Class ERRXOS
  2618.  
  2619.           <implementation specific>
  2620.  
  2621.  
  2622. _4._2._1_4.  _I_O_C_T_L
  2623.  
  2624. Request Format:
  2625.  
  2626.   BYTE   smb_wct;         /* value = 1 */
  2627.   WORD   smb_fid;         /* file handle */
  2628.   WORD   smb_bcc;         /* minimum value = 6 */
  2629.   BYTE   smb_ident1;      /* value = ASCII */
  2630.   BYTE   smb_path[];      /* [bid+]pathname */
  2631.   BYTE   smb_ident2;      /* value = DATA_BLOCK */
  2632.  
  2633.  
  2634.  
  2635. Copyright Microsoft Corp., 1985              Intel PN 138447
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641. File Sharing Protocol Extensions- 41 -          September 5, 1986
  2642.  
  2643.  
  2644.   BYTE   smb_size[2];     /* length of IOCTL request */
  2645.   BYTE   smb_request[];   /* the server/device/file specific request */
  2646.  
  2647. Response Format:
  2648.  
  2649.   BYTE   smb_wct;          /* value = 0 */
  2650.   WORD   smb_bcc;          /* minimum value = 4 */
  2651.   BYTE   smb_ident1;       /* value = DATA_BLOCK */
  2652.   BYTE   smb_size[2];      /* length of IOCTL response */
  2653.   BYTE   smb_response[];   /* the server/device/file/request specific response */
  2654.  
  2655. Service:
  2656.  
  2657. This function delivers a device/file specific request  to  a
  2658. server, and the device/file specific response to the reques-
  2659. ter.   The  target  file  may  be   identified   by   either
  2660. [bid+]pathname  or  fid.   If  both  or  neither of these is
  2661. specified an error occurs.   The  request  field  defines  a
  2662. function  specific to a particular device type on a particu-
  2663. lar server type.  Therefore the functions supported are  not
  2664. defined by the protocol, but by server implementations.  The
  2665. protocol simply provides a means of delivering them.
  2666.  
  2667. IOCTL may generate the following errors.
  2668.  
  2669.         Error Class ERRDOS
  2670.  
  2671.           ERRbadfile
  2672.           ERRbadpath
  2673.           ERRbadfid
  2674.           ERRbaddata
  2675.           <implementation specific>
  2676.  
  2677.  
  2678.         Error Class ERRSRV
  2679.  
  2680.           ERRerror
  2681.           ERRinvnid
  2682.           ERRbadbid
  2683.           ERRpathsyntax
  2684.           ERRfilespecs
  2685.           <implementation specific>
  2686.  
  2687.  
  2688.         Error Class ERRHRD
  2689.  
  2690.           <implementation specific>
  2691.  
  2692.  
  2693.         Error Class ERRXOS
  2694.  
  2695.           <implementation specific>
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701. Copyright Microsoft Corp., 1985              Intel PN 138447
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707. File Sharing Protocol Extensions- 42 -          September 5, 1986
  2708.  
  2709.  
  2710. _5.  _D_A_T_A _D_E_F_I_N_I_T_I_O_N_S
  2711.  
  2712. _5._1.  _C_O_M_M_A_N_D _C_O_D_E_S
  2713.  
  2714. The command codes are unchanged for commands that are common
  2715. with  the Core File Sharing Protocol.  The commands added by
  2716. the Extended File Sharing Protocol have the  following  com-
  2717. mand codes.
  2718.  
  2719. #define SMBlogon       0x60   /* Consumer Logon */
  2720. #define SMBbind        0x61   /* Bind */
  2721. #define SMBunbind      0x62   /* Unbind */
  2722. #define SMBgetaccess   0x63   /* Get Access Rights */
  2723. #define SMBlink        0x64   /* Link */
  2724. #define SMBfork        0x65   /* Fork */
  2725. #define SMBioctl       0x66   /* IOCTL */
  2726. #define SMBcopy        0x67   /* copy */
  2727. #define SMBgetpath     0x68   /* get pathname */
  2728. #define SMBreadh       0x69   /* read and hide */
  2729. #define SMBmove        0x6A   /* move */
  2730. #define SMBrdchk       0x6B   /* read check */
  2731. #define SMBmknod       0x6C   /* make node */
  2732. #define SMBreadopt     0x6F   /* read with options */
  2733.  
  2734.  
  2735. _5._2.  _E_R_R_O_R _C_L_A_S_S_E_S _A_N_D _C_O_D_E_S
  2736.  
  2737. The error class and code lists in the  section  include  all
  2738. classes  and codes generated by the Core File Sharing Proto-
  2739. col. Errors listed here are  intended  to  provide  a  finer
  2740. granularity  of  error conditions.  These lists are not com-
  2741. plete.
  2742.  
  2743. The following error classes may be returned by the  protocol
  2744. elements defined in this document.
  2745.  
  2746. SUCCESS      0   The request was successful.
  2747. ERRDOS    0x01   Error is generated by the server operating system.
  2748. ERRSRV    0x02   Error is generated by the server network file manager.
  2749. ERRHRD    0x03   Error is an hardware error (MSDOS int 24).
  2750. ERRXOS    0x04   Error is from extended operating system set.
  2751. ERRRMX1   0xE1   Reserved for iRMX
  2752. ERRRMX2   0xE2   Reserved for iRMX
  2753. ERRRMX3   0xE3   Reserved for iRMX
  2754. ERRCMD    0xFF   Command was not in the "SMB" format.
  2755.  
  2756.  
  2757. The following error codes may be generated with the  SUCCESS
  2758. error class.
  2759.  
  2760. SUCCESS   0   The request was successful.
  2761.  
  2762.  
  2763. The following error codes may be generated with  the  ERRDOS
  2764.  
  2765.  
  2766.  
  2767. Copyright Microsoft Corp., 1985              Intel PN 138447
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773. File Sharing Protocol Extensions- 43 -          September 5, 1986
  2774.  
  2775.  
  2776. error  class.   The Xenix errors equivalent to each of these
  2777. errors are noted at the end of the error description.
  2778.  
  2779. ERRbadfunc       1
  2780.                      Invalid function.  The server OS did not recognize or could not  perform
  2781.                      a system call generated by the server, e.g., set the DIRECTORY attribute
  2782.                      on a data file, invalid seek mode. [EINVAL]
  2783. ERRbadfile       2
  2784.                      File not found.  The last component of a file's pathname  could  not  be
  2785.                      found.
  2786. ERRbadpath       3
  2787.                      Directory invalid.  A directory component in a  pathname  could  not  be
  2788.                      found.  [ENOENT]
  2789. ERRnofids        4
  2790.                      Too many open files.  The server has no file handles  (fids)  available.
  2791.                      [EMFILE]
  2792. ERRnoaccess      5
  2793.                      Access denied, the requester's context does  not  permit  the  requested
  2794.                      function.  This includes the following conditions.  [EPERM]
  2795.                          invalid rename command
  2796.                          write to fid open for read only
  2797.                          read on fid open for write only
  2798.                          Attempt to delete a non-empty directory
  2799. ERRbadfid        6
  2800.                      Invalid file handle.  The file handle specified was  not  recognized  by
  2801.                      the server.  [EBADF]
  2802. ERRbadmcb        7   Memory control blocks destroyed.  [EREMOTEIO]
  2803. ERRnomem         8   Insufficient server memory to perform the requested function.  [ENOMEM]
  2804. ERRbadmem        9   Invalid memory block address.  [EFAULT]
  2805. ERRbadenv       10   Invalid environment.  [EREMOTEIO]
  2806. ERRbadformat    11   Invalid format.  [EREMOTEIO]
  2807. ERRbadaccess    12   Invalid open mode.
  2808. ERRbaddata      13   Invalid data (generated only by IOCTL calls within the server).  [E2BIG]
  2809. ERR             14   reserved
  2810. ERRbaddrive     15   Invalid drive specified.  [ENXIO]
  2811. ERRremcd        16
  2812.                      A Delete Directory request attempted  to  remove  the  server's  current
  2813.                      directory.  [EREMOTEIO]
  2814. ERRdiffdevice   17   Not same device (e.g., a cross volume rename was attempted)  [EXDEV]
  2815. ERRnofiles      18
  2816.                      A File Search command can find no more files matching the specified cri-
  2817.                      tera.
  2818. ERRbadshare     21
  2819.                      The sharing mode specified for an Open conflicts with existing  FIDs  on
  2820.                      the file.  [ETXTBSY]
  2821. ERRlock         22
  2822.                      A Lock request conflicted with an existing lock or specified an  invalid
  2823.                      mode,  or an Unlock requested attempted to remove a lock held by another
  2824.                      process.  [EDEADLOCK]
  2825. ERRfilexists    80
  2826.                      The file named in a Create Directory, Make  New  File  or  Link  request
  2827.                      already exists. The error may also be generated in the Create and Rename
  2828.                      transaction.  [EEXIST]
  2829.  
  2830.  
  2831. The following error codes may be generated with  the  ERRSRV
  2832. error class.
  2833.  
  2834. ERRerror              1   Non-specific error code.  It is returned under the following conditions:
  2835.                               first command on VC was not negotiate
  2836.                               multiple negotiates attempted
  2837.  
  2838.  
  2839.  
  2840.  
  2841. Copyright Microsoft Corp., 1985              Intel PN 138447
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847. File Sharing Protocol Extensions- 44 -          September 5, 1986
  2848.  
  2849.  
  2850. ERRbadpw              2
  2851.                           Bad password - name/password pair in a Tree Connect or Consumer Logon  are
  2852.                           invalid.
  2853. ERRbadtype            3   reserved
  2854. ERRaccess             4
  2855.                           The requester does not have the necessary access rights within the  speci-
  2856.                           fied context for the requested function. The context is defined by the TID
  2857.                           (for server based protection) or by the uid and gid  (for  consumer  based
  2858.                           protection, where TID is -1).  [EACCES]
  2859. ERRinvnid             5   The tree ID (tid) specified in a command was invalid.
  2860. ERRinvnetname         6   Invalid network name in tree connect.
  2861. ERRinvdevice          7
  2862.                           Invalid device - printer request made to non-printer  connection  or  non-
  2863.                           printer request made to printer connection.
  2864. ERRqfull             49   Print queue full (files) -- returned by open print file.
  2865. ERRqtoobig           50   Print queue full -- no space.
  2866. ERRqeof              51   EOF on print queue dump.
  2867. ERRsmbcmd            64   The server did not recognize the command received.
  2868. ERRsrverror          65
  2869.                           The server encountered an internal error, e.g., system file unavailable.
  2870. ERRbadbid            66   The bid supplied does not reference a file in the server's file hierarchy.
  2871. ERRfilespecs         67
  2872.                           The file handle (FID), BID and pathname parameters  contained  an  invalid
  2873.                           combination of values.
  2874. ERRbadlink           68   The server cannot perform the requested LINK function.
  2875. ERRbadpermits        69
  2876.                           The access permissions specified for a file or directory are not  a  valid
  2877.                           combination.   The  server  cannot  set  the  requested  attribute.   This
  2878.                           includes the following conditions.
  2879.                               EXECUTE cannot be set independently of READ
  2880.                               SEARCH cannot be reset
  2881.                               STICKY cannot be set
  2882.                               SETUID cannot be set
  2883.                               SETGID cannot be set
  2884. ERRbadpid            70   The new pid specified in a Fork request is already assigned.
  2885. ERRsetattrmode       71   The attribute mode in the Set File Attribute request is invalid.
  2886. ERRpaused            81   Server is paused. (reserved for messaging)
  2887. ERRmsgoff            82   Not receiving messages. (reserved for messaging).
  2888. ERRnoroom            83   No room to buffer message. (reserved for messaging).
  2889. ERRrmuns             87   Too many remote user names. (reserved for messaging).
  2890. ERRnosupport     0xFFFF   Function not supported.
  2891.  
  2892.  
  2893. The following error codes may be generated with  the  ERRHRD
  2894. error  class.   The Xenix errors equivalent to each of these
  2895. errors are noted at the end of the error description.
  2896.  
  2897. ERRnowrite     19   Attempt to write on write-protected diskette.  [EROFS]
  2898. ERRbadunit     20   Unknown unit.  [ENODEV]
  2899. ERRnotready    21   Drive not ready.  [EUCLEAN]
  2900. ERRbadcmd      22   Unknown command.
  2901. ERRdata        23   Data error (CRC).  [EIO]
  2902. ERRbadreq      24   Bad request structure length.  [ERANGE]
  2903. ERRseek        25   Seek error.
  2904. ERRbadmedia    26   Unknown media type.
  2905. ERRbadsector   27   Sector not found.
  2906. ERRnopaper     28   Printer out of paper.
  2907. ERRwrite       29   Write fault.
  2908. ERRread        30   Read fault.
  2909.  
  2910.  
  2911.  
  2912. Copyright Microsoft Corp., 1985              Intel PN 138447
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918. File Sharing Protocol Extensions- 45 -          September 5, 1986
  2919.  
  2920.  
  2921. ERRgeneral     31   General failure.
  2922. ERRbadshare    32   A compatibility mode open conflicts with an existing open. [ETXTBSY]
  2923.  
  2924. The following error codes may be generated with  the  ERRXOS
  2925. error class.
  2926.  
  2927. ESRCH           3   No such process.
  2928. EINTR           4   Interrupted system call.
  2929. ENOEXEC         8   Bad executable file format.
  2930. ECHILD         10   Wait executed for a process with no "unwaited-for" children.
  2931. EAGAIN         11   Server's process table is full.
  2932. ENOTBLK        15   An ordinary file was designated where a block device is required.
  2933. EBUSY          16   Device cannot be MOUNTed or UMOUNTed.
  2934. ENOTDIR        20   A directory must be specified for this request.
  2935. EISDIR         21   An attempt to write on a directory.
  2936. ENFILE         23   Internal table overflow, e.g., file table.
  2937. ENOTTY         25   A terminal device is required.
  2938. EFBIG          27   File size exceeded maximum supported.
  2939. ENOSPC         28   No space left on device.
  2940. ESPIPE         29   A seek was issued to a pipe.
  2941. EMLINK         31   Too many links.
  2942. EPIPE          32   Write to a pipe for which there is no process to read the data.
  2943. EDOM           33   Bad math argument.
  2944. ENOTNAM        37   Invalid semaphore identifier.
  2945. ENAVAIL        38   Semaphore not available.
  2946. EISNAM         39   File is a semaphore
  2947. EREMOTEIO      40   Remote I/O error.
  2948. EINIT          41   The network could not be initialized.
  2949. EREMDEV        42   The referenced device is remote.
  2950. EPATHSYNTAX   256   A pathname contained a syntax error.
  2951. ENOTFILE      257   A data file must be specified for this request.
  2952. Ereserved     258   reserved
  2953. EREADONLY     259   Invalid access to read only file, e.g., open for write, delete, set attributes.
  2954. EACL          260   Access Control List full.
  2955.  
  2956.  
  2957. _6.  _E_X_C_E_P_T_I_O_N _H_A_N_D_L_I_N_G
  2958.  
  2959. Exception handling within the extended protocol  environment
  2960. is  an  extension  to the core techniques.  It is built upon
  2961. the various environments supported by the file sharing  pro-
  2962. tocol.  When any environment is dissolved (in either an ord-
  2963. erly or disorderly fashion) all contained  environments  are
  2964. dissolved.   The  hierarchy  of  environments  is summarized
  2965. below:
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978. Copyright Microsoft Corp., 1985              Intel PN 138447
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984. File Sharing Protocol Extensions- 46 -          September 5, 1986
  2985.  
  2986.  
  2987.  
  2988.         Consumer Based User Authentication:
  2989.  
  2990.           Virtual Circuit
  2991.               UID+GID
  2992.               BID
  2993.               PID
  2994.                   FID
  2995.  
  2996.         Server Based User Authentication:
  2997.  
  2998.           Virtual Circuit
  2999.               TID
  3000.               BID
  3001.               PID
  3002.                   FID
  3003.  
  3004.  
  3005. As can be seen from these  summaries,  the  Virtual  Circuit
  3006. (VC)  is  the  key  environment.  When a VC is dissolved the
  3007. server processes (or equivalent) is  terminated;  the  TIDs,
  3008. BIDs  and  FIDs  are  invalidated,  and outstanding requests
  3009. (MIDs) are dropped -- responses will not be generated.
  3010.  
  3011. The termination of a PID will cause the closing of all  FIDs
  3012. it  contains.  The destruction of TIDs, BIDs and FIDs has no
  3013. affect on other environments.
  3014.  
  3015. The rules for VC establishment and dissolution are identical
  3016. to those enforced by the core file sharing protocol with the
  3017. following exceptions.
  3018.  
  3019. If a server receives a VC establishment request from a  con-
  3020. sumer with which it already conversing, the existing VC will
  3021. be dropped, invalidating all its  enclosed  TIDs,  PIDs  and
  3022. FIDs, and the new request accepted.
  3023.  
  3024. A server may drop the VC to a consumer at any  time  if  the
  3025. consumer  is  generating illogical requests.  However, wher-
  3026. ever possible the server should first return an  error  code
  3027. to the consumer indicating the cause of the VC abort.
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044. Copyright Microsoft Corp., 1985              Intel PN 138447
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050. File Sharing Protocol Extensions- 47 -          September 5, 1986
  3051.  
  3052.  
  3053.                         _A_P_P_E_N_D_I_X _A
  3054.  
  3055.                     _S_U_P_P_O_R_T_I_N_G _F_U_N_C_T_I_O_N_S
  3056.  
  3057.  
  3058. In order to implement a product using the file sharing  pro-
  3059. tocol  defined  in  this  and the core protocol documents, a
  3060. system must support a number of functions not  addressed  by
  3061. the protocols.  The approaches that will be supported by the
  3062. protocol developers in some of these areas are outlined here
  3063. as  examples.   There  is not intended to be any implication
  3064. that any other developer must support these approaches.
  3065.  
  3066.  
  3067. _F_I_L_E _N_A_M_I_N_G
  3068.  
  3069. Implementations of the file sharing  protocol  will  usually
  3070. involve  extending file names in such a manner that consumer
  3071. systems can deduce the server containing  the  file.   Typi-
  3072. cally  this will consist of the addition of one or more file
  3073. name components to indicate the server.
  3074.  
  3075. This extended naming system is  strictly  a  consumer  local
  3076. issue as it is used only to inform the consumer which server
  3077. to address, and only the portion of the pathname  for  which
  3078. the server is responsible is passed to it.
  3079.  
  3080. We will add a pathname component to identify the file server
  3081. node.   The  presence  of  this additional component will be
  3082. indicated by beginning the pathname with "//".  Thus a  net-
  3083. work pathname has the form:
  3084.  
  3085.             //server_name/server_local_pathname
  3086.  
  3087.  
  3088. If the server_name component is not present in  a  pathname,
  3089. the file is assumed to be local.
  3090.  
  3091. It is anticipated that in future additional components  will
  3092. be added to the pathname to allow identification of the net-
  3093. work containing the server.
  3094.  
  3095.  
  3096. _N_A_M_E _S_E_R_V_E_R
  3097.  
  3098. The nameserver provides mappings between network objects and
  3099. their properties, e.g., logical names and network addresses.
  3100. There are two components to the nameserver -- the nameserver
  3101. database  which  contains  the necessary mapping information
  3102. for the network and the nameserver procedure which uses  the
  3103. database to perform translations.
  3104.  
  3105. The nameserver database is  a  globally  accessible  network
  3106. file.   The nameserver procedure may execute on the consumer
  3107.  
  3108.  
  3109.  
  3110. Copyright Microsoft Corp., 1985              Intel PN 138447
  3111.  
  3112.  
  3113.  
  3114.  
  3115.  
  3116. File Sharing Protocol Extensions- 48 -          September 5, 1986
  3117.  
  3118.  
  3119. systems requiring the  translations  or  may  execute  on  a
  3120. "nameserver  system" and receive its requests from consumers
  3121. through a separate "nameserver  protocol".   The  nameserver
  3122. procedure  will  access  the  file  using normal file access
  3123. functions, thus, when the database is remote, the NFS proto-
  3124. cols  will  automatically  and  transparently  be invoked to
  3125. access the file.
  3126.  
  3127. If  accessed  directly  by  consumers,  the  name   of   the
  3128. nameserver  database  file  must  be  globally known.  It is
  3129. anticipated that this will typically be held in a local file
  3130. by each consumer.
  3131.  
  3132. Most networks will also wish to backup the nameserver  data-
  3133. base.   This  can  be done either on a per consumer basis --
  3134. where each consumer makes a local copy of the file  periodi-
  3135. cally  to  guarantee  the availability of a not too outdated
  3136. version of the file -- or globally where a  single  copy  of
  3137. the  file  is  made  on  a "reliable" system other than that
  3138. holding the primary file.  In either case the  name  of  the
  3139. backup  file must be known to the consumers -- probably with
  3140. the same technique used for the primary file.
  3141.  
  3142. Example:  A consumer might have a local file containing  the
  3143. following information
  3144.  
  3145.         --------------------------------------------------------------------
  3146.         bigsys:12345 (the name and address of the server containing
  3147.                       the nameserver database)
  3148.         //bigsys/net/global.names (the file name of the nameserver
  3149.                                    database)
  3150.         /net/global.backup (the file name of the nameserver
  3151.                             database local backup file)
  3152.         --------------------------------------------------------------------
  3153.  
  3154.         //bigsys/net/global.names contains:  a long list of names
  3155.                                              and addresses.
  3156.  
  3157.         /net/global.backup contains:  a long list of names
  3158.                                       and addresses, possibly
  3159.                                       not as current as
  3160.                                       //bigsys/net/global.names.
  3161.  
  3162.  
  3163.  
  3164. _U_S_E_R _A_D_M_I_N_I_S_T_R_A_T_I_O_N
  3165.  
  3166. As the architectural model outlined, the file sharing proto-
  3167. col accommodates both consumer and server based user authen-
  3168. tication. In a server based network each user will  have  an
  3169. identity  on  each  server  with which he communicates.  The
  3170. server will maintain a local User Definition File (UDF) con-
  3171. taining  the  profile  of  its users. When a Tree Connect is
  3172. received the name and password supplied are verified, by the
  3173.  
  3174.  
  3175.  
  3176. Copyright Microsoft Corp., 1985              Intel PN 138447
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182. File Sharing Protocol Extensions- 49 -          September 5, 1986
  3183.  
  3184.  
  3185. server,  against  the contents of this file.  If the user is
  3186. valid a Tree ID (TID) is generated for him and used  as  the
  3187. key  identifier  in  all  further communication between that
  3188. instance of the user and the server.
  3189.  
  3190. In networks using consumer  based  user  authentication  the
  3191. network will support a single community of users.  Each user
  3192. will have a single identity (name and  user  ID)  throughout
  3193. the  network.   Groups  also will have a network wide scope.
  3194. The users view of the network  will  be  that  of  a  single
  3195. multi-user system.  There will be a single superuser defini-
  3196. tion and that superuser will have network  wide  privileges,
  3197. i.e.,  will  have  superuser  privileges on all systems con-
  3198. nected to the network.
  3199.  
  3200. There will be a single User  Definition  File  (UDF).   This
  3201. file  will  be  replicated at every node in the network, and
  3202. this local copy will be used by all  commands  that  do  not
  3203. modify it.  When the UDF is updated it is the user's respon-
  3204. sibility to ensure that all copies are synchronized.
  3205.  
  3206. One copy of the UDF is named the "master".  This  copy  will
  3207. be  identified by a pathname in a local file (presumably the
  3208. same file that names the  nameserver  files).   All  updates
  3209. must  be  made  to  this  copy.   Update  utilities, such as
  3210. passwd, will be modified to update both the local  copy  and
  3211. the master copy. The users are responsible for ensuring that
  3212. the master copy is periodically copied to all nodes  in  the
  3213. network.
  3214.  
  3215. This approach will support most system  functions  when  the
  3216. system  is  in  standalone  mode.  All users will be able to
  3217. login using the local UDF copy, but no UDF modification  can
  3218. be  allowed.   Therefore in standalone mode passwords cannot
  3219. be changed and users cannot be added or deleted.
  3220.  
  3221.  
  3222. _N_O_D_E _A_D_M_I_N_I_S_T_R_A_T_I_O_N
  3223.  
  3224. In a network with consumer based user authentication  it  is
  3225. necessary  for  servers  to be able to authenticate consumer
  3226. systems before trusting their user identifications.   To  do
  3227. this  each  consumer  system  will  have a name and password
  3228. which it uses with  the  Consumer  Logon  command.   When  a
  3229. server  receives  such  a  command  it  validates  the  data
  3230. presented against a Node Definition File (NDF).
  3231.  
  3232. The NDF is maintained in a manner  similar  to  the  current
  3233. UNIX   Password  File.   It  may  be  updated  only  by  the
  3234. superuser.  When the network configuration changes  the  NDF
  3235. must be updated.  NDF update may be performed without inter-
  3236. rupting network operation.
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242. Copyright Microsoft Corp., 1985              Intel PN 138447
  3243.  
  3244.  
  3245.