home *** CD-ROM | disk | FTP | other *** search
/ ftp.microsoft.com / 2002-07-02_ftp.microsoft.com.zip / developr / drg / CIFS / cifslog.txt < prev    next >
Text File  |  1997-01-29  |  53KB  |  1,343 lines

  1.  
  2.  
  3.  
  4.             CIFS Domain Logon and Pass Through Autentication
  5.  
  6.  
  7. Network Working Group                           Paul J. Leach, Microsoft
  8. INTERNET-DRAFT                                  Dilip C. Naik, Microsoft
  9. draft-leach-cifs-logon-spec-00.txt
  10. Category: Informational
  11. Expires June 3, 1997                         January 3, 1997
  12.  
  13.  
  14.                CIFS Logon and Pass Through Authentication
  15.  
  16.                            Preliminary Draft
  17.  
  18.  
  19.  
  20.  
  21. STATUS OF THIS MEMO
  22.  
  23. THIS IS A PRELIMINARY DRAFT OF AN INTERNET-DRAFT.  IT DOES NOT REPRESENT
  24. THE CONSENSUS OF  ANY WORKING GROUP.
  25.  
  26. This document is an Internet-Draft. Internet-Drafts are working
  27. documents of the Internet Engineering Task Force (IETF), its areas, and
  28. its working groups. Note that other groups may also distribute working
  29. documents as Internet-Drafts.
  30.  
  31. Internet-Drafts are draft documents valid for a maximum of six months
  32. and may be updated, replaced, or obsoleted by other documents at any
  33. time. It is inappropriate to use Internet-Drafts as reference material
  34. or to cite them other than as "work in progress".
  35.  
  36. To learn the current status of any Internet-Draft, please check the
  37. "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow
  38. Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
  39. munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
  40. ftp.isi.edu (US West Coast).
  41.  
  42. Distribution of this document is unlimited.  Please send comments to the
  43. authors or the CIFS mailing list at <cifs@listserv.msn.com>.
  44. Discussions of the mailing list are archived at
  45. <URL:http://microsoft.ease.lsoft.com/archives/cifs.html>.
  46.  
  47.  
  48. ABSTRACT
  49.  
  50. This specification defines how a certain Common Internet File Systems
  51. (CIFS) client accomplishes logging on to a CIFS server. The
  52. specification also details how a CIFS server may accomplish pass through
  53. authentication.
  54.  
  55.  
  56. Table of Contents
  57.  
  58.  
  59. 1. PREREQUISITES AND SUGGESTED READING.................................2
  60.  
  61.  
  62. Leach, Naik                                                            1
  63.  
  64.  
  65.             CIFS Domain Logon and Pass Through Autentication
  66.  
  67.  
  68. 2. CIFS DOMAIN LOGON...................................................3
  69.  
  70.  2.1 DOMAIN CONTROLLER DISCOVERY ......................................3
  71.   2.1.1 NetBIOS Name Notation .........................................3
  72.   2.1.2 Mailslot Protocol Specification ...............................3
  73.   2.1.3 Primary Domain Controller Location Protocol ...................4
  74.  2.2 SESSION SETUP ....................................................6
  75.  2.3 REMOTE API EXECUTION .............................................6
  76.  2.4 NETWKSTAUSERLOGON ................................................6
  77.  2.5 NETWKSTAUSERLOGOFF ..............................................11
  78.  2.6 NETUSERGETINFO ..................................................13
  79.  
  80. 3. CIFS PASS THROUGH AUTHENTICATION...................................17
  81.  
  82.  
  83. 4. APPENDIX A - REMOTE ADMINISTRATION PROTOCOL........................18
  84.  
  85.  4.1 NOTATION ........................................................18
  86.  4.2 DESCRIPTORS .....................................................19
  87.   4.2.1 Request Parameter Descriptors ................................19
  88.   4.2.2 Response Parameter Descriptors ...............................20
  89.   4.2.3 Data Descriptors .............................................20
  90.  4.3 TRANSACTION REQUEST PARAMETERS SECTION ..........................21
  91.  4.4 TRANSACTION REQUEST DATA SECTION ................................21
  92.  4.5 TRANSACTION RESPONSE PARAMETERS SECTION .........................21
  93.  4.6 TRANSACTION RESPONSE DATA SECTION ...............................22
  94.  
  95. 5. AUTHOR'S ADDRESSES.................................................22
  96.  
  97.  
  98. Objective
  99.  
  100. This document details :
  101. . how a CIFS client logs on to a domain
  102. . how a CIFS client logs on to a CIFS server where the CIFS server
  103.   performs pass through authentication , verifying the client
  104.   credentials with a Domain Controller.
  105.  
  106. For convenience, some sections from the CIFS specification have been
  107. reproduced in part within this document. Note that the CIFS
  108. specification should be considered to be the authoritative reference, in
  109. case of any doubts, rather than this document.
  110.  
  111.  
  112. 1. Prerequisites and suggested reading
  113.  
  114. . Familiarity with Common Internet File Systems specification (CIFS)
  115. . Familiarity with the CIFS Remote Administration Protocol (RAP)
  116.   specification.
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123. Leach, Naik                                                            2
  124.  
  125.  
  126.             CIFS Domain Logon and Pass Through Autentication
  127.  
  128.  
  129. 2. CIFS Domain Logon
  130.  
  131. CIFS domain logon is a mechanism by which a CIFS server validates a
  132. user's credentials with a Domain Controller (DC). For the purposes of
  133. this document, a domain is simply a logical grouping of resources such
  134. as CIFS servers, user accounts, etc. A Domain Controller is a CIFS
  135. server that coordinates synchronization and management activities within
  136. a domain.  Specific Microsoft products implement the concept of domains
  137. with much greater richness and detail, but that is beyond the scope of
  138. this document.
  139.  
  140. A CIFS client logs onto a domain in 3 logical steps:
  141. . Domain Controller Discovery
  142. . Session Setup
  143. . Remote API execution
  144.  
  145. Each of these are discussed in greater detail in the following sections.
  146.  
  147.  
  148. 2.1 Domain Controller Discovery
  149.  
  150. Domain Controller Discovery is the process by means of which a CIFS
  151. client locates a Domain Controller (DC). This
  152. functionality is implemented using mailslots and special NETBIOS names.
  153. Before proceeding to explain the Domain Controller Discovery mechanism,
  154. it would be appropriate to discuss NETBIOS names and Mailslots.
  155.  
  156. Mailslots provide an easy to use mechanism for fast, unreliable
  157. unidirectional data transfer. With Microsoft implementations of
  158. mailslots, once an application has obtained a handle to a mailslot, the
  159. application can write to the mailslot in a fashion very similar to
  160. writing to a file. Mailslot writes are implemented using the CIFS
  161. Transact SMB which is sent via a datagram to some special Netbios names.
  162. Various data structures, which are detailed  subsequently within this
  163. document, flow as the data portion of the Transact SMB.
  164.  
  165. 2.1.1 NetBIOS Name Notation
  166.  
  167. NAME(xx) denotes the ASCII string "NAME," padded with spaces (0x20) to
  168. 15 bytes, with a hex xx value in the 16th byte.  For example, the
  169. notation "FOOBAR(xx)" indicates a NetBIOS name consisting of the bytes:
  170.     [69,79,79,65,64,82,20,20,20,20,20,20,20,20,20, xx]
  171.  
  172. String literals that are placeholders and that need to be substituted
  173. with their actual values are bracketed within <>. Thus the string
  174. <Domain> would become _Redmond_ if the domain under consideration is
  175. named _Redmond_.
  176. Details of the various NETBIOS names used for browsing are described in
  177. Appendix  C
  178.  
  179. 2.1.2 Mailslot Protocol Specification
  180.  
  181. Mailslots provide an easy to use mechanism for fast, unreliable
  182. unidirectional data transfer. With Microsoft implementations of
  183.  
  184. Leach, Naik                                                            3
  185.  
  186.  
  187.             CIFS Domain Logon and Pass Through Autentication
  188.  
  189.  
  190. mailslots, once an application has obtained a handle to a mailslot, the
  191. application can write to the mailslot in a fashion very similar to
  192. writing to a file. Mailslot writes are implemented using the CIFS
  193. Transact SMB which is sent via a datagram to some special Netbios names.
  194. Various data structures, which are detailed  subsequently within this
  195. document, flow as the data portion of the CIFS Transact SMB.
  196.  
  197. The only transaction allowed to a mailslot is a mailslot write.
  198. Mailslot writes requests are encapsulated in CIFS TRANSACT SMBs. The
  199. following table shows the interpretation of the TRANSACT SMB parameters
  200. for a mailslot transaction:
  201.  Name       Value                Description
  202.  Command    SMB_COM_TRANSACTION
  203.  Name       \MAILSLOT\<name>      STRING Name of mail slot to  write
  204.  SetupCount 3                    Always 3 for mailslot writes
  205.  Setup[0]   1                    Command code == write mailslot
  206.  Setup[1]   Ignored
  207.  Setup[2]   Ignored
  208.             n                    Size of data in bytes to write to the
  209. TotalDataCo                      mailslot
  210. unt
  211. Data[n]                          The data to write to the mailslot
  212.  
  213.  
  214. 2.1.3 Primary Domain Controller Location Protocol
  215.  
  216. This appendix details how a client goes about locating a Primary Domain
  217. Controller (PDC). The process is rather involved, because different
  218. versions of the Primary Domain Controller have used different versions
  219. of the protocol, and hence a client that does not know what protocol is
  220. supported by its Primary Domain Controller has to try them all.
  221.  
  222. A Primary Domain Controller (PDC) for a domain "D" is located by sending
  223. a mailslot message containing a NETLOGON_QUERY frame to a NETBIOS name
  224. and mailslot "\NET\NETLOGON" and then waiting for a reply mailslot
  225. message, which will be sent to the mailslot name specified by the client
  226. in the NETLOGON_QUERY structure., and which will contain a
  227. NETLOGON_RESPONSE structure. If there is no response after a delay, the
  228. message may be retransmitted. The delay MUST be at least twice the
  229. expected service time, and the delay should be doubled after each time-
  230. out.
  231.  
  232. If a reply is received, the name of the Primary Domain Controller SHOULD
  233. be cached for future use, so as time minimize network traffic. If no
  234. reply is received after several retransmissions, the Primary Domain
  235. Controller may be declared to be unreachable, and no further attempt to
  236. locate it should be made for a while (exactly how long depends on the
  237. expected recovery time for a Primary Domain Controller and/or for the
  238. network; typically a minute or so, but should be increased after each
  239. failure).
  240.  
  241. The only difference between versions of the protocol is the NETBIOS name
  242. to which the message is sent, as follows:
  243.  
  244.  
  245. Leach, Naik                                                            4
  246.  
  247.  
  248.             CIFS Domain Logon and Pass Through Autentication
  249.  
  250.  
  251. NETBIOS     name      PDC's OS version
  252. name        type      =============
  253. =========== ========
  254. D(1b)       unique    Windows NT 3.51 or later or compatible
  255. D(1c)       group     Windows NT 3.1 or later or compatible
  256. D(00)       group     all
  257.  
  258. Clients which are configured to know or are willing to assume what
  259. version of the protocol their Primary Domain Controller is running may
  260. directly use the appropriate NETBIOS name for that version. Otherwise,
  261. they SHOULD first attempt D(1b), since it is unicast and creates the
  262. least network traffic; if there is no response, then they SHOULD try the
  263. others. They MAY try them in parallel.
  264.  
  265. The NETLOGON_QUERY structure is defined as :
  266.  
  267.     struct NETLOGON_QUERY{
  268.         unsigned char   Opcode;
  269.         char            ComputerName[];
  270.         char            MailslotName[];
  271.         unsigned short  Lm20Token;
  272.     } ;
  273.  
  274.     Opcode __Identifies this structure as a NETLOGON_QUERY and has a
  275.         value of 0x07.
  276.  
  277.     ComputerName __Specifies the ASCII name of the computer sending the
  278.         query, and is up to 16 bytes in length. The response is sent to
  279.         NETBIOS unique name <ComputerName>(00).
  280.  
  281.     MailslotName __Specifies the ASCII name of the mailslot to which the
  282.         response is to be sent, and is up to 256 bytes in length; cannot
  283.         be _\MAILSLOT\LANMAN_ or _\MAILSLOT\MSBROWSE_ or
  284.         "\NET\NETLOGON".
  285.  
  286.     Lm20Token - has a value of 0xFFFF.
  287.  
  288.  
  289. The response mailslot message contains a NETLOGON_RESPONSE data
  290. structure that is defined as the following :
  291.  
  292.     struct NETLOGON_RESPONSE
  293.     {
  294.         unsigned char   Opcode;
  295.         char            PrimaryDCName[16];
  296.         unsigned short  Lm20Token;
  297.     };
  298.  
  299. where
  300.     Opcode __Identifies this structure as a NETLOGON_RESPONSE and has a
  301.         value of 0x12.
  302.  
  303.     PrimaryDCName __Specifies the ASCII name of the Primary Domain
  304.         Controller and is up to 16 bytes in length.
  305.  
  306. Leach, Naik                                                            5
  307.  
  308.  
  309.             CIFS Domain Logon and Pass Through Autentication
  310.  
  311.  
  312.     Lm20Token - has a value of 0xFFFF
  313.  
  314. Note that this procedure to locate a Primary Domain Controller is
  315. expensive in terms of network traffic. The Microsoft implementations
  316. attempt to alleviate this by caching the PDC Name. Before using the
  317. cached PDC Name, a NetServerEnum2 API is remoted to the PDC and a sanity
  318. check is performed to ensure that the server type returned indicates a
  319. Primary Domain Controller
  320.  
  321.  
  322.  
  323. 2.2 Session Setup
  324.  
  325. The objective of this phase is to validate the client credentials. The
  326. CIFS client sends a SessionSetupAndX SMB to the Domain Controller whose
  327. identity has just been dicovered, along with a challenge response that
  328. is computed as detailed in the CIFS specification. The SessionSetupAndX
  329. SMB response indicates whether the Domain Controller was satisfied with
  330. the challenge response. The SessiopnSetupAndX SMB response will also
  331. indicate if the Domain Controller is dissatisfied with the challenge
  332. response, but permits guest access. Obviously, the SessionSetupAndX SMB
  333. must be preceded by a Negotiate SMB as detailed in the CIFS
  334. specification.
  335.  
  336. The Negotiate and Session Setup SMBs are detailed in the CIFS document.
  337. All of these SMBs are sent to the Domain Controller.
  338.  
  339. 2.3 Remote API execution
  340.  
  341. Persons unfamiliar with the RAP specification are strongly advised to
  342. read the CIFS specification or at least Appendix A at this stage.
  343. Sections that follow describe how a CIFS client logs on, logs off and
  344. retrieves other significant information such as home directory, etc
  345. about a particular user.
  346.  
  347. 2.4 NetwkstaUserLogon
  348.  
  349. This is a function executed on a remote CIFS server to log on a user.
  350. The purpose is to perform checks such as whether the specified user is
  351. permitted to logon from the specified computer, whether the specified
  352. user is permitted to log on at the given moment, etc. as well as perform
  353. housekeeping and statistics updates.
  354.  
  355. There is a password field in the parameters for this function. However,
  356. this field is always set to null before the function is sent on the
  357. wire, in order to preserve security. The remote CIFS server ignores this
  358. meaningless password that is sent. The remote CIFS server ensures
  359. security by checking that the user name and computer name that are in
  360. the request parameters are the same used to establish the session and
  361. connection to the IPC$ share on the remote CIFS server.
  362.  
  363. The definition is:
  364.  
  365.  unsigned short NetWkstaUserLogon(
  366.  
  367. Leach, Naik                                                            6
  368.  
  369.  
  370.             CIFS Domain Logon and Pass Through Autentication
  371.  
  372.  
  373.    char        *reserved1;
  374.    char        *reserved2;
  375.    unsigned short    sLevel;
  376.    BYTE        bReqBuffer[54];
  377.    unsigned short   cbReqBuffer;
  378.    RCVBUF      pbBuffer;
  379.    RCVBUFLEN   cbBuffer;
  380.    unsigned short   *pcbTotalAvail;
  381.  );
  382.  
  383.  where:
  384.  
  385.    reserved1 and reserved2 are reserved fields and must be null.
  386.  
  387.    sLevel specifies the level of detail returned. The only legal
  388.    value is 1.
  389.  
  390.    pbReqBuffer points to the request buffer. This buffer contains
  391.    parameters that need to be sent to the server. The actual value
  392.    and structure is defined in the Transaction Request Parameters
  393.    section.
  394.  
  395.    cbReqBuffer specifies the size, in bytes, of the buffer pointed to
  396.    by the pbReqBuffer parameter.  The value must be decimal 54.
  397.  
  398.    pbBuffer points to the buffer to receive the returned data.
  399.  
  400.    cbBuffer specifies the size, in bytes, of the buffer pointed to by
  401.    the pbBuffer parameter.
  402.  
  403.    pcbTotalAvail is a pointer to an unsigned short which gets filled
  404.    with the total number of data bytes available if the function
  405.    succeeds.
  406.  
  407. Transaction Request Parameters section
  408.  
  409. The Transaction request parameters section in this instance contains:
  410.  
  411. . The 16 bit function number for NetWkstaUserLogon which is 132.
  412. . The parameter descriptor string which is "zzWb54WrLh"
  413. . The data descriptor string for the (returned) data which is
  414.   "WB21BWDWWDDDDDDDzzzD"
  415. . The actual parameters as described by the parameter descriptor
  416.   string.
  417.  
  418. The parameters are:
  419. . A null pointer
  420. . Another null pointer
  421. . A 16 bit integer with a value of 1 (corresponding to the "W" in the
  422.   parameter descriptor string. This represents the level of detail the
  423.   server is expected to return)
  424. . a byte array of length 54 bytes. These 54 bytes are defined as
  425.  
  426.  
  427.  
  428. Leach, Naik                                                            7
  429.  
  430.  
  431.             CIFS Domain Logon and Pass Through Autentication
  432.  
  433.  
  434.     char    wlreq1_name[21];        // User Name
  435.     char    wlreq1_pad1;            //Pad next field to a word boundary
  436.     char    wlreq1_password[15];    //Password, set to null, ignored by
  437.     server
  438.     char    wlreq1_pad2;            //Pad next field to word boundary
  439.     char    wlreq1_workstation[16]; //ASCII name of computer
  440. . A 16 bit integer with a value of 54
  441. . A 16 bit integer that contains the size of the receive buffer
  442.  
  443.  
  444. Transaction Request Data section
  445.  
  446. There is no data or auxiliary data to send as part of the request.
  447.  
  448. Transaction Response Parameters section
  449.  
  450. The transaction response parameters section consists of:
  451. . A 16 bit word indicating the return status. The possible values are:
  452.  
  453. Code                    Value  Description
  454. NERR_Success            0      No errors encountered
  455. ERROR_ACCESS_DENIED     5      User has insufficient privilege
  456. NERR_LogonScriptError   2212   An error occurred while loading or
  457.                                running the logon script
  458. NERR_StandaloneLogon    2214   The logon was not validated by any
  459.                                server
  460. NERR_NonValidatedLogon  2217   The logon server is running an
  461.                                older software version and cannot
  462.                                validate the logon
  463. NERR_InvalidWorkstation 2240   The user is not allowed to logon
  464.                                from this computer
  465. NERR_InvalidLogonHours  2241   The user is not allowed to logon at
  466.                                this time
  467. NERR_PasswordExpired    2242   The user password has expired
  468.  
  469. . A 16 bit "converter" word.
  470. . A 16 bit number representing the total number of available bytes.
  471.   This has meaning only if the return status is NERR_Success or
  472.   ERROR_MORE_DATA. Upon success, this number indicates the number of
  473.   useful bytes available. Upon failure, this indicates how big the
  474.   receive buffer needs to be.
  475.  
  476. Transaction Response Data section
  477.  
  478. The Transaction response data section contains a data structure
  479. user_logon_info_1 which is defined as:
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489. Leach, Naik                                                            8
  490.  
  491.  
  492.             CIFS Domain Logon and Pass Through Autentication
  493.  
  494.  
  495.     struct user_logon_info_1 {
  496.         unsigned short      usrlog1_code; 
  497.         char                usrlog1_eff_name[21];
  498.         char                usrlog1_pad_1;
  499.         unsigned short      usrlog1_priv;
  500.         unsigned long       usrlog1_auth_flags;
  501.         unsigned short      usrlog1_num_logons;
  502.         unsigned short      usrlog1_bad_pw_count;
  503.         unsigned long       usrlog1_last_logon;
  504.         unsigned long       usrlog1_last_logoff;
  505.         unsigned long       usrlog1_logoff_time;
  506.         unsigned long       usrlog1_kickoff_time;
  507.         long                usrlog1_password_age;
  508.         unsigned long       usrlog1_pw_can_change;
  509.         unsigned long       usrlog1_pw_must_change;
  510.         char            *usrlog1_computer;
  511.         char            *usrlog1_domain;
  512.         char                *usrlog1_script_path;
  513.         unsigned long       usrlog1_reserved1;
  514.     };
  515.  
  516. where:
  517.  
  518.   usrlog1_code specifies the result and can have the following values:
  519.  
  520. Code                    Value  Description
  521. NERR_Success            0      No errors encountered
  522. ERROR_ACCESS_DENIED     5      User has insufficient privilege
  523. NERR_LogonScriptError   2212   An error occurred while loading or
  524.                                running the logon script
  525. NERR_StandaloneLogon    2214   The logon was not validated by any
  526.                                server
  527. NERR_NonValidatedLogon  2217   The logon server is running an
  528.                                older software version and cannot
  529.                                validate the logon
  530. NERR_InvalidWorkstation 2240   The user is not allowed to logon
  531.                                from this computer
  532. NERR_InvalidLogonHours  2241   The user is not allowed to logon at
  533.                                this time
  534. NERR_PasswordExpired    2242   Administrator privilege
  535.  
  536.  
  537.   usrlog1_eff_name specifies the account to which the user was logged on
  538.  
  539.   usrlog1_pad1 aligns the next data structure element to a word boundary
  540.  
  541.   usrlog1_priv specifies the user's privilege level. The possible values
  542.        are:
  543.  
  544. Name             Value  Description
  545. USER_PRIV_GUEST  0      Guest privilege
  546. USER_PRIV_USER   1      User privilege
  547. USER_PRV_ADMIN   2      Administrator privilege
  548.  
  549.  
  550. Leach, Naik                                                            9
  551.  
  552.  
  553.             CIFS Domain Logon and Pass Through Autentication
  554.  
  555.  
  556.   usrlog1_auth_flags specifies the account operator privileges. The
  557.        possible values are:
  558.  
  559. Name            Value   Description
  560. AF_OP_PRINT     0       Print operator
  561. AF_OP_COMM      1       Communications operator
  562. AF_OP_SERVER    2       Server operator
  563. AF_OP_ACCOUNTS  3       Accounts operator
  564.  
  565.   usrlog1_num_logons specifies the number of times this user has logged
  566.        on. A value of -1 means the number of logons is unknown.
  567.  
  568.   usrlog1_bad_pw_count specifies the number of incorrect passwords
  569.        entered since the last successful logon.
  570.  
  571.   usrlog1_last_logon specifies the time when the user last logged on.
  572.        This value is stored as the number of seconds elapsed since
  573.        00:00:00, January 1, 1970.
  574.  
  575.   usrlog1_last_logoff specifies the time when the user last logged off.
  576.        This value is stored as the number of seconds elapsed since
  577.        00:00:00, January 1, 1970. A value of 0 means the last logoff
  578.        time is unknown.
  579.  
  580.   usrlog1_logoff_time specifies the time when the user should logoff.
  581.        This value is stored as the number of seconds elapsed since
  582.        00:00:00, Jan 1, 1970. A value of -1 means the user never has to
  583.        logoff.
  584.  
  585.   usrlog1_kickoff_time specifies the time when the user will be logged
  586.        off by the system. This value is stored as the number of seconds
  587.        elapsed since 00:00:00, Jan 1, 1970. A value of -1 means the
  588.        system will  never logoff the user.
  589.  
  590.    usrlog1_password_age specifies the time in seconds since the user
  591.        last changed his/her password.
  592.  
  593.   usrlog1_password_can_change specifies the time when the user can
  594.        change the password. This value is stored as the number of
  595.        seconds elapsed since 00:00:00, Jan 1, 1970. A value of -1 means
  596.        the user can never change the password.
  597.  
  598.   usrlog1_password_must_change specifies the time when the user must
  599.        change the password. This value is stored as the number of
  600.        seconds elapsed since 00:00:00, Jan 1, 1970.
  601.  
  602.   usrlog1_computer specifies the computer where the user is logged on.
  603.  
  604.   usrlog1_script_path specifies the relative path to the user logon
  605.        script.
  606.  
  607.   usrlog1_reserved is reserved with an undefined value.
  608.  
  609.  
  610.  
  611. Leach, Naik                                                           10
  612.  
  613.  
  614.             CIFS Domain Logon and Pass Through Autentication
  615.  
  616.  
  617. The following table defines the valid fields in the user_logon_info_1
  618. structure based upon the return values::
  619.  
  620. function return code  usrlog1_code element     Valid elements of
  621.                                                logoff_info_1
  622. NERR_Success          NERR_Success             All
  623. NERR_Success          NERR_StandaloneLogon     None except usrlog1_code
  624. ERROR_ACCESS_DENIED   NERR_PasswordExpired     None except usrlog1_code
  625. ERROR_ACCESS_DENIED   NERR_InvalidWorkstation  None except usrlog1_code
  626. ERROR_ACCESS_DENIED   NERR_InvalidLogonhours   None except usrlog1_code
  627. ERROR_ACCESS_DENIED   NERR_LogonScriptError    None except usrlog1_code
  628. ERROR_ACCESS_DENIED   ERROR_ACCESS_DENIED      None except usrlog1_code
  629. All other errors      None; the code is        None
  630.                       meaningless
  631.  
  632. All of the pointers in this data structure need to be treated
  633. specially. The  pointer is a 32 bit pointer. The higher 16 bits need
  634. to be ignored. The converter word returned in the parameters section
  635. needs to be subtracted from the lower 16 bits to calculate an offset
  636. into the return buffer where this ASCII string resides.
  637.  
  638. There is no auxiliary data in the response.
  639. 2.5 NetwkstaUserLogoff
  640.  
  641. This is a function executed on a remote CIFS server to log on a user.
  642. The purpose is to perform some checks and accomplish housekeeping and
  643. statistics updates.
  644.  
  645. The definition is:
  646.  
  647.  unsigned short NetWkstaUserLogoff(
  648.    char        *reserved1;
  649.    char        *reserved2;
  650.    unsigned short   sLevel;
  651.    BYTE        bReqBuffer[54];
  652.    unsigned short   cbReqBuffer;
  653.    REQBUF      pbBuffer;
  654.    REQBUFLEN   cbBuffer;
  655.    unsigned short   *pcbTotalAvail;
  656.  );
  657.  
  658.  where:
  659.  
  660.    reserved1 and reserved2 are reserved fields and must be null.
  661.  
  662.    sLevel specifies the level of detail returned. The only legal
  663.    value is 1.
  664.  
  665.    pbReqBuffer points to the request buffer. This buffer contains
  666.    parameters that need to be sent to the server. The actual value
  667.    and structure is defined in the Transaction Request Parameters
  668.    section.
  669.  
  670.  
  671.  
  672. Leach, Naik                                                           11
  673.  
  674.  
  675.             CIFS Domain Logon and Pass Through Autentication
  676.  
  677.  
  678.    cbReqBuffer specifies the size, in bytes, of the buffer pointed to
  679.    by the pbReqBuffer parameter.  The value must be decimal 54.
  680.  
  681.    pbBuffer points to the buffer to receive the returned data.
  682.  
  683.    cbBuffer specifies the size, in bytes, of the buffer pointed to by
  684.    the pbBuffer parameter.
  685.  
  686.    pcbTotalAvail is a pointer to an unsigned short which gets filled
  687.    with the total number of data bytes available if the function
  688.    succeeds.
  689.  
  690. Transaction Request Parameters section
  691.  
  692. The Transaction request parameters section in this instance contains:
  693.  
  694. . The 16 bit function number for NetWkstaUserLogoff which is 133.
  695. . The parameter descriptor string which is "zzWb38WrLh"
  696. . The data descriptor string for the (returned) data which is "WDW"
  697. . The actual parameters as described by the parameter descriptor
  698.   string.
  699.  
  700. The parameters are:
  701. . A null pointer
  702. . Another null pointer
  703. . A 16 bit integer with a value of 1 (corresponding to the "W" in the
  704.   parameter descriptor string. This represents the level of detail the
  705.   server is expected to return)
  706. . An array of  length 38 bytes. These 38 bytes are defined as
  707.     char            wlreq1_name[21];        // User Name
  708.     char            wlreq1_pad1;        //Pad next field to a word
  709.     boundary
  710.     char            wlreq1_workstation[16];     //ASCII name of computer
  711. . A 16 bit integer with a value of decimal 38.
  712. . A 16 bit integer that contains the size of the receive buffer
  713.  
  714. Transaction Request Data section
  715.  
  716. There is no data or auxiliary data to send as part of the request.
  717.  
  718. Transaction Response Parameters section
  719.  
  720. The transaction response parameters section consists of:
  721. . A 16 bit word indicating the return status. The possible values are:
  722.  
  723. Code                   Value  Description
  724. NERR_Success           0      No errors encountered
  725. NERR_StandaloneLogon   2214   The logon was not validated by any
  726.                               server
  727. NERR_NonValidatedLogon 2217   The logon server is running an older
  728.                               software version and cannot validate the
  729.                               logoff
  730.  
  731. . A 16 bit "converter" word.
  732.  
  733. Leach, Naik                                                           12
  734.  
  735.  
  736.             CIFS Domain Logon and Pass Through Autentication
  737.  
  738.  
  739. . A 16 bit number representing the total number of available bytes.
  740.   This has meaning only if the return status is NERR_Success or
  741.   ERROR_MORE_DATA. Upon success, this number indicates the number of
  742.   useful bytes available. Upon failure, this indicates how big the
  743.   receive buffer needs to be.
  744.  
  745. Transaction Response Data section
  746.  
  747. The Transaction response data section contains a data structure
  748. user_logoff_info_1 which is defined as:
  749.  
  750.     struct user_logoff_info_1 {
  751.             unsigned short  usrlogf1_code;
  752.             unsigned long   usrlogf1_duration;
  753.             unsigned short  usrlogf1_num_logons;
  754.     };
  755.  
  756. where:
  757.  
  758.   usrlogf1_code specifies the result and can have the following values:
  759.  
  760. Code                    Value  Description
  761. NERR_Success            0      No errors encountered
  762. ERROR_ACCESS_DENIED     5      User has insufficient privilege
  763. NERR_InvalidWorkstation 2240   The user is not allowed to logon from
  764.                                this computer
  765.  
  766.   usrlogf1_duration specifies the time in number of seconds for which
  767.        the user was logged
  768.  
  769.   usrlogf1_num_logons specifies the number of times this user has logged
  770.        on. A value of -1 indicates the number is unknown.
  771.  
  772. The following table defines the valid fields in the logoff_info_1
  773. structure based upon the return values::
  774.  
  775. function       usrlogf11_code         Valid elements of  logoff_info_1
  776. return code    element
  777. NERR_Success   NERR_Success           All
  778. NERR_Success   NERR_StandaloneLogon   None except usrlogf1_code
  779. All other      None; the code is      None
  780. errors         meaningless
  781.  
  782. There is no auxiliary data in the response.
  783.  
  784. 2.6 NetUserGetInfo
  785.  
  786. This is a function executed on a remote CIFS server to obtain detailed
  787. information about a particular user.
  788.  
  789. The definition is:
  790.  
  791.  unsigned short NetUserGetInfo(
  792.    char        *pszUser;
  793.  
  794. Leach, Naik                                                           13
  795.  
  796.  
  797.             CIFS Domain Logon and Pass Through Autentication
  798.  
  799.  
  800.    unsigned short    sLevel;
  801.    RCVBUF pBuffer;
  802.    RCVBUFLEN   cbBuffer;
  803.    unsigned short   *pcbTotalAvail;
  804.  );
  805.  
  806.  where:
  807.  
  808.    pszUser points to a null terminated ASCII string signifying the
  809.    name of the user for which information should be retrieved.
  810.  
  811.    sLevel specifies the level of detail returned. The only legal
  812.    value is 11.
  813.  
  814.    pbBuffer points to the buffer to receive the returned data.
  815.  
  816.    cbBuffer specifies the size, in bytes, of the buffer pointed to by
  817.    the pbBuffer parameter.
  818.  
  819.    pcbTotalAvail is a pointer to an unsigned short which gets filled
  820.    with the total number of data bytes available if the function
  821.    succeeds.
  822.  
  823. Transaction Request Parameters section
  824.  
  825. The Transaction request parameters section in this instance contains:
  826.  
  827. . The 16 bit function number for NetUserGetInfo which is 56.
  828. . The parameter descriptor string which is "zWrLh"
  829. . The data descriptor string for the (returned) data which is
  830.   "B21BzzzWDDzzDDWWzWzDWb21W"
  831. . The actual parameters as described by the parameter descriptor
  832.   string.
  833.  
  834. The parameters are:
  835. . A null terminated ASCII string indicating the user for which
  836.   information should be retrieved.
  837. . A 16 bit integer with a value of decimal 11 (corresponding to the "W"
  838.   in the parameter descriptor string. This represents the level of
  839.   detail the server is expected to return)
  840. . A 16 bit integer that contains the size of the receive buffer
  841.  
  842.  
  843. Transaction Request Data section
  844.  
  845. There is no data or auxiliary data to send as part of the request.
  846.  
  847. Transaction Response Parameters section
  848.  
  849. The transaction response parameters section consists of:
  850. . A 16 bit word indicating the return status. The possible values are:
  851.  
  852. Code                    Value  Description
  853. NERR_Success            0      No errors encountered
  854.  
  855. Leach, Naik                                                           14
  856.  
  857.  
  858.             CIFS Domain Logon and Pass Through Autentication
  859.  
  860.  
  861. ERROR_ACCESS_DENIED     5      User has insufficient privilege
  862. ERROR_MORE_DATA         234    additional data is available
  863. NERR_BufTooSmall        2123   The supplied buffer is too small
  864. NERR_UserNotFound       2221   The user name was not found
  865. . A 16 bit "converter" word.
  866. . A 16 bit number representing the total number of available bytes.
  867.   This has meaning only if the return status is NERR_Success or
  868.   ERROR_MORE_DATA. Upon success, this number indicates the number of
  869.   useful bytes available. Upon failure, this indicates how big the
  870.   receive buffer needs to be.
  871.  
  872. Transaction Response Data section
  873.  
  874. The Transaction response data section contains a data structure
  875. user_logon_info_1 which is defined as:
  876.  
  877.     struct user_info_11 {
  878.         char                usri11_name[21]; 
  879.         char                usri11_pad;
  880.         char                *usri11_comment;
  881.         char            *usri11_usr_comment;
  882.         unsigned short      usri11_priv;
  883.         unsigned long       usri11_auth_flags;
  884.         long                usri11_password_age;
  885.         char                *usri11_homedir;
  886.         char            *usri11_parms;
  887.         long                usri11_last_logon;
  888.         long                usri11_last_logoff;
  889.         unsigned short      usri11_bad_pw_count;
  890.         unsigned short      usri11_num_logons;
  891.         char                *usri11_logon_server;
  892.         unsigned short      usri11_country_code;
  893.         char            *usri11_workstations;
  894.         unsigned long       usri11_max_storage;
  895.         unsigned short      usri11_units_per_week;
  896.         unsigned char       *usri11_logon_hours;
  897.         unsigned short      usri11_code_page;
  898.     };
  899.  
  900. where:
  901.  
  902.   usri11_name specifies the user name for which information is retireved
  903.  
  904.   usri11_pad aligns the next data structure element to a word boundary
  905.  
  906.   usri11_comment is a null terminated ASCII comment
  907.  
  908.   usri11_user_comment is a null terminated ASCII comment about the user
  909.  
  910.   usri11_priv specifies the level of the privilege assigned to the user.
  911.        The possible values are:
  912.  
  913. Name             Value  Description
  914. USER_PRIV_GUEST  0      Guest privilege
  915.  
  916. Leach, Naik                                                           15
  917.  
  918.  
  919.             CIFS Domain Logon and Pass Through Autentication
  920.  
  921.  
  922. USER_PRIV_USER   1      User privilege
  923. USER_PRV_ADMIN   2      Administrator privilege
  924.  
  925.   usri11_auth_flags specifies the account operator privileges. The
  926.        possible values are:
  927.  
  928. Name            Value   Description
  929. AF_OP_PRINT     0       Print operator
  930. AF_OP_COMM      1       Communications operator
  931. AF_OP_SERVER    2       Server operator
  932. AF_OP_ACCOUNTS  3       Accounts operator
  933.  
  934.  
  935.   usri11_password_age specifies how many seconds have elapsed since the
  936.        password was last changed.
  937.  
  938.   usri11_home_dir points to a null terminated ASCII string that contains
  939.        the path name of the user's home directory.
  940.  
  941.   usri11_parms points to a null terminated ASCII string that is set
  942.        aside for use by applications.
  943.  
  944.   usri11_last_logon specifies the time when the user last logged on.
  945.        This value is stored as the number of seconds elapsed since
  946.        00:00:00, January 1, 1970.
  947.  
  948.   usri11_last_logoff specifies the time when the user last logged off.
  949.        This value is stored as the number of seconds elapsed since
  950.        00:00:00, January 1, 1970. A value of 0 means the last logoff
  951.        time is unknown.
  952.  
  953.   usri11_bad_pw_count specifies the number of incorrect passwords
  954.        entered since the last successful logon.
  955.  
  956.   usri11_log1_num_logons specifies the number of times this user has
  957.        logged on. A value of -1 means the number of logons is unknown.
  958.  
  959.   usri11_logon_server points to a null terminated ASCII string that
  960.        contains the name of the server to which logon requests are sent.
  961.        A null string indicates logon requests should be sent to the
  962.        domain controller.
  963.  
  964.   usri11_country_code specifies the country code for the user's language
  965.        of choice.
  966.  
  967.   usri11_workstations points to a null terminated ASCII string that
  968.        contains the names of workstations the user may log on from.
  969.        There may be up to 8 workstations, with the names separated by
  970.        commas. A null strings indicates there are no restrictions.
  971.  
  972.   usri11_max_storage specifies the maximum amount of disk space the user
  973.        can occupy. A value of 0xffffffff indicates there are no
  974.        restrictions.
  975.  
  976.  
  977. Leach, Naik                                                           16
  978.  
  979.  
  980.             CIFS Domain Logon and Pass Through Autentication
  981.  
  982.  
  983.   usri11_units_per_week specifies the equal number of time units into
  984.        which a week is divided. This value must be equal to 168.
  985.  
  986.   usri11_logon_hours points to a 21 byte (168 bits) string that
  987.        specifies the time during which the user can log on. Each bit
  988.        represents one unique hour in a week. The first bit (bit 0, word
  989.        0) is Sunday, 0:00 to 0:59, the second bit (bit 1, word 0) is
  990.        Sunday, 1:00 to 1:59 and so on. A null pointer indicates there
  991.        are no restrictions.
  992.  
  993.   usri11_code_page specifies the code page for the user's language of
  994.        choice
  995.  
  996. All of the pointers in this data structure need to be treated
  997. specially. The  pointer is a 32 bit pointer. The higher 16 bits need
  998. to be ignored. The converter word returned in the parameters section
  999. needs to be subtracted from the lower 16 bits to calculate an offset
  1000. into the return buffer where this ASCII string resides.
  1001.  
  1002. There is no auxiliary data in the response.
  1003.  
  1004.  
  1005.  
  1006. 3. CIFS pass through authentication
  1007.  
  1008. CIFS pass through authentication is a mechanism employed by a CIFS
  1009. server to validate user credentials with a Domain Controller and the
  1010. grant the user access to a resource on the CIFS server, based upon
  1011. successful validation of the user credentials by the Domain Controller.
  1012.  
  1013. Note that a CIFS server can do pass through authentication to only a
  1014. single domain. Thus the name of the domain is essentially known before a
  1015. user even attempts to connect to the CIFS server. The CIFS server
  1016. locates the Domain Controller of this single domain of interest using
  1017. the mechanism described in section 3.1.3. This mechanism is expensive in
  1018. terms of network traffic, so the CIFS server caches the name of the
  1019. Domain Controller. The CIFS server can verify this cached information by
  1020. sending a NetServerEnum2 RAP request to the Domain Controller and
  1021. checking that the returned information still indicates the server to be
  1022. a Domain Controller. Complete details of the RAP specification as well
  1023. as details of the NetServerEnum2 RAP request may be found in the CIFS
  1024. Remote Administration Protocol specification.
  1025.  
  1026. Consider the case of a CIFS server running with user level security. The
  1027. CIFS document describes a user level (security) server as a server that
  1028. requires clients to provide a user name and corresponding password to
  1029. connect to any resources shared by the server.
  1030.  
  1031. Consider a CIFS client seeking to connect to this CIFS server. The
  1032. client is prepared to submit it's credentials (user name and challenge
  1033. response). The CIFS server does not have an accounts database that can
  1034. establish the validity of the user credentials. This is the situation in
  1035. which a CIFS server resorts to pass through authentication. The steps
  1036. involved in pass through authentication are:
  1037.  
  1038. Leach, Naik                                                           17
  1039.  
  1040.  
  1041.             CIFS Domain Logon and Pass Through Autentication
  1042.  
  1043.  
  1044. . The CIFS client sends a negotiate SMB to the CIFS server
  1045. . The CIFS server verifies the cached Domain Controller name (as
  1046.   described above)
  1047. . If the cached name is invalid, the CIFS server does a Domain
  1048.   Controller Discovery
  1049. . The CIFS server  sends a NEGOTIATE SMB to the Domain Controller
  1050. . The NEGOTIATE response along with the challenge is saved by the CIFS
  1051.   server
  1052. . The CIFS server sends a NEGOTIATE response (to client) using the
  1053.   saved challenge
  1054. . The CIFS client computes the challenge response as detailed in the
  1055.   CIFS specification, and then challenge response is sent as part of a
  1056.   SessionSetupAndX SMB
  1057. . The CIFS server extracts the challenge response from above SMB
  1058. . The CIFS server sends it's own SessionSetupAndX SMB to the domain
  1059.   controller using the extracted challenge response
  1060. . The Domain Controller sends a SessionSetupAndX response to the CIFS
  1061.   server. This response will be successful if the CIFS client had
  1062.   provided the correct response.
  1063. . The CIFS server tears down the session with the Domain Controller
  1064.   that was established using user credentials. This is accomplished by
  1065.   means of a LogOffAndX SMB.
  1066. . The CIFS server sends a SessionSetupAndX response to the CIFS client.
  1067.   This response is based upon the response from the Domain Controller.
  1068.  
  1069. 4. Appendix A - Remote Administration Protocol
  1070. A RAP service request is sent to the server encapsulated in a Transact2
  1071. request SMB and the server sends back a Transact2 SMB response. An
  1072. attribute of the Transact2 SMB is that it divides the payload of request
  1073. and response messages into two sections: a parameters section and a data
  1074. section. As might be expected from the nomenclature, RAP service
  1075. parameters are sent in the parameters section of a Transact2 SMB, and
  1076. the data buffer in the data section. Therefore, to define a service
  1077. protocol, it is necessary to define the formats of the parameter and
  1078. data sections of the Transact2 request and response.
  1079.  
  1080. This is done in two stages. First, a C-like declaration notation is used
  1081. to define descriptor strings, and then the descriptor strings define the
  1082. formats of the  parameter and data sections.. Note well: even though the
  1083. declarations may look like a programming interface, they are not: they
  1084. are a notation for describing the contents of RAP requests and
  1085. responses; an implementation on any particular system can use any
  1086. programming interface to RAP services that is appropriate to that
  1087. system.
  1088. 4.1 Notation
  1089.  
  1090. Parameter descriptor strings are defined using a C-like function
  1091. declaration; data descriptor and auxiliary data descriptor strings are
  1092. defined using a C-like structure declaration.
  1093.  
  1094. Parameter descriptor strings are defined with the following C-like
  1095. function declaration syntax:
  1096.  
  1097.  
  1098.  
  1099. Leach, Naik                                                           18
  1100.  
  1101.  
  1102.             CIFS Domain Logon and Pass Through Autentication
  1103.  
  1104.  
  1105.     rap-service     = "unsigned short" service-name "(" parameters ");"
  1106.     service-name        = <upper and lower case alpha and numeric>
  1107. The return type of the function is always "unsigned short", and
  1108. represents the status code from the function. The service-name is for
  1109. documentation purposes.
  1110.     parameters      = parameter [ ";" parameter ]
  1111. The parameter descriptor string for the service is the concatenation of
  1112. the descriptor characters for the parameters.
  1113.     parameter       = [ "const" ] param-data-type parameter-name
  1114.                       [ "[" size "]" ]
  1115.     param-data-type = <from parameter descriptor tables below>
  1116.     parameter-name      = <upper and lower case alpha and numeric>
  1117.     size                = <string of ASCII 0-9>
  1118. The descriptor character for a parameter is determined by looking up the
  1119. data-type in the tables below for request or response parameter
  1120. descriptors. The parameter-name is for documentation purposes. If there
  1121. is a size following the parameter-name, then it is placed in the
  1122. descriptor string following the descriptor character.
  1123.  
  1124. Data and auxiliary data descriptor strings are defined  with the
  1125. following C-like structure declaration syntax:
  1126.     rap-struct      = "struct" struct-name "{" members "}"
  1127. The descriptor string for the struct is the concatenation of the
  1128. descriptor characters for the members. The struct-name is for
  1129. documentation purposes.
  1130.     members         = member [  ";" member ]
  1131.     member          = member-data-type member-name [ "[" size "]" ]
  1132.     member-data-type    = <from data descriptor tables below>
  1133. The descriptor character for a member is determined by looking up the
  1134. data-type in the tables below for data descriptors. The member-name is
  1135. for documentation purposes. If there is a size following the member-
  1136. name, then it is placed in the descriptor string following the
  1137. descriptor character.
  1138. 4.2 Descriptors
  1139.  
  1140. The following section contain tables that specify the descriptor
  1141. character and the notation for each data type for that data type.
  1142. 4.2.1 Request Parameter Descriptors
  1143.  
  1144.  
  1145. Descriptor  Data Type        Format
  1146. ==========  =========        =====
  1147. W           unsigned short   indicates parameter type of 16 bit integer
  1148.                              (word).
  1149. D           unsigned long    indicates parameter type of 32 bit integer
  1150.                              (dword).
  1151. b           BYTE             indicates bytes (octets). May be followed
  1152.                              by an ASCII number indicating number of
  1153.                              bytes..
  1154. O           NULL             indicates a NULL pointer
  1155. z           char             indicates a NULL terminated ASCII string
  1156.                              present in the parameter area
  1157. F           PAD              indicates Pad bytes (octets). May be
  1158.                              followed by an ASCII number indicating the
  1159.  
  1160. Leach, Naik                                                           19
  1161.  
  1162.  
  1163.             CIFS Domain Logon and Pass Through Autentication
  1164.  
  1165.  
  1166.                              number of bytes
  1167. r           RCVBUF           pointer to receive data buffer in response
  1168.                              parameter section
  1169. L           RCVBUFLEN        16 bit integer containing length of
  1170.                              receive data buffer in (16 bit) words
  1171. s           SNDBUF           pointer to send data buffer in request
  1172.                              parameter section
  1173. T           SNDBUFLEN        16 bit integer containing length of send
  1174.                              data buffer in words
  1175.  
  1176. 4.2.2 Response Parameter Descriptors
  1177.  
  1178.  
  1179. Descriptor  Data Type        Format
  1180. ==========  =========        =====
  1181. g           BYTE *           indicates a byte is  to be received. May
  1182.                              be followed by an ASCII number indicating
  1183.                              number of bytes to receive
  1184. h           unsigned short * indicates a word is to be received
  1185. i           unsigned long *  indicates  a dword is to be received
  1186. e           ENTCOUNT         indicates a word is to be received  which
  1187.                              indicates the number of entries returned
  1188.  
  1189. 4.2.3 Data Descriptors
  1190.  
  1191.  
  1192. Descriptor  Data Type        Format
  1193. ==========  =========        =====
  1194. W           unsigned short   indicates data type of 16 bit integer
  1195.                              (word). Descriptor char may be followed by
  1196.                              an ASCII number indicating the number of
  1197.                              16 bit words present
  1198. D           unsigned long    indicates data type of 32 bit integer
  1199.                              (dword). Descriptor char may be followed
  1200.                              by an ASCII number indicating the number
  1201.                              of 32 bit words present
  1202. B           BYTE             indicates item of data type 8 bit byte
  1203.                              (octet). The indicated number of bytes are
  1204.                              present  in the data. Descriptor char may
  1205.                              be followed by an ASCII number indicating
  1206.                              the number of 8 bit bytes present
  1207. O           NULL             indicates a NULL pointer
  1208. z           char *           indicates a 32 bit pointer to a NULL
  1209.                              terminated ASCII string is present in the
  1210.                              response parameter area. The actual string
  1211.                              is in the response data area and the
  1212.                              pointer in the parameter area points to
  1213.                              the string in the data area. The high word
  1214.                              of the pointer should be ignored. The
  1215.                              converter word present in the response
  1216.                              parameter section should be subtracted
  1217.                              from the low 16 bit value to obtain an
  1218.                              offset into the data area indicating where
  1219.                              the data area resides.
  1220.  
  1221. Leach, Naik                                                           20
  1222.  
  1223.  
  1224.             CIFS Domain Logon and Pass Through Autentication
  1225.  
  1226.  
  1227. N           AUXCOUNT         indicates number of auxiliary data
  1228.                              structures. The transaction response data
  1229.                              section contains an unsigned 16 bit number
  1230.                              corresponding to this data item.
  1231.  
  1232. 4.3 Transaction Request Parameters section
  1233.  
  1234. The parameters and data being sent and received are described by ASCII
  1235. descriptor strings. These descriptor strings are described in section
  1236. 4.2.
  1237.  
  1238. The parameters section of the Transact2 SMB request contains the
  1239. following (in the order described)
  1240. . The function number: an unsigned short 16 bit integer identifying the
  1241.   function being remoted
  1242. . The parameter descriptor string: a null terminated ASCII string
  1243. . The data descriptor string: a null terminated ASCII string.
  1244. . The request parameters, as described by the parameter descriptor
  1245.   string, in the order that the request parameter descriptor characters
  1246.   appear in the parameter descriptor string
  1247. . An optional auxiliary data descriptor string: a null terminated ASCII
  1248.   string. It will be present if there is an auxiliary data structure
  1249.   count in the primary data struct (an "N" descriptor in the data
  1250.   descriptor string).
  1251.  
  1252. RAP requires that the length of the return parameters be less than or
  1253. equal to the length of the parameters being sent; this requirement is
  1254. made to simply buffer management in implementations. This is reasonable
  1255. as the functions were designed to return data in the data section and
  1256. use the return parameters for items like data length, handles, etc. If
  1257. need be, this restriction can be circumvented by filling in some pad
  1258. bytes into the parameters being sent.
  1259. 4.4 Transaction Request Data section
  1260.  
  1261. The Data section for the transaction request is present if the parameter
  1262. description string contains an "s" (SENDBUF) descriptor. If present, it
  1263. contains:
  1264. . A primary data struct, as described by the data descriptor string
  1265. . Zero or more instances of the auxiliary data struct, as described by
  1266.   the auxiliary data descriptor string. The number of instances is
  1267.   determined by the value of the an auxiliary data structure count
  1268.   member of the primary data struct, indicated by the "N" (AUXCOUNT)
  1269.   descriptor. The auxiliary data is present only if the auxiliary data
  1270.   descriptor string is non null.
  1271. . Possibly some pad bytes
  1272. . The heap: the data referenced by pointers in the primary and
  1273.   auxiliary data structs.
  1274. 4.5 Transaction Response Parameters section
  1275.  
  1276. The response sent by the server contains a parameter section which
  1277. consists of:
  1278. . A 16 bit integer indicating the status or return code. The possible
  1279.   values for different functions are different.
  1280.  
  1281.  
  1282. Leach, Naik                                                           21
  1283.  
  1284.  
  1285.             CIFS Domain Logon and Pass Through Autentication
  1286.  
  1287.  
  1288. . A 16 bit converter word, used adjust pointers to information in the
  1289.   response data section. Pointers returned within the response buffer
  1290.   are 32 bit pointers. The high order 16 bit word should be ignored.
  1291.   The converter word needs to be subtracted from the low order  16 bit
  1292.   word to arrive at an offset into the response buffer.
  1293. . The response parameters, as described by the parameter descriptor
  1294.   string, in the order that the response parameter descriptor
  1295.   characters appear in the parameter descriptor string.
  1296. 4.6 Transaction Response Data section
  1297.  
  1298. The Data section for the transaction response is present if the
  1299. parameter description string contains an "r" (RCVBUF) descriptor. If
  1300. present, it contains:
  1301. . Zero or more entries. The number of entries is determined by the
  1302.   value of the entry count parameter, indicated by the "e"(ENTCOUNT)
  1303.   descriptor. Each entry contains:
  1304.         . A primary data struct, as described by the data descriptor
  1305.           string
  1306.         . Zero or more instances of the auxiliary data struct, as
  1307.           described by the auxiliary data descriptor string. The number
  1308.           of instances is determined by the value of the AUXCOUNT
  1309.           member of the primary data struct (whose descriptor is "N").
  1310.           The auxiliary data is present only if the auxiliary data
  1311.           descriptor string is non null.
  1312. . Possibly some pad bytes
  1313. . The heap: the data referenced by pointers in the primary and
  1314.   auxiliary data structs.
  1315.  
  1316.  
  1317. 5. Author's Addresses
  1318.  
  1319. Paul Leach
  1320. Dilip Naik
  1321. Microsoft
  1322. 1 Microsoft Way
  1323. Redmond, WA  98052
  1324.  paulle@microsoft.com
  1325. v-dilipn@microsoft.com
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343. Leach, Naik                                                           22