summaryrefslogtreecommitdiff
path: root/docs/htmldocs/Samba-Developers-Guide.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/htmldocs/Samba-Developers-Guide.html')
-rw-r--r--docs/htmldocs/Samba-Developers-Guide.html342
1 files changed, 171 insertions, 171 deletions
diff --git a/docs/htmldocs/Samba-Developers-Guide.html b/docs/htmldocs/Samba-Developers-Guide.html
index 86de03d627..e1df878bb1 100644
--- a/docs/htmldocs/Samba-Developers-Guide.html
+++ b/docs/htmldocs/Samba-Developers-Guide.html
@@ -12,10 +12,10 @@ Please send updates to Jelmer Vernooij.
This documentation is distributed under the GNU General Public License (GPL)
version 2. A copy of the license is included with the Samba source
distribution. A copy can be found on-line at http://www.fsf.org/licenses/gpl.txt
-"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="Samba-Developers-Guide"></a>SAMBA Developers Guide</h1></div><div><div class="author"><h3 class="author"><span class="surname">SAMBA Team</span></h3></div></div><div><div class="legalnotice"><p><b>Attributions. </b>
- </p><div class="variablelist"><dl><dt><span class="term"><a href="#netbios" title="Chapter 1. Definition of NetBIOS Protocol and Name Resolution Modes">Definition of NetBIOS Protocol and Name Resolution Modes</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Luke Leighton</p></li></ul></div></dd><dt><span class="term"><a href="#architecture" title="Chapter 2. Samba Architecture">Samba Architecture</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Dan Shearer</p></li></ul></div></dd><dt><span class="term"><a href="#debug" title="Chapter 3. The samba DEBUG system">The samba DEBUG system</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Chris Hertel</p></li></ul></div></dd><dt><span class="term"><a href="#CodingSuggestions" title="Chapter 4. Coding Suggestions">Coding Suggestions</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Steve French</p></li><li><p>Simo Sorce</p></li><li><p>Andrew Bartlett</p></li><li><p>Tim Potter</p></li><li><p>Martin Pool</p></li></ul></div></dd><dt><span class="term"><a href="#internals" title="Chapter 5. Samba Internals">Samba Internals</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>David Chappell &lt;<a href="David.Chappell@mail.trincoll.edu" target="_top">David.Chappell@mail.trincoll.edu</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#parsing" title="Chapter 6. The smb.conf file">The smb.conf file</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Chris Hertel</p></li></ul></div></dd><dt><span class="term"><a href="#unix-smb" title="Chapter 7. NetBIOS in a Unix World">NetBIOS in a Unix World</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Andrew Tridgell</p></li></ul></div></dd><dt><span class="term"><a href="#tracing" title="Chapter 8. Tracing samba system calls">Tracing samba system calls</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Andrew Tridgell</p></li></ul></div></dd><dt><span class="term"><a href="#ntdomain" title="Chapter 9. NT Domain RPC's">NT Domain RPC's</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Luke Leighton &lt;<a href="lkcl@switchboard.net" target="_top">lkcl@switchboard.net</a>&gt;</p></li><li><p>Paul Ashton &lt;<a href="paul@argo.demon.co.uk" target="_top">paul@argo.demon.co.uk</a>&gt;</p></li><li><p>Duncan Stansfield &lt;<a href="duncans@sco.com" target="_top">duncans@sco.com</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#printing" title="Chapter 10. Samba Printing Internals">Samba Printing Internals</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Gerald Carter</p></li></ul></div></dd><dt><span class="term"><a href="#wins" title="Chapter 11. Samba WINS Internals">Samba WINS Internals</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Gerald Carter</p></li></ul></div></dd><dt><span class="term"><a href="#sam" title="Chapter 12. The Upcoming SAM System">The Upcoming SAM System</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Andrew Bartlett</p></li></ul></div></dd><dt><span class="term"><a href="#pwencrypt" title="Chapter 13. LanMan and NT Password Encryption">LanMan and NT Password Encryption</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Jeremy Allison &lt;<a href="samba@samba.org" target="_top">samba@samba.org</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#modules" title="Chapter 14. Modules">Modules</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Jelmer Vernooij &lt;<a href="jelmer@samba.org" target="_top">jelmer@samba.org</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#rpc-plugin" title="Chapter 15. RPC Pluggable Modules">RPC Pluggable Modules</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Anthony Liguori &lt;<a href="aliguor@us.ibm.com" target="_top">aliguor@us.ibm.com</a>&gt;</p></li><li><p>Jelmer Vernooij &lt;<a href="jelmer@samba.org" target="_top">jelmer@samba.org</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#vfs" title="Chapter 16. VFS Modules">VFS Modules</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Alexander Bokovoy &lt;<a href="ab@samba.org" target="_top">ab@samba.org</a>&gt;</p></li><li><p>Stefan Metzmacher &lt;<a href="metze@metzemix.de" target="_top">metze@metzemix.de</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#Packaging" title="Chapter 17. Notes to packagers">Notes to packagers</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Jelmer Vernooij</p></li></ul></div></dd><dt><span class="term"><a href="#contributing" title="Chapter 18. Contributing code">Contributing code</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Jelmer Vernooij &lt;<a href="jelmer@samba.org" target="_top">jelmer@samba.org</a>&gt;</p></li></ul></div></dd></dl></div><p>
+"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="Samba-Developers-Guide"></a>SAMBA Developers Guide</h1></div><div><div class="author"><h3 class="author"><span class="surname">SAMBA Team</span></h3></div></div><div><div xmlns:ns1="" class="legalnotice"><ns1:p><b>Attributions. </b>
+ </ns1:p><div class="variablelist"><dl><dt><span class="term"><a href="#netbios" title="Chapter 1. Definition of NetBIOS Protocol and Name Resolution Modes">Definition of NetBIOS Protocol and Name Resolution Modes</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Luke Leighton</p></li></ul></div></dd><dt><span class="term"><a href="#architecture" title="Chapter 2. Samba Architecture">Samba Architecture</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Dan Shearer</p></li></ul></div></dd><dt><span class="term"><a href="#debug" title="Chapter 3. The samba DEBUG system">The samba DEBUG system</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Chris Hertel</p></li></ul></div></dd><dt><span class="term"><a href="#CodingSuggestions" title="Chapter 4. Coding Suggestions">Coding Suggestions</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Steve French</p></li><li><p>Simo Sorce</p></li><li><p>Andrew Bartlett</p></li><li><p>Tim Potter</p></li><li><p>Martin Pool</p></li></ul></div></dd><dt><span class="term"><a href="#internals" title="Chapter 5. Samba Internals">Samba Internals</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>David Chappell &lt;<a href="mailto:David.Chappell@mail.trincoll.edu" target="_top">David.Chappell@mail.trincoll.edu</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#parsing" title="Chapter 6. The smb.conf file">The smb.conf file</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Chris Hertel</p></li></ul></div></dd><dt><span class="term"><a href="#unix-smb" title="Chapter 7. NetBIOS in a Unix World">NetBIOS in a Unix World</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Andrew Tridgell</p></li></ul></div></dd><dt><span class="term"><a href="#tracing" title="Chapter 8. Tracing samba system calls">Tracing samba system calls</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Andrew Tridgell</p></li></ul></div></dd><dt><span class="term"><a href="#ntdomain" title="Chapter 9. NT Domain RPC's">NT Domain RPC's</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Luke Leighton &lt;<a href="mailto:lkcl@switchboard.net" target="_top">lkcl@switchboard.net</a>&gt;</p></li><li><p>Paul Ashton &lt;<a href="mailto:paul@argo.demon.co.uk" target="_top">paul@argo.demon.co.uk</a>&gt;</p></li><li><p>Duncan Stansfield &lt;<a href="mailto:duncans@sco.com" target="_top">duncans@sco.com</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#printing" title="Chapter 10. Samba Printing Internals">Samba Printing Internals</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Gerald Carter</p></li></ul></div></dd><dt><span class="term"><a href="#wins" title="Chapter 11. Samba WINS Internals">Samba WINS Internals</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Gerald Carter</p></li></ul></div></dd><dt><span class="term"><a href="#sam" title="Chapter 12. The Upcoming SAM System">The Upcoming SAM System</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Andrew Bartlett</p></li></ul></div></dd><dt><span class="term"><a href="#pwencrypt" title="Chapter 13. LanMan and NT Password Encryption">LanMan and NT Password Encryption</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Jeremy Allison &lt;<a href="mailto:samba@samba.org" target="_top">samba@samba.org</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#modules" title="Chapter 14. Modules">Modules</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Jelmer Vernooij &lt;<a href="mailto:jelmer@samba.org" target="_top">jelmer@samba.org</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#rpc-plugin" title="Chapter 15. RPC Pluggable Modules">RPC Pluggable Modules</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Anthony Liguori &lt;<a href="mailto:aliguor@us.ibm.com" target="_top">aliguor@us.ibm.com</a>&gt;</p></li><li><p>Jelmer Vernooij &lt;<a href="mailto:jelmer@samba.org" target="_top">jelmer@samba.org</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#vfs" title="Chapter 16. VFS Modules">VFS Modules</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Alexander Bokovoy &lt;<a href="mailto:ab@samba.org" target="_top">ab@samba.org</a>&gt;</p></li><li><p>Stefan Metzmacher &lt;<a href="mailto:metze@metzemix.de" target="_top">metze@metzemix.de</a>&gt;</p></li></ul></div></dd><dt><span class="term"><a href="#Packaging" title="Chapter 17. Notes to packagers">Notes to packagers</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Jelmer Vernooij</p></li></ul></div></dd><dt><span class="term"><a href="#contributing" title="Chapter 18. Contributing code">Contributing code</a></span></dt><dd><div class="itemizedlist"><ul type="disc"><li><p>Jelmer Vernooij &lt;<a href="mailto:jelmer@samba.org" target="_top">jelmer@samba.org</a>&gt;</p></li></ul></div></dd></dl></div><ns1:p>
- </p></div></div><div><div class="abstract"><p class="title"><b>Abstract</b></p><p>
+ </ns1:p></div></div><div><div class="abstract"><p class="title"><b>Abstract</b></p><p>
<span class="emphasis"><em>Last Update</em></span> : Fri Jun 6 00:45:54 CEST 2003
</p><p>
This book is a collection of documents that might be useful for
@@ -29,15 +29,15 @@ Please send updates to <a href="mailto:jelmer@samba.org" target="_top">Jelmer Ve
This documentation is distributed under the GNU General Public License (GPL)
version 2. A copy of the license is included with the Samba source
distribution. A copy can be found on-line at <a href="http://www.fsf.org/licenses/gpl.txt" target="_top">http://www.fsf.org/licenses/gpl.txt</a>
-</p></div></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="#netbios">Definition of NetBIOS Protocol and Name Resolution Modes</a></dt><dd><dl><dt><a href="#id2797526">NETBIOS</a></dt><dt><a href="#id2866011">BROADCAST NetBIOS</a></dt><dt><a href="#id2866042">NBNS NetBIOS</a></dt></dl></dd><dt>2. <a href="#architecture">Samba Architecture</a></dt><dd><dl><dt><a href="#id2797150">Introduction</a></dt><dt><a href="#id2797202">Multithreading and Samba</a></dt><dt><a href="#id2797240">Threading smbd</a></dt><dt><a href="#id2797314">Threading nmbd</a></dt><dt><a href="#id2797382">nbmd Design</a></dt></dl></dd><dt>3. <a href="#debug">The samba DEBUG system</a></dt><dd><dl><dt><a href="#id2796808">New Output Syntax</a></dt><dt><a href="#id2796946">The DEBUG() Macro</a></dt><dt><a href="#id2867248">The DEBUGADD() Macro</a></dt><dt><a href="#id2867293">The DEBUGLVL() Macro</a></dt><dt><a href="#id2867398">New Functions</a></dt><dd><dl><dt><a href="#id2867405">dbgtext()</a></dt><dt><a href="#id2867425">dbghdr()</a></dt><dt><a href="#id2867448">format_debug_text()</a></dt></dl></dd></dl></dd><dt>4. <a href="#CodingSuggestions">Coding Suggestions</a></dt><dt>5. <a href="#internals">Samba Internals</a></dt><dd><dl><dt><a href="#id2866821">Character Handling</a></dt><dt><a href="#id2866847">The new functions</a></dt><dt><a href="#id2868099">Macros in byteorder.h</a></dt><dd><dl><dt><a href="#id2869024">CVAL(buf,pos)</a></dt><dt><a href="#id2869037">PVAL(buf,pos)</a></dt><dt><a href="#id2869051">SCVAL(buf,pos,val)</a></dt><dt><a href="#id2869064">SVAL(buf,pos)</a></dt><dt><a href="#id2869080">IVAL(buf,pos)</a></dt><dt><a href="#id2869094">SVALS(buf,pos)</a></dt><dt><a href="#id2869109">IVALS(buf,pos)</a></dt><dt><a href="#id2869123">SSVAL(buf,pos,val)</a></dt><dt><a href="#id2869138">SIVAL(buf,pos,val)</a></dt><dt><a href="#id2869152">SSVALS(buf,pos,val)</a></dt><dt><a href="#id2869166">SIVALS(buf,pos,val)</a></dt><dt><a href="#id2869181">RSVAL(buf,pos)</a></dt><dt><a href="#id2869195">RIVAL(buf,pos)</a></dt><dt><a href="#id2869210">RSSVAL(buf,pos,val)</a></dt><dt><a href="#id2869225">RSIVAL(buf,pos,val)</a></dt></dl></dd><dt><a href="#id2869240">LAN Manager Samba API</a></dt><dd><dl><dt><a href="#id2869276">Parameters</a></dt><dt><a href="#id2869427">Return value</a></dt></dl></dd><dt><a href="#id2869512">Code character table</a></dt></dl></dd><dt>6. <a href="#parsing">The smb.conf file</a></dt><dd><dl><dt><a href="#id2868851">Lexical Analysis</a></dt><dd><dl><dt><a href="#id2868944">Handling of Whitespace</a></dt><dt><a href="#id2869000">Handling of Line Continuation</a></dt><dt><a href="#id2870660">Line Continuation Quirks</a></dt></dl></dd><dt><a href="#id2870758">Syntax</a></dt><dd><dl><dt><a href="#id2870829">About params.c</a></dt></dl></dd></dl></dd><dt>7. <a href="#unix-smb">NetBIOS in a Unix World</a></dt><dd><dl><dt><a href="#id2870276">Introduction</a></dt><dt><a href="#id2870301">Usernames</a></dt><dt><a href="#id2870529">File Ownership</a></dt><dt><a href="#id2870566">Passwords</a></dt><dt><a href="#id2870604">Locking</a></dt><dt><a href="#id2871543">Deny Modes</a></dt><dt><a href="#id2871573">Trapdoor UIDs</a></dt><dt><a href="#id2871598">Port numbers</a></dt><dt><a href="#id2871644">Protocol Complexity</a></dt></dl></dd><dt>8. <a href="#tracing">Tracing samba system calls</a></dt><dt>9. <a href="#ntdomain">NT Domain RPC's</a></dt><dd><dl><dt><a href="#id2871220">Introduction</a></dt><dd><dl><dt><a href="#id2872245">Sources</a></dt><dt><a href="#id2872278">Credits</a></dt></dl></dd><dt><a href="#id2872317">Notes and Structures</a></dt><dd><dl><dt><a href="#id2872324">Notes</a></dt><dt><a href="#id2873087">Enumerations</a></dt><dt><a href="#id2873300">Structures</a></dt></dl></dd><dt><a href="#id2876250">MSRPC over Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2876262">MSRPC Pipes</a></dt><dt><a href="#id2876365">Header</a></dt><dt><a href="#id2877236">Tail</a></dt><dt><a href="#id2877281">RPC Bind / Bind Ack</a></dt><dt><a href="#id2877461">NTLSA Transact Named Pipe</a></dt><dt><a href="#id2877626">LSA Open Policy</a></dt><dt><a href="#id2877752">LSA Query Info Policy</a></dt><dt><a href="#id2877858">LSA Enumerate Trusted Domains</a></dt><dt><a href="#id2877950">LSA Open Secret</a></dt><dt><a href="#id2878060">LSA Close</a></dt><dt><a href="#id2878126">LSA Lookup SIDS</a></dt><dt><a href="#id2878335">LSA Lookup Names</a></dt></dl></dd><dt><a href="#id2878561">NETLOGON rpc Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2878722">LSA Request Challenge</a></dt><dt><a href="#id2878856">LSA Authenticate 2</a></dt><dt><a href="#id2879004">LSA Server Password Set</a></dt><dt><a href="#id2879119">LSA SAM Logon</a></dt><dt><a href="#id2879232">LSA SAM Logoff</a></dt></dl></dd><dt><a href="#id2879324">\\MAILSLOT\NET\NTLOGON</a></dt><dd><dl><dt><a href="#id2879336">Query for PDC</a></dt><dt><a href="#id2879604">SAM Logon</a></dt></dl></dd><dt><a href="#id2879929">SRVSVC Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2879974">Net Share Enum</a></dt><dt><a href="#id2880194">Net Server Get Info</a></dt></dl></dd><dt><a href="#id2880310">Cryptographic side of NT Domain Authentication</a></dt><dd><dl><dt><a href="#id2880318">Definitions</a></dt><dt><a href="#id2880480">Protocol</a></dt><dt><a href="#id2880577">Comments</a></dt></dl></dd><dt><a href="#id2880626">SIDs and RIDs</a></dt><dd><dl><dt><a href="#id2880666">Well-known SIDs</a></dt><dt><a href="#id2880981">Well-known RIDS</a></dt></dl></dd></dl></dd><dt>10. <a href="#printing">Samba Printing Internals</a></dt><dd><dl><dt><a href="#id2889663">Abstract</a></dt><dt><a href="#id2889679">
+</p></div></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="#netbios">Definition of NetBIOS Protocol and Name Resolution Modes</a></dt><dd><dl><dt><a href="#id2801706">NETBIOS</a></dt><dt><a href="#id2801790">BROADCAST NetBIOS</a></dt><dt><a href="#id2801821">NBNS NetBIOS</a></dt></dl></dd><dt>2. <a href="#architecture">Samba Architecture</a></dt><dd><dl><dt><a href="#id2800444">Introduction</a></dt><dt><a href="#id2800493">Multithreading and Samba</a></dt><dt><a href="#id2800530">Threading smbd</a></dt><dt><a href="#id2800121">Threading nmbd</a></dt><dt><a href="#id2800174">nbmd Design</a></dt></dl></dd><dt>3. <a href="#debug">The samba DEBUG system</a></dt><dd><dl><dt><a href="#id2799483">New Output Syntax</a></dt><dt><a href="#id2799606">The DEBUG() Macro</a></dt><dt><a href="#id2799736">The DEBUGADD() Macro</a></dt><dt><a href="#id2799781">The DEBUGLVL() Macro</a></dt><dt><a href="#id2799887">New Functions</a></dt><dd><dl><dt><a href="#id2799894">dbgtext()</a></dt><dt><a href="#id2799913">dbghdr()</a></dt><dt><a href="#id2799936">format_debug_text()</a></dt></dl></dd></dl></dd><dt>4. <a href="#CodingSuggestions">Coding Suggestions</a></dt><dt>5. <a href="#internals">Samba Internals</a></dt><dd><dl><dt><a href="#id2867396">Character Handling</a></dt><dt><a href="#id2867421">The new functions</a></dt><dt><a href="#id2866034">Macros in byteorder.h</a></dt><dd><dl><dt><a href="#id2866047">CVAL(buf,pos)</a></dt><dt><a href="#id2866061">PVAL(buf,pos)</a></dt><dt><a href="#id2866075">SCVAL(buf,pos,val)</a></dt><dt><a href="#id2866088">SVAL(buf,pos)</a></dt><dt><a href="#id2866101">IVAL(buf,pos)</a></dt><dt><a href="#id2866115">SVALS(buf,pos)</a></dt><dt><a href="#id2866130">IVALS(buf,pos)</a></dt><dt><a href="#id2866144">SSVAL(buf,pos,val)</a></dt><dt><a href="#id2866158">SIVAL(buf,pos,val)</a></dt><dt><a href="#id2866173">SSVALS(buf,pos,val)</a></dt><dt><a href="#id2866187">SIVALS(buf,pos,val)</a></dt><dt><a href="#id2866201">RSVAL(buf,pos)</a></dt><dt><a href="#id2867059">RIVAL(buf,pos)</a></dt><dt><a href="#id2867074">RSSVAL(buf,pos,val)</a></dt><dt><a href="#id2867089">RSIVAL(buf,pos,val)</a></dt></dl></dd><dt><a href="#id2867105">LAN Manager Samba API</a></dt><dd><dl><dt><a href="#id2867139">Parameters</a></dt><dt><a href="#id2867290">Return value</a></dt></dl></dd><dt><a href="#id2867973">Code character table</a></dt></dl></dd><dt>6. <a href="#parsing">The smb.conf file</a></dt><dd><dl><dt><a href="#id2868095">Lexical Analysis</a></dt><dd><dl><dt><a href="#id2868180">Handling of Whitespace</a></dt><dt><a href="#id2868234">Handling of Line Continuation</a></dt><dt><a href="#id2868297">Line Continuation Quirks</a></dt></dl></dd><dt><a href="#id2868394">Syntax</a></dt><dd><dl><dt><a href="#id2869245">About params.c</a></dt></dl></dd></dl></dd><dt>7. <a href="#unix-smb">NetBIOS in a Unix World</a></dt><dd><dl><dt><a href="#id2869924">Introduction</a></dt><dt><a href="#id2869945">Usernames</a></dt><dt><a href="#id2870011">File Ownership</a></dt><dt><a href="#id2870047">Passwords</a></dt><dt><a href="#id2869310">Locking</a></dt><dt><a href="#id2869371">Deny Modes</a></dt><dt><a href="#id2869402">Trapdoor UIDs</a></dt><dt><a href="#id2869427">Port numbers</a></dt><dt><a href="#id2869472">Protocol Complexity</a></dt></dl></dd><dt>8. <a href="#tracing">Tracing samba system calls</a></dt><dt>9. <a href="#ntdomain">NT Domain RPC's</a></dt><dd><dl><dt><a href="#id2870486">Introduction</a></dt><dd><dl><dt><a href="#id2870684">Sources</a></dt><dt><a href="#id2870718">Credits</a></dt></dl></dd><dt><a href="#id2871306">Notes and Structures</a></dt><dd><dl><dt><a href="#id2871313">Notes</a></dt><dt><a href="#id2871388">Enumerations</a></dt><dt><a href="#id2871600">Structures</a></dt></dl></dd><dt><a href="#id2883067">MSRPC over Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2883079">MSRPC Pipes</a></dt><dt><a href="#id2883181">Header</a></dt><dt><a href="#id2884052">Tail</a></dt><dt><a href="#id2884098">RPC Bind / Bind Ack</a></dt><dt><a href="#id2884278">NTLSA Transact Named Pipe</a></dt><dt><a href="#id2884443">LSA Open Policy</a></dt><dt><a href="#id2884568">LSA Query Info Policy</a></dt><dt><a href="#id2884674">LSA Enumerate Trusted Domains</a></dt><dt><a href="#id2884766">LSA Open Secret</a></dt><dt><a href="#id2884876">LSA Close</a></dt><dt><a href="#id2884941">LSA Lookup SIDS</a></dt><dt><a href="#id2885151">LSA Lookup Names</a></dt></dl></dd><dt><a href="#id2885377">NETLOGON rpc Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2885537">LSA Request Challenge</a></dt><dt><a href="#id2885672">LSA Authenticate 2</a></dt><dt><a href="#id2885819">LSA Server Password Set</a></dt><dt><a href="#id2885934">LSA SAM Logon</a></dt><dt><a href="#id2886037">LSA SAM Logoff</a></dt></dl></dd><dt><a href="#id2886129">\\MAILSLOT\NET\NTLOGON</a></dt><dd><dl><dt><a href="#id2886146">Query for PDC</a></dt><dt><a href="#id2886407">SAM Logon</a></dt></dl></dd><dt><a href="#id2886733">SRVSVC Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2886778">Net Share Enum</a></dt><dt><a href="#id2886997">Net Server Get Info</a></dt></dl></dd><dt><a href="#id2887114">Cryptographic side of NT Domain Authentication</a></dt><dd><dl><dt><a href="#id2887121">Definitions</a></dt><dt><a href="#id2887283">Protocol</a></dt><dt><a href="#id2887363">Comments</a></dt></dl></dd><dt><a href="#id2887413">SIDs and RIDs</a></dt><dd><dl><dt><a href="#id2887453">Well-known SIDs</a></dt><dt><a href="#id2887767">Well-known RIDS</a></dt></dl></dd></dl></dd><dt>10. <a href="#printing">Samba Printing Internals</a></dt><dd><dl><dt><a href="#id2889311">Abstract</a></dt><dt><a href="#id2889327">
Printing Interface to Various Back ends
-</a></dt><dt><a href="#id2889934">
+</a></dt><dt><a href="#id2889419">
Print Queue TDB's
-</a></dt><dt><a href="#id2890143">
+</a></dt><dt><a href="#id2888211">
ChangeID and Client Caching of Printer Information
-</a></dt><dt><a href="#id2890156">
+</a></dt><dt><a href="#id2888224">
Windows NT/2K Printer Change Notify
-</a></dt></dl></dd><dt>11. <a href="#wins">Samba WINS Internals</a></dt><dd><dl><dt><a href="#id2889624">WINS Failover</a></dt></dl></dd><dt>12. <a href="#sam">The Upcoming SAM System</a></dt><dd><dl><dt><a href="#id2889427">Security in the 'new SAM'</a></dt><dt><a href="#id2890951">Standalone from UNIX</a></dt><dt><a href="#id2890985">Handles and Races in the new SAM</a></dt><dt><a href="#id2891054">Layers</a></dt><dd><dl><dt><a href="#id2891061">Application</a></dt><dt><a href="#id2891077">SAM Interface</a></dt><dt><a href="#id2891105">SAM Modules</a></dt></dl></dd><dt><a href="#id2891126">SAM Modules</a></dt><dd><dl><dt><a href="#id2891134">Special Module: sam_passdb</a></dt><dt><a href="#id2891152">sam_ads</a></dt></dl></dd><dt><a href="#id2891191">Memory Management</a></dt><dt><a href="#id2891281">Testing</a></dt></dl></dd><dt>13. <a href="#pwencrypt">LanMan and NT Password Encryption</a></dt><dd><dl><dt><a href="#id2891920">Introduction</a></dt><dt><a href="#id2891945">How does it work?</a></dt><dt><a href="#id2890832">The smbpasswd file</a></dt></dl></dd><dt>14. <a href="#modules">Modules</a></dt><dd><dl><dt><a href="#id2891872">Advantages</a></dt><dt><a href="#id2892773">Loading modules</a></dt><dd><dl><dt><a href="#id2892806">Static modules</a></dt><dt><a href="#id2893746">Shared modules</a></dt></dl></dd><dt><a href="#id2893775">Writing modules</a></dt><dd><dl><dt><a href="#id2893837">Static/Shared selection in configure.in</a></dt></dl></dd></dl></dd><dt>15. <a href="#rpc-plugin">RPC Pluggable Modules</a></dt><dd><dl><dt><a href="#id2892540">About</a></dt><dt><a href="#id2892559">General Overview</a></dt></dl></dd><dt>16. <a href="#vfs">VFS Modules</a></dt><dd><dl><dt><a href="#id2894852">The Samba (Posix) VFS layer</a></dt><dd><dl><dt><a href="#id2894859">The general interface</a></dt><dt><a href="#id2894974">Possible VFS operation layers</a></dt></dl></dd><dt><a href="#id2895046">The Interaction between the Samba VFS subsystem and the modules</a></dt><dd><dl><dt><a href="#id2895054">Initialization and registration</a></dt><dt><a href="#id2895246">How the Modules handle per connection data</a></dt></dl></dd><dt><a href="#id2895490">Upgrading to the New VFS Interface</a></dt><dd><dl><dt><a href="#id2895497">Upgrading from 2.2.* and 3.0aplha modules</a></dt></dl></dd><dt><a href="#id2896037">Some Notes</a></dt><dd><dl><dt><a href="#id2896044">Implement TRANSPARENT functions</a></dt><dt><a href="#id2896069">Implement OPAQUE functions</a></dt></dl></dd></dl></dd><dt>17. <a href="#Packaging">Notes to packagers</a></dt><dd><dl><dt><a href="#id2894645">Versioning</a></dt><dt><a href="#id2894678">Modules</a></dt></dl></dd><dt>18. <a href="#contributing">Contributing code</a></dt></dl></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="netbios"></a>Chapter 1. Definition of NetBIOS Protocol and Name Resolution Modes</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Luke</span> <span class="surname">Leighton</span></h3></div></div><div><p class="pubdate">12 June 1997</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2797526">NETBIOS</a></dt><dt><a href="#id2866011">BROADCAST NetBIOS</a></dt><dt><a href="#id2866042">NBNS NetBIOS</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2797526"></a>NETBIOS</h2></div></div><div></div></div><p>
+</a></dt></dl></dd><dt>11. <a href="#wins">Samba WINS Internals</a></dt><dd><dl><dt><a href="#id2888880">WINS Failover</a></dt></dl></dd><dt>12. <a href="#sam">The Upcoming SAM System</a></dt><dd><dl><dt><a href="#id2888557">Security in the 'new SAM'</a></dt><dt><a href="#id2888685">Standalone from UNIX</a></dt><dt><a href="#id2888711">Handles and Races in the new SAM</a></dt><dt><a href="#id2888780">Layers</a></dt><dd><dl><dt><a href="#id2888787">Application</a></dt><dt><a href="#id2888803">SAM Interface</a></dt><dt><a href="#id2888829">SAM Modules</a></dt></dl></dd><dt><a href="#id2888851">SAM Modules</a></dt><dd><dl><dt><a href="#id2888858">Special Module: sam_passdb</a></dt><dt><a href="#id2890101">sam_ads</a></dt></dl></dd><dt><a href="#id2890131">Memory Management</a></dt><dt><a href="#id2890217">Testing</a></dt></dl></dd><dt>13. <a href="#pwencrypt">LanMan and NT Password Encryption</a></dt><dd><dl><dt><a href="#id2890947">Introduction</a></dt><dt><a href="#id2890972">How does it work?</a></dt><dt><a href="#id2891066">The smbpasswd file</a></dt></dl></dd><dt>14. <a href="#modules">Modules</a></dt><dd><dl><dt><a href="#id2892850">Advantages</a></dt><dt><a href="#id2892895">Loading modules</a></dt><dd><dl><dt><a href="#id2892925">Static modules</a></dt><dt><a href="#id2892965">Shared modules</a></dt></dl></dd><dt><a href="#id2892994">Writing modules</a></dt><dd><dl><dt><a href="#id2893054">Static/Shared selection in configure.in</a></dt></dl></dd></dl></dd><dt>15. <a href="#rpc-plugin">RPC Pluggable Modules</a></dt><dd><dl><dt><a href="#id2893212">About</a></dt><dt><a href="#id2893231">General Overview</a></dt></dl></dd><dt>16. <a href="#vfs">VFS Modules</a></dt><dd><dl><dt><a href="#id2895474">The Samba (Posix) VFS layer</a></dt><dd><dl><dt><a href="#id2895481">The general interface</a></dt><dt><a href="#id2895581">Possible VFS operation layers</a></dt></dl></dd><dt><a href="#id2895645">The Interaction between the Samba VFS subsystem and the modules</a></dt><dd><dl><dt><a href="#id2895653">Initialization and registration</a></dt><dt><a href="#id2891713">How the Modules handle per connection data</a></dt></dl></dd><dt><a href="#id2891932">Upgrading to the New VFS Interface</a></dt><dd><dl><dt><a href="#id2893534">Upgrading from 2.2.* and 3.0aplha modules</a></dt></dl></dd><dt><a href="#id2893946">Some Notes</a></dt><dd><dl><dt><a href="#id2893953">Implement TRANSPARENT functions</a></dt><dt><a href="#id2893976">Implement OPAQUE functions</a></dt></dl></dd></dl></dd><dt>17. <a href="#Packaging">Notes to packagers</a></dt><dd><dl><dt><a href="#id2894041">Versioning</a></dt><dt><a href="#id2894070">Modules</a></dt></dl></dd><dt>18. <a href="#contributing">Contributing code</a></dt></dl></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="netbios"></a>Chapter 1. Definition of NetBIOS Protocol and Name Resolution Modes</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Luke</span> <span class="surname">Leighton</span></h3></div></div><div><p class="pubdate">12 June 1997</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2801706">NETBIOS</a></dt><dt><a href="#id2801790">BROADCAST NetBIOS</a></dt><dt><a href="#id2801821">NBNS NetBIOS</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2801706"></a>NETBIOS</h2></div></div><div></div></div><p>
NetBIOS runs over the following tranports: TCP/IP; NetBEUI and IPX/SPX.
Samba only uses NetBIOS over TCP/IP. For details on the TCP/IP NetBIOS
Session Service NetBIOS Datagram Service, and NetBIOS Names, see
@@ -78,7 +78,7 @@ NetBIOS names are either UNIQUE or GROUP. Only one application can claim a
UNIQUE NetBIOS name on a network.
</p><p>
There are two kinds of NetBIOS Name resolution: Broadcast and Point-to-Point.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2866011"></a>BROADCAST NetBIOS</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2801790"></a>BROADCAST NetBIOS</h2></div></div><div></div></div><p>
Clients can claim names, and therefore offer services on successfully claimed
names, on their broadcast-isolated subnet. One way to get NetBIOS services
(such as browsing: see ftp.microsoft.com/drg/developr/CIFS/browdiff.txt; and
@@ -90,7 +90,7 @@ find that some of your hosts spend 95 percent of their time dealing with
broadcast traffic. [If you have IPX/SPX on your LAN or WAN, you will find
that this is already happening: a packet analyzer will show, roughly
every twelve minutes, great swathes of broadcast traffic!].
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2866042"></a>NBNS NetBIOS</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2801821"></a>NBNS NetBIOS</h2></div></div><div></div></div><p>
rfc1001.txt describes, amongst other things, the implementation and use
of, a 'NetBIOS Name Service'. NT/AS offers 'Windows Internet Name Service'
which is fully rfc1001/2 compliant, but has had to take specific action
@@ -131,7 +131,7 @@ WINS Clients therefore claim names from the WINS server. If the WINS
server allows them to register a name, the client's NetBIOS session service
can then offer services on this name. Other WINS clients will then
contact the WINS server to resolve a NetBIOS name.
-</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="architecture"></a>Chapter 2. Samba Architecture</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Dan</span> <span class="surname">Shearer</span></h3></div></div><div><p class="pubdate"> November 1997</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2797150">Introduction</a></dt><dt><a href="#id2797202">Multithreading and Samba</a></dt><dt><a href="#id2797240">Threading smbd</a></dt><dt><a href="#id2797314">Threading nmbd</a></dt><dt><a href="#id2797382">nbmd Design</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2797150"></a>Introduction</h2></div></div><div></div></div><p>
+</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="architecture"></a>Chapter 2. Samba Architecture</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Dan</span> <span class="surname">Shearer</span></h3></div></div><div><p class="pubdate"> November 1997</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2800444">Introduction</a></dt><dt><a href="#id2800493">Multithreading and Samba</a></dt><dt><a href="#id2800530">Threading smbd</a></dt><dt><a href="#id2800121">Threading nmbd</a></dt><dt><a href="#id2800174">nbmd Design</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2800444"></a>Introduction</h2></div></div><div></div></div><p>
This document gives a general overview of how Samba works
internally. The Samba Team has tried to come up with a model which is
the best possible compromise between elegance, portability, security
@@ -142,7 +142,7 @@ It also tries to answer some of the frequently asked questions such as:
</p><div class="orderedlist"><ol type="1"><li><p>
Is Samba secure when running on Unix? The xyz platform?
What about the root priveliges issue?
-</p></li><li><p>Pros and cons of multithreading in various parts of Samba</p></li><li><p>Why not have a separate process for name resolution, WINS, and browsing?</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2797202"></a>Multithreading and Samba</h2></div></div><div></div></div><p>
+</p></li><li><p>Pros and cons of multithreading in various parts of Samba</p></li><li><p>Why not have a separate process for name resolution, WINS, and browsing?</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2800493"></a>Multithreading and Samba</h2></div></div><div></div></div><p>
People sometimes tout threads as a uniformly good thing. They are very
nice in their place but are quite inappropriate for smbd. nmbd is
another matter, and multi-threading it would be very nice.
@@ -159,7 +159,7 @@ smbd multi-threaded. Multi-threading would actually make Samba much
slower, less scalable, less portable and much less robust. The fact
that we use a separate process for each connection is one of Samba's
biggest advantages.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2797240"></a>Threading smbd</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2800530"></a>Threading smbd</h2></div></div><div></div></div><p>
A few problems that would arise from a threaded smbd are:
</p><div class="orderedlist"><ol type="1"><li><p>
It's not only to create threads instead of processes, but you
@@ -184,7 +184,7 @@ A few problems that would arise from a threaded smbd are:
</p></li><li><p>
we couldn't use the system locking calls as the locking context of
fcntl() is a process, not a thread.
-</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2797314"></a>Threading nmbd</h2></div></div><div></div></div><p>
+</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2800121"></a>Threading nmbd</h2></div></div><div></div></div><p>
This would be ideal, but gets sunk by portability requirements.
</p><p>
Andrew tried to write a test threads library for nmbd that used only
@@ -211,7 +211,7 @@ packet that arrives. Having a pool of processes is possible but is
nasty to program cleanly due to the enormous amount of shared data (in
complex structures) between the processes. We can't rely on each
platform having a shared memory system.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2797382"></a>nbmd Design</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2800174"></a>nbmd Design</h2></div></div><div></div></div><p>
Originally Andrew used recursion to simulate a multi-threaded
environment, which use the stack enormously and made for really
confusing debugging sessions. Luke Leighton rewrote it to use a
@@ -232,7 +232,7 @@ keeps the idea of a distinct packet. See &quot;struct packet_struct&quot; in
nameserv.h. It has all the detail but none of the on-the-wire
mess. This makes it ideal for using in disk or memory-based databases
for browsing and WINS support.
-</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="debug"></a>Chapter 3. The samba DEBUG system</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Chris</span> <span class="surname">Hertel</span></h3></div></div><div><p class="pubdate">July 1998</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2796808">New Output Syntax</a></dt><dt><a href="#id2796946">The DEBUG() Macro</a></dt><dt><a href="#id2867248">The DEBUGADD() Macro</a></dt><dt><a href="#id2867293">The DEBUGLVL() Macro</a></dt><dt><a href="#id2867398">New Functions</a></dt><dd><dl><dt><a href="#id2867405">dbgtext()</a></dt><dt><a href="#id2867425">dbghdr()</a></dt><dt><a href="#id2867448">format_debug_text()</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2796808"></a>New Output Syntax</h2></div></div><div></div></div><p>
+</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="debug"></a>Chapter 3. The samba DEBUG system</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Chris</span> <span class="surname">Hertel</span></h3></div></div><div><p class="pubdate">July 1998</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2799483">New Output Syntax</a></dt><dt><a href="#id2799606">The DEBUG() Macro</a></dt><dt><a href="#id2799736">The DEBUGADD() Macro</a></dt><dt><a href="#id2799781">The DEBUGLVL() Macro</a></dt><dt><a href="#id2799887">New Functions</a></dt><dd><dl><dt><a href="#id2799894">dbgtext()</a></dt><dt><a href="#id2799913">dbghdr()</a></dt><dt><a href="#id2799936">format_debug_text()</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2799483"></a>New Output Syntax</h2></div></div><div></div></div><p>
The syntax of a debugging log file is represented as:
</p><pre class="programlisting">
&gt;debugfile&lt; :== { &gt;debugmsg&lt; }
@@ -285,7 +285,7 @@ by a newline.
Note that in the above example the function names are not listed on
the header line. That's because the example above was generated on an
SGI Indy, and the SGI compiler doesn't support the __FUNCTION__ macro.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2796946"></a>The DEBUG() Macro</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2799606"></a>The DEBUG() Macro</h2></div></div><div></div></div><p>
Use of the DEBUG() macro is unchanged. DEBUG() takes two parameters.
The first is the message level, the second is the body of a function
call to the Debug1() function.
@@ -336,7 +336,7 @@ would look like this:
[1998/07/30 16:00:51, 0] file.c:function(261)
.
</pre><p>Which isn't much use. The format buffer kludge fixes this problem.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2867248"></a>The DEBUGADD() Macro</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2799736"></a>The DEBUGADD() Macro</h2></div></div><div></div></div><p>
In addition to the kludgey solution to the broken line problem
described above, there is a clean solution. The DEBUGADD() macro never
generates a header. It will append new text to the current debug
@@ -350,7 +350,7 @@ DEBUGADD() macro is the same as that of the DEBUG() macro.
This is the first line.
This is the second line.
This is the third line.
-</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2867293"></a>The DEBUGLVL() Macro</h2></div></div><div></div></div><p>
+</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2799781"></a>The DEBUGLVL() Macro</h2></div></div><div></div></div><p>
One of the problems with the DEBUG() macro was that DEBUG() lines
tended to get a bit long. Consider this example from
nmbd_sendannounce.c:
@@ -385,7 +385,7 @@ within the DEBUGLVL() block.
</p></li><li><p>
Processing that is only relevant to debug output can be contained
within the DEBUGLVL() block.
-</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2867398"></a>New Functions</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2867405"></a>dbgtext()</h3></div></div><div></div></div><p>
+</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2799887"></a>New Functions</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2799894"></a>dbgtext()</h3></div></div><div></div></div><p>
This function prints debug message text to the debug file (and
possibly to syslog) via the format buffer. The function uses a
variable argument list just like printf() or Debug1(). The
@@ -394,7 +394,7 @@ and then passed to format_debug_text().
If you use DEBUGLVL() you will probably print the body of the
message using dbgtext().
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2867425"></a>dbghdr()</h3></div></div><div></div></div><p>
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2799913"></a>dbghdr()</h3></div></div><div></div></div><p>
This is the function that writes a debug message header.
Headers are not processed via the format buffer. Also note that
if the format buffer is not empty, a call to dbghdr() will not
@@ -402,7 +402,7 @@ produce any output. See the comments in dbghdr() for more info.
</p><p>
It is not likely that this function will be called directly. It
is used by DEBUG() and DEBUGADD().
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2867448"></a>format_debug_text()</h3></div></div><div></div></div><p>
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2799936"></a>format_debug_text()</h3></div></div><div></div></div><p>
This is a static function in debug.c. It stores the output text
for the body of the message in a buffer until it encounters a
newline. When the newline character is found, the buffer is
@@ -553,7 +553,7 @@ The suggestions above are simply that, suggestions, but the information may
help in reducing the routine rework done on new code. The preceeding list
is expected to change routinely as new support routines and macros are
added.
-</p></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="internals"></a>Chapter 5. Samba Internals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">David</span> <span class="surname">Chappell</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:David.Chappell@mail.trincoll.edu">David.Chappell@mail.trincoll.edu</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate">8 May 1996</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2866821">Character Handling</a></dt><dt><a href="#id2866847">The new functions</a></dt><dt><a href="#id2868099">Macros in byteorder.h</a></dt><dd><dl><dt><a href="#id2869024">CVAL(buf,pos)</a></dt><dt><a href="#id2869037">PVAL(buf,pos)</a></dt><dt><a href="#id2869051">SCVAL(buf,pos,val)</a></dt><dt><a href="#id2869064">SVAL(buf,pos)</a></dt><dt><a href="#id2869080">IVAL(buf,pos)</a></dt><dt><a href="#id2869094">SVALS(buf,pos)</a></dt><dt><a href="#id2869109">IVALS(buf,pos)</a></dt><dt><a href="#id2869123">SSVAL(buf,pos,val)</a></dt><dt><a href="#id2869138">SIVAL(buf,pos,val)</a></dt><dt><a href="#id2869152">SSVALS(buf,pos,val)</a></dt><dt><a href="#id2869166">SIVALS(buf,pos,val)</a></dt><dt><a href="#id2869181">RSVAL(buf,pos)</a></dt><dt><a href="#id2869195">RIVAL(buf,pos)</a></dt><dt><a href="#id2869210">RSSVAL(buf,pos,val)</a></dt><dt><a href="#id2869225">RSIVAL(buf,pos,val)</a></dt></dl></dd><dt><a href="#id2869240">LAN Manager Samba API</a></dt><dd><dl><dt><a href="#id2869276">Parameters</a></dt><dt><a href="#id2869427">Return value</a></dt></dl></dd><dt><a href="#id2869512">Code character table</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2866821"></a>Character Handling</h2></div></div><div></div></div><p>
+</p></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="internals"></a>Chapter 5. Samba Internals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">David</span> <span class="surname">Chappell</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:David.Chappell@mail.trincoll.edu">David.Chappell@mail.trincoll.edu</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate">8 May 1996</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2867396">Character Handling</a></dt><dt><a href="#id2867421">The new functions</a></dt><dt><a href="#id2866034">Macros in byteorder.h</a></dt><dd><dl><dt><a href="#id2866047">CVAL(buf,pos)</a></dt><dt><a href="#id2866061">PVAL(buf,pos)</a></dt><dt><a href="#id2866075">SCVAL(buf,pos,val)</a></dt><dt><a href="#id2866088">SVAL(buf,pos)</a></dt><dt><a href="#id2866101">IVAL(buf,pos)</a></dt><dt><a href="#id2866115">SVALS(buf,pos)</a></dt><dt><a href="#id2866130">IVALS(buf,pos)</a></dt><dt><a href="#id2866144">SSVAL(buf,pos,val)</a></dt><dt><a href="#id2866158">SIVAL(buf,pos,val)</a></dt><dt><a href="#id2866173">SSVALS(buf,pos,val)</a></dt><dt><a href="#id2866187">SIVALS(buf,pos,val)</a></dt><dt><a href="#id2866201">RSVAL(buf,pos)</a></dt><dt><a href="#id2867059">RIVAL(buf,pos)</a></dt><dt><a href="#id2867074">RSSVAL(buf,pos,val)</a></dt><dt><a href="#id2867089">RSIVAL(buf,pos,val)</a></dt></dl></dd><dt><a href="#id2867105">LAN Manager Samba API</a></dt><dd><dl><dt><a href="#id2867139">Parameters</a></dt><dt><a href="#id2867290">Return value</a></dt></dl></dd><dt><a href="#id2867973">Code character table</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2867396"></a>Character Handling</h2></div></div><div></div></div><p>
This section describes character set handling in Samba, as implemented in
Samba 3.0 and above
</p><p>
@@ -563,7 +563,7 @@ strings to/from DOS codepages. The problem is that there was no way of
telling if a particular char* is in dos codepage or unix
codepage. This led to a nightmare of code that tried to cope with
particular cases without handlingt the general case.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2866847"></a>The new functions</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2867421"></a>The new functions</h2></div></div><div></div></div><p>
The new system works like this:
</p><div class="orderedlist"><ol type="1"><li><p>
all char* strings inside Samba are &quot;unix&quot; strings. These are
@@ -625,41 +625,41 @@ The new system works like this:
parameters is gone.
</p></li><li><p>
all vfs functions take unix strings. Don't convert when passing to them
-</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2868099"></a>Macros in byteorder.h</h2></div></div><div></div></div><p>
+</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2866034"></a>Macros in byteorder.h</h2></div></div><div></div></div><p>
This section describes the macros defined in byteorder.h. These macros
are used extensively in the Samba code.
-</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869024"></a>CVAL(buf,pos)</h3></div></div><div></div></div><p>
+</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866047"></a>CVAL(buf,pos)</h3></div></div><div></div></div><p>
returns the byte at offset pos within buffer buf as an unsigned character.
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869037"></a>PVAL(buf,pos)</h3></div></div><div></div></div><p>returns the value of CVAL(buf,pos) cast to type unsigned integer.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869051"></a>SCVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the byte at offset pos within buffer buf to value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869064"></a>SVAL(buf,pos)</h3></div></div><div></div></div><p>
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866061"></a>PVAL(buf,pos)</h3></div></div><div></div></div><p>returns the value of CVAL(buf,pos) cast to type unsigned integer.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866075"></a>SCVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the byte at offset pos within buffer buf to value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866088"></a>SVAL(buf,pos)</h3></div></div><div></div></div><p>
returns the value of the unsigned short (16 bit) little-endian integer at
offset pos within buffer buf. An integer of this type is sometimes
refered to as &quot;USHORT&quot;.
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869080"></a>IVAL(buf,pos)</h3></div></div><div></div></div><p>returns the value of the unsigned 32 bit little-endian integer at offset
-pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869094"></a>SVALS(buf,pos)</h3></div></div><div></div></div><p>returns the value of the signed short (16 bit) little-endian integer at
-offset pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869109"></a>IVALS(buf,pos)</h3></div></div><div></div></div><p>returns the value of the signed 32 bit little-endian integer at offset pos
-within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869123"></a>SSVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the unsigned short (16 bit) little-endian integer at offset pos within
-buffer buf to value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869138"></a>SIVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the unsigned 32 bit little-endian integer at offset pos within buffer
-buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869152"></a>SSVALS(buf,pos,val)</h3></div></div><div></div></div><p>sets the short (16 bit) signed little-endian integer at offset pos within
-buffer buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869166"></a>SIVALS(buf,pos,val)</h3></div></div><div></div></div><p>sets the signed 32 bit little-endian integer at offset pos withing buffer
-buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869181"></a>RSVAL(buf,pos)</h3></div></div><div></div></div><p>returns the value of the unsigned short (16 bit) big-endian integer at
-offset pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869195"></a>RIVAL(buf,pos)</h3></div></div><div></div></div><p>returns the value of the unsigned 32 bit big-endian integer at offset
-pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869210"></a>RSSVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the value of the unsigned short (16 bit) big-endian integer at
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866101"></a>IVAL(buf,pos)</h3></div></div><div></div></div><p>returns the value of the unsigned 32 bit little-endian integer at offset
+pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866115"></a>SVALS(buf,pos)</h3></div></div><div></div></div><p>returns the value of the signed short (16 bit) little-endian integer at
+offset pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866130"></a>IVALS(buf,pos)</h3></div></div><div></div></div><p>returns the value of the signed 32 bit little-endian integer at offset pos
+within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866144"></a>SSVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the unsigned short (16 bit) little-endian integer at offset pos within
+buffer buf to value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866158"></a>SIVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the unsigned 32 bit little-endian integer at offset pos within buffer
+buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866173"></a>SSVALS(buf,pos,val)</h3></div></div><div></div></div><p>sets the short (16 bit) signed little-endian integer at offset pos within
+buffer buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866187"></a>SIVALS(buf,pos,val)</h3></div></div><div></div></div><p>sets the signed 32 bit little-endian integer at offset pos withing buffer
+buf to the value val.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2866201"></a>RSVAL(buf,pos)</h3></div></div><div></div></div><p>returns the value of the unsigned short (16 bit) big-endian integer at
+offset pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2867059"></a>RIVAL(buf,pos)</h3></div></div><div></div></div><p>returns the value of the unsigned 32 bit big-endian integer at offset
+pos within buffer buf.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2867074"></a>RSSVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the value of the unsigned short (16 bit) big-endian integer at
offset pos within buffer buf to value val.
-refered to as &quot;USHORT&quot;.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869225"></a>RSIVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the value of the unsigned 32 bit big-endian integer at offset
-pos within buffer buf to value val.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2869240"></a>LAN Manager Samba API</h2></div></div><div></div></div><p>
+refered to as &quot;USHORT&quot;.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2867089"></a>RSIVAL(buf,pos,val)</h3></div></div><div></div></div><p>sets the value of the unsigned 32 bit big-endian integer at offset
+pos within buffer buf to value val.</p></div></div><div xmlns:ns2="" class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2867105"></a>LAN Manager Samba API</h2></div></div><div></div></div><p>
This section describes the functions need to make a LAN Manager RPC call.
This information had been obtained by examining the Samba code and the LAN
Manager 2.0 API documentation. It should not be considered entirely
reliable.
-</p><p>
-</p><pre class="programlisting">
+</p><ns2:p>
+</ns2:p><pre class="programlisting">
call_api(int prcnt, int drcnt, int mprcnt, int mdrcnt,
char *param, char *data, char **rparam, char **rdata);
-</pre><p>
-</p><p>
+</pre><ns2:p>
+</ns2:p><p>
This function is defined in client.c. It uses an SMB transaction to call a
remote api.
-</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869276"></a>Parameters</h3></div></div><div></div></div><p>The parameters are as follows:</p><div class="orderedlist"><ol type="1"><li><p>
+</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2867139"></a>Parameters</h3></div></div><div></div></div><p>The parameters are as follows:</p><div class="orderedlist"><ol type="1"><li><p>
prcnt: the number of bytes of parameters begin sent.
</p></li><li><p>
drcnt: the number of bytes of data begin sent.
@@ -704,7 +704,7 @@ substructures apply, this string is of zero length.
</p></li></ol></div><p>
The code in client.c always calls call_api() with no data. It is unclear
when a non-zero length data buffer would be sent.
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869427"></a>Return value</h3></div></div><div></div></div><p>
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2867290"></a>Return value</h3></div></div><div></div></div><p>
The returned parameters (pointed to by rparam), in their order of appearance
are:</p><div class="orderedlist"><ol type="1"><li><p>
An unsigned 16 bit integer which contains the API function's return code.
@@ -735,7 +735,7 @@ fix_char_ptr() in client.c can be used for this purpose.
The third parameter (which may be read as &quot;SVAL(rparam,4)&quot;) has something to
do with indicating the amount of data returned or possibly the amount of
data which can be returned if enough buffer space is allowed.
-</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2869512"></a>Code character table</h2></div></div><div></div></div><p>
+</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2867973"></a>Code character table</h2></div></div><div></div></div><p>
Certain data structures are described by means of ASCIIz strings containing
code characters. These are the code characters:
</p><div class="orderedlist"><ol type="1"><li><p>
@@ -758,7 +758,7 @@ r pointer to returned data buffer???
L length in bytes of returned data buffer???
</p></li><li><p>
h number of bytes of information available???
-</p></li></ol></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="parsing"></a>Chapter 6. The smb.conf file</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Chris</span> <span class="surname">Hertel</span></h3></div></div><div><p class="pubdate">November 1997</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2868851">Lexical Analysis</a></dt><dd><dl><dt><a href="#id2868944">Handling of Whitespace</a></dt><dt><a href="#id2869000">Handling of Line Continuation</a></dt><dt><a href="#id2870660">Line Continuation Quirks</a></dt></dl></dd><dt><a href="#id2870758">Syntax</a></dt><dd><dl><dt><a href="#id2870829">About params.c</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2868851"></a>Lexical Analysis</h2></div></div><div></div></div><p>
+</p></li></ol></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="parsing"></a>Chapter 6. The smb.conf file</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Chris</span> <span class="surname">Hertel</span></h3></div></div><div><p class="pubdate">November 1997</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2868095">Lexical Analysis</a></dt><dd><dl><dt><a href="#id2868180">Handling of Whitespace</a></dt><dt><a href="#id2868234">Handling of Line Continuation</a></dt><dt><a href="#id2868297">Line Continuation Quirks</a></dt></dl></dd><dt><a href="#id2868394">Syntax</a></dt><dd><dl><dt><a href="#id2869245">About params.c</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2868095"></a>Lexical Analysis</h2></div></div><div></div></div><p>
Basically, the file is processed on a line by line basis. There are
four types of lines that are recognized by the lexical analyzer
(params.c):
@@ -785,7 +785,7 @@ ignores them. The latter two line types are scanned for
These are the only tokens passed to the parameter loader
(loadparm.c). Parameter names and values are divided from one
another by an equal sign: '='.
-</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2868944"></a>Handling of Whitespace</h3></div></div><div></div></div><p>
+</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2868180"></a>Handling of Whitespace</h3></div></div><div></div></div><p>
Whitespace is defined as all characters recognized by the isspace()
function (see ctype(3C)) except for the newline character ('\n')
The newline is excluded because it identifies the end of the line.
@@ -800,7 +800,7 @@ the exception of carriage return characters ('\r'), all of which
are removed.
</p></li><li><p>
Leading and trailing whitespace is removed from names and values.
-</p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869000"></a>Handling of Line Continuation</h3></div></div><div></div></div><p>
+</p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2868234"></a>Handling of Line Continuation</h3></div></div><div></div></div><p>
Long section header and parameter lines may be extended across
multiple lines by use of the backslash character ('\\'). Line
continuation is ignored for blank and comment lines.
@@ -823,7 +823,7 @@ line, plus the four preceeding the word 'with' in the second line.
Line continuation characters are ignored on blank lines and at the end
of comments. They are *only* recognized within section and parameter
lines.
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2870660"></a>Line Continuation Quirks</h3></div></div><div></div></div><p>Note the following example:</p><pre class="programlisting">
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2868297"></a>Line Continuation Quirks</h3></div></div><div></div></div><p>Note the following example:</p><pre class="programlisting">
param name = parameter value string \
\
with line continuation.
@@ -847,7 +847,7 @@ terminating character, and the rest of the line is ignored. The lines
</pre><p>are read as</p><pre class="programlisting">
[section name]
param name = value
-</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2870758"></a>Syntax</h2></div></div><div></div></div><p>The syntax of the smb.conf file is as follows:</p><pre class="programlisting">
+</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2868394"></a>Syntax</h2></div></div><div></div></div><p>The syntax of the smb.conf file is as follows:</p><pre class="programlisting">
&lt;file&gt; :== { &lt;section&gt; } EOF
&lt;section&gt; :== &lt;section header&gt; { &lt;parameter line&gt; }
&lt;section header&gt; :== '[' NAME ']'
@@ -866,12 +866,12 @@ terminating character, and the rest of the line is ignored. The lines
A parameter line is divided into a NAME and a VALUE. The *first*
equal sign on the line separates the NAME from the VALUE. The
VALUE is terminated by a newline character (NL = '\n').
-</p></li></ol></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2870829"></a>About params.c</h3></div></div><div></div></div><p>
+</p></li></ol></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2869245"></a>About params.c</h3></div></div><div></div></div><p>
The parsing of the config file is a bit unusual if you are used to
lex, yacc, bison, etc. Both lexical analysis (scanning) and parsing
are performed by params.c. Values are loaded via callbacks to
loadparm.c.
-</p></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="unix-smb"></a>Chapter 7. NetBIOS in a Unix World</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Andrew</span> <span class="surname">Tridgell</span></h3></div></div><div><p class="pubdate">April 1995</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2870276">Introduction</a></dt><dt><a href="#id2870301">Usernames</a></dt><dt><a href="#id2870529">File Ownership</a></dt><dt><a href="#id2870566">Passwords</a></dt><dt><a href="#id2870604">Locking</a></dt><dt><a href="#id2871543">Deny Modes</a></dt><dt><a href="#id2871573">Trapdoor UIDs</a></dt><dt><a href="#id2871598">Port numbers</a></dt><dt><a href="#id2871644">Protocol Complexity</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2870276"></a>Introduction</h2></div></div><div></div></div><p>
+</p></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="unix-smb"></a>Chapter 7. NetBIOS in a Unix World</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Andrew</span> <span class="surname">Tridgell</span></h3></div></div><div><p class="pubdate">April 1995</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2869924">Introduction</a></dt><dt><a href="#id2869945">Usernames</a></dt><dt><a href="#id2870011">File Ownership</a></dt><dt><a href="#id2870047">Passwords</a></dt><dt><a href="#id2869310">Locking</a></dt><dt><a href="#id2869371">Deny Modes</a></dt><dt><a href="#id2869402">Trapdoor UIDs</a></dt><dt><a href="#id2869427">Port numbers</a></dt><dt><a href="#id2869472">Protocol Complexity</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2869924"></a>Introduction</h2></div></div><div></div></div><p>
This is a short document that describes some of the issues that
confront a SMB implementation on unix, and how Samba copes with
them. They may help people who are looking at unix&lt;-&gt;PC
@@ -879,7 +879,7 @@ interoperability.
</p><p>
It was written to help out a person who was writing a paper on unix to
PC connectivity.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2870301"></a>Usernames</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2869945"></a>Usernames</h2></div></div><div></div></div><p>
The SMB protocol has only a loose username concept. Early SMB
protocols (such as CORE and COREPLUS) have no username concept at
all. Even in later protocols clients often attempt operations
@@ -916,7 +916,7 @@ in the vast majority of cases. The methods include username maps, the
service%user syntax, the saving of session setup usernames for later
validation and the derivation of the username from the service name
(either directly or via the user= option).
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2870529"></a>File Ownership</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2870011"></a>File Ownership</h2></div></div><div></div></div><p>
The commonly used SMB protocols have no way of saying &quot;you can't do
that because you don't own the file&quot;. They have, in fact, no concept
of file ownership at all.
@@ -934,7 +934,7 @@ file time comparisons right.
There are several possible solutions to this problem, including
username mapping, and forcing a specific username for particular
shares.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2870566"></a>Passwords</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2870047"></a>Passwords</h2></div></div><div></div></div><p>
Many SMB clients uppercase passwords before sending them. I have no
idea why they do this. Interestingly WfWg uppercases the password only
if the server is running a protocol greater than COREPLUS, so
@@ -956,7 +956,7 @@ This means that it is *VERY* important to ensure that the Samba
smbpasswd file containing these password hashes is only readable
by the root user. See the documentation ENCRYPTION.txt for more
details.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2870604"></a>Locking</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2869310"></a>Locking</h2></div></div><div></div></div><p>
Since samba 2.2, samba supports other types of locking as well. This
section is outdated.
</p><p>
@@ -987,7 +987,7 @@ asking the server to notify it if anyone else tries to do something on
the same file, at which time the client will say if it is willing to
give up its lock. Unix has no simple way of implementing
opportunistic locking, and currently Samba has no support for it.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2871543"></a>Deny Modes</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2869371"></a>Deny Modes</h2></div></div><div></div></div><p>
When a SMB client opens a file it asks for a particular &quot;deny mode&quot; to
be placed on the file. These modes (DENY_NONE, DENY_READ, DENY_WRITE,
DENY_ALL, DENY_FCB and DENY_DOS) specify what actions should be
@@ -1001,7 +1001,7 @@ directory or a shared memory implementation. The lock file method
is clumsy and consumes processing and file resources,
the shared memory implementation is vastly prefered and is turned on
by default for those systems that support it.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2871573"></a>Trapdoor UIDs</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2869402"></a>Trapdoor UIDs</h2></div></div><div></div></div><p>
A SMB session can run with several uids on the one socket. This
happens when a user connects to two shares with different
usernames. To cope with this the unix server needs to switch uids
@@ -1011,7 +1011,7 @@ a single uid.
</p><p>
Note that you can also get the &quot;trapdoor uid&quot; message for other
reasons. Please see the FAQ for details.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2871598"></a>Port numbers</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2869427"></a>Port numbers</h2></div></div><div></div></div><p>
There is a convention that clients on sockets use high &quot;unprivilaged&quot;
port numbers (&gt;1000) and connect to servers on low &quot;privilaged&quot; port
numbers. This is enforced in Unix as non-root users can't open a
@@ -1034,7 +1034,7 @@ to any of these OSes unless they are running as root. The answer comes
back, but it goes to port 137 which the unix user can't listen
on. Interestingly WinNT3.1 got this right - it sends node status
responses back to the source port in the request.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2871644"></a>Protocol Complexity</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2869472"></a>Protocol Complexity</h2></div></div><div></div></div><p>
There are many &quot;protocol levels&quot; in the SMB protocol. It seems that
each time new functionality was added to a Microsoft operating system,
they added the equivalent functions in a new protocol level of the SMB
@@ -1148,7 +1148,7 @@ causes printing to fail with Samba:
The process is trying to first open <tt class="filename">/dev/null</tt> read-write
then read-only. Both fail. This means <tt class="filename">/dev/null</tt> has
incorrect permissions.
-</p></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="ntdomain"></a>Chapter 9. NT Domain RPC's</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Luke</span> <span class="surname">Leighton</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:lkcl@switchboard.net">lkcl@switchboard.net</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Paul</span> <span class="surname">Ashton</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:paul@argo.demon.co.uk">paul@argo.demon.co.uk</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Duncan</span> <span class="surname">Stansfield</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:duncans@sco.com">duncans@sco.com</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate">01 November 97(version 0.0.24)</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2871220">Introduction</a></dt><dd><dl><dt><a href="#id2872245">Sources</a></dt><dt><a href="#id2872278">Credits</a></dt></dl></dd><dt><a href="#id2872317">Notes and Structures</a></dt><dd><dl><dt><a href="#id2872324">Notes</a></dt><dt><a href="#id2873087">Enumerations</a></dt><dt><a href="#id2873300">Structures</a></dt></dl></dd><dt><a href="#id2876250">MSRPC over Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2876262">MSRPC Pipes</a></dt><dt><a href="#id2876365">Header</a></dt><dt><a href="#id2877236">Tail</a></dt><dt><a href="#id2877281">RPC Bind / Bind Ack</a></dt><dt><a href="#id2877461">NTLSA Transact Named Pipe</a></dt><dt><a href="#id2877626">LSA Open Policy</a></dt><dt><a href="#id2877752">LSA Query Info Policy</a></dt><dt><a href="#id2877858">LSA Enumerate Trusted Domains</a></dt><dt><a href="#id2877950">LSA Open Secret</a></dt><dt><a href="#id2878060">LSA Close</a></dt><dt><a href="#id2878126">LSA Lookup SIDS</a></dt><dt><a href="#id2878335">LSA Lookup Names</a></dt></dl></dd><dt><a href="#id2878561">NETLOGON rpc Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2878722">LSA Request Challenge</a></dt><dt><a href="#id2878856">LSA Authenticate 2</a></dt><dt><a href="#id2879004">LSA Server Password Set</a></dt><dt><a href="#id2879119">LSA SAM Logon</a></dt><dt><a href="#id2879232">LSA SAM Logoff</a></dt></dl></dd><dt><a href="#id2879324">\\MAILSLOT\NET\NTLOGON</a></dt><dd><dl><dt><a href="#id2879336">Query for PDC</a></dt><dt><a href="#id2879604">SAM Logon</a></dt></dl></dd><dt><a href="#id2879929">SRVSVC Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2879974">Net Share Enum</a></dt><dt><a href="#id2880194">Net Server Get Info</a></dt></dl></dd><dt><a href="#id2880310">Cryptographic side of NT Domain Authentication</a></dt><dd><dl><dt><a href="#id2880318">Definitions</a></dt><dt><a href="#id2880480">Protocol</a></dt><dt><a href="#id2880577">Comments</a></dt></dl></dd><dt><a href="#id2880626">SIDs and RIDs</a></dt><dd><dl><dt><a href="#id2880666">Well-known SIDs</a></dt><dt><a href="#id2880981">Well-known RIDS</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2871220"></a>Introduction</h2></div></div><div></div></div><p>
+</p></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="ntdomain"></a>Chapter 9. NT Domain RPC's</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Luke</span> <span class="surname">Leighton</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:lkcl@switchboard.net">lkcl@switchboard.net</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Paul</span> <span class="surname">Ashton</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:paul@argo.demon.co.uk">paul@argo.demon.co.uk</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Duncan</span> <span class="surname">Stansfield</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:duncans@sco.com">duncans@sco.com</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate">01 November 97(version 0.0.24)</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2870486">Introduction</a></dt><dd><dl><dt><a href="#id2870684">Sources</a></dt><dt><a href="#id2870718">Credits</a></dt></dl></dd><dt><a href="#id2871306">Notes and Structures</a></dt><dd><dl><dt><a href="#id2871313">Notes</a></dt><dt><a href="#id2871388">Enumerations</a></dt><dt><a href="#id2871600">Structures</a></dt></dl></dd><dt><a href="#id2883067">MSRPC over Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2883079">MSRPC Pipes</a></dt><dt><a href="#id2883181">Header</a></dt><dt><a href="#id2884052">Tail</a></dt><dt><a href="#id2884098">RPC Bind / Bind Ack</a></dt><dt><a href="#id2884278">NTLSA Transact Named Pipe</a></dt><dt><a href="#id2884443">LSA Open Policy</a></dt><dt><a href="#id2884568">LSA Query Info Policy</a></dt><dt><a href="#id2884674">LSA Enumerate Trusted Domains</a></dt><dt><a href="#id2884766">LSA Open Secret</a></dt><dt><a href="#id2884876">LSA Close</a></dt><dt><a href="#id2884941">LSA Lookup SIDS</a></dt><dt><a href="#id2885151">LSA Lookup Names</a></dt></dl></dd><dt><a href="#id2885377">NETLOGON rpc Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2885537">LSA Request Challenge</a></dt><dt><a href="#id2885672">LSA Authenticate 2</a></dt><dt><a href="#id2885819">LSA Server Password Set</a></dt><dt><a href="#id2885934">LSA SAM Logon</a></dt><dt><a href="#id2886037">LSA SAM Logoff</a></dt></dl></dd><dt><a href="#id2886129">\\MAILSLOT\NET\NTLOGON</a></dt><dd><dl><dt><a href="#id2886146">Query for PDC</a></dt><dt><a href="#id2886407">SAM Logon</a></dt></dl></dd><dt><a href="#id2886733">SRVSVC Transact Named Pipe</a></dt><dd><dl><dt><a href="#id2886778">Net Share Enum</a></dt><dt><a href="#id2886997">Net Server Get Info</a></dt></dl></dd><dt><a href="#id2887114">Cryptographic side of NT Domain Authentication</a></dt><dd><dl><dt><a href="#id2887121">Definitions</a></dt><dt><a href="#id2887283">Protocol</a></dt><dt><a href="#id2887363">Comments</a></dt></dl></dd><dt><a href="#id2887413">SIDs and RIDs</a></dt><dd><dl><dt><a href="#id2887453">Well-known SIDs</a></dt><dt><a href="#id2887767">Well-known RIDS</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2870486"></a>Introduction</h2></div></div><div></div></div><p>
This document contains information to provide an NT workstation with login
services, without the need for an NT server. It is the sgml version of <a href="http://mailhost.cb1.com/~lkcl/cifsntdomain.txt" target="_top">http://mailhost.cb1.com/~lkcl/cifsntdomain.txt</a>, controlled by Luke.
</p><p>
@@ -1194,7 +1194,7 @@ Failure to return this error code will make the workstation report
that it is already a member of the domain.</p></li><li><p>the cryptographic side of the NetrServerPasswordSet command,
which would allow the workstation to change its password. This password is
used to generate the long-term session key. [It is possible to reject this
-command, and keep the default workstation password].</p></li></ol></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2872245"></a>Sources</h3></div></div><div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>cket Traces from Netmonitor (Service Pack 1 and above)</td></tr><tr><td>ul Ashton and Luke Leighton's other &quot;NT Domain&quot; doc.</td></tr><tr><td>FS documentation - cifs6.txt</td></tr><tr><td>FS documentation - cifsrap2.txt</td></tr></table></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2872278"></a>Credits</h3></div></div><div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Paul Ashton: loads of work with Net Monitor; understanding the NT authentication system; reference implementation of the NT domain support on which this document is originally based.</td></tr><tr><td>Duncan Stansfield: low-level analysis of MSRPC Pipes.</td></tr><tr><td>Linus Nordberg: producing c-code from Paul's crypto spec.</td></tr><tr><td>Windows Sourcer development team</td></tr></table></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2872317"></a>Notes and Structures</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2872324"></a>Notes</h3></div></div><div></div></div><div class="orderedlist"><ol type="1"><li><p>
+command, and keep the default workstation password].</p></li></ol></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2870684"></a>Sources</h3></div></div><div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>cket Traces from Netmonitor (Service Pack 1 and above)</td></tr><tr><td>ul Ashton and Luke Leighton's other &quot;NT Domain&quot; doc.</td></tr><tr><td>FS documentation - cifs6.txt</td></tr><tr><td>FS documentation - cifsrap2.txt</td></tr></table></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2870718"></a>Credits</h3></div></div><div></div></div><table class="simplelist" border="0" summary="Simple list"><tr><td>Paul Ashton: loads of work with Net Monitor; understanding the NT authentication system; reference implementation of the NT domain support on which this document is originally based.</td></tr><tr><td>Duncan Stansfield: low-level analysis of MSRPC Pipes.</td></tr><tr><td>Linus Nordberg: producing c-code from Paul's crypto spec.</td></tr><tr><td>Windows Sourcer development team</td></tr></table></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2871306"></a>Notes and Structures</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2871313"></a>Notes</h3></div></div><div></div></div><div class="orderedlist"><ol type="1"><li><p>
In the SMB Transact pipes, some &quot;Structures&quot;, described here, appear to be
4-byte aligned with the SMB header, at their start. Exactly which
&quot;Structures&quot; need aligning is not precisely known or documented.
@@ -1222,15 +1222,15 @@ into or taken out of the SMB data stream. if the count is non-zero, then
the pointer is also non-zero. immediately following the pointer is the
count again, followed by an array of container sub-structures. the count
appears a third time after the last sub-structure.
-</p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2873087"></a>Enumerations</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873094"></a>MSRPC Header type</h4></div></div><div></div></div><p>command number in the msrpc packet header</p><div class="variablelist"><dl><dt><span class="term">MSRPC_Request:</span></dt><dd><p>0x00</p></dd><dt><span class="term">MSRPC_Response:</span></dt><dd><p>0x02</p></dd><dt><span class="term">MSRPC_Bind:</span></dt><dd><p>0x0B</p></dd><dt><span class="term">MSRPC_BindAck:</span></dt><dd><p>0x0C</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873169"></a>MSRPC Packet info</h4></div></div><div></div></div><p>The meaning of these flags is undocumented</p><div class="variablelist"><dl><dt><span class="term">FirstFrag:</span></dt><dd><p>0x01 </p></dd><dt><span class="term">LastFrag:</span></dt><dd><p>0x02 </p></dd><dt><span class="term">NotaFrag:</span></dt><dd><p>0x04 </p></dd><dt><span class="term">RecRespond:</span></dt><dd><p>0x08 </p></dd><dt><span class="term">NoMultiplex:</span></dt><dd><p>0x10 </p></dd><dt><span class="term">NotForIdemp:</span></dt><dd><p>0x20 </p></dd><dt><span class="term">NotforBcast:</span></dt><dd><p>0x40 </p></dd><dt><span class="term">NoUuid:</span></dt><dd><p>0x80 </p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2873300"></a>Structures</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873307"></a>VOID *</h4></div></div><div></div></div><p>sizeof VOID* is 32 bits.</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873319"></a>char</h4></div></div><div></div></div><p>sizeof char is 8 bits.</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873330"></a>UTIME</h4></div></div><div></div></div><p>UTIME is 32 bits, indicating time in seconds since 01jan1970. documented in cifs6.txt (section 3.5 page, page 30).</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873343"></a>NTTIME</h4></div></div><div></div></div><p>NTTIME is 64 bits. documented in cifs6.txt (section 3.5 page, page 30).</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873355"></a>DOM_SID (domain SID structure)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>num of sub-authorities in domain SID</p></dd><dt><span class="term">UINT8</span></dt><dd><p>SID revision number</p></dd><dt><span class="term">UINT8</span></dt><dd><p>num of sub-authorities in domain SID</p></dd><dt><span class="term">UINT8[6]</span></dt><dd><p>6 bytes for domain SID - Identifier Authority.</p></dd><dt><span class="term">UINT16[n_subauths]</span></dt><dd><p>domain SID sub-authorities</p></dd></dl></div><p><span class="emphasis"><em>Note: the domain SID is documented elsewhere.</em></span>
-</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873449"></a>STR (string)</h4></div></div><div></div></div><p>STR (string) is a char[] : a null-terminated string of ascii characters.</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873462"></a>UNIHDR (unicode string header) </h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16</span></dt><dd><p>length of unicode string</p></dd><dt><span class="term">UINT16</span></dt><dd><p>max length of unicode string</p></dd><dt><span class="term">UINT32</span></dt><dd><p>4 - undocumented.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873519"></a>UNIHDR2 (unicode string header plus buffer pointer)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UNIHDR</span></dt><dd><p>unicode string header</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873561"></a>UNISTR (unicode string)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16[]</span></dt><dd><p>null-terminated string of unicode characters.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873589"></a>NAME (length-indicated unicode string)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>length of unicode string</p></dd><dt><span class="term">UINT16[]</span></dt><dd><p>null-terminated string of unicode characters.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873631"></a>UNISTR2 (aligned unicode string)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT8[]</span></dt><dd><p>padding to get unicode string 4-byte aligned with the start of the SMB header.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>max length of unicode string</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>length of unicode string</p></dd><dt><span class="term">UINT16[]</span></dt><dd><p>string of uncode characters</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873717"></a>OBJ_ATTR (object attributes)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>0x18 - length (in bytes) including the length field.</p></dd><dt><span class="term">VOID*</span></dt><dd><p>0 - root directory (pointer)</p></dd><dt><span class="term">VOID*</span></dt><dd><p>0 - object name (pointer)</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - attributes (undocumented)</p></dd><dt><span class="term">VOID*</span></dt><dd><p>0 - security descriptior (pointer)</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - security quality of service</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873810"></a>POL_HND (LSA policy handle)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">char[20]</span></dt><dd><p>policy handle</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873837"></a>DOM_SID2 (domain SID structure, SIDS stored in unicode)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>5 - SID type</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UNIHDR2</span></dt><dd><p>domain SID unicode string header</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>domain SID unicode string</p></dd></dl></div><p><span class="emphasis"><em>Note: there is a conflict between the unicode string header and the unicode string itself as to which to use to indicate string length. this will need to be resolved.</em></span></p><p><span class="emphasis"><em>Note: the SID type indicates, for example, an alias; a well-known group etc. this is documented somewhere.</em></span></p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873924"></a>DOM_RID (domain RID structure)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>5 - well-known SID. 1 - user SID (see ShowACLs)</p></dd><dt><span class="term">UINT32</span></dt><dd><p>5 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>domain RID </p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - domain index out of above reference domains</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2873993"></a>LOG_INFO (server, account, client structure)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: logon server name starts with two '\' characters and is upper case.</em></span></p><p><span class="emphasis"><em>Note: account name is the logon client name from the LSA Request Challenge, with a $ on the end of it, in upper case.</em></span></p><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon server unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>account name unicode string</p></dd><dt><span class="term">UINT16</span></dt><dd><p>sec_chan - security channel type</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon client machine unicode string</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2874093"></a>CLNT_SRV (server, client names structure)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: logon server name starts with two '\' characters and is upper case.</em></span></p><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon server unicode string</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon client machine unicode string</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2874170"></a>CREDS (credentials + time stamp)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">char[8]</span></dt><dd><p>credentials</p></dd><dt><span class="term">UTIME</span></dt><dd><p>time stamp</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2874210"></a>CLNT_INFO2 (server, client structure, client credentials)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: whenever this structure appears in a request, you must take a copy of the client-calculated credentials received, because they will beused in subsequent credential checks. the presumed intention is to
- maintain an authenticated request/response trail.</em></span></p><div class="variablelist"><dl><dt><span class="term">CLNT_SRV</span></dt><dd><p>client and server names</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>???? padding, for 4-byte alignment with SMB header.</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to client credentials.</p></dd><dt><span class="term">CREDS</span></dt><dd><p>client-calculated credentials + client time</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2874294"></a>CLNT_INFO (server, account, client structure, client credentials)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: whenever this structure appears in a request, you must take a copy of the client-calculated credentials received, because they will be used in subsequent credential checks. the presumed intention is to maintain an authenticated request/response trail.</em></span></p><div class="variablelist"><dl><dt><span class="term">LOG_INFO</span></dt><dd><p>logon account info</p></dd><dt><span class="term">CREDS</span></dt><dd><p>client-calculated credentials + client time</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2874346"></a>ID_INFO_1 (id info structure, auth level 1)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>ptr_id_info_1</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>domain name unicode header</p></dd><dt><span class="term">UINT32</span></dt><dd><p>param control</p></dd><dt><span class="term">UINT64</span></dt><dd><p>logon ID</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>user name unicode header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>workgroup name unicode header</p></dd><dt><span class="term">char[16]</span></dt><dd><p>arc4 LM OWF Password</p></dd><dt><span class="term">char[16]</span></dt><dd><p>arc4 NT OWF Password</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>domain name unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>user name unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>workstation name unicode string</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2874516"></a>SAM_INFO (sam logon/logoff id info structure)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: presumably, the return credentials is supposedly for the server to verify that the credential chain hasn't been compromised.</em></span></p><div class="variablelist"><dl><dt><span class="term">CLNT_INFO2</span></dt><dd><p>client identification/authentication info</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to return credentials.</p></dd><dt><span class="term">CRED</span></dt><dd><p>return credentials - ignored.</p></dd><dt><span class="term">UINT16</span></dt><dd><p>logon level</p></dd><dt><span class="term">UINT16</span></dt><dd><p>switch value</p></dd></dl></div><pre class="programlisting">
+</p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2871388"></a>Enumerations</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2871395"></a>MSRPC Header type</h4></div></div><div></div></div><p>command number in the msrpc packet header</p><div class="variablelist"><dl><dt><span class="term">MSRPC_Request:</span></dt><dd><p>0x00</p></dd><dt><span class="term">MSRPC_Response:</span></dt><dd><p>0x02</p></dd><dt><span class="term">MSRPC_Bind:</span></dt><dd><p>0x0B</p></dd><dt><span class="term">MSRPC_BindAck:</span></dt><dd><p>0x0C</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2871469"></a>MSRPC Packet info</h4></div></div><div></div></div><p>The meaning of these flags is undocumented</p><div class="variablelist"><dl><dt><span class="term">FirstFrag:</span></dt><dd><p>0x01 </p></dd><dt><span class="term">LastFrag:</span></dt><dd><p>0x02 </p></dd><dt><span class="term">NotaFrag:</span></dt><dd><p>0x04 </p></dd><dt><span class="term">RecRespond:</span></dt><dd><p>0x08 </p></dd><dt><span class="term">NoMultiplex:</span></dt><dd><p>0x10 </p></dd><dt><span class="term">NotForIdemp:</span></dt><dd><p>0x20 </p></dd><dt><span class="term">NotforBcast:</span></dt><dd><p>0x40 </p></dd><dt><span class="term">NoUuid:</span></dt><dd><p>0x80 </p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2871600"></a>Structures</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2871607"></a>VOID *</h4></div></div><div></div></div><p>sizeof VOID* is 32 bits.</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2871619"></a>char</h4></div></div><div></div></div><p>sizeof char is 8 bits.</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2871630"></a>UTIME</h4></div></div><div></div></div><p>UTIME is 32 bits, indicating time in seconds since 01jan1970. documented in cifs6.txt (section 3.5 page, page 30).</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2871643"></a>NTTIME</h4></div></div><div></div></div><p>NTTIME is 64 bits. documented in cifs6.txt (section 3.5 page, page 30).</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2871656"></a>DOM_SID (domain SID structure)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>num of sub-authorities in domain SID</p></dd><dt><span class="term">UINT8</span></dt><dd><p>SID revision number</p></dd><dt><span class="term">UINT8</span></dt><dd><p>num of sub-authorities in domain SID</p></dd><dt><span class="term">UINT8[6]</span></dt><dd><p>6 bytes for domain SID - Identifier Authority.</p></dd><dt><span class="term">UINT16[n_subauths]</span></dt><dd><p>domain SID sub-authorities</p></dd></dl></div><p><span class="emphasis"><em>Note: the domain SID is documented elsewhere.</em></span>
+</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872013"></a>STR (string)</h4></div></div><div></div></div><p>STR (string) is a char[] : a null-terminated string of ascii characters.</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872027"></a>UNIHDR (unicode string header) </h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16</span></dt><dd><p>length of unicode string</p></dd><dt><span class="term">UINT16</span></dt><dd><p>max length of unicode string</p></dd><dt><span class="term">UINT32</span></dt><dd><p>4 - undocumented.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872083"></a>UNIHDR2 (unicode string header plus buffer pointer)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UNIHDR</span></dt><dd><p>unicode string header</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872125"></a>UNISTR (unicode string)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16[]</span></dt><dd><p>null-terminated string of unicode characters.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872152"></a>NAME (length-indicated unicode string)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>length of unicode string</p></dd><dt><span class="term">UINT16[]</span></dt><dd><p>null-terminated string of unicode characters.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872195"></a>UNISTR2 (aligned unicode string)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT8[]</span></dt><dd><p>padding to get unicode string 4-byte aligned with the start of the SMB header.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>max length of unicode string</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>length of unicode string</p></dd><dt><span class="term">UINT16[]</span></dt><dd><p>string of uncode characters</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872280"></a>OBJ_ATTR (object attributes)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>0x18 - length (in bytes) including the length field.</p></dd><dt><span class="term">VOID*</span></dt><dd><p>0 - root directory (pointer)</p></dd><dt><span class="term">VOID*</span></dt><dd><p>0 - object name (pointer)</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - attributes (undocumented)</p></dd><dt><span class="term">VOID*</span></dt><dd><p>0 - security descriptior (pointer)</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - security quality of service</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872374"></a>POL_HND (LSA policy handle)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">char[20]</span></dt><dd><p>policy handle</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872401"></a>DOM_SID2 (domain SID structure, SIDS stored in unicode)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>5 - SID type</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UNIHDR2</span></dt><dd><p>domain SID unicode string header</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>domain SID unicode string</p></dd></dl></div><p><span class="emphasis"><em>Note: there is a conflict between the unicode string header and the unicode string itself as to which to use to indicate string length. this will need to be resolved.</em></span></p><p><span class="emphasis"><em>Note: the SID type indicates, for example, an alias; a well-known group etc. this is documented somewhere.</em></span></p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872487"></a>DOM_RID (domain RID structure)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>5 - well-known SID. 1 - user SID (see ShowACLs)</p></dd><dt><span class="term">UINT32</span></dt><dd><p>5 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>domain RID </p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - domain index out of above reference domains</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2872557"></a>LOG_INFO (server, account, client structure)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: logon server name starts with two '\' characters and is upper case.</em></span></p><p><span class="emphasis"><em>Note: account name is the logon client name from the LSA Request Challenge, with a $ on the end of it, in upper case.</em></span></p><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon server unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>account name unicode string</p></dd><dt><span class="term">UINT16</span></dt><dd><p>sec_chan - security channel type</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon client machine unicode string</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2880910"></a>CLNT_SRV (server, client names structure)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: logon server name starts with two '\' characters and is upper case.</em></span></p><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon server unicode string</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon client machine unicode string</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2880987"></a>CREDS (credentials + time stamp)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">char[8]</span></dt><dd><p>credentials</p></dd><dt><span class="term">UTIME</span></dt><dd><p>time stamp</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2881028"></a>CLNT_INFO2 (server, client structure, client credentials)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: whenever this structure appears in a request, you must take a copy of the client-calculated credentials received, because they will beused in subsequent credential checks. the presumed intention is to
+ maintain an authenticated request/response trail.</em></span></p><div class="variablelist"><dl><dt><span class="term">CLNT_SRV</span></dt><dd><p>client and server names</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>???? padding, for 4-byte alignment with SMB header.</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to client credentials.</p></dd><dt><span class="term">CREDS</span></dt><dd><p>client-calculated credentials + client time</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2881110"></a>CLNT_INFO (server, account, client structure, client credentials)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: whenever this structure appears in a request, you must take a copy of the client-calculated credentials received, because they will be used in subsequent credential checks. the presumed intention is to maintain an authenticated request/response trail.</em></span></p><div class="variablelist"><dl><dt><span class="term">LOG_INFO</span></dt><dd><p>logon account info</p></dd><dt><span class="term">CREDS</span></dt><dd><p>client-calculated credentials + client time</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2881163"></a>ID_INFO_1 (id info structure, auth level 1)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>ptr_id_info_1</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>domain name unicode header</p></dd><dt><span class="term">UINT32</span></dt><dd><p>param control</p></dd><dt><span class="term">UINT64</span></dt><dd><p>logon ID</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>user name unicode header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>workgroup name unicode header</p></dd><dt><span class="term">char[16]</span></dt><dd><p>arc4 LM OWF Password</p></dd><dt><span class="term">char[16]</span></dt><dd><p>arc4 NT OWF Password</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>domain name unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>user name unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>workstation name unicode string</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2881333"></a>SAM_INFO (sam logon/logoff id info structure)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: presumably, the return credentials is supposedly for the server to verify that the credential chain hasn't been compromised.</em></span></p><div class="variablelist"><dl><dt><span class="term">CLNT_INFO2</span></dt><dd><p>client identification/authentication info</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to return credentials.</p></dd><dt><span class="term">CRED</span></dt><dd><p>return credentials - ignored.</p></dd><dt><span class="term">UINT16</span></dt><dd><p>logon level</p></dd><dt><span class="term">UINT16</span></dt><dd><p>switch value</p></dd></dl></div><pre class="programlisting">
switch (switch_value)
case 1:
{
ID_INFO_1 id_info_1;
}
-</pre></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2874620"></a>GID (group id info)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>group id</p></dd><dt><span class="term">UINT32</span></dt><dd><p>user attributes (only used by NT 3.1 and 3.51)</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2874658"></a>DOM_REF (domain reference info)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num referenced domains?</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain name buffer pointer.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>32 - max number of entries</p></dd><dt><span class="term">UINT32</span></dt><dd><p>4 - num referenced domains?</p></dd><dt><span class="term">UNIHDR2</span></dt><dd><p>domain name unicode string header</p></dd><dt><span class="term">UNIHDR2[num_ref_doms-1]</span></dt><dd><p>referenced domain unicode string headers</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>domain name unicode string</p></dd><dt><span class="term">DOM_SID[num_ref_doms]</span></dt><dd><p>referenced domain SIDs</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2874802"></a>DOM_INFO (domain info, levels 3 and 5 are the same))</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT8[]</span></dt><dd><p>??? padding to get 4-byte alignment with start of SMB header</p></dd><dt><span class="term">UINT16</span></dt><dd><p>domain name string length * 2</p></dd><dt><span class="term">UINT16</span></dt><dd><p>domain name string length * 2</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain name string buffer pointer</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain SID string buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>domain name (unicode string)</p></dd><dt><span class="term">DOM_SID</span></dt><dd><p>domain SID</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2874915"></a>USER_INFO (user logon info)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: it would be nice to know what the 16 byte user session key is for.</em></span></p><div class="variablelist"><dl><dt><span class="term">NTTIME</span></dt><dd><p>logon time</p></dd><dt><span class="term">NTTIME</span></dt><dd><p>logoff time</p></dd><dt><span class="term">NTTIME</span></dt><dd><p>kickoff time</p></dd><dt><span class="term">NTTIME</span></dt><dd><p>password last set time</p></dd><dt><span class="term">NTTIME</span></dt><dd><p>password can change time</p></dd><dt><span class="term">NTTIME</span></dt><dd><p>password must change time</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>username unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>user's full name unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>logon script unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>profile path unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>home directory unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>home directory drive unicode string header</p></dd><dt><span class="term">UINT16</span></dt><dd><p>logon count</p></dd><dt><span class="term">UINT16</span></dt><dd><p>bad password count</p></dd><dt><span class="term">UINT32</span></dt><dd><p>User ID</p></dd><dt><span class="term">UINT32</span></dt><dd><p>Group ID</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num groups</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer to groups.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>user flags</p></dd><dt><span class="term">char[16]</span></dt><dd><p>user session key</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>logon server unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>logon domain unicode string header</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented logon domain id pointer</p></dd><dt><span class="term">char[40]</span></dt><dd><p>40 undocumented padding bytes. future expansion?</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - num_other_sids?</p></dd><dt><span class="term">VOID*</span></dt><dd><p>NULL - undocumented pointer to other domain SIDs.</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>username unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>user's full name unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon script unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>profile path unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>home directory unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>home directory drive unicode string</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num groups</p></dd><dt><span class="term">GID[num_groups]</span></dt><dd><p>group info</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon server unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon domain unicode string</p></dd><dt><span class="term">DOM_SID</span></dt><dd><p>domain SID</p></dd><dt><span class="term">DOM_SID[num_sids]</span></dt><dd><p>other domain SIDs?</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2875478"></a>SH_INFO_1_PTR (pointers to level 1 share info strings)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: see cifsrap2.txt section5, page 10.</em></span></p><table class="simplelist" border="0" summary="Simple list"><tr><td>0 for shi1_type indicates a Disk.</td></tr><tr><td>1 for shi1_type indicates a Print Queue.</td></tr><tr><td>2 for shi1_type indicates a Device.</td></tr><tr><td>3 for shi1_type indicates an IPC pipe.</td></tr><tr><td>0x8000 0000 (top bit set in shi1_type) indicates a hidden share.</td></tr></table><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>shi1_netname - pointer to net name</p></dd><dt><span class="term">UINT32</span></dt><dd><p>shi1_type - type of share. 0 - undocumented.</p></dd><dt><span class="term">VOID*</span></dt><dd><p>shi1_remark - pointer to comment.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2875573"></a>SH_INFO_1_STR (level 1 share info strings)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UNISTR2</span></dt><dd><p>shi1_netname - unicode string of net name</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>shi1_remark - unicode string of comment.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2875615"></a>SHARE_INFO_1_CTR</h4></div></div><div></div></div><p>share container with 0 entries:</p><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>0 - EntriesRead</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - Buffer</p></dd></dl></div><p>share container with &gt; 0 entries:</p><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>EntriesRead</p></dd><dt><span class="term">UINT32</span></dt><dd><p>non-zero - Buffer</p></dd><dt><span class="term">UINT32</span></dt><dd><p>EntriesRead</p></dd><dt><span class="term">SH_INFO_1_PTR[EntriesRead]</span></dt><dd><p>share entry pointers</p></dd><dt><span class="term">SH_INFO_1_STR[EntriesRead]</span></dt><dd><p>share entry strings</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to get unicode string 4-byte aligned with start of the SMB header.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>EntriesRead</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - padding</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2875784"></a>SERVER_INFO_101</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: see cifs6.txt section 6.4 - the fields described therein will be of assistance here. for example, the type listed below is the same as fServerType, which is described in 6.4.1. </em></span></p><div class="variablelist"><dl><dt><span class="term">SV_TYPE_WORKSTATION</span></dt><dd><p>0x00000001 All workstations</p></dd><dt><span class="term">SV_TYPE_SERVER</span></dt><dd><p>0x00000002 All servers</p></dd><dt><span class="term">SV_TYPE_SQLSERVER</span></dt><dd><p>0x00000004 Any server running with SQL server</p></dd><dt><span class="term">SV_TYPE_DOMAIN_CTRL</span></dt><dd><p>0x00000008 Primary domain controller</p></dd><dt><span class="term">SV_TYPE_DOMAIN_BAKCTRL</span></dt><dd><p>0x00000010 Backup domain controller</p></dd><dt><span class="term">SV_TYPE_TIME_SOURCE</span></dt><dd><p>0x00000020 Server running the timesource service</p></dd><dt><span class="term">SV_TYPE_AFP</span></dt><dd><p>0x00000040 Apple File Protocol servers</p></dd><dt><span class="term">SV_TYPE_NOVELL</span></dt><dd><p>0x00000080 Novell servers</p></dd><dt><span class="term">SV_TYPE_DOMAIN_MEMBER</span></dt><dd><p>0x00000100 Domain Member</p></dd><dt><span class="term">SV_TYPE_PRINTQ_SERVER</span></dt><dd><p>0x00000200 Server sharing print queue</p></dd><dt><span class="term">SV_TYPE_DIALIN_SERVER</span></dt><dd><p>0x00000400 Server running dialin service.</p></dd><dt><span class="term">SV_TYPE_XENIX_SERVER</span></dt><dd><p>0x00000800 Xenix server</p></dd><dt><span class="term">SV_TYPE_NT</span></dt><dd><p>0x00001000 NT server</p></dd><dt><span class="term">SV_TYPE_WFW</span></dt><dd><p>0x00002000 Server running Windows for </p></dd><dt><span class="term">SV_TYPE_SERVER_NT</span></dt><dd><p>0x00008000 Windows NT non DC server</p></dd><dt><span class="term">SV_TYPE_POTENTIAL_BROWSER</span></dt><dd><p>0x00010000 Server that can run the browser service</p></dd><dt><span class="term">SV_TYPE_BACKUP_BROWSER</span></dt><dd><p>0x00020000 Backup browser server</p></dd><dt><span class="term">SV_TYPE_MASTER_BROWSER</span></dt><dd><p>0x00040000 Master browser server</p></dd><dt><span class="term">SV_TYPE_DOMAIN_MASTER</span></dt><dd><p>0x00080000 Domain Master Browser server</p></dd><dt><span class="term">SV_TYPE_LOCAL_LIST_ONLY</span></dt><dd><p>0x40000000 Enumerate only entries marked &quot;local&quot;</p></dd><dt><span class="term">SV_TYPE_DOMAIN_ENUM</span></dt><dd><p>0x80000000 Enumerate Domains. The pszServer and pszDomain parameters must be NULL.</p></dd></dl></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>500 - platform_id</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to name</p></dd><dt><span class="term">UINT32</span></dt><dd><p>5 - major version</p></dd><dt><span class="term">UINT32</span></dt><dd><p>4 - minor version</p></dd><dt><span class="term">UINT32</span></dt><dd><p>type (SV_TYPE_... bit field)</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to comment</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>sv101_name - unicode string of server name</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>sv_101_comment - unicode string of server comment.</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to get unicode string 4-byte aligned with start of the SMB header.</p></dd></dl></div></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2876250"></a>MSRPC over Transact Named Pipe</h2></div></div><div></div></div><p>For details on the SMB Transact Named Pipe, see cifs6.txt</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2876262"></a>MSRPC Pipes</h3></div></div><div></div></div><p>
+</pre></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2881436"></a>GID (group id info)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>group id</p></dd><dt><span class="term">UINT32</span></dt><dd><p>user attributes (only used by NT 3.1 and 3.51)</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2881475"></a>DOM_REF (domain reference info)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num referenced domains?</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain name buffer pointer.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>32 - max number of entries</p></dd><dt><span class="term">UINT32</span></dt><dd><p>4 - num referenced domains?</p></dd><dt><span class="term">UNIHDR2</span></dt><dd><p>domain name unicode string header</p></dd><dt><span class="term">UNIHDR2[num_ref_doms-1]</span></dt><dd><p>referenced domain unicode string headers</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>domain name unicode string</p></dd><dt><span class="term">DOM_SID[num_ref_doms]</span></dt><dd><p>referenced domain SIDs</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2881618"></a>DOM_INFO (domain info, levels 3 and 5 are the same))</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT8[]</span></dt><dd><p>??? padding to get 4-byte alignment with start of SMB header</p></dd><dt><span class="term">UINT16</span></dt><dd><p>domain name string length * 2</p></dd><dt><span class="term">UINT16</span></dt><dd><p>domain name string length * 2</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain name string buffer pointer</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain SID string buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>domain name (unicode string)</p></dd><dt><span class="term">DOM_SID</span></dt><dd><p>domain SID</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2881731"></a>USER_INFO (user logon info)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: it would be nice to know what the 16 byte user session key is for.</em></span></p><div class="variablelist"><dl><dt><span class="term">NTTIME</span></dt><dd><p>logon time</p></dd><dt><span class="term">NTTIME</span></dt><dd><p>logoff time</p></dd><dt><span class="term">NTTIME</span></dt><dd><p>kickoff time</p></dd><dt><span class="term">NTTIME</span></dt><dd><p>password last set time</p></dd><dt><span class="term">NTTIME</span></dt><dd><p>password can change time</p></dd><dt><span class="term">NTTIME</span></dt><dd><p>password must change time</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>username unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>user's full name unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>logon script unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>profile path unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>home directory unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>home directory drive unicode string header</p></dd><dt><span class="term">UINT16</span></dt><dd><p>logon count</p></dd><dt><span class="term">UINT16</span></dt><dd><p>bad password count</p></dd><dt><span class="term">UINT32</span></dt><dd><p>User ID</p></dd><dt><span class="term">UINT32</span></dt><dd><p>Group ID</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num groups</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer to groups.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>user flags</p></dd><dt><span class="term">char[16]</span></dt><dd><p>user session key</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>logon server unicode string header</p></dd><dt><span class="term">UNIHDR</span></dt><dd><p>logon domain unicode string header</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented logon domain id pointer</p></dd><dt><span class="term">char[40]</span></dt><dd><p>40 undocumented padding bytes. future expansion?</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - num_other_sids?</p></dd><dt><span class="term">VOID*</span></dt><dd><p>NULL - undocumented pointer to other domain SIDs.</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>username unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>user's full name unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon script unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>profile path unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>home directory unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>home directory drive unicode string</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num groups</p></dd><dt><span class="term">GID[num_groups]</span></dt><dd><p>group info</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon server unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon domain unicode string</p></dd><dt><span class="term">DOM_SID</span></dt><dd><p>domain SID</p></dd><dt><span class="term">DOM_SID[num_sids]</span></dt><dd><p>other domain SIDs?</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2882295"></a>SH_INFO_1_PTR (pointers to level 1 share info strings)</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: see cifsrap2.txt section5, page 10.</em></span></p><table class="simplelist" border="0" summary="Simple list"><tr><td>0 for shi1_type indicates a Disk.</td></tr><tr><td>1 for shi1_type indicates a Print Queue.</td></tr><tr><td>2 for shi1_type indicates a Device.</td></tr><tr><td>3 for shi1_type indicates an IPC pipe.</td></tr><tr><td>0x8000 0000 (top bit set in shi1_type) indicates a hidden share.</td></tr></table><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>shi1_netname - pointer to net name</p></dd><dt><span class="term">UINT32</span></dt><dd><p>shi1_type - type of share. 0 - undocumented.</p></dd><dt><span class="term">VOID*</span></dt><dd><p>shi1_remark - pointer to comment.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2882389"></a>SH_INFO_1_STR (level 1 share info strings)</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UNISTR2</span></dt><dd><p>shi1_netname - unicode string of net name</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>shi1_remark - unicode string of comment.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2882432"></a>SHARE_INFO_1_CTR</h4></div></div><div></div></div><p>share container with 0 entries:</p><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>0 - EntriesRead</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - Buffer</p></dd></dl></div><p>share container with &gt; 0 entries:</p><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>EntriesRead</p></dd><dt><span class="term">UINT32</span></dt><dd><p>non-zero - Buffer</p></dd><dt><span class="term">UINT32</span></dt><dd><p>EntriesRead</p></dd><dt><span class="term">SH_INFO_1_PTR[EntriesRead]</span></dt><dd><p>share entry pointers</p></dd><dt><span class="term">SH_INFO_1_STR[EntriesRead]</span></dt><dd><p>share entry strings</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to get unicode string 4-byte aligned with start of the SMB header.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>EntriesRead</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - padding</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2882600"></a>SERVER_INFO_101</h4></div></div><div></div></div><p><span class="emphasis"><em>Note: see cifs6.txt section 6.4 - the fields described therein will be of assistance here. for example, the type listed below is the same as fServerType, which is described in 6.4.1. </em></span></p><div class="variablelist"><dl><dt><span class="term">SV_TYPE_WORKSTATION</span></dt><dd><p>0x00000001 All workstations</p></dd><dt><span class="term">SV_TYPE_SERVER</span></dt><dd><p>0x00000002 All servers</p></dd><dt><span class="term">SV_TYPE_SQLSERVER</span></dt><dd><p>0x00000004 Any server running with SQL server</p></dd><dt><span class="term">SV_TYPE_DOMAIN_CTRL</span></dt><dd><p>0x00000008 Primary domain controller</p></dd><dt><span class="term">SV_TYPE_DOMAIN_BAKCTRL</span></dt><dd><p>0x00000010 Backup domain controller</p></dd><dt><span class="term">SV_TYPE_TIME_SOURCE</span></dt><dd><p>0x00000020 Server running the timesource service</p></dd><dt><span class="term">SV_TYPE_AFP</span></dt><dd><p>0x00000040 Apple File Protocol servers</p></dd><dt><span class="term">SV_TYPE_NOVELL</span></dt><dd><p>0x00000080 Novell servers</p></dd><dt><span class="term">SV_TYPE_DOMAIN_MEMBER</span></dt><dd><p>0x00000100 Domain Member</p></dd><dt><span class="term">SV_TYPE_PRINTQ_SERVER</span></dt><dd><p>0x00000200 Server sharing print queue</p></dd><dt><span class="term">SV_TYPE_DIALIN_SERVER</span></dt><dd><p>0x00000400 Server running dialin service.</p></dd><dt><span class="term">SV_TYPE_XENIX_SERVER</span></dt><dd><p>0x00000800 Xenix server</p></dd><dt><span class="term">SV_TYPE_NT</span></dt><dd><p>0x00001000 NT server</p></dd><dt><span class="term">SV_TYPE_WFW</span></dt><dd><p>0x00002000 Server running Windows for </p></dd><dt><span class="term">SV_TYPE_SERVER_NT</span></dt><dd><p>0x00008000 Windows NT non DC server</p></dd><dt><span class="term">SV_TYPE_POTENTIAL_BROWSER</span></dt><dd><p>0x00010000 Server that can run the browser service</p></dd><dt><span class="term">SV_TYPE_BACKUP_BROWSER</span></dt><dd><p>0x00020000 Backup browser server</p></dd><dt><span class="term">SV_TYPE_MASTER_BROWSER</span></dt><dd><p>0x00040000 Master browser server</p></dd><dt><span class="term">SV_TYPE_DOMAIN_MASTER</span></dt><dd><p>0x00080000 Domain Master Browser server</p></dd><dt><span class="term">SV_TYPE_LOCAL_LIST_ONLY</span></dt><dd><p>0x40000000 Enumerate only entries marked &quot;local&quot;</p></dd><dt><span class="term">SV_TYPE_DOMAIN_ENUM</span></dt><dd><p>0x80000000 Enumerate Domains. The pszServer and pszDomain parameters must be NULL.</p></dd></dl></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>500 - platform_id</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to name</p></dd><dt><span class="term">UINT32</span></dt><dd><p>5 - major version</p></dd><dt><span class="term">UINT32</span></dt><dd><p>4 - minor version</p></dd><dt><span class="term">UINT32</span></dt><dd><p>type (SV_TYPE_... bit field)</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to comment</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>sv101_name - unicode string of server name</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>sv_101_comment - unicode string of server comment.</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to get unicode string 4-byte aligned with start of the SMB header.</p></dd></dl></div></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2883067"></a>MSRPC over Transact Named Pipe</h2></div></div><div></div></div><p>For details on the SMB Transact Named Pipe, see cifs6.txt</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2883079"></a>MSRPC Pipes</h3></div></div><div></div></div><p>
The MSRPC is conducted over an SMB Transact Pipe with a name of
<tt class="filename">\PIPE\</tt>. You must first obtain a 16 bit file handle, by
sending a SMBopenX with the pipe name <tt class="filename">\PIPE\srvsvc</tt> for
@@ -1271,11 +1271,11 @@ listed below:</p><pre class="programlisting">
initial SMBopenX request: RPC API command 0x26 params:
&quot;\\PIPE\\lsarpc&quot; 0x65 0x63; 0x72 0x70; 0x44 0x65;
&quot;\\PIPE\\srvsvc&quot; 0x73 0x76; 0x4E 0x00; 0x5C 0x43;
-</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2876365"></a>Header</h3></div></div><div></div></div><p>[section to be rewritten, following receipt of work by Duncan Stansfield]</p><p>Interesting note: if you set packed data representation to 0x0100 0000
-then all 4-byte and 2-byte word ordering is turned around!</p><p>The start of each of the NTLSA and NETLOGON named pipes begins with:</p><div class="segmentedlist"><p><b>offset: </b>00</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>5 - RPC major version</p><p><b>offset: </b>01</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>0 - RPC minor version</p><p><b>offset: </b>02</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>2 - RPC response packet</p><p><b>offset: </b>03</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>3 - (FirstFrag bit-wise or with LastFrag)</p><p><b>offset: </b>04</p><p><b>Variable type: </b>UINT32</p><p><b>Variable data: </b>0x1000 0000 - packed data representation</p><p><b>offset: </b>08</p><p><b>Variable type: </b>UINT16</p><p><b>Variable data: </b>fragment length - data size (bytes) inc header and tail.</p><p><b>offset: </b>0A</p><p><b>Variable type: </b>UINT16</p><p><b>Variable data: </b>0 - authentication length </p><p><b>offset: </b>0C</p><p><b>Variable type: </b>UINT32</p><p><b>Variable data: </b>call identifier. matches 12th UINT32 of incoming RPC data.</p><p><b>offset: </b>10</p><p><b>Variable type: </b>UINT32</p><p><b>Variable data: </b>allocation hint - data size (bytes) minus header and tail.</p><p><b>offset: </b>14</p><p><b>Variable type: </b>UINT16</p><p><b>Variable data: </b>0 - presentation context identifier</p><p><b>offset: </b>16</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>0 - cancel count</p><p><b>offset: </b>17</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>in replies: 0 - reserved; in requests: opnum - see #defines.</p><p><b>offset: </b>18</p><p><b>Variable type: </b>......</p><p><b>Variable data: </b>start of data (goes on for allocation_hint bytes)</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2876554"></a>RPC_Packet for request, response, bind and bind acknowledgement</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT8 versionmaj</span></dt><dd><p>reply same as request (0x05)</p></dd><dt><span class="term">UINT8 versionmin</span></dt><dd><p>reply same as request (0x00)</p></dd><dt><span class="term">UINT8 type</span></dt><dd><p>one of the MSRPC_Type enums</p></dd><dt><span class="term">UINT8 flags</span></dt><dd><p>reply same as request (0x00 for Bind, 0x03 for Request)</p></dd><dt><span class="term">UINT32 representation</span></dt><dd><p>reply same as request (0x00000010)</p></dd><dt><span class="term">UINT16 fraglength</span></dt><dd><p>the length of the data section of the SMB trans packet</p></dd><dt><span class="term">UINT16 authlength</span></dt><dd><p></p></dd><dt><span class="term">UINT32 callid</span></dt><dd><p>call identifier. (e.g. 0x00149594)</p></dd><dt><span class="term">* stub USE TvPacket</span></dt><dd><p>the remainder of the packet depending on the &quot;type&quot;</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2876688"></a>Interface identification</h4></div></div><div></div></div><p>the interfaces are numbered. as yet I haven't seen more than one interface used on the same pipe name srvsvc</p><pre class="programlisting">
+</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2883181"></a>Header</h3></div></div><div></div></div><p>[section to be rewritten, following receipt of work by Duncan Stansfield]</p><p>Interesting note: if you set packed data representation to 0x0100 0000
+then all 4-byte and 2-byte word ordering is turned around!</p><p>The start of each of the NTLSA and NETLOGON named pipes begins with:</p><div class="segmentedlist"><p><b>offset: </b>00</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>5 - RPC major version</p><p><b>offset: </b>01</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>0 - RPC minor version</p><p><b>offset: </b>02</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>2 - RPC response packet</p><p><b>offset: </b>03</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>3 - (FirstFrag bit-wise or with LastFrag)</p><p><b>offset: </b>04</p><p><b>Variable type: </b>UINT32</p><p><b>Variable data: </b>0x1000 0000 - packed data representation</p><p><b>offset: </b>08</p><p><b>Variable type: </b>UINT16</p><p><b>Variable data: </b>fragment length - data size (bytes) inc header and tail.</p><p><b>offset: </b>0A</p><p><b>Variable type: </b>UINT16</p><p><b>Variable data: </b>0 - authentication length </p><p><b>offset: </b>0C</p><p><b>Variable type: </b>UINT32</p><p><b>Variable data: </b>call identifier. matches 12th UINT32 of incoming RPC data.</p><p><b>offset: </b>10</p><p><b>Variable type: </b>UINT32</p><p><b>Variable data: </b>allocation hint - data size (bytes) minus header and tail.</p><p><b>offset: </b>14</p><p><b>Variable type: </b>UINT16</p><p><b>Variable data: </b>0 - presentation context identifier</p><p><b>offset: </b>16</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>0 - cancel count</p><p><b>offset: </b>17</p><p><b>Variable type: </b>UINT8</p><p><b>Variable data: </b>in replies: 0 - reserved; in requests: opnum - see #defines.</p><p><b>offset: </b>18</p><p><b>Variable type: </b>......</p><p><b>Variable data: </b>start of data (goes on for allocation_hint bytes)</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2883371"></a>RPC_Packet for request, response, bind and bind acknowledgement</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT8 versionmaj</span></dt><dd><p>reply same as request (0x05)</p></dd><dt><span class="term">UINT8 versionmin</span></dt><dd><p>reply same as request (0x00)</p></dd><dt><span class="term">UINT8 type</span></dt><dd><p>one of the MSRPC_Type enums</p></dd><dt><span class="term">UINT8 flags</span></dt><dd><p>reply same as request (0x00 for Bind, 0x03 for Request)</p></dd><dt><span class="term">UINT32 representation</span></dt><dd><p>reply same as request (0x00000010)</p></dd><dt><span class="term">UINT16 fraglength</span></dt><dd><p>the length of the data section of the SMB trans packet</p></dd><dt><span class="term">UINT16 authlength</span></dt><dd><p></p></dd><dt><span class="term">UINT32 callid</span></dt><dd><p>call identifier. (e.g. 0x00149594)</p></dd><dt><span class="term">* stub USE TvPacket</span></dt><dd><p>the remainder of the packet depending on the &quot;type&quot;</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2883504"></a>Interface identification</h4></div></div><div></div></div><p>the interfaces are numbered. as yet I haven't seen more than one interface used on the same pipe name srvsvc</p><pre class="programlisting">
abstract (0x4B324FC8, 0x01D31670, 0x475A7812, 0x88E16EBF, 0x00000003)
transfer (0x8A885D04, 0x11C91CEB, 0x0008E89F, 0x6048102B, 0x00000002)
-</pre></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2876714"></a>RPC_Iface RW</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT8 byte[16]</span></dt><dd><p>16 bytes of number</p></dd><dt><span class="term">UINT32 version</span></dt><dd><p>the interface number</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2876753"></a>RPC_ReqBind RW</h4></div></div><div></div></div><p>the remainder of the packet after the header if &quot;type&quot; was Bind in the response header, &quot;type&quot; should be BindAck</p><div class="variablelist"><dl><dt><span class="term">UINT16 maxtsize</span></dt><dd><p>maximum transmission fragment size (0x1630)</p></dd><dt><span class="term">UINT16 maxrsize</span></dt><dd><p>max receive fragment size (0x1630)</p></dd><dt><span class="term">UINT32 assocgid</span></dt><dd><p>associated group id (0x0)</p></dd><dt><span class="term">UINT32 numelements</span></dt><dd><p>the number of elements (0x1)</p></dd><dt><span class="term">UINT16 contextid</span></dt><dd><p>presentation context identifier (0x0)</p></dd><dt><span class="term">UINT8 numsyntaxes</span></dt><dd><p>the number of syntaxes (has always been 1?)(0x1)</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>4-byte alignment padding, against SMB header</p></dd><dt><span class="term">* abstractint USE RPC_Iface</span></dt><dd><p>num and vers. of interface client is using</p></dd><dt><span class="term">* transferint USE RPC_Iface</span></dt><dd><p>num and vers. of interface to use for replies</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2876893"></a>RPC_Address RW</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16 length</span></dt><dd><p>length of the string including null terminator</p></dd><dt><span class="term">* port USE string</span></dt><dd><p>the string above in single byte, null terminated form</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2876933"></a>RPC_ResBind RW</h4></div></div><div></div></div><p>the response to place after the header in the reply packet</p><div class="variablelist"><dl><dt><span class="term">UINT16 maxtsize</span></dt><dd><p>same as request</p></dd><dt><span class="term">UINT16 maxrsize</span></dt><dd><p>same as request</p></dd><dt><span class="term">UINT32 assocgid</span></dt><dd><p>zero</p></dd><dt><span class="term">* secondaddr USE RPC_Address</span></dt><dd><p>the address string, as described earlier</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>4-byte alignment padding, against SMB header</p></dd><dt><span class="term">UINT8 numresults</span></dt><dd><p>the number of results (0x01)</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>4-byte alignment padding, against SMB header</p></dd><dt><span class="term">UINT16 result</span></dt><dd><p>result (0x00 = accept)</p></dd><dt><span class="term">UINT16 reason</span></dt><dd><p>reason (0x00 = no reason specified)</p></dd><dt><span class="term">* transfersyntax USE RPC_Iface</span></dt><dd><p>the transfer syntax from the request</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2877084"></a>RPC_ReqNorm RW</h4></div></div><div></div></div><p>the remainder of the packet after the header for every other other request</p><div class="variablelist"><dl><dt><span class="term">UINT32 allochint</span></dt><dd><p>the size of the stub data in bytes</p></dd><dt><span class="term">UINT16 prescontext</span></dt><dd><p>presentation context identifier (0x0)</p></dd><dt><span class="term">UINT16 opnum</span></dt><dd><p>operation number (0x15)</p></dd><dt><span class="term">* stub USE TvPacket</span></dt><dd><p>a packet dependent on the pipe name (probably the interface) and the op number)</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2877156"></a>RPC_ResNorm RW</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32 allochint</span></dt><dd><p># size of the stub data in bytes</p></dd><dt><span class="term">UINT16 prescontext</span></dt><dd><p># presentation context identifier (same as request)</p></dd><dt><span class="term">UINT8 cancelcount</span></dt><dd><p># cancel count? (0x0)</p></dd><dt><span class="term">UINT8 reserved</span></dt><dd><p># 0 - one byte padding</p></dd><dt><span class="term">* stub USE TvPacket</span></dt><dd><p># the remainder of the reply</p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2877236"></a>Tail</h3></div></div><div></div></div><p>The end of each of the NTLSA and NETLOGON named pipes ends with:</p><div class="variablelist"><dl><dt><span class="term">......</span></dt><dd><p>end of data</p></dd><dt><span class="term">UINT32</span></dt><dd><p>return code</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2877281"></a>RPC Bind / Bind Ack</h3></div></div><div></div></div><p>
+</pre></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2883530"></a>RPC_Iface RW</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT8 byte[16]</span></dt><dd><p>16 bytes of number</p></dd><dt><span class="term">UINT32 version</span></dt><dd><p>the interface number</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2883569"></a>RPC_ReqBind RW</h4></div></div><div></div></div><p>the remainder of the packet after the header if &quot;type&quot; was Bind in the response header, &quot;type&quot; should be BindAck</p><div class="variablelist"><dl><dt><span class="term">UINT16 maxtsize</span></dt><dd><p>maximum transmission fragment size (0x1630)</p></dd><dt><span class="term">UINT16 maxrsize</span></dt><dd><p>max receive fragment size (0x1630)</p></dd><dt><span class="term">UINT32 assocgid</span></dt><dd><p>associated group id (0x0)</p></dd><dt><span class="term">UINT32 numelements</span></dt><dd><p>the number of elements (0x1)</p></dd><dt><span class="term">UINT16 contextid</span></dt><dd><p>presentation context identifier (0x0)</p></dd><dt><span class="term">UINT8 numsyntaxes</span></dt><dd><p>the number of syntaxes (has always been 1?)(0x1)</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>4-byte alignment padding, against SMB header</p></dd><dt><span class="term">* abstractint USE RPC_Iface</span></dt><dd><p>num and vers. of interface client is using</p></dd><dt><span class="term">* transferint USE RPC_Iface</span></dt><dd><p>num and vers. of interface to use for replies</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2883710"></a>RPC_Address RW</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16 length</span></dt><dd><p>length of the string including null terminator</p></dd><dt><span class="term">* port USE string</span></dt><dd><p>the string above in single byte, null terminated form</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2883750"></a>RPC_ResBind RW</h4></div></div><div></div></div><p>the response to place after the header in the reply packet</p><div class="variablelist"><dl><dt><span class="term">UINT16 maxtsize</span></dt><dd><p>same as request</p></dd><dt><span class="term">UINT16 maxrsize</span></dt><dd><p>same as request</p></dd><dt><span class="term">UINT32 assocgid</span></dt><dd><p>zero</p></dd><dt><span class="term">* secondaddr USE RPC_Address</span></dt><dd><p>the address string, as described earlier</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>4-byte alignment padding, against SMB header</p></dd><dt><span class="term">UINT8 numresults</span></dt><dd><p>the number of results (0x01)</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>4-byte alignment padding, against SMB header</p></dd><dt><span class="term">UINT16 result</span></dt><dd><p>result (0x00 = accept)</p></dd><dt><span class="term">UINT16 reason</span></dt><dd><p>reason (0x00 = no reason specified)</p></dd><dt><span class="term">* transfersyntax USE RPC_Iface</span></dt><dd><p>the transfer syntax from the request</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2883900"></a>RPC_ReqNorm RW</h4></div></div><div></div></div><p>the remainder of the packet after the header for every other other request</p><div class="variablelist"><dl><dt><span class="term">UINT32 allochint</span></dt><dd><p>the size of the stub data in bytes</p></dd><dt><span class="term">UINT16 prescontext</span></dt><dd><p>presentation context identifier (0x0)</p></dd><dt><span class="term">UINT16 opnum</span></dt><dd><p>operation number (0x15)</p></dd><dt><span class="term">* stub USE TvPacket</span></dt><dd><p>a packet dependent on the pipe name (probably the interface) and the op number)</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2883972"></a>RPC_ResNorm RW</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32 allochint</span></dt><dd><p># size of the stub data in bytes</p></dd><dt><span class="term">UINT16 prescontext</span></dt><dd><p># presentation context identifier (same as request)</p></dd><dt><span class="term">UINT8 cancelcount</span></dt><dd><p># cancel count? (0x0)</p></dd><dt><span class="term">UINT8 reserved</span></dt><dd><p># 0 - one byte padding</p></dd><dt><span class="term">* stub USE TvPacket</span></dt><dd><p># the remainder of the reply</p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2884052"></a>Tail</h3></div></div><div></div></div><p>The end of each of the NTLSA and NETLOGON named pipes ends with:</p><div class="variablelist"><dl><dt><span class="term">......</span></dt><dd><p>end of data</p></dd><dt><span class="term">UINT32</span></dt><dd><p>return code</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2884098"></a>RPC Bind / Bind Ack</h3></div></div><div></div></div><p>
RPC Binds are the process of associating an RPC pipe (e.g \PIPE\lsarpc)
with a &quot;transfer syntax&quot; (see RPC_Iface structure). The purpose for doing
this is unknown.
@@ -1283,7 +1283,7 @@ this is unknown.
returned by the SMBopenX Transact response.</em></span></p><p><span class="emphasis"><em>Note: The RPC_ResBind members maxtsize, maxrsize and assocgid are the same in the response as the same members in the RPC_ReqBind. The
RPC_ResBind member transfersyntax is the same in the response as
the</em></span></p><p><span class="emphasis"><em>Note: The RPC_ResBind response member secondaddr contains the name of what is presumed to be the service behind the RPC pipe. The
- mapping identified so far is:</em></span></p><div class="variablelist"><dl><dt><span class="term">initial SMBopenX request:</span></dt><dd><p>RPC_ResBind response:</p></dd><dt><span class="term">&quot;\\PIPE\\srvsvc&quot;</span></dt><dd><p>&quot;\\PIPE\\ntsvcs&quot;</p></dd><dt><span class="term">&quot;\\PIPE\\samr&quot;</span></dt><dd><p>&quot;\\PIPE\\lsass&quot;</p></dd><dt><span class="term">&quot;\\PIPE\\lsarpc&quot;</span></dt><dd><p>&quot;\\PIPE\\lsass&quot;</p></dd><dt><span class="term">&quot;\\PIPE\\wkssvc&quot;</span></dt><dd><p>&quot;\\PIPE\\wksvcs&quot;</p></dd><dt><span class="term">&quot;\\PIPE\\NETLOGON&quot;</span></dt><dd><p>&quot;\\PIPE\\NETLOGON&quot;</p></dd></dl></div><p><span class="emphasis"><em>Note: The RPC_Packet fraglength member in both the Bind Request and Bind Acknowledgment must contain the length of the entire RPC data, including the RPC_Packet header.</em></span></p><p>Request:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>RPC_Packet</td></tr><tr><td>RPC_ReqBind</td></tr></table><p>Response:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>RPC_Packet</td></tr><tr><td>RPC_ResBind</td></tr></table></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2877461"></a>NTLSA Transact Named Pipe</h3></div></div><div></div></div><p>The sequence of actions taken on this pipe are:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>Establish a connection to the IPC$ share (SMBtconX). use encrypted passwords.</td></tr><tr><td>Open an RPC Pipe with the name &quot;\\PIPE\\lsarpc&quot;. Store the file handle.</td></tr><tr><td>Using the file handle, send a Set Named Pipe Handle state to 0x4300.</td></tr><tr><td>Send an LSA Open Policy request. Store the Policy Handle.</td></tr><tr><td>Using the Policy Handle, send LSA Query Info Policy requests, etc.</td></tr><tr><td>Using the Policy Handle, send an LSA Close.</td></tr><tr><td>Close the IPC$ share.</td></tr></table><p>Defines for this pipe, identifying the query are:</p><div class="variablelist"><dl><dt><span class="term">LSA Open Policy:</span></dt><dd><p>0x2c</p></dd><dt><span class="term">LSA Query Info Policy:</span></dt><dd><p>0x07</p></dd><dt><span class="term">LSA Enumerate Trusted Domains:</span></dt><dd><p>0x0d</p></dd><dt><span class="term">LSA Open Secret:</span></dt><dd><p>0xff</p></dd><dt><span class="term">LSA Lookup SIDs:</span></dt><dd><p>0xfe</p></dd><dt><span class="term">LSA Lookup Names:</span></dt><dd><p>0xfd</p></dd><dt><span class="term">LSA Close:</span></dt><dd><p>0x00</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2877626"></a>LSA Open Policy</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: The policy handle can be anything you like.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2877640"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>server name - unicode string starting with two '\'s</p></dd><dt><span class="term">OBJ_ATTR</span></dt><dd><p>object attributes</p></dd><dt><span class="term">UINT32</span></dt><dd><p>1 - desired access</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2877710"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>LSA policy handle</p></dd><dt><span class="term">return</span></dt><dd><p>0 - indicates success</p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2877752"></a>LSA Query Info Policy</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: The info class in response must be the same as that in the request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2877766"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>LSA policy handle</p></dd><dt><span class="term">UINT16</span></dt><dd><p>info class (also a policy handle?)</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2877805"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UINT16</span></dt><dd><p>info class (same as info class in request).</p></dd></dl></div><pre class="programlisting">
+ mapping identified so far is:</em></span></p><div class="variablelist"><dl><dt><span class="term">initial SMBopenX request:</span></dt><dd><p>RPC_ResBind response:</p></dd><dt><span class="term">&quot;\\PIPE\\srvsvc&quot;</span></dt><dd><p>&quot;\\PIPE\\ntsvcs&quot;</p></dd><dt><span class="term">&quot;\\PIPE\\samr&quot;</span></dt><dd><p>&quot;\\PIPE\\lsass&quot;</p></dd><dt><span class="term">&quot;\\PIPE\\lsarpc&quot;</span></dt><dd><p>&quot;\\PIPE\\lsass&quot;</p></dd><dt><span class="term">&quot;\\PIPE\\wkssvc&quot;</span></dt><dd><p>&quot;\\PIPE\\wksvcs&quot;</p></dd><dt><span class="term">&quot;\\PIPE\\NETLOGON&quot;</span></dt><dd><p>&quot;\\PIPE\\NETLOGON&quot;</p></dd></dl></div><p><span class="emphasis"><em>Note: The RPC_Packet fraglength member in both the Bind Request and Bind Acknowledgment must contain the length of the entire RPC data, including the RPC_Packet header.</em></span></p><p>Request:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>RPC_Packet</td></tr><tr><td>RPC_ReqBind</td></tr></table><p>Response:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>RPC_Packet</td></tr><tr><td>RPC_ResBind</td></tr></table></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2884278"></a>NTLSA Transact Named Pipe</h3></div></div><div></div></div><p>The sequence of actions taken on this pipe are:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>Establish a connection to the IPC$ share (SMBtconX). use encrypted passwords.</td></tr><tr><td>Open an RPC Pipe with the name &quot;\\PIPE\\lsarpc&quot;. Store the file handle.</td></tr><tr><td>Using the file handle, send a Set Named Pipe Handle state to 0x4300.</td></tr><tr><td>Send an LSA Open Policy request. Store the Policy Handle.</td></tr><tr><td>Using the Policy Handle, send LSA Query Info Policy requests, etc.</td></tr><tr><td>Using the Policy Handle, send an LSA Close.</td></tr><tr><td>Close the IPC$ share.</td></tr></table><p>Defines for this pipe, identifying the query are:</p><div class="variablelist"><dl><dt><span class="term">LSA Open Policy:</span></dt><dd><p>0x2c</p></dd><dt><span class="term">LSA Query Info Policy:</span></dt><dd><p>0x07</p></dd><dt><span class="term">LSA Enumerate Trusted Domains:</span></dt><dd><p>0x0d</p></dd><dt><span class="term">LSA Open Secret:</span></dt><dd><p>0xff</p></dd><dt><span class="term">LSA Lookup SIDs:</span></dt><dd><p>0xfe</p></dd><dt><span class="term">LSA Lookup Names:</span></dt><dd><p>0xfd</p></dd><dt><span class="term">LSA Close:</span></dt><dd><p>0x00</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2884443"></a>LSA Open Policy</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: The policy handle can be anything you like.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884456"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>server name - unicode string starting with two '\'s</p></dd><dt><span class="term">OBJ_ATTR</span></dt><dd><p>object attributes</p></dd><dt><span class="term">UINT32</span></dt><dd><p>1 - desired access</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884526"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>LSA policy handle</p></dd><dt><span class="term">return</span></dt><dd><p>0 - indicates success</p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2884568"></a>LSA Query Info Policy</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: The info class in response must be the same as that in the request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884582"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>LSA policy handle</p></dd><dt><span class="term">UINT16</span></dt><dd><p>info class (also a policy handle?)</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884621"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UINT16</span></dt><dd><p>info class (same as info class in request).</p></dd></dl></div><pre class="programlisting">
switch (info class)
case 3:
case 5:
@@ -1292,11 +1292,11 @@ DOM_INFO domain info, levels 3 and 5 (are the same).
}
return 0 - indicates success
-</pre></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2877858"></a>LSA Enumerate Trusted Domains</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2877866"></a>Request</h4></div></div><div></div></div><p>no extra data</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2877878"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>0 - enumeration context</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - entries read</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - trust information</p></dd><dt><span class="term">return</span></dt><dd><p>0x8000 001a - &quot;no trusted domains&quot; success code</p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2877950"></a>LSA Open Secret</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2877957"></a>Request</h4></div></div><div></div></div><p>no extra data</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2877969"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd></dl></div><p>return 0x0C00 0034 - &quot;no such secret&quot; success code</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2878060"></a>LSA Close</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2878067"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>policy handle to be closed</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2878094"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>0s - closed policy handle (all zeros)</p></dd></dl></div><p>return 0 - indicates success</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2878126"></a>LSA Lookup SIDS</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: num_entries in response must be same as num_entries in request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2878139"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>LSA policy handle</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain SID buffer pointer</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain name buffer pointer</p></dd><dt><span class="term">VOID*[num_entries] undocumented domain SID pointers to be looked up.
-</span></dt><dd><p>DOM_SID[num_entries] domain SIDs to be looked up.</p></dd><dt><span class="term">char[16]</span></dt><dd><p>completely undocumented 16 bytes.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2878239"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">DOM_REF</span></dt><dd><p>domain reference response</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd><dt><span class="term">DOM_SID2[num_entries]</span></dt><dd><p>domain SIDs (from Request, listed above).</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd></dl></div><p>return 0 - indicates success</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2878335"></a>LSA Lookup Names</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: num_entries in response must be same as num_entries in request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2878349"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>LSA policy handle</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain SID buffer pointer</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain name buffer pointer</p></dd><dt><span class="term">NAME[num_entries]</span></dt><dd><p>names to be looked up.</p></dd><dt><span class="term">char[]</span></dt><dd><p>undocumented bytes - falsely translated SID structure?</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2878463"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">DOM_REF</span></dt><dd><p>domain reference response</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd><dt><span class="term">DOM_RID[num_entries]</span></dt><dd><p>domain SIDs (from Request, listed above).</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd></dl></div><p>return 0 - indicates success</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2878561"></a>NETLOGON rpc Transact Named Pipe</h2></div></div><div></div></div><p>The sequence of actions taken on this pipe are:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>tablish a connection to the IPC$ share (SMBtconX). use encrypted passwords.</td></tr><tr><td>en an RPC Pipe with the name &quot;\\PIPE\\NETLOGON&quot;. Store the file handle.</td></tr><tr><td>ing the file handle, send a Set Named Pipe Handle state to 0x4300.</td></tr><tr><td>eate Client Challenge. Send LSA Request Challenge. Store Server Challenge.</td></tr><tr><td>lculate Session Key. Send an LSA Auth 2 Challenge. Store Auth2 Challenge.</td></tr><tr><td>lc/Verify Client Creds. Send LSA Srv PW Set. Calc/Verify Server Creds.</td></tr><tr><td>lc/Verify Client Creds. Send LSA SAM Logon . Calc/Verify Server Creds.</td></tr><tr><td>lc/Verify Client Creds. Send LSA SAM Logoff. Calc/Verify Server Creds.</td></tr><tr><td>ose the IPC$ share.</td></tr></table><p>Defines for this pipe, identifying the query are</p><div class="variablelist"><dl><dt><span class="term">LSA Request Challenge:</span></dt><dd><p>0x04</p></dd><dt><span class="term">LSA Server Password Set:</span></dt><dd><p>0x06</p></dd><dt><span class="term">LSA SAM Logon:</span></dt><dd><p>0x02</p></dd><dt><span class="term">LSA SAM Logoff:</span></dt><dd><p>0x03</p></dd><dt><span class="term">LSA Auth 2:</span></dt><dd><p>0x0f</p></dd><dt><span class="term">LSA Logon Control:</span></dt><dd><p>0x0e</p></dd></dl></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2878722"></a>LSA Request Challenge</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: logon server name starts with two '\' characters and is upper case.</em></span></p><p><span class="emphasis"><em>Note: logon client is the machine, not the user.</em></span></p><p><span class="emphasis"><em>Note: the initial LanManager password hash, against which the challenge is issued, is the machine name itself (lower case). there will becalls issued (LSA Server Password Set) which will change this, later. refusing these calls allows you to always deal with the same password (i.e the LM# of the machine name in lower case).</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2878754"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon server unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon client unicode string</p></dd><dt><span class="term">char[8]</span></dt><dd><p>client challenge</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2878824"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">char[8]</span></dt><dd><p>server challenge</p></dd></dl></div><p>return 0 - indicates success</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2878856"></a>LSA Authenticate 2</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: in between request and response, calculate the client credentials, and check them against the client-calculated credentials (this process uses the previously received client credentials).</em></span></p><p><span class="emphasis"><em>Note: neg_flags in the response is the same as that in the request.</em></span></p><p><span class="emphasis"><em>Note: you must take a copy of the client-calculated credentials received here, because they will be used in subsequent authentication packets.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2878887"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">LOG_INFO</span></dt><dd><p>client identification info</p></dd><dt><span class="term">char[8]</span></dt><dd><p>client-calculated credentials</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to 4-byte align with start of SMB header.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>neg_flags - negotiated flags (usual value is 0x0000 01ff)</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2878956"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">char[8]</span></dt><dd><p>server credentials.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>neg_flags - same as neg_flags in request.</p></dd></dl></div><p>return 0 - indicates success. failure value unknown.</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2879004"></a>LSA Server Password Set</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: the new password is suspected to be a DES encryption using the old password to generate the key.</em></span></p><p><span class="emphasis"><em>Note: in between request and response, calculate the client credentials, and check them against the client-calculated credentials (this process uses the previously received client credentials).</em></span></p><p><span class="emphasis"><em>Note: the server credentials are constructed from the client-calculated credentials and the client time + 1 second.</em></span></p><p><span class="emphasis"><em>Note: you must take a copy of the client-calculated credentials received here, because they will be used in subsequent authentication packets.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879043"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">CLNT_INFO</span></dt><dd><p>client identification/authentication info</p></dd><dt><span class="term">char[]</span></dt><dd><p>new password - undocumented.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879085"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">CREDS</span></dt><dd><p>server credentials. server time stamp appears to be ignored.</p></dd></dl></div><p>return 0 - indicates success; 0xC000 006a indicates failure</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2879119"></a>LSA SAM Logon</h3></div></div><div></div></div><p><span class="emphasis"><em>
+</pre></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2884674"></a>LSA Enumerate Trusted Domains</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884682"></a>Request</h4></div></div><div></div></div><p>no extra data</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884694"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>0 - enumeration context</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - entries read</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - trust information</p></dd><dt><span class="term">return</span></dt><dd><p>0x8000 001a - &quot;no trusted domains&quot; success code</p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2884766"></a>LSA Open Secret</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884773"></a>Request</h4></div></div><div></div></div><p>no extra data</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884786"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd><dt><span class="term">UINT32</span></dt><dd><p>0 - undocumented</p></dd></dl></div><p>return 0x0C00 0034 - &quot;no such secret&quot; success code</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2884876"></a>LSA Close</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884882"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>policy handle to be closed</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884909"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>0s - closed policy handle (all zeros)</p></dd></dl></div><p>return 0 - indicates success</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2884941"></a>LSA Lookup SIDS</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: num_entries in response must be same as num_entries in request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2884955"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>LSA policy handle</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain SID buffer pointer</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain name buffer pointer</p></dd><dt><span class="term">VOID*[num_entries] undocumented domain SID pointers to be looked up.
+</span></dt><dd><p>DOM_SID[num_entries] domain SIDs to be looked up.</p></dd><dt><span class="term">char[16]</span></dt><dd><p>completely undocumented 16 bytes.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885054"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">DOM_REF</span></dt><dd><p>domain reference response</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd><dt><span class="term">DOM_SID2[num_entries]</span></dt><dd><p>domain SIDs (from Request, listed above).</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd></dl></div><p>return 0 - indicates success</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2885151"></a>LSA Lookup Names</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: num_entries in response must be same as num_entries in request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885165"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">POL_HND</span></dt><dd><p>LSA policy handle</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain SID buffer pointer</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented domain name buffer pointer</p></dd><dt><span class="term">NAME[num_entries]</span></dt><dd><p>names to be looked up.</p></dd><dt><span class="term">char[]</span></dt><dd><p>undocumented bytes - falsely translated SID structure?</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885278"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">DOM_REF</span></dt><dd><p>domain reference response</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd><dt><span class="term">DOM_RID[num_entries]</span></dt><dd><p>domain SIDs (from Request, listed above).</p></dd><dt><span class="term">UINT32</span></dt><dd><p>num_entries (listed above)</p></dd></dl></div><p>return 0 - indicates success</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2885377"></a>NETLOGON rpc Transact Named Pipe</h2></div></div><div></div></div><p>The sequence of actions taken on this pipe are:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>tablish a connection to the IPC$ share (SMBtconX). use encrypted passwords.</td></tr><tr><td>en an RPC Pipe with the name &quot;\\PIPE\\NETLOGON&quot;. Store the file handle.</td></tr><tr><td>ing the file handle, send a Set Named Pipe Handle state to 0x4300.</td></tr><tr><td>eate Client Challenge. Send LSA Request Challenge. Store Server Challenge.</td></tr><tr><td>lculate Session Key. Send an LSA Auth 2 Challenge. Store Auth2 Challenge.</td></tr><tr><td>lc/Verify Client Creds. Send LSA Srv PW Set. Calc/Verify Server Creds.</td></tr><tr><td>lc/Verify Client Creds. Send LSA SAM Logon . Calc/Verify Server Creds.</td></tr><tr><td>lc/Verify Client Creds. Send LSA SAM Logoff. Calc/Verify Server Creds.</td></tr><tr><td>ose the IPC$ share.</td></tr></table><p>Defines for this pipe, identifying the query are</p><div class="variablelist"><dl><dt><span class="term">LSA Request Challenge:</span></dt><dd><p>0x04</p></dd><dt><span class="term">LSA Server Password Set:</span></dt><dd><p>0x06</p></dd><dt><span class="term">LSA SAM Logon:</span></dt><dd><p>0x02</p></dd><dt><span class="term">LSA SAM Logoff:</span></dt><dd><p>0x03</p></dd><dt><span class="term">LSA Auth 2:</span></dt><dd><p>0x0f</p></dd><dt><span class="term">LSA Logon Control:</span></dt><dd><p>0x0e</p></dd></dl></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2885537"></a>LSA Request Challenge</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: logon server name starts with two '\' characters and is upper case.</em></span></p><p><span class="emphasis"><em>Note: logon client is the machine, not the user.</em></span></p><p><span class="emphasis"><em>Note: the initial LanManager password hash, against which the challenge is issued, is the machine name itself (lower case). there will becalls issued (LSA Server Password Set) which will change this, later. refusing these calls allows you to always deal with the same password (i.e the LM# of the machine name in lower case).</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885569"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon server unicode string</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>logon client unicode string</p></dd><dt><span class="term">char[8]</span></dt><dd><p>client challenge</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885639"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">char[8]</span></dt><dd><p>server challenge</p></dd></dl></div><p>return 0 - indicates success</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2885672"></a>LSA Authenticate 2</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: in between request and response, calculate the client credentials, and check them against the client-calculated credentials (this process uses the previously received client credentials).</em></span></p><p><span class="emphasis"><em>Note: neg_flags in the response is the same as that in the request.</em></span></p><p><span class="emphasis"><em>Note: you must take a copy of the client-calculated credentials received here, because they will be used in subsequent authentication packets.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885703"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">LOG_INFO</span></dt><dd><p>client identification info</p></dd><dt><span class="term">char[8]</span></dt><dd><p>client-calculated credentials</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to 4-byte align with start of SMB header.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>neg_flags - negotiated flags (usual value is 0x0000 01ff)</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885771"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">char[8]</span></dt><dd><p>server credentials.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>neg_flags - same as neg_flags in request.</p></dd></dl></div><p>return 0 - indicates success. failure value unknown.</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2885819"></a>LSA Server Password Set</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: the new password is suspected to be a DES encryption using the old password to generate the key.</em></span></p><p><span class="emphasis"><em>Note: in between request and response, calculate the client credentials, and check them against the client-calculated credentials (this process uses the previously received client credentials).</em></span></p><p><span class="emphasis"><em>Note: the server credentials are constructed from the client-calculated credentials and the client time + 1 second.</em></span></p><p><span class="emphasis"><em>Note: you must take a copy of the client-calculated credentials received here, because they will be used in subsequent authentication packets.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885858"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">CLNT_INFO</span></dt><dd><p>client identification/authentication info</p></dd><dt><span class="term">char[]</span></dt><dd><p>new password - undocumented.</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885900"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">CREDS</span></dt><dd><p>server credentials. server time stamp appears to be ignored.</p></dd></dl></div><p>return 0 - indicates success; 0xC000 006a indicates failure</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2885934"></a>LSA SAM Logon</h3></div></div><div></div></div><p><span class="emphasis"><em>
Note: valid_user is True iff the username and password hash are valid for
the requested domain.
-</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879133"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">SAM_INFO</span></dt><dd><p>sam_id structure</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879161"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">CREDS</span></dt><dd><p>server credentials. server time stamp appears to be ignored.</p></dd></dl></div><pre class="programlisting">
+</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885949"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">SAM_INFO</span></dt><dd><p>sam_id structure</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2885975"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">CREDS</span></dt><dd><p>server credentials. server time stamp appears to be ignored.</p></dd></dl></div><pre class="programlisting">
if (valid_user)
{
UINT16 3 - switch value indicating USER_INFO structure.
@@ -1316,16 +1316,16 @@ else
return 0xC000 0064 - NT_STATUS_NO_SUCH_USER.
}
-</pre></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2879232"></a>LSA SAM Logoff</h3></div></div><div></div></div><p><span class="emphasis"><em>
+</pre></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2886037"></a>LSA SAM Logoff</h3></div></div><div></div></div><p><span class="emphasis"><em>
Note: presumably, the SAM_INFO structure is validated, and a (currently
undocumented) error code returned if the Logoff is invalid.
-</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879247"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">SAM_INFO</span></dt><dd><p>sam_id structure</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879274"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">CREDS</span></dt><dd><p>server credentials. server time stamp appears to be ignored.</p></dd></dl></div><p>return 0 - indicates success. undocumented failure indication.</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2879324"></a>\\MAILSLOT\NET\NTLOGON</h2></div></div><div></div></div><p><span class="emphasis"><em>
+</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886052"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">SAM_INFO</span></dt><dd><p>sam_id structure</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886079"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>undocumented buffer pointer</p></dd><dt><span class="term">CREDS</span></dt><dd><p>server credentials. server time stamp appears to be ignored.</p></dd></dl></div><p>return 0 - indicates success. undocumented failure indication.</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2886129"></a>\\MAILSLOT\NET\NTLOGON</h2></div></div><div></div></div><p><span class="emphasis"><em>
Note: mailslots will contain a response mailslot, to which the response
should be sent. the target NetBIOS name is REQUEST_NAME&lt;20&gt;, where
REQUEST_NAME is the name of the machine that sent the request.
-</em></span></p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2879336"></a>Query for PDC</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: NTversion, LMNTtoken, LM20token in response are the same as those given in the request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879356"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16</span></dt><dd><p>0x0007 - Query for PDC</p></dd><dt><span class="term">STR</span></dt><dd><p>machine name</p></dd><dt><span class="term">STR</span></dt><dd><p>response mailslot</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to 2-byte align with start of mailslot.</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>machine name</p></dd><dt><span class="term">UINT32</span></dt><dd><p>NTversion</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LMNTtoken</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LM20token</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879483"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16</span></dt><dd><p>0x000A - Respose to Query for PDC</p></dd><dt><span class="term">STR</span></dt><dd><p>machine name (in uppercase)</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to 2-byte align with start of mailslot.</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>machine name</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>domain name</p></dd><dt><span class="term">UINT32</span></dt><dd><p>NTversion (same as received in request)</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LMNTtoken (same as received in request)</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LM20token (same as received in request)</p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2879604"></a>SAM Logon</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: machine name in response is preceded by two '\' characters.</em></span></p><p><span class="emphasis"><em>Note: NTversion, LMNTtoken, LM20token in response are the same as those given in the request.</em></span></p><p><span class="emphasis"><em>Note: user name in the response is presumably the same as that in the request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879632"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16</span></dt><dd><p>0x0012 - SAM Logon</p></dd><dt><span class="term">UINT16</span></dt><dd><p>request count</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>machine name</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>user name</p></dd><dt><span class="term">STR</span></dt><dd><p>response mailslot</p></dd><dt><span class="term">UINT32</span></dt><dd><p>alloweable account</p></dd><dt><span class="term">UINT32</span></dt><dd><p>domain SID size</p></dd><dt><span class="term">char[sid_size]</span></dt><dd><p>domain SID, of sid_size bytes.</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>???? padding to 4? 2? -byte align with start of mailslot.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>NTversion</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LMNTtoken</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LM20token</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879815"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16</span></dt><dd><p>0x0013 - Response to SAM Logon</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>machine name</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>user name - workstation trust account</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>domain name </p></dd><dt><span class="term">UINT32</span></dt><dd><p>NTversion</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LMNTtoken</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LM20token</p></dd></dl></div></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2879929"></a>SRVSVC Transact Named Pipe</h2></div></div><div></div></div><p>Defines for this pipe, identifying the query are:</p><div class="variablelist"><dl><dt><span class="term">Net Share Enum</span></dt><dd><p>0x0f</p></dd><dt><span class="term">Net Server Get Info</span></dt><dd><p>0x15</p></dd></dl></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2879974"></a>Net Share Enum</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: share level and switch value in the response are presumably the same as those in the request.</em></span></p><p><span class="emphasis"><em>Note: cifsrap2.txt (section 5) may be of limited assistance here.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2879995"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>pointer (to server name?)</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>server name</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to get unicode string 4-byte aligned with the start of the SMB header.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>share level</p></dd><dt><span class="term">UINT32</span></dt><dd><p>switch value</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to SHARE_INFO_1_CTR</p></dd><dt><span class="term">SHARE_INFO_1_CTR</span></dt><dd><p>share info with 0 entries</p></dd><dt><span class="term">UINT32</span></dt><dd><p>preferred maximum length (0xffff ffff)</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2880120"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>share level</p></dd><dt><span class="term">UINT32</span></dt><dd><p>switch value</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to SHARE_INFO_1_CTR</p></dd><dt><span class="term">SHARE_INFO_1_CTR</span></dt><dd><p>share info (only added if share info ptr is non-zero)</p></dd></dl></div><p>return 0 - indicates success</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2880194"></a>Net Server Get Info</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: level is the same value as in the request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2880207"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UNISTR2</span></dt><dd><p>server name</p></dd><dt><span class="term">UINT32</span></dt><dd><p>switch level</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2880248"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>switch level</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to SERVER_INFO_101</p></dd><dt><span class="term">SERVER_INFO_101</span></dt><dd><p>server info (only added if server info ptr is non-zero)</p></dd></dl></div><p>return 0 - indicates success</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2880310"></a>Cryptographic side of NT Domain Authentication</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2880318"></a>Definitions</h3></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">Add(A1,A2)</span></dt><dd><p>Intel byte ordered addition of corresponding 4 byte words in arrays A1 and A2</p></dd><dt><span class="term">E(K,D)</span></dt><dd><p>DES ECB encryption of 8 byte data D using 7 byte key K</p></dd><dt><span class="term">lmowf()</span></dt><dd><p>Lan man hash</p></dd><dt><span class="term">ntowf()</span></dt><dd><p>NT hash</p></dd><dt><span class="term">PW</span></dt><dd><p>md4(machine_password) == md4(lsadump $machine.acc) ==
+</em></span></p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2886146"></a>Query for PDC</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: NTversion, LMNTtoken, LM20token in response are the same as those given in the request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886160"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16</span></dt><dd><p>0x0007 - Query for PDC</p></dd><dt><span class="term">STR</span></dt><dd><p>machine name</p></dd><dt><span class="term">STR</span></dt><dd><p>response mailslot</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to 2-byte align with start of mailslot.</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>machine name</p></dd><dt><span class="term">UINT32</span></dt><dd><p>NTversion</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LMNTtoken</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LM20token</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886286"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16</span></dt><dd><p>0x000A - Respose to Query for PDC</p></dd><dt><span class="term">STR</span></dt><dd><p>machine name (in uppercase)</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to 2-byte align with start of mailslot.</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>machine name</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>domain name</p></dd><dt><span class="term">UINT32</span></dt><dd><p>NTversion (same as received in request)</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LMNTtoken (same as received in request)</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LM20token (same as received in request)</p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2886407"></a>SAM Logon</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: machine name in response is preceded by two '\' characters.</em></span></p><p><span class="emphasis"><em>Note: NTversion, LMNTtoken, LM20token in response are the same as those given in the request.</em></span></p><p><span class="emphasis"><em>Note: user name in the response is presumably the same as that in the request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886435"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16</span></dt><dd><p>0x0012 - SAM Logon</p></dd><dt><span class="term">UINT16</span></dt><dd><p>request count</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>machine name</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>user name</p></dd><dt><span class="term">STR</span></dt><dd><p>response mailslot</p></dd><dt><span class="term">UINT32</span></dt><dd><p>alloweable account</p></dd><dt><span class="term">UINT32</span></dt><dd><p>domain SID size</p></dd><dt><span class="term">char[sid_size]</span></dt><dd><p>domain SID, of sid_size bytes.</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>???? padding to 4? 2? -byte align with start of mailslot.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>NTversion</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LMNTtoken</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LM20token</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886618"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT16</span></dt><dd><p>0x0013 - Response to SAM Logon</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>machine name</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>user name - workstation trust account</p></dd><dt><span class="term">UNISTR</span></dt><dd><p>domain name </p></dd><dt><span class="term">UINT32</span></dt><dd><p>NTversion</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LMNTtoken</p></dd><dt><span class="term">UINT16</span></dt><dd><p>LM20token</p></dd></dl></div></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2886733"></a>SRVSVC Transact Named Pipe</h2></div></div><div></div></div><p>Defines for this pipe, identifying the query are:</p><div class="variablelist"><dl><dt><span class="term">Net Share Enum</span></dt><dd><p>0x0f</p></dd><dt><span class="term">Net Server Get Info</span></dt><dd><p>0x15</p></dd></dl></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2886778"></a>Net Share Enum</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: share level and switch value in the response are presumably the same as those in the request.</em></span></p><p><span class="emphasis"><em>Note: cifsrap2.txt (section 5) may be of limited assistance here.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886799"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">VOID*</span></dt><dd><p>pointer (to server name?)</p></dd><dt><span class="term">UNISTR2</span></dt><dd><p>server name</p></dd><dt><span class="term">UINT8[]</span></dt><dd><p>padding to get unicode string 4-byte aligned with the start of the SMB header.</p></dd><dt><span class="term">UINT32</span></dt><dd><p>share level</p></dd><dt><span class="term">UINT32</span></dt><dd><p>switch value</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to SHARE_INFO_1_CTR</p></dd><dt><span class="term">SHARE_INFO_1_CTR</span></dt><dd><p>share info with 0 entries</p></dd><dt><span class="term">UINT32</span></dt><dd><p>preferred maximum length (0xffff ffff)</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886924"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>share level</p></dd><dt><span class="term">UINT32</span></dt><dd><p>switch value</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to SHARE_INFO_1_CTR</p></dd><dt><span class="term">SHARE_INFO_1_CTR</span></dt><dd><p>share info (only added if share info ptr is non-zero)</p></dd></dl></div><p>return 0 - indicates success</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2886997"></a>Net Server Get Info</h3></div></div><div></div></div><p><span class="emphasis"><em>Note: level is the same value as in the request.</em></span></p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2887011"></a>Request</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UNISTR2</span></dt><dd><p>server name</p></dd><dt><span class="term">UINT32</span></dt><dd><p>switch level</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2887051"></a>Response</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">UINT32</span></dt><dd><p>switch level</p></dd><dt><span class="term">VOID*</span></dt><dd><p>pointer to SERVER_INFO_101</p></dd><dt><span class="term">SERVER_INFO_101</span></dt><dd><p>server info (only added if server info ptr is non-zero)</p></dd></dl></div><p>return 0 - indicates success</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2887114"></a>Cryptographic side of NT Domain Authentication</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2887121"></a>Definitions</h3></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">Add(A1,A2)</span></dt><dd><p>Intel byte ordered addition of corresponding 4 byte words in arrays A1 and A2</p></dd><dt><span class="term">E(K,D)</span></dt><dd><p>DES ECB encryption of 8 byte data D using 7 byte key K</p></dd><dt><span class="term">lmowf()</span></dt><dd><p>Lan man hash</p></dd><dt><span class="term">ntowf()</span></dt><dd><p>NT hash</p></dd><dt><span class="term">PW</span></dt><dd><p>md4(machine_password) == md4(lsadump $machine.acc) ==
pwdump(machine$) (initially) == md4(lmowf(unicode(machine)))
-</p></dd><dt><span class="term">ARC4(K,Lk,D,Ld)</span></dt><dd><p>ARC4 encryption of data D of length Ld with key K of length Lk</p></dd><dt><span class="term">v[m..n(,l)]</span></dt><dd><p>subset of v from bytes m to n, optionally padded with zeroes to length l</p></dd><dt><span class="term">Cred(K,D)</span></dt><dd><p>E(K[7..7,7],E(K[0..6],D)) computes a credential</p></dd><dt><span class="term">Time()</span></dt><dd><p>4 byte current time</p></dd><dt><span class="term">Cc,Cs</span></dt><dd><p>8 byte client and server challenges Rc,Rs: 8 byte client and server credentials</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2880480"></a>Protocol</h3></div></div><div></div></div><pre class="programlisting">
+</p></dd><dt><span class="term">ARC4(K,Lk,D,Ld)</span></dt><dd><p>ARC4 encryption of data D of length Ld with key K of length Lk</p></dd><dt><span class="term">v[m..n(,l)]</span></dt><dd><p>subset of v from bytes m to n, optionally padded with zeroes to length l</p></dd><dt><span class="term">Cred(K,D)</span></dt><dd><p>E(K[7..7,7],E(K[0..6],D)) computes a credential</p></dd><dt><span class="term">Time()</span></dt><dd><p>4 byte current time</p></dd><dt><span class="term">Cc,Cs</span></dt><dd><p>8 byte client and server challenges Rc,Rs: 8 byte client and server credentials</p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2887283"></a>Protocol</h3></div></div><div></div></div><pre class="programlisting">
C-&gt;S ReqChal,Cc
S-&gt;C Cs
</pre><pre class="programlisting">
@@ -1361,7 +1361,7 @@ S: Ts = Time()
S-&gt;C Cred(Ks,Cred(Ks,Rc+Tc+1)),userinfo(logon script,UID,SIDs,etc)
C: assert(Rs == Cred(Ks,Cred(Rc+Tc+1))
C: Rc = Cred(Ks,Rc+Tc+1)
-</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2880577"></a>Comments</h3></div></div><div></div></div><p>
+</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2887363"></a>Comments</h3></div></div><div></div></div><p>
On first joining the domain the session key could be computed by
anyone listening in on the network as the machine password has a well
known value. Until the machine is rebooted it will use this session
@@ -1382,30 +1382,30 @@ returned by the server.
The password OWFs should NOT be sent over the network reversibly
encrypted. They should be sent using ARC4(Ks,md4(owf)) with the server
computing the same function using the owf values in the SAM.
-</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2880626"></a>SIDs and RIDs</h2></div></div><div></div></div><p>
+</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2887413"></a>SIDs and RIDs</h2></div></div><div></div></div><p>
SIDs and RIDs are well documented elsewhere.
</p><p>
A SID is an NT Security ID (see DOM_SID structure). They are of the form:
</p><table class="simplelist" border="0" summary="Simple list"><tr><td>revision-NN-SubAuth1-SubAuth2-SubAuth3... </td></tr><tr><td>revision-0xNNNNNNNNNNNN-SubAuth1-SubAuth2-SubAuth3...</td></tr></table><p>
currently, the SID revision is 1.
The Sub-Authorities are known as Relative IDs (RIDs).
-</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2880666"></a>Well-known SIDs</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2880673"></a>Universal well-known SIDs</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">Null SID</span></dt><dd><p>S-1-0-0</p></dd><dt><span class="term">World</span></dt><dd><p>S-1-1-0</p></dd><dt><span class="term">Local</span></dt><dd><p>S-1-2-0</p></dd><dt><span class="term">Creator Owner ID</span></dt><dd><p>S-1-3-0</p></dd><dt><span class="term">Creator Group ID</span></dt><dd><p>S-1-3-1</p></dd><dt><span class="term">Creator Owner Server ID</span></dt><dd><p>S-1-3-2</p></dd><dt><span class="term">Creator Group Server ID</span></dt><dd><p>S-1-3-3</p></dd><dt><span class="term">(Non-unique IDs)</span></dt><dd><p>S-1-4</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2880800"></a>NT well-known SIDs</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">NT Authority</span></dt><dd><p>S-1-5</p></dd><dt><span class="term">Dialup</span></dt><dd><p>S-1-5-1</p></dd><dt><span class="term">Network</span></dt><dd><p>S-1-5-2</p></dd><dt><span class="term">Batch</span></dt><dd><p>S-1-5-3</p></dd><dt><span class="term">Interactive</span></dt><dd><p>S-1-5-4</p></dd><dt><span class="term">Service</span></dt><dd><p>S-1-5-6</p></dd><dt><span class="term">AnonymousLogon(aka null logon session)</span></dt><dd><p>S-1-5-7</p></dd><dt><span class="term">Proxy</span></dt><dd><p>S-1-5-8</p></dd><dt><span class="term">ServerLogon(aka domain controller account)</span></dt><dd><p>S-1-5-8</p></dd><dt><span class="term">(Logon IDs)</span></dt><dd><p>S-1-5-5-X-Y</p></dd><dt><span class="term">(NT non-unique IDs)</span></dt><dd><p>S-1-5-0x15-...</p></dd><dt><span class="term">(Built-in domain)</span></dt><dd><p>s-1-5-0x20</p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2880981"></a>Well-known RIDS</h3></div></div><div></div></div><p>
+</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2887453"></a>Well-known SIDs</h3></div></div><div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2887460"></a>Universal well-known SIDs</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">Null SID</span></dt><dd><p>S-1-0-0</p></dd><dt><span class="term">World</span></dt><dd><p>S-1-1-0</p></dd><dt><span class="term">Local</span></dt><dd><p>S-1-2-0</p></dd><dt><span class="term">Creator Owner ID</span></dt><dd><p>S-1-3-0</p></dd><dt><span class="term">Creator Group ID</span></dt><dd><p>S-1-3-1</p></dd><dt><span class="term">Creator Owner Server ID</span></dt><dd><p>S-1-3-2</p></dd><dt><span class="term">Creator Group Server ID</span></dt><dd><p>S-1-3-3</p></dd><dt><span class="term">(Non-unique IDs)</span></dt><dd><p>S-1-4</p></dd></dl></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2887586"></a>NT well-known SIDs</h4></div></div><div></div></div><div class="variablelist"><dl><dt><span class="term">NT Authority</span></dt><dd><p>S-1-5</p></dd><dt><span class="term">Dialup</span></dt><dd><p>S-1-5-1</p></dd><dt><span class="term">Network</span></dt><dd><p>S-1-5-2</p></dd><dt><span class="term">Batch</span></dt><dd><p>S-1-5-3</p></dd><dt><span class="term">Interactive</span></dt><dd><p>S-1-5-4</p></dd><dt><span class="term">Service</span></dt><dd><p>S-1-5-6</p></dd><dt><span class="term">AnonymousLogon(aka null logon session)</span></dt><dd><p>S-1-5-7</p></dd><dt><span class="term">Proxy</span></dt><dd><p>S-1-5-8</p></dd><dt><span class="term">ServerLogon(aka domain controller account)</span></dt><dd><p>S-1-5-8</p></dd><dt><span class="term">(Logon IDs)</span></dt><dd><p>S-1-5-5-X-Y</p></dd><dt><span class="term">(NT non-unique IDs)</span></dt><dd><p>S-1-5-0x15-...</p></dd><dt><span class="term">(Built-in domain)</span></dt><dd><p>s-1-5-0x20</p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2887767"></a>Well-known RIDS</h3></div></div><div></div></div><p>
A RID is a sub-authority value, as part of either a SID, or in the case
of Group RIDs, part of the DOM_GID structure, in the USER_INFO_1
structure, in the LSA SAM Logon response.
-</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2880995"></a>Well-known RID users</h4></div></div><div></div></div><div class="segmentedlist"><p><b>Groupname: </b>DOMAIN_USER_RID_ADMIN</p><p><b>????: </b>0x0000</p><p><b>RID: </b>01F4</p><p><b>Groupname: </b>DOMAIN_USER_RID_GUEST</p><p><b>????: </b>0x0000</p><p><b>RID: </b>01F5</p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2881044"></a>Well-known RID groups</h4></div></div><div></div></div><div class="segmentedlist"><p><b>Groupname: </b> DOMAIN_GROUP_RID_ADMINS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0200</p><p><b>Groupname: </b> DOMAIN_GROUP_RID_USERS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0201</p><p><b>Groupname: </b> DOMAIN_GROUP_RID_GUESTS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0202</p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2881103"></a>Well-known RID aliases</h4></div></div><div></div></div><div class="segmentedlist"><p><b>Groupname: </b> DOMAIN_ALIAS_RID_ADMINS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0220</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_USERS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0221</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_GUESTS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0222</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_POWER_USERS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0223</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_ACCOUNT_OPS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0224</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_SYSTEM_OPS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0225</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_PRINT_OPS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0226</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_BACKUP_OPS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0227</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_REPLICATOR</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0228</p></div></div></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="printing"></a>Chapter 10. Samba Printing Internals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Gerald</span> <span class="surname">Carter</span></h3></div></div><div><p class="pubdate">October 2002</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2889663">Abstract</a></dt><dt><a href="#id2889679">
+</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2887782"></a>Well-known RID users</h4></div></div><div></div></div><div class="segmentedlist"><p><b>Groupname: </b>DOMAIN_USER_RID_ADMIN</p><p><b>????: </b>0x0000</p><p><b>RID: </b>01F4</p><p><b>Groupname: </b>DOMAIN_USER_RID_GUEST</p><p><b>????: </b>0x0000</p><p><b>RID: </b>01F5</p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2887830"></a>Well-known RID groups</h4></div></div><div></div></div><div class="segmentedlist"><p><b>Groupname: </b> DOMAIN_GROUP_RID_ADMINS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0200</p><p><b>Groupname: </b> DOMAIN_GROUP_RID_USERS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0201</p><p><b>Groupname: </b> DOMAIN_GROUP_RID_GUESTS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0202</p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2887889"></a>Well-known RID aliases</h4></div></div><div></div></div><div class="segmentedlist"><p><b>Groupname: </b> DOMAIN_ALIAS_RID_ADMINS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0220</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_USERS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0221</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_GUESTS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0222</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_POWER_USERS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0223</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_ACCOUNT_OPS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0224</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_SYSTEM_OPS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0225</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_PRINT_OPS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0226</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_BACKUP_OPS</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0227</p><p><b>Groupname: </b> DOMAIN_ALIAS_RID_REPLICATOR</p><p><b>????: </b>0x0000</p><p><b>RID: </b>0228</p></div></div></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="printing"></a>Chapter 10. Samba Printing Internals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Gerald</span> <span class="surname">Carter</span></h3></div></div><div><p class="pubdate">October 2002</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2889311">Abstract</a></dt><dt><a href="#id2889327">
Printing Interface to Various Back ends
-</a></dt><dt><a href="#id2889934">
+</a></dt><dt><a href="#id2889419">
Print Queue TDB's
-</a></dt><dt><a href="#id2890143">
+</a></dt><dt><a href="#id2888211">
ChangeID and Client Caching of Printer Information
-</a></dt><dt><a href="#id2890156">
+</a></dt><dt><a href="#id2888224">
Windows NT/2K Printer Change Notify
-</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2889663"></a>Abstract</h2></div></div><div></div></div><p>
+</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2889311"></a>Abstract</h2></div></div><div></div></div><p>
The purpose of this document is to provide some insight into
Samba's printing functionality and also to describe the semantics
of certain features of Windows client printing.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2889679"></a>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2889327"></a>
Printing Interface to Various Back ends
</h2></div></div><div></div></div><p>
Samba uses a table of function pointers to seven functions. The
@@ -1416,7 +1416,7 @@ Currently there are only two printing back end implementations
defined.
</p><div class="itemizedlist"><ul type="disc"><li><p>a generic set of functions for working with standard UNIX
printing subsystems</p></li><li><p>a set of CUPS specific functions (this is only enabled if
- the CUPS libraries were located at compile time).</p></li></ul></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2889934"></a>
+ the CUPS libraries were located at compile time).</p></li></ul></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2889419"></a>
Print Queue TDB's
</h2></div></div><div></div></div><p>
Samba provides periodic caching of the output from the &quot;lpq command&quot;
@@ -1505,11 +1505,11 @@ and the job has the printer's device mode associated with it by default.
Only non-default Device Mode are stored with print jobs in the print
queue TDB. Otherwise, the Device Mode is obtained from the printer
object when the client issues a GetJob(level == 2) request.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2890143"></a>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2888211"></a>
ChangeID and Client Caching of Printer Information
</h2></div></div><div></div></div><p>
[To be filled in later]
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2890156"></a>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2888224"></a>
Windows NT/2K Printer Change Notify
</h2></div></div><div></div></div><p>
When working with Windows NT+ clients, it is possible for a
@@ -1607,7 +1607,7 @@ handle for notification. Samba currently uses the snum of
the printer for this which can break if the list of services
has been modified since the notification handle was registered.</p></li><li><p>The size is either (a) the string length in UNICODE for strings,
(b) the size in bytes of the security descriptor, or (c) 0 for
-data values.</p></li></ul></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="wins"></a>Chapter 11. Samba WINS Internals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Gerald</span> <span class="surname">Carter</span></h3></div></div><div><p class="pubdate">October 2002</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2889624">WINS Failover</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2889624"></a>WINS Failover</h2></div></div><div></div></div><p>
+data values.</p></li></ul></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="wins"></a>Chapter 11. Samba WINS Internals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Gerald</span> <span class="surname">Carter</span></h3></div></div><div><p class="pubdate">October 2002</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2888880">WINS Failover</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2888880"></a>WINS Failover</h2></div></div><div></div></div><p>
The current Samba codebase possesses the capability to use groups of WINS
servers that share a common namespace for NetBIOS name registration and
resolution. The formal parameter syntax is
@@ -1649,7 +1649,7 @@ If a timeout occurs when querying a specific WINS server, that server is marked
prevent further timeouts and the next server in the WINS group is contacted. Once marked as
dead, Samba will not attempt to contact that server for name registration/resolution queries
for a period of 10 minutes.
-</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="sam"></a>Chapter 12. The Upcoming SAM System</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Andrew</span> <span class="surname">Bartlett</span></h3></div></div><div><p class="pubdate">1 October 2002</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2889427">Security in the 'new SAM'</a></dt><dt><a href="#id2890951">Standalone from UNIX</a></dt><dt><a href="#id2890985">Handles and Races in the new SAM</a></dt><dt><a href="#id2891054">Layers</a></dt><dd><dl><dt><a href="#id2891061">Application</a></dt><dt><a href="#id2891077">SAM Interface</a></dt><dt><a href="#id2891105">SAM Modules</a></dt></dl></dd><dt><a href="#id2891126">SAM Modules</a></dt><dd><dl><dt><a href="#id2891134">Special Module: sam_passdb</a></dt><dt><a href="#id2891152">sam_ads</a></dt></dl></dd><dt><a href="#id2891191">Memory Management</a></dt><dt><a href="#id2891281">Testing</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2889427"></a>Security in the 'new SAM'</h2></div></div><div></div></div><p>One of the biggest problems with passdb is it's implementation of
+</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="sam"></a>Chapter 12. The Upcoming SAM System</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Andrew</span> <span class="surname">Bartlett</span></h3></div></div><div><p class="pubdate">1 October 2002</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2888557">Security in the 'new SAM'</a></dt><dt><a href="#id2888685">Standalone from UNIX</a></dt><dt><a href="#id2888711">Handles and Races in the new SAM</a></dt><dt><a href="#id2888780">Layers</a></dt><dd><dl><dt><a href="#id2888787">Application</a></dt><dt><a href="#id2888803">SAM Interface</a></dt><dt><a href="#id2888829">SAM Modules</a></dt></dl></dd><dt><a href="#id2888851">SAM Modules</a></dt><dd><dl><dt><a href="#id2888858">Special Module: sam_passdb</a></dt><dt><a href="#id2890101">sam_ads</a></dt></dl></dd><dt><a href="#id2890131">Memory Management</a></dt><dt><a href="#id2890217">Testing</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2888557"></a>Security in the 'new SAM'</h2></div></div><div></div></div><p>One of the biggest problems with passdb is it's implementation of
'security'. Access control is on a 'are you root at the moment' basis,
and it has no concept of NT ACLs. Things like ldapsam had to add
'magic' 'are you root' checks.</p><p>We took this very seriously when we started work, and the new structure
@@ -1709,7 +1709,7 @@ actual data store (like the LDAP server).
</p><p>
Finally, we have generic get_sec_desc() and set_sec_desc() routines to
allow external ACL manipulation. These do lookups based on SID.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2890951"></a>Standalone from UNIX</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2888685"></a>Standalone from UNIX</h2></div></div><div></div></div><p>
One of the primary tenants of the 'new SAM' is that it would not attempt
to deal with 'what unix id for that'. This would be left to the 'SMS'
(Sid Mapping System') or SID farm, and probably administered via
@@ -1719,7 +1719,7 @@ Accounts not preexisting in unix would be served up via winbind.
</p><p>
This is an *optional* part, and my preferred end-game. We have a fare
way to go before things like winbind up to it however.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2890985"></a>Handles and Races in the new SAM</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2888711"></a>Handles and Races in the new SAM</h2></div></div><div></div></div><p>
One of the things that the 'new SAM' work has tried to face is both
compatibility with existing code, and a closer alignment to the SAMR
interface. I consider SAMR to be a 'primary customer' to the this work,
@@ -1744,11 +1744,11 @@ have *really* changed.
'conflicting' updates: Currently we don't deal with this (in passdb
or the new sam stuff), but the design is sufficiently flexible to 'deny'
a second update. I don't foresee locking records however.
-</p></li></ul></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891054"></a>Layers</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2891061"></a>Application</h3></div></div><div></div></div><p>
+</p></li></ul></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2888780"></a>Layers</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2888787"></a>Application</h3></div></div><div></div></div><p>
This is where smbd, samtest and whatever end-user replacement we have
for pdbedit sits. They use only the SAM interface, and do not get
'special knowledge' of what is below them.
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2891077"></a>SAM Interface</h3></div></div><div></div></div><p>
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2888803"></a>SAM Interface</h3></div></div><div></div></div><p>
This level 'owns' the various handle structures, the get/set routines on
those structures and provides the public interface. The application
layer may initialize a 'context' to be passed to all interface routines,
@@ -1759,7 +1759,7 @@ abstraction to the modules below, and arrange for their initial loading.
</p><p>
We could possibly add ACL checking at this layer, to avoid discrepancies
in implementation modules.
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2891105"></a>SAM Modules</h3></div></div><div></div></div><p>
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2888829"></a>SAM Modules</h3></div></div><div></div></div><p>
These do not communicate with the application directly, only by setting
values in the handles, and receiving requests from the interface. These
modules are responsible for translating values from the handle's
@@ -1767,13 +1767,13 @@ modules are responsible for translating values from the handle's
to 'know' things like it's own domain SID, domain name, and any other
state attached to the SAM. Simpler modules may call back to some helper
routine.
-</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891126"></a>SAM Modules</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2891134"></a>Special Module: sam_passdb</h3></div></div><div></div></div><p>
+</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2888851"></a>SAM Modules</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2888858"></a>Special Module: sam_passdb</h3></div></div><div></div></div><p>
In order for there to be a smooth transition, kai is writing a module
that reads existing passdb backends, and translates them into SAM
replies. (Also pulling data from the account policy DB etc). We also
intend to write a module that does the reverse - gives the SAM a passdb
interface.
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2891152"></a>sam_ads</h3></div></div><div></div></div><p>
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2890101"></a>sam_ads</h3></div></div><div></div></div><p>
This is the first of the SAM modules to be committed to the tree -
mainly because I needed to coordinate work with metze (who authored most
of it). This module aims to use Samba's libads code to provide an
@@ -1785,7 +1785,7 @@ the construction of an Samba AD DC.
</p><p>
We also intend to construct a Samba 2.2/3.0 compatible ldap module,
again using libads code.
-</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891191"></a>Memory Management</h2></div></div><div></div></div><p>
+</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2890131"></a>Memory Management</h2></div></div><div></div></div><p>
The 'new SAM' development effort also concerned itself with getting a
sane implementation of memory management. It was decided that we would
be (as much as possible) talloc based, using an 'internal talloc
@@ -1814,7 +1814,7 @@ NT_USER_TOKEN *access_token, uint32 access_desired, const DOM_SID
NTSTATUS sam_enum_accounts(const SAM_CONTEXT *context, const
NT_USER_TOKEN *access_token, const DOM_SID *domainsid, uint16 acct_ctrl,
int32 *account_count, SAM_ACCOUNT_ENUM **accounts)
-</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891281"></a>Testing</h2></div></div><div></div></div><p>
+</pre></div><div xmlns:ns3="" class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2890217"></a>Testing</h2></div></div><div></div></div><p>
Testing is vital in any piece of software, and Samba is certainly no
exception. In designing this new subsystem, we have taken care to ensure
it is easily tested, independent of outside protocols.
@@ -1831,25 +1831,25 @@ already proved vital in testing. I expect SAM module authors will find
it particularly valuable.
</p><p>Example useage:</p><p><tt class="prompt">$</tt> <b class="command">bin/samtest</b></p><pre class="programlisting">
&gt; context ads:ldap://192.168.1.96
-</pre><p>
+</pre><ns3:p>
(this loads a new context, using the new ADS module. The parameter is
the 'location' of the ldap server)
-</p><pre class="programlisting">
+</ns3:p><pre class="programlisting">
&gt; lookup_name DOMAIN abartlet
-</pre><p>
+</pre><ns3:p>
(returns a sid).
-</p><p>
+</ns3:p><p>
Because the 'new SAM' is NT ACL based, there will be a command to
specify an arbitrary NT ACL, but for now it uses 'system' by default.
</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="pwencrypt"></a>Chapter 13. LanMan and NT Password Encryption</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jeremy</span> <span class="surname">Allison</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><br>
<tt class="email">&lt;<a href="mailto:samba@samba.org">samba@samba.org</a>&gt;</tt><br>
- </p></div></div></div></div><div><p class="pubdate">19 Apr 1999</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2891920">Introduction</a></dt><dt><a href="#id2891945">How does it work?</a></dt><dt><a href="#id2890832">The smbpasswd file</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891920"></a>Introduction</h2></div></div><div></div></div><p>With the development of LanManager and Windows NT
+ </p></div></div></div></div><div><p class="pubdate">19 Apr 1999</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2890947">Introduction</a></dt><dt><a href="#id2890972">How does it work?</a></dt><dt><a href="#id2891066">The smbpasswd file</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2890947"></a>Introduction</h2></div></div><div></div></div><p>With the development of LanManager and Windows NT
compatible password encryption for Samba, it is now able
to validate user connections in exactly the same way as
a LanManager or Windows NT server.</p><p>This document describes how the SMB password encryption
algorithm works and what issues there are in choosing whether
you want to use it. You should read it carefully, especially
- the part about security and the &quot;PROS and CONS&quot; section.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891945"></a>How does it work?</h2></div></div><div></div></div><p>LanManager encryption is somewhat similar to UNIX
+ the part about security and the &quot;PROS and CONS&quot; section.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2890972"></a>How does it work?</h2></div></div><div></div></div><p>LanManager encryption is somewhat similar to UNIX
password encryption. The server uses a file containing a
hashed value of a user's password. This is created by taking
the user's plaintext password, capitalising it, and either
@@ -1886,7 +1886,7 @@ specify an arbitrary NT ACL, but for now it uses 'system' by default.
know the correct password and is denied access.</p><p>Note that the Samba server never knows or stores the cleartext
of the user's password - just the 16 byte hashed values derived from
it. Also note that the cleartext password or 16 byte hashed values
- are never transmitted over the network - thus increasing security.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2890832"></a>The smbpasswd file</h2></div></div><div></div></div><a name="SMBPASSWDFILEFORMAT"></a><p>In order for Samba to participate in the above protocol
+ are never transmitted over the network - thus increasing security.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891066"></a>The smbpasswd file</h2></div></div><div></div></div><a name="SMBPASSWDFILEFORMAT"></a><p>In order for Samba to participate in the above protocol
it must be able to look up the 16 byte hashed values given a user name.
Unfortunately, as the UNIX password value is also a one way hash
function (ie. it is impossible to retrieve the cleartext of the user's
@@ -1943,10 +1943,10 @@ bob:100:NO PASSWORDXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:
to enable this on your server.</p><p><span class="emphasis"><em>Note : </em></span>This file should be protected very
carefully. Anyone with access to this file can (with enough knowledge of
the protocols) gain access to your SMB server. The file is thus more
- sensitive than a normal unix <tt class="filename">/etc/passwd</tt> file.</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="modules"></a>Chapter 14. Modules</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate"> 19 March 2003 </p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2891872">Advantages</a></dt><dt><a href="#id2892773">Loading modules</a></dt><dd><dl><dt><a href="#id2892806">Static modules</a></dt><dt><a href="#id2893746">Shared modules</a></dt></dl></dd><dt><a href="#id2893775">Writing modules</a></dt><dd><dl><dt><a href="#id2893837">Static/Shared selection in configure.in</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891872"></a>Advantages</h2></div></div><div></div></div><p>
+ sensitive than a normal unix <tt class="filename">/etc/passwd</tt> file.</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="modules"></a>Chapter 14. Modules</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate"> 19 March 2003 </p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2892850">Advantages</a></dt><dt><a href="#id2892895">Loading modules</a></dt><dd><dl><dt><a href="#id2892925">Static modules</a></dt><dt><a href="#id2892965">Shared modules</a></dt></dl></dd><dt><a href="#id2892994">Writing modules</a></dt><dd><dl><dt><a href="#id2893054">Static/Shared selection in configure.in</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2892850"></a>Advantages</h2></div></div><div></div></div><p>
The new modules system has the following advantages:
</p><table class="simplelist" border="0" summary="Simple list"><tr><td>Transparent loading of static and shared modules (no need
-for a subsystem to know about modules)</td></tr><tr><td>Simple selection between shared and static modules at configure time</td></tr><tr><td>&quot;preload modules&quot; option for increasing performance for stable modules</td></tr><tr><td>No nasty #define stuff anymore</td></tr><tr><td>All backends are available as plugin now (including pdb_ldap and pdb_tdb)</td></tr></table></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2892773"></a>Loading modules</h2></div></div><div></div></div><p>
+for a subsystem to know about modules)</td></tr><tr><td>Simple selection between shared and static modules at configure time</td></tr><tr><td>&quot;preload modules&quot; option for increasing performance for stable modules</td></tr><tr><td>No nasty #define stuff anymore</td></tr><tr><td>All backends are available as plugin now (including pdb_ldap and pdb_tdb)</td></tr></table></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2892895"></a>Loading modules</h2></div></div><div></div></div><p>
Some subsystems in samba use different backends. These backends can be
either statically linked in to samba or available as a plugin. A subsystem
should have a function that allows a module to register itself. For example,
@@ -1956,7 +1956,7 @@ NTSTATUS smb_register_passdb(int version, const char *name, pdb_init_function in
</pre><p>
This function will be called by the initialisation function of the module to
register itself.
-</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892806"></a>Static modules</h3></div></div><div></div></div><p>
+</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892925"></a>Static modules</h3></div></div><div></div></div><p>
The modules system compiles a list of initialisation functions for the
static modules of each subsystem. This is a define. For example,
it is here currently (from <tt class="filename">include/config.h</tt>):
@@ -1966,7 +1966,7 @@ it is here currently (from <tt class="filename">include/config.h</tt>):
</pre><p>
These functions should be called before the subsystem is used. That
should be done when the subsystem is initialised or first used.
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2893746"></a>Shared modules</h3></div></div><div></div></div><p>
+</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2892965"></a>Shared modules</h3></div></div><div></div></div><p>
If a subsystem needs a certain backend, it should check if it has
already been registered. If the backend hasn't been registered already,
the subsystem should call smb_probe_module(char *subsystem, char *backend).
@@ -1976,7 +1976,7 @@ is a slash, smb_probe_module() tries to load the module from the
absolute path specified in 'backend'.
</p><p>After smb_probe_module() has been executed, the subsystem
should check again if the module has been registered.
-</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2893775"></a>Writing modules</h2></div></div><div></div></div><p>
+</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2892994"></a>Writing modules</h2></div></div><div></div></div><p>
Each module has an initialisation function. For modules that are
included with samba this name is '<i class="replaceable"><tt>subsystem</tt></i>_<i class="replaceable"><tt>backend</tt></i>_init'. For external modules (that will never be built-in, but only available as a module) this name is always 'init_module'. (In the case of modules included with samba, the configure system will add a #define subsystem_backend_init() init_module()).
The prototype for these functions is:
@@ -1991,7 +1991,7 @@ smb_register_passdb(PASSDB_INTERFACE_VERSION, &quot;ldapsam&quot;, pdb_init_ldap
smb_register_passdb(PASSDB_INTERFACE_VERSION, &quot;ldapsam_nua&quot;, pdb_init_ldapsam_nua);
return NT_STATUS_OK;
}
-</pre><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2893837"></a>Static/Shared selection in configure.in</h3></div></div><div></div></div><p>
+</pre><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2893054"></a>Static/Shared selection in configure.in</h3></div></div><div></div></div><p>
Some macros in configure.in generate the various defines and substs that
are necessary for the system to work correct. All modules that should
be built by default have to be added to the variable 'default_modules'.
@@ -2010,13 +2010,13 @@ be replaced with the names of the plugins to build.
</p><p>You must make sure all .c files that contain defines that can
be changed by ./configure are rebuilded in the 'modules_clean' make target.
Practically, this means all c files that contain <b class="command">static_init_subsystem;</b> calls need to be rebuilded.
-</p></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="rpc-plugin"></a>Chapter 15. RPC Pluggable Modules</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Anthony</span> <span class="surname">Liguori</span></h3><div class="affiliation"><span class="orgname">IBM<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:aliguor@us.ibm.com">aliguor@us.ibm.com</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate">January 2003</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2892540">About</a></dt><dt><a href="#id2892559">General Overview</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2892540"></a>About</h2></div></div><div></div></div><p>
+</p></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="rpc-plugin"></a>Chapter 15. RPC Pluggable Modules</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Anthony</span> <span class="surname">Liguori</span></h3><div class="affiliation"><span class="orgname">IBM<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:aliguor@us.ibm.com">aliguor@us.ibm.com</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate">January 2003</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2893212">About</a></dt><dt><a href="#id2893231">General Overview</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2893212"></a>About</h2></div></div><div></div></div><p>
This document describes how to make use the new RPC Pluggable Modules features
of Samba 3.0. This architecture was added to increase the maintainability of
Samba allowing RPC Pipes to be worked on separately from the main CVS branch.
The RPM architecture will also allow third-party vendors to add functionality
to Samba through plug-ins.
-</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2892559"></a>General Overview</h2></div></div><div></div></div><p>
+</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2893231"></a>General Overview</h2></div></div><div></div></div><p>
When an RPC call is sent to smbd, smbd tries to load a shared library by the
name <tt class="filename">librpc_&lt;pipename&gt;.so</tt> to handle the call if
it doesn't know how to handle the call internally. For instance, LSA calls
@@ -2033,7 +2033,7 @@ NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, const char *s
argument.</p></dd><dt><span class="term">clnt</span></dt><dd><p>the Client name of the named pipe</p></dd><dt><span class="term">srv</span></dt><dd><p>the Server name of the named pipe</p></dd><dt><span class="term">cmds</span></dt><dd><p>a list of api_structs that map RPC ordinal numbers to function calls</p></dd><dt><span class="term">size</span></dt><dd><p>the number of api_structs contained in cmds</p></dd></dl></div><p>
See rpc_server/srv_reg.c and rpc_server/srv_reg_nt.c for a small example of
how to use this library.
-</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="vfs"></a>Chapter 16. VFS Modules</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Alexander</span> <span class="surname">Bokovoy</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:ab@samba.org">ab@samba.org</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Stefan</span> <span class="surname">Metzmacher</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:metze@metzemix.de">metze@metzemix.de</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate"> 27 May 2003 </p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2894852">The Samba (Posix) VFS layer</a></dt><dd><dl><dt><a href="#id2894859">The general interface</a></dt><dt><a href="#id2894974">Possible VFS operation layers</a></dt></dl></dd><dt><a href="#id2895046">The Interaction between the Samba VFS subsystem and the modules</a></dt><dd><dl><dt><a href="#id2895054">Initialization and registration</a></dt><dt><a href="#id2895246">How the Modules handle per connection data</a></dt></dl></dd><dt><a href="#id2895490">Upgrading to the New VFS Interface</a></dt><dd><dl><dt><a href="#id2895497">Upgrading from 2.2.* and 3.0aplha modules</a></dt></dl></dd><dt><a href="#id2896037">Some Notes</a></dt><dd><dl><dt><a href="#id2896044">Implement TRANSPARENT functions</a></dt><dt><a href="#id2896069">Implement OPAQUE functions</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2894852"></a>The Samba (Posix) VFS layer</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2894859"></a>The general interface</h3></div></div><div></div></div><p>
+</p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="vfs"></a>Chapter 16. VFS Modules</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Alexander</span> <span class="surname">Bokovoy</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:ab@samba.org">ab@samba.org</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Stefan</span> <span class="surname">Metzmacher</span></h3><div class="affiliation"><div class="address"><p><tt class="email">&lt;<a href="mailto:metze@metzemix.de">metze@metzemix.de</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate"> 27 May 2003 </p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2895474">The Samba (Posix) VFS layer</a></dt><dd><dl><dt><a href="#id2895481">The general interface</a></dt><dt><a href="#id2895581">Possible VFS operation layers</a></dt></dl></dd><dt><a href="#id2895645">The Interaction between the Samba VFS subsystem and the modules</a></dt><dd><dl><dt><a href="#id2895653">Initialization and registration</a></dt><dt><a href="#id2891713">How the Modules handle per connection data</a></dt></dl></dd><dt><a href="#id2891932">Upgrading to the New VFS Interface</a></dt><dd><dl><dt><a href="#id2893534">Upgrading from 2.2.* and 3.0aplha modules</a></dt></dl></dd><dt><a href="#id2893946">Some Notes</a></dt><dd><dl><dt><a href="#id2893953">Implement TRANSPARENT functions</a></dt><dt><a href="#id2893976">Implement OPAQUE functions</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2895474"></a>The Samba (Posix) VFS layer</h2></div></div><div></div></div><div xmlns:ns4="" class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2895481"></a>The general interface</h3></div></div><div></div></div><p>
Each VFS operation has a vfs_op_type, a function pointer and a handle pointer in the
struct vfs_ops and tree macros to make it easier to call the operations.
(Take a look at <tt class="filename">include/vfs.h</tt> and <tt class="filename">include/vfs_macros.h</tt>.)
@@ -2056,7 +2056,7 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_LAST
} vfs_op_type;
-</pre><p>This struct contains the function and handle pointers for all operations.</p><pre class="programlisting">
+</pre><ns4:p>This struct contains the function and handle pointers for all operations.</ns4:p><pre class="programlisting">
struct vfs_ops {
struct vfs_fn_pointers {
...
@@ -2098,10 +2098,10 @@ struct vfs_ops {
...
} handles;
};
-</pre><p>
+</pre><ns4:p>
This macros SHOULD be used to call any vfs operation.
DO NOT ACCESS conn-&gt;vfs.ops.* directly !!!
-</p><pre class="programlisting">
+</ns4:p><pre class="programlisting">
...
/* File operations */
@@ -2129,7 +2129,7 @@ DO NOT ACCESS conn-&gt;vfs.ops.* directly !!!
(tofd), (fsp), (fromfd), (header), (offset), (count)))
...
-</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2894974"></a>Possible VFS operation layers</h3></div></div><div></div></div><p>
+</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2895581"></a>Possible VFS operation layers</h3></div></div><div></div></div><p>
These values are used by the VFS subsystem when building the conn-&gt;vfs
and conn-&gt;vfs_opaque structs for a connection with multiple VFS modules.
Internally, Samba differentiates only opaque and transparent layers at this process.
@@ -2158,19 +2158,19 @@ typedef enum _vfs_op_layer {
SMB_VFS_LAYER_SCANNER /* - Checks data and possibly initiates additional */
/* file activity like logging to files _inside_ samba VFS */
} vfs_op_layer;
-</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2895046"></a>The Interaction between the Samba VFS subsystem and the modules</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2895054"></a>Initialization and registration</h3></div></div><div></div></div><p>
+</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2895645"></a>The Interaction between the Samba VFS subsystem and the modules</h2></div></div><div></div></div><div xmlns:ns5="" class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2895653"></a>Initialization and registration</h3></div></div><div></div></div><ns5:p>
As each Samba module a VFS module should have a
-</p><pre class="programlisting">NTSTATUS vfs_example_init(void);</pre><p> function if it's staticly linked to samba or
-</p><pre class="programlisting">NTSTATUS init_module(void);</pre><p> function if it's a shared module.
-</p><p>
+</ns5:p><pre class="programlisting">NTSTATUS vfs_example_init(void);</pre><ns5:p> function if it's staticly linked to samba or
+</ns5:p><pre class="programlisting">NTSTATUS init_module(void);</pre><ns5:p> function if it's a shared module.
+</ns5:p><p>
This should be the only non static function inside the module.
Global variables should also be static!
-</p><p>
+</p><ns5:p>
The module should register its functions via the
-</p><pre class="programlisting">
+</ns5:p><pre class="programlisting">
NTSTATUS smb_register_vfs(int version, const char *name, vfs_op_tuple *vfs_op_tuples);
-</pre><p> function.
-</p><div class="variablelist"><dl><dt><span class="term">version</span></dt><dd><p>should be filled with SMB_VFS_INTERFACE_VERSION</p></dd><dt><span class="term">name</span></dt><dd><p>this is the name witch can be listed in the
+</pre><ns5:p> function.
+</ns5:p><div class="variablelist"><dl><dt><span class="term">version</span></dt><dd><p>should be filled with SMB_VFS_INTERFACE_VERSION</p></dd><dt><span class="term">name</span></dt><dd><p>this is the name witch can be listed in the
<b class="command">vfs objects</b> parameter to use this module.</p></dd><dt><span class="term">vfs_op_tuples</span></dt><dd><p>
this is an array of vfs_op_tuple's.
(vfs_op_tuples is descripted in details below.)
@@ -2198,7 +2198,7 @@ NTSTATUS init_module(void)
{
return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, &quot;example&quot;, example_op_tuples);
}
-</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2895246"></a>How the Modules handle per connection data</h3></div></div><div></div></div><p>Each VFS function has as first parameter a pointer to the modules vfs_handle_struct.
+</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2891713"></a>How the Modules handle per connection data</h3></div></div><div></div></div><p>Each VFS function has as first parameter a pointer to the modules vfs_handle_struct.
</p><pre class="programlisting">
typedef struct vfs_handle_struct {
struct vfs_handle_struct *next, *prev;
@@ -2209,7 +2209,7 @@ typedef struct vfs_handle_struct {
void (*free_data)(void **data);
} vfs_handle_struct;
</pre><div class="variablelist"><dl><dt><span class="term">param</span></dt><dd><p>this is the module parameter specified in the <b class="command">vfs objects</b> parameter.</p><p>e.g. for 'vfs objects = example:test' param would be &quot;test&quot;.</p></dd><dt><span class="term">vfs_next</span></dt><dd><p>This vfs_ops struct contains the information for calling the next module operations.
-Use the vfs_next_* macros to call a next module operations and
+Use the SMB_VFS_NEXT_* macros to call a next module operations and
don't access handle-&gt;vfs_next.ops.* directly!</p></dd><dt><span class="term">conn</span></dt><dd><p>This is a pointer back to the connection_struct to witch the handle belongs.</p></dd><dt><span class="term">data</span></dt><dd><p>This is a pointer for holding module private data.
You can alloc data with connection life time on the handle-&gt;conn-&gt;mem_ctx TALLOC_CTX.
But you can also manage the memory allocation yourself.</p></dd><dt><span class="term">free_data</span></dt><dd><p>This is a function pointer to a function that free's the module private data.
@@ -2299,7 +2299,7 @@ you can set this function pointer to NULL.</p></dd></dl></div><p>Some useful MAC
(handle)-&gt;vfs_next.handles.sendfile,\
(tofd), (fsp), (fromfd), (header), (offset), (count)))
...
-</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2895490"></a>Upgrading to the New VFS Interface</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2895497"></a>Upgrading from 2.2.* and 3.0aplha modules</h3></div></div><div></div></div><div class="orderedlist"><ol type="1"><li><p>
+</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2891932"></a>Upgrading to the New VFS Interface</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2893534"></a>Upgrading from 2.2.* and 3.0aplha modules</h3></div></div><div></div></div><div class="orderedlist"><ol type="1"><li><p>
Add &quot;vfs_handle_struct *handle, &quot; as first parameter to all vfs operation functions.
e.g. example_connect(connection_struct *conn, const char *service, const char *user);
-&gt; example_connect(vfs_handle_struct *handle, connection_struct *conn, const char *service, const char *user);
@@ -2308,19 +2308,19 @@ Replace &quot;default_vfs_ops.&quot; with &quot;smb_vfs_next_&quot;.
e.g. default_vfs_ops.connect(conn, service, user);
-&gt; smb_vfs_next_connect(conn, service, user);
</p></li><li><p>
-Uppercase all &quot;vfs_next_*&quot; functions.
+Uppercase all &quot;smb_vfs_next_*&quot; functions.
e.g. smb_vfs_next_connect(conn, service, user);
-&gt; SMB_VFS_NEXT_CONNECT(conn, service, user);
</p></li><li><p>
-Add &quot;handle, &quot; as first parameter to all VFS_NEXT_*() calls.
+Add &quot;handle, &quot; as first parameter to all SMB_VFS_NEXT_*() calls.
e.g. SMB_VFS_NEXT_CONNECT(conn, service, user);
-&gt; SMB_VFS_NEXT_CONNECT(handle, conn, service, user);
-</p></li><li><p>
+</p></li><li xmlns:ns6=""><ns6:p>
(Only for 2.2.* modules)
Convert the old struct vfs_ops example_ops to
a vfs_op_tuple example_op_tuples[] array.
e.g.
-</p><pre class="programlisting">
+</ns6:p><pre class="programlisting">
struct vfs_ops example_ops = {
/* Disk operations */
example_connect, /* connect */
@@ -2390,9 +2390,9 @@ struct vfs_ops example_ops = {
NULL, /* sys_acl_free_acl */
NULL /* sys_acl_free_qualifier */
};
-</pre><p>
+</pre><ns6:p>
-&gt;
-</p><pre class="programlisting">
+</ns6:p><pre class="programlisting">
static vfs_op_tuple example_op_tuples[] = {
{SMB_VFS_OP(example_connect), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(example_disconnect), SMB_VFS_OP_DISCONNECT, SMB_VFS_LAYER_TRANSPARENT},
@@ -2403,42 +2403,42 @@ static vfs_op_tuple example_op_tuples[] = {
{SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP}
};
-</pre><p>
-</p></li><li><p>
+</pre><ns6:p>
+</ns6:p></li><li><p>
Move the example_op_tuples[] array to the end of the file.
-</p></li><li><p>
+</p></li><li xmlns:ns7=""><ns7:p>
Add the init_module() function at the end of the file.
e.g.
-</p><pre class="programlisting">
+</ns7:p><pre class="programlisting">
NTSTATUS init_module(void)
{
return smb_register_vfs(SMB_VFS_INTERFACE_VERSION,&quot;example&quot;,example_op_tuples);
}
-</pre><p>
-</p></li><li><p>
+</pre><ns7:p>
+</ns7:p></li><li xmlns:ns8=""><ns8:p>
Check if your vfs_init() function does more then just prepare the vfs_ops structs or
remember the struct smb_vfs_handle_struct.
-</p><table class="simplelist" border="0" summary="Simple list"><tr><td>If NOT you can remove the vfs_init() function.</td></tr><tr><td>If YES decide if you want to move the code to the example_connect() operation or to the init_module(). And then remove vfs_init().
- e.g. a debug class registration should go into init_module() and the allocation of private data should go to example_connect().</td></tr></table><p>
-</p></li><li><p>
+</ns8:p><table class="simplelist" border="0" summary="Simple list"><tr><td>If NOT you can remove the vfs_init() function.</td></tr><tr><td>If YES decide if you want to move the code to the example_connect() operation or to the init_module(). And then remove vfs_init().
+ e.g. a debug class registration should go into init_module() and the allocation of private data should go to example_connect().</td></tr></table><ns8:p>
+</ns8:p></li><li xmlns:ns9=""><ns9:p>
(Only for 3.0alpha* modules)
Check if your vfs_done() function contains needed code.
-</p><table class="simplelist" border="0" summary="Simple list"><tr><td>If NOT you can remove the vfs_done() function.</td></tr><tr><td>If YES decide if you can move the code to the example_disconnect() operation. Otherwise register a SMB_EXIT_EVENT with smb_register_exit_event(); (Described in the <a href="#modules" title="Chapter 14. Modules">modules section</a>) And then remove vfs_done(). e.g. the freeing of private data should go to example_disconnect().
-</td></tr></table><p>
-</p></li><li><p>
+</ns9:p><table class="simplelist" border="0" summary="Simple list"><tr><td>If NOT you can remove the vfs_done() function.</td></tr><tr><td>If YES decide if you can move the code to the example_disconnect() operation. Otherwise register a SMB_EXIT_EVENT with smb_register_exit_event(); (Described in the <a href="#modules" title="Chapter 14. Modules">modules section</a>) And then remove vfs_done(). e.g. the freeing of private data should go to example_disconnect().
+</td></tr></table><ns9:p>
+</ns9:p></li><li xmlns:ns10=""><ns10:p>
Check if you have any global variables left.
Decide if it wouldn't be better to have this data on a connection basis.
-</p><table class="simplelist" border="0" summary="Simple list"><tr><td>If NOT leave them as they are. (e.g. this could be the variable for the private debug class.)</td></tr><tr><td>If YES pack all this data into a struct. You can use handle-&gt;data to point to such a struct on a per connection basis.</td></tr></table><p>
+</ns10:p><table class="simplelist" border="0" summary="Simple list"><tr><td>If NOT leave them as they are. (e.g. this could be the variable for the private debug class.)</td></tr><tr><td>If YES pack all this data into a struct. You can use handle-&gt;data to point to such a struct on a per connection basis.</td></tr></table><ns10:p>
e.g. if you have such a struct:
-</p><pre class="programlisting">
+</ns10:p><pre class="programlisting">
struct example_privates {
char *some_string;
int db_connection;
};
-</pre><p>
+</pre><ns10:p>
first way of doing it:
-</p><pre class="programlisting">
+</ns10:p><pre class="programlisting">
static int example_connect(vfs_handle_struct *handle,
connection_struct *conn, const char *service,
const char* user)
@@ -2485,9 +2485,9 @@ static int example_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
return SMB_VFS_NEXT_CLOSE(handle, fsp, fd);
}
-</pre><p>
+</pre><ns10:p>
second way of doing it:
-</p><pre class="programlisting">
+</ns10:p><pre class="programlisting">
static void free_example_privates(void **datap)
{
struct example_privates *data = (struct example_privates *)*datap;
@@ -2543,10 +2543,10 @@ static int example_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
/* do something here...*/
DEBUG(0,(&quot;some_string: %s\n&quot;,data-&gt;some_string));
- return VFS_NEXT_CLOSE(handle, fsp, fd);
+ return SMB_VFS_NEXT_CLOSE(handle, fsp, fd);
}
-</pre><p>
-</p></li><li><p>
+</pre><ns10:p>
+</ns10:p></li><li><p>
To make it easy to build 3rd party modules it would be usefull to provide
configure.in, (configure), install.sh and Makefile.in with the module.
(Take a look at the example in <tt class="filename">examples/VFS</tt>.)
@@ -2559,21 +2559,21 @@ give you more warnings.
The idea is that you can extend this
<tt class="filename">configure.in</tt> and <tt class="filename">Makefile.in</tt> scripts
for your module.
-</p></li><li><p>
+</p></li><li xmlns:ns11=""><ns11:p>
Compiling &amp; Testing...
-</p><table class="simplelist" border="0" summary="Simple list"><tr><td><b class="userinput"><tt>./configure <tt class="option">--enable-developer</tt></tt></b> ...</td></tr><tr><td><b class="userinput"><tt>make</tt></b></td></tr><tr><td>Try to fix all compiler warnings</td></tr><tr><td><b class="userinput"><tt>make</tt></b></td></tr><tr><td>Testing, Testing, Testing ...</td></tr></table><p>
-</p></li></ol></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2896037"></a>Some Notes</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2896044"></a>Implement TRANSPARENT functions</h3></div></div><div></div></div><p>
+</ns11:p><table class="simplelist" border="0" summary="Simple list"><tr><td><b class="userinput"><tt>./configure <tt class="option">--enable-developer</tt></tt></b> ...</td></tr><tr><td><b class="userinput"><tt>make</tt></b></td></tr><tr><td>Try to fix all compiler warnings</td></tr><tr><td><b class="userinput"><tt>make</tt></b></td></tr><tr><td>Testing, Testing, Testing ...</td></tr></table><ns11:p>
+</ns11:p></li></ol></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2893946"></a>Some Notes</h2></div></div><div></div></div><div xmlns:ns12="" class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2893953"></a>Implement TRANSPARENT functions</h3></div></div><div></div></div><ns12:p>
Avoid writing functions like this:
-</p><pre class="programlisting">
+</ns12:p><pre class="programlisting">
static int example_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
{
return SMB_VFS_NEXT_CLOSE(handle, fsp, fd);
}
-</pre><p>
+</pre><ns12:p>
Overload only the functions you really need to!
-</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2896069"></a>Implement OPAQUE functions</h3></div></div><div></div></div><p>
+</ns12:p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2893976"></a>Implement OPAQUE functions</h3></div></div><div></div></div><p>
If you want to just implement a better version of a
default samba opaque function
(e.g. like a disk_free() function for a special filesystem)
@@ -2593,12 +2593,12 @@ static int example_rename(vfs_handle_struct *handle, connection_struct *conn,
errno = ENOSYS;
return -1;
}
-</pre></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Packaging"></a>Chapter 17. Notes to packagers</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3></div></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2894645">Versioning</a></dt><dt><a href="#id2894678">Modules</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2894645"></a>Versioning</h2></div></div><div></div></div><p>Please, please update the version number in
+</pre></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="Packaging"></a>Chapter 17. Notes to packagers</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3></div></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2894041">Versioning</a></dt><dt><a href="#id2894070">Modules</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2894041"></a>Versioning</h2></div></div><div></div></div><p>Please, please update the version number in
<tt class="filename">source/include/version.h</tt> to include the versioning of your package. This makes it easier to distinguish standard samba builds
from custom-build samba builds (distributions often patch packages). For
example, a good version would be: </p><pre class="programlisting">
Version 2.999+3.0.alpha21-5 for Debian
-</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2894678"></a>Modules</h2></div></div><div></div></div><p>Samba now has support for building parts of samba as plugins. This
+</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2894070"></a>Modules</h2></div></div><div></div></div><p>Samba now has support for building parts of samba as plugins. This
makes it possible to, for example, put ldap or mysql support in a seperate
package, thus making it possible to have a normal samba package not
depending on ldap or mysql. To build as much parts of samba
@@ -2621,8 +2621,8 @@ as a plugin, run: </p><pre class="programlisting">
e.g. files generated by <b class="userinput"><tt>diff -u</tt></b>.
</p><p>If you are modifying a copy of samba you retrieved from CVS,
you can easily generate a diff file of these changes by running
- <b class="userinput"><tt>cvs diff -u</tt></b>.</p></dd><dt><span class="term">Points of attention when modifying samba source code</span></dt><dd><p>
- </p><table class="simplelist" border="0" summary="Simple list"><tr><td>Don't simply copy code from other places and modify it until it
+ <b class="userinput"><tt>cvs diff -u</tt></b>.</p></dd><dt><span class="term">Points of attention when modifying samba source code</span></dt><dd xmlns:ns13=""><ns13:p>
+ </ns13:p><table class="simplelist" border="0" summary="Simple list"><tr><td>Don't simply copy code from other places and modify it until it
works. Code needs to be clean and logical. Duplicate
code is to be avoided.</td></tr><tr><td>Test your patch. It might take a while before one of us looks
at your patch so it will take longer before your patch when your patch
@@ -2630,8 +2630,8 @@ as a plugin, run: </p><pre class="programlisting">
it harder to read, understand and test the patch. You might
also risk not getting a good patch committed because you mixed it
with one that had issues. </td></tr><tr><td>Make sure your patch complies to the samba coding style as
- suggested in the coding-suggestions chapter. </td></tr></table><p>
- </p></dd><dt><span class="term">Sending in bugfixes</span></dt><dd><p>Bugfixes to bugs in samba should be submitted to samba's
+ suggested in the coding-suggestions chapter. </td></tr></table><ns13:p>
+ </ns13:p></dd><dt><span class="term">Sending in bugfixes</span></dt><dd><p>Bugfixes to bugs in samba should be submitted to samba's
<a href="https://bugzilla.samba.org/" target="_top">bugzilla system</a>,
along with a description of the bug.
</p></dd><dt><span class="term">Sending in feature patches</span></dt><dd><p>Send feature patches along with a description of what the