diff options
author | Gerald Carter <jerry@samba.org> | 2002-09-30 20:18:12 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2002-09-30 20:18:12 +0000 |
commit | d64e0e9772e3fd1b4c5af2ff8fd6aa0b89f0fcb6 (patch) | |
tree | fe29485235e3050a4a1236eb8b01646b48ffc593 /docs/htmldocs | |
parent | ae61c575babe9488b190481e8f3a10754c876f06 (diff) | |
download | samba-d64e0e9772e3fd1b4c5af2ff8fd6aa0b89f0fcb6.tar.gz samba-d64e0e9772e3fd1b4c5af2ff8fd6aa0b89f0fcb6.tar.bz2 samba-d64e0e9772e3fd1b4c5af2ff8fd6aa0b89f0fcb6.zip |
* add the Developers guide to the repository
* fix syntax errors in developer's docs
* update Makefile.in to place HTML files in htmldocs & text
files in textdocs/
(This used to be commit cb96e1a1d9a07314bb60e431484cfd05aef83de6)
Diffstat (limited to 'docs/htmldocs')
-rw-r--r-- | docs/htmldocs/Samba-Developers-Guide.html | 7734 | ||||
-rw-r--r-- | docs/htmldocs/Samba-HOWTO-Collection.html | 3571 |
2 files changed, 9721 insertions, 1584 deletions
diff --git a/docs/htmldocs/Samba-Developers-Guide.html b/docs/htmldocs/Samba-Developers-Guide.html new file mode 100644 index 0000000000..f7a452bfc5 --- /dev/null +++ b/docs/htmldocs/Samba-Developers-Guide.html @@ -0,0 +1,7734 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> +<HTML +><HEAD +><TITLE +>SAMBA Developers Guide</TITLE +><META +NAME="GENERATOR" +CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ +"></HEAD +><BODY +CLASS="BOOK" +BGCOLOR="#FFFFFF" +TEXT="#000000" +LINK="#0000FF" +VLINK="#840084" +ALINK="#0000FF" +><DIV +CLASS="BOOK" +><A +NAME="SAMBA-DEVELOPER-DOCUMENTATION"><DIV +CLASS="TITLEPAGE" +><H1 +CLASS="TITLE" +><A +NAME="SAMBA-DEVELOPER-DOCUMENTATION">SAMBA Developers Guide</H1 +><H3 +CLASS="AUTHOR" +><A +NAME="AEN4">SAMBA Team</H3 +><HR></DIV +><HR><H1 +><A +NAME="AEN8">Abstract</H1 +><P +><I +CLASS="EMPHASIS" +>Last Update</I +> : Mon aug 26 12:41:19 CEST 2002</P +><P +>This book is a collection of documents that might be useful for +people developing samba or those interested in doing so. +It's nothing more than a collection of documents written by samba developers about +the internals of various parts of samba and the SMB protocol. It's still incomplete. +The most recent version of this document +can be found at <A +HREF="http://devel.samba.org/" +TARGET="_top" +>http://devel.samba.org/</A +>. +Please send updates to <A +HREF="mailto:jelmer@samba.org" +TARGET="_top" +>jelmer@samba.org</A +>.</P +><P +>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 +CLASS="TOC" +><DL +><DT +><B +>Table of Contents</B +></DT +><DT +><A +HREF="#NETBIOS" +>Definition of NetBIOS Protocol and Name Resolution Modes</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN24" +>NETBIOS</A +></DT +><DT +><A +HREF="#AEN35" +>BROADCAST NetBIOS</A +></DT +><DT +><A +HREF="#AEN39" +>NBNS NetBIOS</A +></DT +></DL +></DD +><DT +><A +HREF="#ARCHITECTURE" +>Samba Architecture</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN54" +>Introduction</A +></DT +><DT +><A +HREF="#AEN65" +>Multithreading and Samba</A +></DT +><DT +><A +HREF="#AEN70" +>Threading smbd</A +></DT +><DT +><A +HREF="#AEN86" +>Threading nmbd</A +></DT +><DT +><A +HREF="#AEN92" +>nbmd Design</A +></DT +></DL +></DD +><DT +><A +HREF="#DEBUG" +>The samba DEBUG system</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN103" +>New Output Syntax</A +></DT +><DT +><A +HREF="#AEN128" +>The DEBUG() Macro</A +></DT +><DT +><A +HREF="#AEN151" +>The DEBUGADD() Macro</A +></DT +><DT +><A +HREF="#AEN159" +>The DEBUGLVL() Macro</A +></DT +><DT +><A +HREF="#AEN179" +>New Functions</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN181" +>dbgtext()</A +></DT +><DT +><A +HREF="#AEN184" +>dbghdr()</A +></DT +><DT +><A +HREF="#AEN188" +>format_debug_text()</A +></DT +></DL +></DD +></DL +></DD +><DT +><A +HREF="#CODINGSUGGESTIONS" +>Coding Suggestions</A +></DT +><DT +><A +HREF="#INTERNALS" +>Samba Internals</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN284" +>Character Handling</A +></DT +><DT +><A +HREF="#AEN288" +>The new functions</A +></DT +><DT +><A +HREF="#AEN317" +>Macros in byteorder.h</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN320" +>CVAL(buf,pos)</A +></DT +><DT +><A +HREF="#AEN323" +>PVAL(buf,pos)</A +></DT +><DT +><A +HREF="#AEN326" +>SCVAL(buf,pos,val)</A +></DT +><DT +><A +HREF="#AEN329" +>SVAL(buf,pos)</A +></DT +><DT +><A +HREF="#AEN332" +>IVAL(buf,pos)</A +></DT +><DT +><A +HREF="#AEN335" +>SVALS(buf,pos)</A +></DT +><DT +><A +HREF="#AEN338" +>IVALS(buf,pos)</A +></DT +><DT +><A +HREF="#AEN341" +>SSVAL(buf,pos,val)</A +></DT +><DT +><A +HREF="#AEN344" +>SIVAL(buf,pos,val)</A +></DT +><DT +><A +HREF="#AEN347" +>SSVALS(buf,pos,val)</A +></DT +><DT +><A +HREF="#AEN350" +>SIVALS(buf,pos,val)</A +></DT +><DT +><A +HREF="#AEN353" +>RSVAL(buf,pos)</A +></DT +><DT +><A +HREF="#AEN356" +>RIVAL(buf,pos)</A +></DT +><DT +><A +HREF="#AEN359" +>RSSVAL(buf,pos,val)</A +></DT +><DT +><A +HREF="#AEN362" +>RSIVAL(buf,pos,val)</A +></DT +></DL +></DD +><DT +><A +HREF="#AEN365" +>LAN Manager Samba API</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN371" +>Parameters</A +></DT +><DT +><A +HREF="#AEN406" +>Return value</A +></DT +></DL +></DD +><DT +><A +HREF="#AEN420" +>Code character table</A +></DT +></DL +></DD +><DT +><A +HREF="#PARSING" +>The smb.conf file</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN451" +>Lexical Analysis</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN472" +>Handling of Whitespace</A +></DT +><DT +><A +HREF="#AEN484" +>Handling of Line Continuation</A +></DT +><DT +><A +HREF="#AEN495" +>Line Continuation Quirks</A +></DT +></DL +></DD +><DT +><A +HREF="#AEN515" +>Syntax</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN530" +>About params.c</A +></DT +></DL +></DD +></DL +></DD +><DT +><A +HREF="#UNIX-SMB" +>NetBIOS in a Unix World</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN540" +>Introduction</A +></DT +><DT +><A +HREF="#AEN544" +>Usernames</A +></DT +><DT +><A +HREF="#AEN552" +>File Ownership</A +></DT +><DT +><A +HREF="#AEN557" +>Passwords</A +></DT +><DT +><A +HREF="#AEN563" +>Locking</A +></DT +><DT +><A +HREF="#AEN570" +>Deny Modes</A +></DT +><DT +><A +HREF="#AEN574" +>Trapdoor UIDs</A +></DT +><DT +><A +HREF="#AEN578" +>Port numbers</A +></DT +><DT +><A +HREF="#AEN583" +>Protocol Complexity</A +></DT +></DL +></DD +><DT +><A +HREF="#TRACING" +>Tracing samba system calls</A +></DT +><DT +><A +HREF="#NTDOMAIN" +>NT Domain RPC's</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN651" +>Introduction</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN687" +>Sources</A +></DT +><DT +><A +HREF="#AEN694" +>Credits</A +></DT +></DL +></DD +><DT +><A +HREF="#AEN701" +>Notes and Structures</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN703" +>Notes</A +></DT +><DT +><A +HREF="#AEN716" +>Enumerations</A +></DT +><DT +><A +HREF="#AEN774" +>Structures</A +></DT +></DL +></DD +><DT +><A +HREF="#AEN1570" +>MSRPC over Transact Named Pipe</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN1573" +>MSRPC Pipes</A +></DT +><DT +><A +HREF="#AEN1587" +>Header</A +></DT +><DT +><A +HREF="#AEN1841" +>Tail</A +></DT +><DT +><A +HREF="#AEN1853" +>RPC Bind / Bind Ack</A +></DT +><DT +><A +HREF="#AEN1897" +>NTLSA Transact Named Pipe</A +></DT +><DT +><A +HREF="#AEN1938" +>LSA Open Policy</A +></DT +><DT +><A +HREF="#AEN1972" +>LSA Query Info Policy</A +></DT +><DT +><A +HREF="#AEN2000" +>LSA Enumerate Trusted Domains</A +></DT +><DT +><A +HREF="#AEN2024" +>LSA Open Secret</A +></DT +><DT +><A +HREF="#AEN2053" +>LSA Close</A +></DT +><DT +><A +HREF="#AEN2070" +>LSA Lookup SIDS</A +></DT +><DT +><A +HREF="#AEN2129" +>LSA Lookup Names</A +></DT +></DL +></DD +><DT +><A +HREF="#AEN2192" +>NETLOGON rpc Transact Named Pipe</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN2231" +>LSA Request Challenge</A +></DT +><DT +><A +HREF="#AEN2266" +>LSA Authenticate 2</A +></DT +><DT +><A +HREF="#AEN2305" +>LSA Server Password Set</A +></DT +><DT +><A +HREF="#AEN2334" +>LSA SAM Logon</A +></DT +><DT +><A +HREF="#AEN2358" +>LSA SAM Logoff</A +></DT +></DL +></DD +><DT +><A +HREF="#AEN2381" +>\\MAILSLOT\NET\NTLOGON</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN2385" +>Query for PDC</A +></DT +><DT +><A +HREF="#AEN2459" +>SAM Logon</A +></DT +></DL +></DD +><DT +><A +HREF="#AEN2549" +>SRVSVC Transact Named Pipe</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN2561" +>Net Share Enum</A +></DT +><DT +><A +HREF="#AEN2622" +>Net Server Get Info</A +></DT +></DL +></DD +><DT +><A +HREF="#AEN2653" +>Cryptographic side of NT Domain Authentication</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN2655" +>Definitions</A +></DT +><DT +><A +HREF="#AEN2698" +>Protocol</A +></DT +><DT +><A +HREF="#AEN2708" +>Comments</A +></DT +></DL +></DD +><DT +><A +HREF="#AEN2715" +>SIDs and RIDs</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN2723" +>Well-known SIDs</A +></DT +><DT +><A +HREF="#AEN2811" +>Well-known RIDS</A +></DT +></DL +></DD +></DL +></DD +></DL +></DIV +><DIV +CLASS="CHAPTER" +><HR><H1 +><A +NAME="NETBIOS">Definition of NetBIOS Protocol and Name Resolution Modes</H1 +><DIV +CLASS="SECT1" +><H2 +CLASS="SECT1" +><A +NAME="AEN24">NETBIOS</H2 +><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 +rfc1001.txt and rfc1002.txt.</P +><P +> +NetBEUI is a raw NetBIOS frame protocol implementation that allows NetBIOS +datagrams to be sent out over the 'wire' embedded within LLC frames. +NetBEUI is not required when using NetBIOS over TCP/IP protocols and it +is preferable NOT to install NetBEUI if it can be avoided.</P +><P +> +IPX/SPX is also not required when using NetBIOS over TCP/IP, and it is +preferable NOT to install the IPX/SPX transport unless you are using Novell +servers. At the very least, it is recommended that you do not install +'NetBIOS over IPX/SPX'.</P +><P +>[When installing Windows 95, you will find that NetBEUI and IPX/SPX are +installed as the default protocols. This is because they are the simplest +to manage: no Windows 95 user-configuration is required].</P +><P +> +NetBIOS applications (such as samba) offer their services (for example, +SMB file and print sharing) on a NetBIOS name. They must claim this name +on the network before doing so. The NetBIOS session service will then +accept connections on the application's behalf (on the NetBIOS name +claimed by the application). A NetBIOS session between the application +and the client can then commence.</P +><P +> +NetBIOS names consist of 15 characters plus a 'type' character. This is +similar, in concept, to an IP address and a TCP port number, respectively. +A NetBIOS-aware application on a host will offer different services under +different NetBIOS name types, just as a host will offer different TCP/IP +services on different port numbers.</P +><P +> +NetBIOS names must be claimed on a network, and must be defended. The use +of NetBIOS names is most suitable on a single subnet; a Local Area Network +or a Wide Area Network.</P +><P +> +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN35">BROADCAST NetBIOS</H2 +><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 +SMB file/print sharing: see cifs4.txt) working on a LAN or WAN is to make +your routers forward all broadcast packets from TCP/IP ports 137, 138 and 139.</P +><P +> +This, however, is not recommended. If you have a large LAN or WAN, you will +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN39">NBNS NetBIOS</H2 +><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 +with certain NetBIOS names in order to make it useful. (for example, it +deals with the registration of <1c> <1d> <1e> names all in different ways. +I recommend the reading of the Microsoft WINS Server Help files for full +details).</P +><P +> +The use of a WINS server cuts down on broadcast network traffic for +NetBIOS name resolution. It has the effect of pulling all the broadcast +isolated subnets together into a single NetBIOS scope, across your LAN +or WAN, while avoiding the use of TCP/IP broadcast packets.</P +><P +>When you have a WINS server on your LAN, WINS clients will be able to +contact the WINS server to resolve NetBIOS names. Note that only those +WINS clients that have registered with the same WINS server will be +visible. The WINS server _can_ have static NetBIOS entries added to its +database (usually for security reasons you might want to consider putting +your domain controllers or other important servers as static entries, +but you should not rely on this as your sole means of security), but for +the most part, NetBIOS names are registered dynamically.</P +><P +>This provides some confusion for lots of people, and is worth mentioning +here: a Browse Server is NOT a WINS Server, even if these services are +implemented in the same application. A Browse Server _needs_ a WINS server +because a Browse Server is a WINS client, which is _not_ the same thing].</P +><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 +SMB file/print sharing: see cifs6.txt) working on a LAN or WAN is to make +your routers forward all broadcast packets from TCP/IP ports 137, 138 and 139. +You will find, however, if you do this on a large LAN or a WAN, that your +network is completely swamped by NetBIOS and browsing packets, which is why +WINS was developed to minimise the necessity of broadcast traffic.</P +><P +> +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" +><HR><H1 +><A +NAME="ARCHITECTURE">Samba Architecture</H1 +><DIV +CLASS="SECT1" +><H2 +CLASS="SECT1" +><A +NAME="AEN54">Introduction</H2 +><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 +and the constraints imposed by the very messy SMB and CIFS +protocol. </P +><P +>It also tries to answer some of the frequently asked questions such as:</P +><P +></P +><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 +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN65">Multithreading and Samba</H2 +><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. </P +><P +>The short version is that smbd is not multithreaded, and alternative +servers that take this approach under Unix (such as Syntax, at the +time of writing) suffer tremendous performance penalties and are less +robust. nmbd is not threaded either, but this is because it is not +possible to do it while keeping code consistent and portable across 35 +or more platforms. (This drawback also applies to threading smbd.)</P +><P +>The longer versions is that there are very good reasons for not making +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN70">Threading smbd</H2 +><P +>A few problems that would arise from a threaded smbd are:</P +><P +></P +><OL +TYPE="1" +><LI +><P +> It's not only to create threads instead of processes, but you + must care about all variables if they have to be thread specific + (currently they would be global).</P +></LI +><LI +><P +> if one thread dies (eg. a seg fault) then all threads die. We can + immediately throw robustness out the window.</P +></LI +><LI +><P +> many of the system calls we make are blocking. Non-blocking + equivalents of many calls are either not available or are awkward (and + slow) to use. So while we block in one thread all clients are + waiting. Imagine if one share is a slow NFS filesystem and the others + are fast, we will end up slowing all clients to the speed of NFS.</P +></LI +><LI +><P +> you can't run as a different uid in different threads. This means + we would have to switch uid/gid on _every_ SMB packet. It would be + horrendously slow.</P +></LI +><LI +><P +> the per process file descriptor limit would mean that we could only + support a limited number of clients.</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 +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN86">Threading nmbd</H2 +><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 +ansi-C constructs (using setjmp and longjmp). Unfortunately some OSes +defeat this by restricting longjmp to calling addresses that are +shallower than the current address on the stack (apparently AIX does +this). This makes a truly portable threads library impossible. So to +support all our current platforms we would have to code nmbd both with +and without threads, and as the real aim of threads is to make the +code clearer we would not have gained anything. (it is a myth that +threads make things faster. threading is like recursion, it can make +things clear but the same thing can always be done faster by some +other method)</P +><P +>Chris tried to spec out a general design that would abstract threading +vs separate processes (vs other methods?) and make them accessible +through some general API. This doesn't work because of the data +sharing requirements of the protocol (packets in the future depending +on packets now, etc.) At least, the code would work but would be very +clumsy, and besides the fork() type model would never work on Unix. (Is there an OS that it would work on, for nmbd?)</P +><P +>A fork() is cheap, but not nearly cheap enough to do on every UDP +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN92">nbmd Design</H2 +><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 +queuing system that keeps state information on each packet. The +first version used a single structure which was used by all the +pending states. As the initialisation of this structure was +done by adding arguments, as the functionality developed, it got +pretty messy. So, it was replaced with a higher-order function +and a pointer to a user-defined memory block. This suddenly +made things much simpler: large numbers of functions could be +made static, and modularised. This is the same principle as used +in NT's kernel, and achieves the same effect as threads, but in +a single process.</P +><P +>Then Jeremy rewrote nmbd. The packet data in nmbd isn't what's on the +wire. It's a nice format that is very amenable to processing but still +keeps the idea of a distinct packet. See "struct packet_struct" 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" +><HR><H1 +><A +NAME="DEBUG">The samba DEBUG system</H1 +><DIV +CLASS="SECT1" +><H2 +CLASS="SECT1" +><A +NAME="AEN103">New Output Syntax</H2 +><P +> The syntax of a debugging log file is represented as:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> >debugfile< :== { >debugmsg< } + + >debugmsg< :== >debughdr< '\n' >debugtext< + + >debughdr< :== '[' TIME ',' LEVEL ']' FILE ':' [FUNCTION] '(' LINE ')' + + >debugtext< :== { >debugline< } + + >debugline< :== TEXT '\n'</PRE +></TD +></TR +></TABLE +></P +><P +>TEXT is a string of characters excluding the newline character.</P +><P +>LEVEL is the DEBUG level of the message (an integer in the range + 0..10).</P +><P +>TIME is a timestamp.</P +><P +>FILE is the name of the file from which the debug message was +generated.</P +><P +>FUNCTION is the function from which the debug message was generated.</P +><P +>LINE is the line number of the debug statement that generated the +message.</P +><P +>Basically, what that all means is:</P +><P +></P +><OL +TYPE="1" +><LI +><P +>A debugging log file is made up of debug messages.</P +></LI +><LI +><P +>Each debug message is made up of a header and text. The header is +separated from the text by a newline.</P +></LI +><LI +><P +>The header begins with the timestamp and debug level of the +message enclosed in brackets. The filename, function, and line +number at which the message was generated follow. The filename is +terminated by a colon, and the function name is terminated by the +parenthesis which contain the line number. Depending upon the +compiler, the function name may be missing (it is generated by the +__FUNCTION__ macro, which is not universally implemented, dangit).</P +></LI +><LI +><P +>The message text is made up of zero or more lines, each terminated +by a newline.</P +></LI +></OL +><P +>Here's some example output:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> [1998/08/03 12:55:25, 1] nmbd.c:(659) + Netbios nameserver version 1.9.19-prealpha started. + Copyright Andrew Tridgell 1994-1997 + [1998/08/03 12:55:25, 3] loadparm.c:(763) + Initializing global parameters</PRE +></TD +></TR +></TABLE +></P +><P +>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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN128">The DEBUG() Macro</H2 +><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.</P +><P +>That's confusing.</P +><P +>Here's an example which may help a bit. If you would write</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>printf( "This is a %s message.\n", "debug" );</PRE +></TD +></TR +></TABLE +></P +><P +>to send the output to stdout, then you would write</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>DEBUG( 0, ( "This is a %s message.\n", "debug" ) );</PRE +></TD +></TR +></TABLE +></P +><P +>to send the output to the debug file. All of the normal printf() +formatting escapes work.</P +><P +>Note that in the above example the DEBUG message level is set to 0. +Messages at level 0 always print. Basically, if the message level is +less than or equal to the global value DEBUGLEVEL, then the DEBUG +statement is processed.</P +><P +>The output of the above example would be something like:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> [1998/07/30 16:00:51, 0] file.c:function(128) + This is a debug message.</PRE +></TD +></TR +></TABLE +></P +><P +>Each call to DEBUG() creates a new header *unless* the output produced +by the previous call to DEBUG() did not end with a '\n'. Output to the +debug file is passed through a formatting buffer which is flushed +every time a newline is encountered. If the buffer is not empty when +DEBUG() is called, the new input is simply appended.</P +><P +>...but that's really just a Kludge. It was put in place because +DEBUG() has been used to write partial lines. Here's a simple (dumb) +example of the kind of thing I'm talking about:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> DEBUG( 0, ("The test returned " ) ); + if( test() ) + DEBUG(0, ("True") ); + else + DEBUG(0, ("False") ); + DEBUG(0, (".\n") );</PRE +></TD +></TR +></TABLE +></P +><P +>Without the format buffer, the output (assuming test() returned true) +would look like this:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> [1998/07/30 16:00:51, 0] file.c:function(256) + The test returned + [1998/07/30 16:00:51, 0] file.c:function(258) + True + [1998/07/30 16:00:51, 0] file.c:function(261) + .</PRE +></TD +></TR +></TABLE +></P +><P +>Which isn't much use. The format buffer kludge fixes this problem.</P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN151">The DEBUGADD() Macro</H2 +><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 +message even if the format buffer is empty. The syntax of the +DEBUGADD() macro is the same as that of the DEBUG() macro.</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> DEBUG( 0, ("This is the first line.\n" ) ); + DEBUGADD( 0, ("This is the second line.\nThis is the third line.\n" ) );</PRE +></TD +></TR +></TABLE +></P +><P +>Produces</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> [1998/07/30 16:00:51, 0] file.c:function(512) + This is the first line. + This is the second line. + This is the third line.</PRE +></TD +></TR +></TABLE +></P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN159">The DEBUGLVL() Macro</H2 +><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:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> DEBUG(3,("send_local_master_announcement: type %x for name %s on subnet %s for workgroup %s\n", + type, global_myname, subrec->subnet_name, work->work_group));</PRE +></TD +></TR +></TABLE +></P +><P +>One solution to this is to break it down using DEBUG() and DEBUGADD(), +as follows:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> DEBUG( 3, ( "send_local_master_announcement: " ) ); + DEBUGADD( 3, ( "type %x for name %s ", type, global_myname ) ); + DEBUGADD( 3, ( "on subnet %s ", subrec->subnet_name ) ); + DEBUGADD( 3, ( "for workgroup %s\n", work->work_group ) );</PRE +></TD +></TR +></TABLE +></P +><P +>A similar, but arguably nicer approach is to use the DEBUGLVL() macro. +This macro returns True if the message level is less than or equal to +the global DEBUGLEVEL value, so:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> if( DEBUGLVL( 3 ) ) + { + dbgtext( "send_local_master_announcement: " ); + dbgtext( "type %x for name %s ", type, global_myname ); + dbgtext( "on subnet %s ", subrec->subnet_name ); + dbgtext( "for workgroup %s\n", work->work_group ); + }</PRE +></TD +></TR +></TABLE +></P +><P +>(The dbgtext() function is explained below.)</P +><P +>There are a few advantages to this scheme:</P +><P +></P +><OL +TYPE="1" +><LI +><P +>The test is performed only once.</P +></LI +><LI +><P +>You can allocate variables off of the stack that will only be used +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 +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN179">New Functions</H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN181">dbgtext()</H3 +><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 +input is printed into a buffer using the vslprintf() function, +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" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN184">dbghdr()</H3 +><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 +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" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN188">format_debug_text()</H3 +><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 +written to the debug file via the Debug1() function, and the +buffer is reset. This allows us to add the indentation at the +beginning of each line of the message body, and also ensures +that the output is written a line at a time (which cleans up +syslog output).</P +></DIV +></DIV +></DIV +><DIV +CLASS="CHAPTER" +><HR><H1 +><A +NAME="CODINGSUGGESTIONS">Coding Suggestions</H1 +><P +>So you want to add code to Samba ...</P +><P +>One of the daunting tasks facing a programmer attempting to write code for +Samba is understanding the various coding conventions used by those most +active in the project. These conventions were mostly unwritten and helped +improve either the portability, stability or consistency of the code. This +document will attempt to document a few of the more important coding +practices used at this time on the Samba project. The coding practices are +expected to change slightly over time, and even to grow as more is learned +about obscure portability considerations. Two existing documents +<TT +CLASS="FILENAME" +>samba/source/internals.doc</TT +> and +<TT +CLASS="FILENAME" +>samba/source/architecture.doc</TT +> provide +additional information.</P +><P +>The loosely related question of coding style is very personal and this +document does not attempt to address that subject, except to say that I +have observed that eight character tabs seem to be preferred in Samba +source. If you are interested in the topic of coding style, two oft-quoted +documents are:</P +><P +><A +HREF="http://lxr.linux.no/source/Documentation/CodingStyle" +TARGET="_top" +>http://lxr.linux.no/source/Documentation/CodingStyle</A +></P +><P +><A +HREF="http://www.fsf.org/prep/standards_toc.html" +TARGET="_top" +>http://www.fsf.org/prep/standards_toc.html</A +></P +><P +>But note that coding style in Samba varies due to the many different +programmers who have contributed.</P +><P +>Following are some considerations you should use when adding new code to +Samba. First and foremost remember that:</P +><P +>Portability is a primary consideration in adding function, as is network +compatability with de facto, existing, real world CIFS/SMB implementations. +There are lots of platforms that Samba builds on so use caution when adding +a call to a library function that is not invoked in existing Samba code. +Also note that there are many quite different SMB/CIFS clients that Samba +tries to support, not all of which follow the SNIA CIFS Technical Reference +(or the earlier Microsoft reference documents or the X/Open book on the SMB +Standard) perfectly.</P +><P +>Here are some other suggestions:</P +><P +></P +><OL +TYPE="1" +><LI +><P +> use d_printf instead of printf for display text + reason: enable auto-substitution of translated language text </P +></LI +><LI +><P +> use SAFE_FREE instead of free + reason: reduce traps due to null pointers</P +></LI +><LI +><P +> don't use bzero use memset, or ZERO_STRUCT and ZERO_STRUCTP macros + reason: not POSIX</P +></LI +><LI +><P +> don't use strcpy and strlen (use safe_* equivalents) + reason: to avoid traps due to buffer overruns</P +></LI +><LI +><P +> don't use getopt_long, use popt functions instead + reason: portability</P +></LI +><LI +><P +> explicitly add const qualifiers on parm passing in functions where parm + is input only (somewhat controversial but const can be #defined away)</P +></LI +><LI +><P +> when passing a va_list as an arg, or assigning one to another + please use the VA_COPY() macro + reason: on some platforms, va_list is a struct that must be + initialized in each function...can SEGV if you don't.</P +></LI +><LI +><P +> discourage use of threads + reason: portability (also see architecture.doc)</P +></LI +><LI +><P +> don't explicitly include new header files in C files - new h files + should be included by adding them once to includes.h + reason: consistency</P +></LI +><LI +><P +> don't explicitly extern functions (they are autogenerated by + "make proto" into proto.h) + reason: consistency</P +></LI +><LI +><P +> use endian safe macros when unpacking SMBs (see byteorder.h and + internals.doc) + reason: not everyone uses Intel</P +></LI +><LI +><P +> Note Unicode implications of charset handling (see internals.doc). See + pull_* and push_* and convert_string functions. + reason: Internationalization</P +></LI +><LI +><P +> Don't assume English only + reason: See above</P +></LI +><LI +><P +> Try to avoid using in/out parameters (functions that return data which + overwrites input parameters) + reason: Can cause stability problems</P +></LI +><LI +><P +> Ensure copyright notices are correct, don't append Tridge's name to code + that he didn't write. If you did not write the code, make sure that it + can coexist with the rest of the Samba GPLed code.</P +></LI +><LI +><P +> Consider usage of DATA_BLOBs for length specified byte-data. + reason: stability</P +></LI +><LI +><P +> Take advantage of tdbs for database like function + reason: consistency</P +></LI +><LI +><P +> Don't access the SAM_ACCOUNT structure directly, they should be accessed + via pdb_get...() and pdb_set...() functions. + reason: stability, consistency</P +></LI +><LI +><P +> Don't check a password directly against the passdb, always use the + check_password() interface. + reason: long term pluggability</P +></LI +><LI +><P +> Try to use asprintf rather than pstrings and fstrings where possible</P +></LI +><LI +><P +> Use normal C comments / * instead of C++ comments // like + this. Although the C++ comment format is part of the C99 + standard, some older vendor C compilers do not accept it.</P +></LI +><LI +><P +> Try to write documentation for API functions and structures + explaining the point of the code, the way it should be used, and + any special conditions or results. Mark these with a double-star + comment start / ** so that they can be picked up by Doxygen, as in + this file.</P +></LI +><LI +><P +> Keep the scope narrow. This means making functions/variables + static whenever possible. We don't want our namespace + polluted. Each module should have a minimal number of externally + visible functions or variables.</P +></LI +><LI +><P +> Use function pointers to keep knowledge about particular pieces of + code isolated in one place. We don't want a particular piece of + functionality to be spread out across lots of places - that makes + for fragile, hand to maintain code. Instead, design an interface + and use tables containing function pointers to implement specific + functionality. This is particularly important for command + interpreters. </P +></LI +><LI +><P +> Think carefully about what it will be like for someone else to add + to and maintain your code. If it would be hard for someone else to + maintain then do it another way. </P +></LI +></OL +><P +>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" +><HR><H1 +><A +NAME="INTERNALS">Samba Internals</H1 +><DIV +CLASS="SECT1" +><H2 +CLASS="SECT1" +><A +NAME="AEN284">Character Handling</H2 +><P +>This section describes character set handling in Samba, as implemented in +Samba 3.0 and above</P +><P +>In the past Samba had very ad-hoc character set handling. Scattered +throughout the code were numerous calls which converted particular +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN288">The new functions</H2 +><P +>The new system works like this:</P +><P +></P +><OL +TYPE="1" +><LI +><P +> all char* strings inside Samba are "unix" strings. These are + multi-byte strings that are in the charset defined by the "unix + charset" option in smb.conf. </P +></LI +><LI +><P +> there is no single fixed character set for unix strings, but any + character set that is used does need the following properties: + </P +><P +></P +><OL +TYPE="a" +><LI +><P +> must not contain NULLs except for termination + </P +></LI +><LI +><P +> must be 7-bit compatible with C strings, so that a constant + string or character in C will be byte-for-byte identical to the + equivalent string in the chosen character set. + </P +></LI +><LI +><P +> when you uppercase or lowercase a string it does not become + longer than the original string + </P +></LI +><LI +><P +> must be able to correctly hold all characters that your client + will throw at it + </P +></LI +></OL +><P +> For example, UTF-8 is fine, and most multi-byte asian character sets + are fine, but UCS2 could not be used for unix strings as they + contain nulls. + </P +></LI +><LI +><P +> when you need to put a string into a buffer that will be sent on the + wire, or you need a string in a character set format that is + compatible with the clients character set then you need to use a + pull_ or push_ function. The pull_ functions pull a string from a + wire buffer into a (multi-byte) unix string. The push_ functions + push a string out to a wire buffer. </P +></LI +><LI +><P +> the two main pull_ and push_ functions you need to understand are + pull_string and push_string. These functions take a base pointer + that should point at the start of the SMB packet that the string is + in. The functions will check the flags field in this packet to + automatically determine if the packet is marked as a unicode packet, + and they will choose whether to use unicode for this string based on + that flag. You may also force this decision using the STR_UNICODE or + STR_ASCII flags. For use in smbd/ and libsmb/ there are wrapper + functions clistr_ and srvstr_ that call the pull_/push_ functions + with the appropriate first argument. + </P +><P +> You may also call the pull_ascii/pull_ucs2 or push_ascii/push_ucs2 + functions if you know that a particular string is ascii or + unicode. There are also a number of other convenience functions in + charcnv.c that call the pull_/push_ functions with particularly + common arguments, such as pull_ascii_pstring() + </P +></LI +><LI +><P +> The biggest thing to remember is that internal (unix) strings in Samba + may now contain multi-byte characters. This means you cannot assume + that characters are always 1 byte long. Often this means that you will + have to convert strings to ucs2 and back again in order to do some + (seemingly) simple task. For examples of how to do this see functions + like strchr_m(). I know this is very slow, and we will eventually + speed it up but right now we want this stuff correct not fast.</P +></LI +><LI +><P +> all lp_ functions now return unix strings. The magic "DOS" flag on + 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 +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN317">Macros in byteorder.h</H2 +><P +>This section describes the macros defined in byteorder.h. These macros +are used extensively in the Samba code.</P +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN320">CVAL(buf,pos)</H3 +><P +>returns the byte at offset pos within buffer buf as an unsigned character.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN323">PVAL(buf,pos)</H3 +><P +>returns the value of CVAL(buf,pos) cast to type unsigned integer.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN326">SCVAL(buf,pos,val)</H3 +><P +>sets the byte at offset pos within buffer buf to value val.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN329">SVAL(buf,pos)</H3 +><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 "USHORT".</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN332">IVAL(buf,pos)</H3 +><P +>returns the value of the unsigned 32 bit little-endian integer at offset +pos within buffer buf.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN335">SVALS(buf,pos)</H3 +><P +>returns the value of the signed short (16 bit) little-endian integer at +offset pos within buffer buf.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN338">IVALS(buf,pos)</H3 +><P +>returns the value of the signed 32 bit little-endian integer at offset pos +within buffer buf.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN341">SSVAL(buf,pos,val)</H3 +><P +>sets the unsigned short (16 bit) little-endian integer at offset pos within +buffer buf to value val.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN344">SIVAL(buf,pos,val)</H3 +><P +>sets the unsigned 32 bit little-endian integer at offset pos within buffer +buf to the value val.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN347">SSVALS(buf,pos,val)</H3 +><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" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN350">SIVALS(buf,pos,val)</H3 +><P +>sets the signed 32 bit little-endian integer at offset pos withing buffer +buf to the value val.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN353">RSVAL(buf,pos)</H3 +><P +>returns the value of the unsigned short (16 bit) big-endian integer at +offset pos within buffer buf.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN356">RIVAL(buf,pos)</H3 +><P +>returns the value of the unsigned 32 bit big-endian integer at offset +pos within buffer buf.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN359">RSSVAL(buf,pos,val)</H3 +><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 "USHORT".</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN362">RSIVAL(buf,pos,val)</H3 +><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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN365">LAN Manager Samba API</H2 +><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 +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>call_api(int prcnt, int drcnt, int mprcnt, int mdrcnt, + char *param, char *data, char **rparam, char **rdata);</PRE +></TD +></TR +></TABLE +></P +><P +>This function is defined in client.c. It uses an SMB transaction to call a +remote api.</P +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN371">Parameters</H3 +><P +>The parameters are as follows:</P +><P +></P +><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.</P +></LI +><LI +><P +> mprcnt: the maximum number of bytes of parameters which should be returned</P +></LI +><LI +><P +> mdrcnt: the maximum number of bytes of data which should be returned</P +></LI +><LI +><P +> param: a pointer to the parameters to be sent.</P +></LI +><LI +><P +> data: a pointer to the data to be sent.</P +></LI +><LI +><P +> rparam: a pointer to a pointer which will be set to point to the returned + paramters. The caller of call_api() must deallocate this memory.</P +></LI +><LI +><P +> rdata: a pointer to a pointer which will be set to point to the returned + data. The caller of call_api() must deallocate this memory.</P +></LI +></OL +><P +>These are the parameters which you ought to send, in the order of their +appearance in the parameter block:</P +><P +></P +><OL +TYPE="1" +><LI +><P +>An unsigned 16 bit integer API number. You should set this value with +SSVAL(). I do not know where these numbers are described.</P +></LI +><LI +><P +>An ASCIIZ string describing the parameters to the API function as defined +in the LAN Manager documentation. The first parameter, which is the server +name, is ommited. This string is based uppon the API function as described +in the manual, not the data which is actually passed.</P +></LI +><LI +><P +>An ASCIIZ string describing the data structure which ought to be returned.</P +></LI +><LI +><P +>Any parameters which appear in the function call, as defined in the LAN +Manager API documentation, after the "Server" and up to and including the +"uLevel" parameters.</P +></LI +><LI +><P +>An unsigned 16 bit integer which gives the size in bytes of the buffer we +will use to receive the returned array of data structures. Presumably this +should be the same as mdrcnt. This value should be set with SSVAL().</P +></LI +><LI +><P +>An ASCIIZ string describing substructures which should be returned. If no +substructures apply, this string is of zero length.</P +></LI +></OL +><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" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN406">Return value</H3 +><P +>The returned parameters (pointed to by rparam), in their order of appearance +are:</P +><P +></P +><OL +TYPE="1" +><LI +><P +>An unsigned 16 bit integer which contains the API function's return code. +This value should be read with SVAL().</P +></LI +><LI +><P +>An adjustment which tells the amount by which pointers in the returned +data should be adjusted. This value should be read with SVAL(). Basically, +the address of the start of the returned data buffer should have the returned +pointer value added to it and then have this value subtracted from it in +order to obtain the currect offset into the returned data buffer.</P +></LI +><LI +><P +>A count of the number of elements in the array of structures returned. +It is also possible that this may sometimes be the number of bytes returned.</P +></LI +></OL +><P +>When call_api() returns, rparam points to the returned parameters. The +first if these is the result code. It will be zero if the API call +suceeded. This value by be read with "SVAL(rparam,0)".</P +><P +>The second parameter may be read as "SVAL(rparam,2)". It is a 16 bit offset +which indicates what the base address of the returned data buffer was when +it was built on the server. It should be used to correct pointer before +use.</P +><P +>The returned data buffer contains the array of returned data structures. +Note that all pointers must be adjusted before use. The function +fix_char_ptr() in client.c can be used for this purpose.</P +><P +>The third parameter (which may be read as "SVAL(rparam,4)") 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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN420">Code character table</H2 +><P +>Certain data structures are described by means of ASCIIz strings containing +code characters. These are the code characters:</P +><P +></P +><OL +TYPE="1" +><LI +><P +>W a type byte little-endian unsigned integer</P +></LI +><LI +><P +>N a count of substructures which follow</P +></LI +><LI +><P +>D a four byte little-endian unsigned integer</P +></LI +><LI +><P +>B a byte (with optional count expressed as trailing ASCII digits)</P +></LI +><LI +><P +>z a four byte offset to a NULL terminated string</P +></LI +><LI +><P +>l a four byte offset to non-string user data</P +></LI +><LI +><P +>b an offset to data (with count expressed as trailing ASCII digits)</P +></LI +><LI +><P +>r pointer to returned data buffer???</P +></LI +><LI +><P +>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 +CLASS="CHAPTER" +><HR><H1 +><A +NAME="PARSING">The smb.conf file</H1 +><DIV +CLASS="SECT1" +><H2 +CLASS="SECT1" +><A +NAME="AEN451">Lexical Analysis</H2 +><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):</P +><P +></P +><OL +TYPE="1" +><LI +><P +>Blank lines - Lines containing only whitespace.</P +></LI +><LI +><P +>Comment lines - Lines beginning with either a semi-colon or a +pound sign (';' or '#').</P +></LI +><LI +><P +>Section header lines - Lines beginning with an open square bracket ('[').</P +></LI +><LI +><P +>Parameter lines - Lines beginning with any other character. +(The default line type.)</P +></LI +></OL +><P +>The first two are handled exclusively by the lexical analyzer, which +ignores them. The latter two line types are scanned for</P +><P +></P +><OL +TYPE="1" +><LI +><P +> - Section names</P +></LI +><LI +><P +> - Parameter names</P +></LI +><LI +><P +> - Parameter values</P +></LI +></OL +><P +>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" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN472">Handling of Whitespace</H3 +><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.</P +><P +></P +><OL +TYPE="1" +><LI +><P +>The lexical analyzer scans past white space at the beginning of a line.</P +></LI +><LI +><P +>Section and parameter names may contain internal white space. All +whitespace within a name is compressed to a single space character. </P +></LI +><LI +><P +>Internal whitespace within a parameter value is kept verbatim with +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 +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN484">Handling of Line Continuation</H3 +><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.</P +><P +>If the last (non-whitespace) character within a section header or on +a parameter line is a backslash, then the next line will be +(logically) concatonated with the current line by the lexical +analyzer. For example:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> param name = parameter value string \ + with line continuation.</PRE +></TD +></TR +></TABLE +></P +><P +>Would be read as</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> param name = parameter value string with line continuation.</PRE +></TD +></TR +></TABLE +></P +><P +>Note that there are five spaces following the word 'string', +representing the one space between 'string' and '\\' in the top +line, plus the four preceeding the word 'with' in the second line. +(Yes, I'm counting the indentation.)</P +><P +>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" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN495">Line Continuation Quirks</H3 +><P +>Note the following example:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> param name = parameter value string \ + \ + with line continuation.</PRE +></TD +></TR +></TABLE +></P +><P +>The middle line is *not* parsed as a blank line because it is first +concatonated with the top line. The result is</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>param name = parameter value string with line continuation.</PRE +></TD +></TR +></TABLE +></P +><P +>The same is true for comment lines.</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> param name = parameter value string \ + ; comment \ + with a comment.</PRE +></TD +></TR +></TABLE +></P +><P +>This becomes:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>param name = parameter value string ; comment with a comment.</PRE +></TD +></TR +></TABLE +></P +><P +>On a section header line, the closing bracket (']') is considered a +terminating character, and the rest of the line is ignored. The lines</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> [ section name ] garbage \ + param name = value</PRE +></TD +></TR +></TABLE +></P +><P +>are read as</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> [section name] + param name = value</PRE +></TD +></TR +></TABLE +></P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN515">Syntax</H2 +><P +>The syntax of the smb.conf file is as follows:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> <file> :== { <section> } EOF + <section> :== <section header> { <parameter line> } + <section header> :== '[' NAME ']' + <parameter line> :== NAME '=' VALUE NL</PRE +></TD +></TR +></TABLE +></P +><P +>Basically, this means that</P +><P +></P +><OL +TYPE="1" +><LI +><P +> a file is made up of zero or more sections, and is terminated by + an EOF (we knew that).</P +></LI +><LI +><P +> A section is made up of a section header followed by zero or more + parameter lines.</P +></LI +><LI +><P +> A section header is identified by an opening bracket and + terminated by the closing bracket. The enclosed NAME identifies + the section.</P +></LI +><LI +><P +> 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 +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN530">About params.c</H3 +><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" +><HR><H1 +><A +NAME="UNIX-SMB">NetBIOS in a Unix World</H1 +><DIV +CLASS="SECT1" +><H2 +CLASS="SECT1" +><A +NAME="AEN540">Introduction</H2 +><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<->PC +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN544">Usernames</H2 +><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 +(particularly printer operations) without first validating a username +on the server.</P +><P +>Unix security is based around username/password pairs. A unix box +should not allow clients to do any substantive operation without some +sort of validation. </P +><P +>The problem mostly manifests itself when the unix server is in "share +level" security mode. This is the default mode as the alternative +"user level" security mode usually forces a client to connect to the +server as the same user for each connected share, which is +inconvenient in many sites.</P +><P +>In "share level" security the client normally gives a username in the +"session setup" protocol, but does not supply an accompanying +password. The client then connects to resources using the "tree +connect" protocol, and supplies a password. The problem is that the +user on the PC types the username and the password in different +contexts, unaware that they need to go together to give access to the +server. The username is normally the one the user typed in when they +"logged onto" the PC (this assumes Windows for Workgroups). The +password is the one they chose when connecting to the disk or printer.</P +><P +>The user often chooses a totally different username for their login as +for the drive connection. Often they also want to access different +drives as different usernames. The unix server needs some way of +divining the correct username to combine with each password.</P +><P +>Samba tries to avoid this problem using several methods. These succeed +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN552">File Ownership</H2 +><P +>The commonly used SMB protocols have no way of saying "you can't do +that because you don't own the file". They have, in fact, no concept +of file ownership at all.</P +><P +>This brings up all sorts of interesting problems. For example, when +you copy a file to a unix drive, and the file is world writeable but +owned by another user the file will transfer correctly but will +receive the wrong date. This is because the utime() call under unix +only succeeds for the owner of the file, or root, even if the file is +world writeable. For security reasons Samba does all file operations +as the validated user, not root, so the utime() fails. This can stuff +up shared development diectories as programs like "make" will not get +file time comparisons right.</P +><P +>There are several possible solutions to this problem, including +username mapping, and forcing a specific username for particular +shares.</P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN557">Passwords</H2 +><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 +obviously it isn't just the data entry routines that are to blame.</P +><P +>Unix passwords are case sensitive. So if users use mixed case +passwords they are in trouble.</P +><P +>Samba can try to cope with this by either using the "password level" +option which causes Samba to try the offered password with up to the +specified number of case changes, or by using the "password server" +option which allows Samba to do its validation via another machine +(typically a WinNT server).</P +><P +>Samba supports the password encryption method used by SMB +clients. Note that the use of password encryption in Microsoft +networking leads to password hashes that are "plain text equivalent". +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN563">Locking</H2 +><P +>The locking calls available under a DOS/Windows environment are much +richer than those available in unix. This means a unix server (like +Samba) choosing to use the standard fcntl() based unix locking calls +to implement SMB locking has to improvise a bit.</P +><P +>One major problem is that dos locks can be in a 32 bit (unsigned) +range. Unix locking calls are 32 bits, but are signed, giving only a 31 +bit range. Unfortunately OLE2 clients use the top bit to select a +locking range used for OLE semaphores.</P +><P +>To work around this problem Samba compresses the 32 bit range into 31 +bits by appropriate bit shifting. This seems to work but is not +ideal. In a future version a separate SMB lockd may be added to cope +with the problem.</P +><P +>It also doesn't help that many unix lockd daemons are very buggy and +crash at the slightest provocation. They normally go mostly unused in +a unix environment because few unix programs use byte range +locking. The stress of huge numbers of lock requests from dos/windows +clients can kill the daemon on some systems.</P +><P +>The second major problem is the "opportunistic locking" requested by +some clients. If a client requests opportunistic locking then it is +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN570">Deny Modes</H2 +><P +>When a SMB client opens a file it asks for a particular "deny mode" 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 +allowed by anyone else who tries to use the file at the same time. If +DENY_READ is placed on the file, for example, then any attempt to open +the file for reading should fail.</P +><P +>Unix has no equivalent notion. To implement this Samba uses either lock +files based on the files inode and placed in a separate lock +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN574">Trapdoor UIDs</H2 +><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 +within the one process. On some unixes (such as SCO) this is not +possible. This means that on those unixes the client is restricted to +a single uid.</P +><P +>Note that you can also get the "trapdoor uid" message for other +reasons. Please see the FAQ for details.</P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN578">Port numbers</H2 +><P +>There is a convention that clients on sockets use high "unprivilaged" +port numbers (>1000) and connect to servers on low "privilaged" port +numbers. This is enforced in Unix as non-root users can't open a +socket for listening on port numbers less than 1000.</P +><P +>Most PC based SMB clients (such as WfWg and WinNT) don't follow this +convention completely. The main culprit is the netbios nameserving on +udp port 137. Name query requests come from a source port of 137. This +is a problem when you combine it with the common firewalling technique +of not allowing incoming packets on low port numbers. This means that +these clients can't query a netbios nameserver on the other side of a +low port based firewall.</P +><P +>The problem is more severe with netbios node status queries. I've +found that WfWg, Win95 and WinNT3.5 all respond to netbios node status +queries on port 137 no matter what the source port was in the +request. This works between machines that are both using port 137, but +it means it's not possible for a unix user to do a node status request +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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN583">Protocol Complexity</H2 +><P +>There are many "protocol levels" 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 +protocol to "externalise" the new capabilities.</P +><P +>This means the protocol is very "rich", offering many ways of doing +each file operation. This means SMB servers need to be complex and +large. It also means it is very difficult to make them bug free. It is +not just Samba that suffers from this problem, other servers such as +WinNT don't support every variation of every call and it has almost +certainly been a headache for MS developers to support the myriad of +SMB calls that are available.</P +><P +>There are about 65 "top level" operations in the SMB protocol (things +like SMBread and SMBwrite). Some of these include hundreds of +sub-functions (SMBtrans has at least 120 sub-functions, like +DosPrintQAdd and NetSessionEnum). All of them take several options +that can change the way they work. Many take dozens of possible +"information levels" that change the structures that need to be +returned. Samba supports all but 2 of the "top level" functions. It +supports only 8 (so far) of the SMBtrans sub-functions. Even NT +doesn't support them all.</P +><P +>Samba currently supports up to the "NT LM 0.12" protocol, which is the +one preferred by Win95 and WinNT3.5. Luckily this protocol level has a +"capabilities" field which specifies which super-duper new-fangled +options the server suports. This helps to make the implementation of +this protocol level much easier.</P +><P +>There is also a problem with the SMB specications. SMB is a X/Open +spec, but the X/Open book is far from ideal, and fails to cover many +important issues, leaving much to the imagination. Microsoft recently +renamed the SMB protocol CIFS (Common Internet File System) and have +published new specifications. These are far superior to the old +X/Open documents but there are still undocumented calls and features. +This specification is actively being worked on by a CIFS developers +mailing list hosted by Microsft.</P +></DIV +></DIV +><DIV +CLASS="CHAPTER" +><HR><H1 +><A +NAME="TRACING">Tracing samba system calls</H1 +><P +>This file describes how to do a system call trace on Samba to work out +what its doing wrong. This is not for the faint of heart, but if you +are reading this then you are probably desperate.</P +><P +>Actually its not as bad as the the above makes it sound, just don't +expect the output to be very pretty :-)</P +><P +>Ok, down to business. One of the big advantages of unix systems is +that they nearly all come with a system trace utility that allows you +to monitor all system calls that a program is making. This is +extremely using for debugging and also helps when trying to work out +why something is slower than you expect. You can use system tracing +without any special compilation options. </P +><P +>The system trace utility is called different things on different +systems. On Linux systems its called strace. Under SunOS 4 its called +trace. Under SVR4 style systems (including solaris) its called +truss. Under many BSD systems its called ktrace. </P +><P +>The first thing you should do is read the man page for your native +system call tracer. In the discussion below I'll assume its called +strace as strace is the only portable system tracer (its available for +free for many unix types) and its also got some of the nicest +features.</P +><P +>Next, try using strace on some simple commands. For example, <B +CLASS="COMMAND" +>strace +ls</B +> or <B +CLASS="COMMAND" +>strace echo hello</B +>.</P +><P +> +You'll notice that it produces a LOT of output. It is showing you the +arguments to every system call that the program makes and the +result. Very little happens in a program without a system call so you +get lots of output. You'll also find that it produces a lot of +"preamble" stuff showing the loading of shared libraries etc. Ignore +this (unless its going wrong!)</P +><P +>For example, the only line that really matters in the <B +CLASS="COMMAND" +>strace echo +hello</B +> output is:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>write(1, "hello\n", 6) = 6</PRE +></TD +></TR +></TABLE +></P +><P +>all the rest is just setting up to run the program.</P +><P +>Ok, now you're familiar with strace. To use it on Samba you need to +strace the running smbd daemon. The way I tend ot use it is to first +login from my Windows PC to the Samba server, then use smbstatus to +find which process ID that client is attached to, then as root I do +<B +CLASS="COMMAND" +>strace -p PID</B +> to attach to that process. I normally redirect the +stderr output from this command to a file for later perusal. For +example, if I'm using a csh style shell:</P +><P +><B +CLASS="COMMAND" +>strace -f -p 3872 >& strace.out</B +></P +><P +>or with a sh style shell:</P +><P +><B +CLASS="COMMAND" +>strace -f -p 3872 > strace.out 2>&1</B +></P +><P +>Note the "-f" option. This is only available on some systems, and +allows you to trace not just the current process, but any children it +forks. This is great for finding printing problems caused by the +"print command" being wrong.</P +><P +>Once you are attached you then can do whatever it is on the client +that is causing problems and you will capture all the system calls +that smbd makes. </P +><P +>So how do you interpret the results? Generally I search through the +output for strings that I know will appear when the problem +happens. For example, if I am having touble with permissions on a file +I would search for that files name in the strace output and look at +the surrounding lines. Another trick is to match up file descriptor +numbers and "follow" what happens to an open file until it is closed.</P +><P +>Beyond this you will have to use your initiative. To give you an idea +of what you are looking for here is a piece of strace output that +shows that <TT +CLASS="FILENAME" +>/dev/null</TT +> is not world writeable, which +causes printing to fail with Samba:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>[pid 28268] open("/dev/null", O_RDWR) = -1 EACCES (Permission denied) +[pid 28268] open("/dev/null", O_WRONLY) = -1 EACCES (Permission denied)</PRE +></TD +></TR +></TABLE +></P +><P +>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" +><HR><H1 +><A +NAME="NTDOMAIN">NT Domain RPC's</H1 +><DIV +CLASS="SECT1" +><H2 +CLASS="SECT1" +><A +NAME="AEN651">Introduction</H2 +><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 +>It should be possible to select a domain instead of a workgroup (in the NT +workstation's TCP/IP settings) and after the obligatory reboot, type in a +username, password, select a domain and successfully log in. I would +appreciate any feedback on your experiences with this process, and any +comments, corrections and additions to this document.</P +><P +>The packets described here can be easily derived from (and are probably +better understood using) Netmon.exe. You will need to use the version +of Netmon that matches your system, in order to correctly decode the +NETLOGON, lsarpc and srvsvc Transact pipes. This document is derived from +NT Service Pack 1 and its corresponding version of Netmon. It is intended +that an annotated packet trace be produced, which will likely be more +instructive than this document.</P +><P +>Also needed, to fully implement NT Domain Login Services, is the +document describing the cryptographic part of the NT authentication. +This document is available from comp.protocols.smb; from the ntsecurity.net +digest and from the samba digest, amongst other sources.</P +><P +>A copy is available from:</P +><P +><A +HREF="http://ntbugtraq.rc.on.ca/SCRIPTS/WA.EXE?A2=ind9708;L=ntbugtraq;O=A;P=2935" +TARGET="_top" +>http://ntbugtraq.rc.on.ca/SCRIPTS/WA.EXE?A2=ind9708;L=ntbugtraq;O=A;P=2935</A +></P +><P +><A +HREF="http://mailhost.cb1.com/~lkcl/crypt.html" +TARGET="_top" +>http://mailhost.cb1.com/~lkcl/crypt.html</A +></P +><P +>A c-code implementation, provided by <A +HREF="mailto:linus@incolumitas.se" +TARGET="_top" +>Linus Nordberg</A +> +of this protocol is available from:</P +><P +><A +HREF="http://samba.org/cgi-bin/mfs/01/digest/1997/97aug/0391.html" +TARGET="_top" +>http://samba.org/cgi-bin/mfs/01/digest/1997/97aug/0391.html</A +></P +><P +><A +HREF="http://mailhost.cb1.com/~lkcl/crypt.txt" +TARGET="_top" +>http://mailhost.cb1.com/~lkcl/crypt.txt</A +></P +><P +>Also used to provide debugging information is the Check Build version of +NT workstation, and enabling full debugging in NETLOGON. This is +achieved by setting the following REG_SZ registry key to 0x1ffffff:</P +><P +><TT +CLASS="FILENAME" +>HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters</TT +></P +><P +><I +CLASS="EMPHASIS" +>Incorrect direct editing of the registry can cause your +machine to fail. Then again, so can incorrect implementation of this +protocol. See "Liability:" above.</I +></P +><P +>Bear in mind that each packet over-the-wire will have its origin in an +API call. Therefore, there are likely to be structures, enumerations +and defines that are usefully documented elsewhere.</P +><P +>This document is by no means complete or authoritative. Missing sections +include, but are not limited to:</P +><P +></P +><OL +TYPE="1" +><LI +><P +>Mappings of RIDs to usernames (and vice-versa).</P +></LI +><LI +><P +>What a User ID is and what a Group ID is.</P +></LI +><LI +><P +>The exact meaning/definition of various magic constants or enumerations.</P +></LI +><LI +><P +>The reply error code and use of that error code when a +workstation becomes a member of a domain (to be described later). +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 +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN687">Sources</H3 +><P +></P +><TABLE +BORDER="0" +><TBODY +><TR +><TD +>cket Traces from Netmonitor (Service Pack 1 and above)</TD +></TR +><TR +><TD +>ul Ashton and Luke Leighton's other "NT Domain" doc.</TD +></TR +><TR +><TD +>FS documentation - cifs6.txt</TD +></TR +><TR +><TD +>FS documentation - cifsrap2.txt</TD +></TR +></TBODY +></TABLE +><P +></P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN694">Credits</H3 +><P +></P +><TABLE +BORDER="0" +><TBODY +><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 +></TBODY +></TABLE +><P +></P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN701">Notes and Structures</H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN703">Notes</H3 +><P +></P +><OL +TYPE="1" +><LI +><P +>In the SMB Transact pipes, some "Structures", described here, appear to be +4-byte aligned with the SMB header, at their start. Exactly which +"Structures" need aligning is not precisely known or documented.</P +></LI +><LI +><P +>In the UDP NTLOGON Mailslots, some "Structures", described here, appear to be +2-byte aligned with the start of the mailslot, at their start.</P +></LI +><LI +><P +>Domain SID is of the format S-revision-version-auth1-auth2...authN. +e.g S-1-5-123-456-789-123-456. the 5 could be a sub-revision.</P +></LI +><LI +><P +>any undocumented buffer pointers must be non-zero if the string buffer it +refers to contains characters. exactly what value they should be is unknown. +0x0000 0002 seems to do the trick to indicate that the buffer exists. a +NULL buffer pointer indicates that the string buffer is of zero length. +If the buffer pointer is NULL, then it is suspected that the structure it +refers to is NOT put into (or taken out of) the SMB data stream. This is +empirically derived from, for example, the LSA SAM Logon response packet, +where if the buffer pointer is NULL, the user information is not inserted +into the data stream. Exactly what happens with an array of buffer pointers +is not known, although an educated guess can be made.</P +></LI +><LI +><P +>an array of structures (a container) appears to have a count and a pointer. +if the count is zero, the pointer is also zero. no further data is put +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 +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN716">Enumerations</H3 +><DIV +CLASS="SECT3" +><H4 +CLASS="SECT3" +><A +NAME="AEN718">MSRPC Header type</H4 +><P +>command number in the msrpc packet header</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>MSRPC_Request:</DT +><DD +><P +>0x00</P +></DD +><DT +>MSRPC_Response:</DT +><DD +><P +>0x02</P +></DD +><DT +>MSRPC_Bind:</DT +><DD +><P +>0x0B</P +></DD +><DT +>MSRPC_BindAck:</DT +><DD +><P +>0x0C</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN738">MSRPC Packet info</H4 +><P +>The meaning of these flags is undocumented</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>FirstFrag:</DT +><DD +><P +>0x01 </P +></DD +><DT +>LastFrag:</DT +><DD +><P +>0x02 </P +></DD +><DT +>NotaFrag:</DT +><DD +><P +>0x04 </P +></DD +><DT +>RecRespond:</DT +><DD +><P +>0x08 </P +></DD +><DT +>NoMultiplex:</DT +><DD +><P +>0x10 </P +></DD +><DT +>NotForIdemp:</DT +><DD +><P +>0x20 </P +></DD +><DT +>NotforBcast:</DT +><DD +><P +>0x40 </P +></DD +><DT +>NoUuid:</DT +><DD +><P +>0x80 </P +></DD +></DL +></DIV +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN774">Structures</H3 +><DIV +CLASS="SECT3" +><H4 +CLASS="SECT3" +><A +NAME="AEN776">VOID *</H4 +><P +>sizeof VOID* is 32 bits.</P +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN779">char</H4 +><P +>sizeof char is 8 bits.</P +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN782">UTIME</H4 +><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" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN785">NTTIME</H4 +><P +>NTTIME is 64 bits. documented in cifs6.txt (section 3.5 page, page 30).</P +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN788">DOM_SID (domain SID structure)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>num of sub-authorities in domain SID</P +></DD +><DT +>UINT8</DT +><DD +><P +>SID revision number</P +></DD +><DT +>UINT8</DT +><DD +><P +>num of sub-authorities in domain SID</P +></DD +><DT +>UINT8[6]</DT +><DD +><P +>6 bytes for domain SID - Identifier Authority.</P +></DD +><DT +>UINT16[n_subauths]</DT +><DD +><P +>domain SID sub-authorities</P +></DD +></DL +></DIV +><P +><I +CLASS="EMPHASIS" +>Note: the domain SID is documented elsewhere.</I +></P +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN813">STR (string)</H4 +><P +>STR (string) is a char[] : a null-terminated string of ascii characters.</P +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN816">UNIHDR (unicode string header)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT16</DT +><DD +><P +>length of unicode string</P +></DD +><DT +>UINT16</DT +><DD +><P +>max length of unicode string</P +></DD +><DT +>UINT32</DT +><DD +><P +>4 - undocumented.</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN831">UNIHDR2 (unicode string header plus buffer pointer)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UNIHDR</DT +><DD +><P +>unicode string header</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN842">UNISTR (unicode string)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT16[]</DT +><DD +><P +>null-terminated string of unicode characters.</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN849">NAME (length-indicated unicode string)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>length of unicode string</P +></DD +><DT +>UINT16[]</DT +><DD +><P +>null-terminated string of unicode characters.</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN860">UNISTR2 (aligned unicode string)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT8[]</DT +><DD +><P +>padding to get unicode string 4-byte aligned with the start of the SMB header.</P +></DD +><DT +>UINT32</DT +><DD +><P +>max length of unicode string</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - undocumented</P +></DD +><DT +>UINT32</DT +><DD +><P +>length of unicode string</P +></DD +><DT +>UINT16[]</DT +><DD +><P +>string of uncode characters</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN883">OBJ_ATTR (object attributes)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>0x18 - length (in bytes) including the length field.</P +></DD +><DT +>VOID*</DT +><DD +><P +>0 - root directory (pointer)</P +></DD +><DT +>VOID*</DT +><DD +><P +>0 - object name (pointer)</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - attributes (undocumented)</P +></DD +><DT +>VOID*</DT +><DD +><P +>0 - security descriptior (pointer)</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - security quality of service</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN910">POL_HND (LSA policy handle)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>char[20]</DT +><DD +><P +>policy handle</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN917">DOM_SID2 (domain SID structure, SIDS stored in unicode)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>5 - SID type</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - undocumented</P +></DD +><DT +>UNIHDR2</DT +><DD +><P +>domain SID unicode string header</P +></DD +><DT +>UNISTR</DT +><DD +><P +>domain SID unicode string</P +></DD +></DL +></DIV +><P +><I +CLASS="EMPHASIS" +>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.</I +></P +><P +><I +CLASS="EMPHASIS" +>Note: the SID type indicates, for example, an alias; a well-known group etc. this is documented somewhere.</I +></P +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN940">DOM_RID (domain RID structure)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>5 - well-known SID. 1 - user SID (see ShowACLs)</P +></DD +><DT +>UINT32</DT +><DD +><P +>5 - undocumented</P +></DD +><DT +>UINT32</DT +><DD +><P +>domain RID </P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - domain index out of above reference domains</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN959">LOG_INFO (server, account, client structure)</H4 +><P +><I +CLASS="EMPHASIS" +>Note: logon server name starts with two '\' characters and is upper case.</I +></P +><P +><I +CLASS="EMPHASIS" +>Note: account name is the logon client name from the LSA Request Challenge, with a $ on the end of it, in upper case.</I +></P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>logon server unicode string</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>account name unicode string</P +></DD +><DT +>UINT16</DT +><DD +><P +>sec_chan - security channel type</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>logon client machine unicode string</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN986">CLNT_SRV (server, client names structure)</H4 +><P +><I +CLASS="EMPHASIS" +>Note: logon server name starts with two '\' characters and is upper case.</I +></P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>logon server unicode string</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>logon client machine unicode string</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1007">CREDS (credentials + time stamp)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>char[8]</DT +><DD +><P +>credentials</P +></DD +><DT +>UTIME</DT +><DD +><P +>time stamp</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1018">CLNT_INFO2 (server, client structure, client credentials)</H4 +><P +><I +CLASS="EMPHASIS" +>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.</I +></P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>CLNT_SRV</DT +><DD +><P +>client and server names</P +></DD +><DT +>UINT8[]</DT +><DD +><P +>???? padding, for 4-byte alignment with SMB header.</P +></DD +><DT +>VOID*</DT +><DD +><P +>pointer to client credentials.</P +></DD +><DT +>CREDS</DT +><DD +><P +>client-calculated credentials + client time</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1039">CLNT_INFO (server, account, client structure, client credentials)</H4 +><P +><I +CLASS="EMPHASIS" +>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.</I +></P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>LOG_INFO</DT +><DD +><P +>logon account info</P +></DD +><DT +>CREDS</DT +><DD +><P +>client-calculated credentials + client time</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1052">ID_INFO_1 (id info structure, auth level 1)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>ptr_id_info_1</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>domain name unicode header</P +></DD +><DT +>UINT32</DT +><DD +><P +>param control</P +></DD +><DT +>UINT64</DT +><DD +><P +>logon ID</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>user name unicode header</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>workgroup name unicode header</P +></DD +><DT +>char[16]</DT +><DD +><P +>arc4 LM OWF Password</P +></DD +><DT +>char[16]</DT +><DD +><P +>arc4 NT OWF Password</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>domain name unicode string</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>user name unicode string</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>workstation name unicode string</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1099">SAM_INFO (sam logon/logoff id info structure)</H4 +><P +><I +CLASS="EMPHASIS" +>Note: presumably, the return credentials is supposedly for the server to verify that the credential chain hasn't been compromised.</I +></P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>CLNT_INFO2</DT +><DD +><P +>client identification/authentication info</P +></DD +><DT +>VOID*</DT +><DD +><P +>pointer to return credentials.</P +></DD +><DT +>CRED</DT +><DD +><P +>return credentials - ignored.</P +></DD +><DT +>UINT16</DT +><DD +><P +>logon level</P +></DD +><DT +>UINT16</DT +><DD +><P +>switch value</P +></DD +></DL +></DIV +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> switch (switch_value) + case 1: + { + ID_INFO_1 id_info_1; + }</PRE +></TD +></TR +></TABLE +></P +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1126">GID (group id info)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>group id</P +></DD +><DT +>UINT32</DT +><DD +><P +>user attributes (only used by NT 3.1 and 3.51)</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1137">DOM_REF (domain reference info)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer.</P +></DD +><DT +>UINT32</DT +><DD +><P +>num referenced domains?</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented domain name buffer pointer.</P +></DD +><DT +>UINT32</DT +><DD +><P +>32 - max number of entries</P +></DD +><DT +>UINT32</DT +><DD +><P +>4 - num referenced domains?</P +></DD +><DT +>UNIHDR2</DT +><DD +><P +>domain name unicode string header</P +></DD +><DT +>UNIHDR2[num_ref_doms-1]</DT +><DD +><P +>referenced domain unicode string headers</P +></DD +><DT +>UNISTR</DT +><DD +><P +>domain name unicode string</P +></DD +><DT +>DOM_SID[num_ref_doms]</DT +><DD +><P +>referenced domain SIDs</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1176">DOM_INFO (domain info, levels 3 and 5 are the same))</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT8[]</DT +><DD +><P +>??? padding to get 4-byte alignment with start of SMB header</P +></DD +><DT +>UINT16</DT +><DD +><P +>domain name string length * 2</P +></DD +><DT +>UINT16</DT +><DD +><P +>domain name string length * 2</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented domain name string buffer pointer</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented domain SID string buffer pointer</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>domain name (unicode string)</P +></DD +><DT +>DOM_SID</DT +><DD +><P +>domain SID</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1207">USER_INFO (user logon info)</H4 +><P +><I +CLASS="EMPHASIS" +>Note: it would be nice to know what the 16 byte user session key is for.</I +></P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>NTTIME</DT +><DD +><P +>logon time</P +></DD +><DT +>NTTIME</DT +><DD +><P +>logoff time</P +></DD +><DT +>NTTIME</DT +><DD +><P +>kickoff time</P +></DD +><DT +>NTTIME</DT +><DD +><P +>password last set time</P +></DD +><DT +>NTTIME</DT +><DD +><P +>password can change time</P +></DD +><DT +>NTTIME</DT +><DD +><P +>password must change time</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>username unicode string header</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>user's full name unicode string header</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>logon script unicode string header</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>profile path unicode string header</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>home directory unicode string header</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>home directory drive unicode string header</P +></DD +><DT +>UINT16</DT +><DD +><P +>logon count</P +></DD +><DT +>UINT16</DT +><DD +><P +>bad password count</P +></DD +><DT +>UINT32</DT +><DD +><P +>User ID</P +></DD +><DT +>UINT32</DT +><DD +><P +>Group ID</P +></DD +><DT +>UINT32</DT +><DD +><P +>num groups</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer to groups.</P +></DD +><DT +>UINT32</DT +><DD +><P +>user flags</P +></DD +><DT +>char[16]</DT +><DD +><P +>user session key</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>logon server unicode string header</P +></DD +><DT +>UNIHDR</DT +><DD +><P +>logon domain unicode string header</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented logon domain id pointer</P +></DD +><DT +>char[40]</DT +><DD +><P +>40 undocumented padding bytes. future expansion?</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - num_other_sids?</P +></DD +><DT +>VOID*</DT +><DD +><P +>NULL - undocumented pointer to other domain SIDs.</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>username unicode string</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>user's full name unicode string</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>logon script unicode string</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>profile path unicode string</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>home directory unicode string</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>home directory drive unicode string</P +></DD +><DT +>UINT32</DT +><DD +><P +>num groups</P +></DD +><DT +>GID[num_groups]</DT +><DD +><P +>group info</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>logon server unicode string</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>logon domain unicode string</P +></DD +><DT +>DOM_SID</DT +><DD +><P +>domain SID</P +></DD +><DT +>DOM_SID[num_sids]</DT +><DD +><P +>other domain SIDs?</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1364">SH_INFO_1_PTR (pointers to level 1 share info strings)</H4 +><P +><I +CLASS="EMPHASIS" +>Note: see cifsrap2.txt section5, page 10.</I +></P +><P +></P +><TABLE +BORDER="0" +><TBODY +><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 +></TBODY +></TABLE +><P +></P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>shi1_netname - pointer to net name</P +></DD +><DT +>UINT32</DT +><DD +><P +>shi1_type - type of share. 0 - undocumented.</P +></DD +><DT +>VOID*</DT +><DD +><P +>shi1_remark - pointer to comment.</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1387">SH_INFO_1_STR (level 1 share info strings)</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UNISTR2</DT +><DD +><P +>shi1_netname - unicode string of net name</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>shi1_remark - unicode string of comment.</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1398">SHARE_INFO_1_CTR</H4 +><P +>share container with 0 entries:</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>0 - EntriesRead</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - Buffer</P +></DD +></DL +></DIV +><P +>share container with > 0 entries:</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>EntriesRead</P +></DD +><DT +>UINT32</DT +><DD +><P +>non-zero - Buffer</P +></DD +><DT +>UINT32</DT +><DD +><P +>EntriesRead</P +></DD +><DT +>SH_INFO_1_PTR[EntriesRead]</DT +><DD +><P +>share entry pointers</P +></DD +><DT +>SH_INFO_1_STR[EntriesRead]</DT +><DD +><P +>share entry strings</P +></DD +><DT +>UINT8[]</DT +><DD +><P +>padding to get unicode string 4-byte aligned with start of the SMB header.</P +></DD +><DT +>UINT32</DT +><DD +><P +>EntriesRead</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - padding</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1444">SERVER_INFO_101</H4 +><P +><I +CLASS="EMPHASIS" +>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. </I +></P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>SV_TYPE_WORKSTATION</DT +><DD +><P +>0x00000001 All workstations</P +></DD +><DT +>SV_TYPE_SERVER</DT +><DD +><P +>0x00000002 All servers</P +></DD +><DT +>SV_TYPE_SQLSERVER</DT +><DD +><P +>0x00000004 Any server running with SQL server</P +></DD +><DT +>SV_TYPE_DOMAIN_CTRL</DT +><DD +><P +>0x00000008 Primary domain controller</P +></DD +><DT +>SV_TYPE_DOMAIN_BAKCTRL</DT +><DD +><P +>0x00000010 Backup domain controller</P +></DD +><DT +>SV_TYPE_TIME_SOURCE</DT +><DD +><P +>0x00000020 Server running the timesource service</P +></DD +><DT +>SV_TYPE_AFP</DT +><DD +><P +>0x00000040 Apple File Protocol servers</P +></DD +><DT +>SV_TYPE_NOVELL</DT +><DD +><P +>0x00000080 Novell servers</P +></DD +><DT +>SV_TYPE_DOMAIN_MEMBER</DT +><DD +><P +>0x00000100 Domain Member</P +></DD +><DT +>SV_TYPE_PRINTQ_SERVER</DT +><DD +><P +>0x00000200 Server sharing print queue</P +></DD +><DT +>SV_TYPE_DIALIN_SERVER</DT +><DD +><P +>0x00000400 Server running dialin service.</P +></DD +><DT +>SV_TYPE_XENIX_SERVER</DT +><DD +><P +>0x00000800 Xenix server</P +></DD +><DT +>SV_TYPE_NT</DT +><DD +><P +>0x00001000 NT server</P +></DD +><DT +>SV_TYPE_WFW</DT +><DD +><P +>0x00002000 Server running Windows for </P +></DD +><DT +>SV_TYPE_SERVER_NT</DT +><DD +><P +>0x00008000 Windows NT non DC server</P +></DD +><DT +>SV_TYPE_POTENTIAL_BROWSER</DT +><DD +><P +>0x00010000 Server that can run the browser service</P +></DD +><DT +>SV_TYPE_BACKUP_BROWSER</DT +><DD +><P +>0x00020000 Backup browser server</P +></DD +><DT +>SV_TYPE_MASTER_BROWSER</DT +><DD +><P +>0x00040000 Master browser server</P +></DD +><DT +>SV_TYPE_DOMAIN_MASTER</DT +><DD +><P +>0x00080000 Domain Master Browser server</P +></DD +><DT +>SV_TYPE_LOCAL_LIST_ONLY</DT +><DD +><P +>0x40000000 Enumerate only entries marked "local"</P +></DD +><DT +>SV_TYPE_DOMAIN_ENUM</DT +><DD +><P +>0x80000000 Enumerate Domains. The pszServer and pszDomain parameters must be NULL.</P +></DD +></DL +></DIV +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>500 - platform_id</P +></DD +><DT +>VOID*</DT +><DD +><P +>pointer to name</P +></DD +><DT +>UINT32</DT +><DD +><P +>5 - major version</P +></DD +><DT +>UINT32</DT +><DD +><P +>4 - minor version</P +></DD +><DT +>UINT32</DT +><DD +><P +>type (SV_TYPE_... bit field)</P +></DD +><DT +>VOID*</DT +><DD +><P +>pointer to comment</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>sv101_name - unicode string of server name</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>sv_101_comment - unicode string of server comment.</P +></DD +><DT +>UINT8[]</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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN1570">MSRPC over Transact Named Pipe</H2 +><P +>For details on the SMB Transact Named Pipe, see cifs6.txt</P +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1573">MSRPC Pipes</H3 +><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 +example. You can then perform an SMB Trans, +and must carry out an SMBclose on the file handle once you are finished.</P +><P +>Trans Requests must be sent with two setup UINT16s, no UINT16 params (none +known about), and UINT8 data parameters sufficient to contain the MSRPC +header, and MSRPC data. The first UINT16 setup parameter must be either +0x0026 to indicate an RPC, or 0x0001 to indicate Set Named Pipe Handle +state. The second UINT16 parameter must be the file handle for the pipe, +obtained above.</P +><P +>The Data section for an API Command of 0x0026 (RPC pipe) in the Trans +Request is the RPC Header, followed by the RPC Data. The Data section for +an API Command of 0x0001 (Set Named Pipe Handle state) is two bytes. The +only value seen for these two bytes is 0x00 0x43.</P +><P +>MSRPC Responses are sent as response data inside standard SMB Trans +responses, with the MSRPC Header, MSRPC Data and MSRPC tail.</P +><P +>It is suspected that the Trans Requests will need to be at least 2-byte +aligned (probably 4-byte). This is standard practice for SMBs. It is also +independent of the observed 4-byte alignments with the start of the MSRPC +header, including the 4-byte alignment between the MSRPC header and the +MSRPC data.</P +><P +>First, an SMBtconX connection is made to the IPC$ share. The connection +must be made using encrypted passwords, not clear-text. Then, an SMBopenX +is made on the pipe. Then, a Set Named Pipe Handle State must be sent, +after which the pipe is ready to accept API commands. Lastly, and SMBclose +is sent.</P +><P +>To be resolved:</P +><P +>lkcl/01nov97 there appear to be two additional bytes after the null-terminated \PIPE\ name for the RPC pipe. Values seen so far are +listed below:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> initial SMBopenX request: RPC API command 0x26 params: + "\\PIPE\\lsarpc" 0x65 0x63; 0x72 0x70; 0x44 0x65; + "\\PIPE\\srvsvc" 0x73 0x76; 0x4E 0x00; 0x5C 0x43;</PRE +></TD +></TR +></TABLE +></P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1587">Header</H3 +><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 +><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 +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1648">RPC_Packet for request, response, bind and bind acknowledgement</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT8 versionmaj</DT +><DD +><P +>reply same as request (0x05)</P +></DD +><DT +>UINT8 versionmin</DT +><DD +><P +>reply same as request (0x00)</P +></DD +><DT +>UINT8 type</DT +><DD +><P +>one of the MSRPC_Type enums</P +></DD +><DT +>UINT8 flags</DT +><DD +><P +>reply same as request (0x00 for Bind, 0x03 for Request)</P +></DD +><DT +>UINT32 representation</DT +><DD +><P +>reply same as request (0x00000010)</P +></DD +><DT +>UINT16 fraglength</DT +><DD +><P +>the length of the data section of the SMB trans packet</P +></DD +><DT +>UINT16 authlength</DT +><DD +><P +></P +></DD +><DT +>UINT32 callid</DT +><DD +><P +>call identifier. (e.g. 0x00149594)</P +></DD +><DT +>* stub USE TvPacket</DT +><DD +><P +>the remainder of the packet depending on the "type"</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1687">Interface identification</H4 +><P +>the interfaces are numbered. as yet I haven't seen more than one interface used on the same pipe name srvsvc</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>abstract (0x4B324FC8, 0x01D31670, 0x475A7812, 0x88E16EBF, 0x00000003) +transfer (0x8A885D04, 0x11C91CEB, 0x0008E89F, 0x6048102B, 0x00000002)</PRE +></TD +></TR +></TABLE +></P +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1692">RPC_Iface RW</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT8 byte[16]</DT +><DD +><P +>16 bytes of number</P +></DD +><DT +>UINT32 version</DT +><DD +><P +>the interface number</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1703">RPC_ReqBind RW</H4 +><P +>the remainder of the packet after the header if "type" was Bind in the response header, "type" should be BindAck</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT16 maxtsize</DT +><DD +><P +>maximum transmission fragment size (0x1630)</P +></DD +><DT +>UINT16 maxrsize</DT +><DD +><P +>max receive fragment size (0x1630)</P +></DD +><DT +>UINT32 assocgid</DT +><DD +><P +>associated group id (0x0)</P +></DD +><DT +>UINT32 numelements</DT +><DD +><P +>the number of elements (0x1)</P +></DD +><DT +>UINT16 contextid</DT +><DD +><P +>presentation context identifier (0x0)</P +></DD +><DT +>UINT8 numsyntaxes</DT +><DD +><P +>the number of syntaxes (has always been 1?)(0x1)</P +></DD +><DT +>UINT8[]</DT +><DD +><P +>4-byte alignment padding, against SMB header</P +></DD +><DT +>* abstractint USE RPC_Iface</DT +><DD +><P +>num and vers. of interface client is using</P +></DD +><DT +>* transferint USE RPC_Iface</DT +><DD +><P +>num and vers. of interface to use for replies</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1743">RPC_Address RW</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT16 length</DT +><DD +><P +>length of the string including null terminator</P +></DD +><DT +>* port USE string</DT +><DD +><P +>the string above in single byte, null terminated form</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1754">RPC_ResBind RW</H4 +><P +>the response to place after the header in the reply packet</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT16 maxtsize</DT +><DD +><P +>same as request</P +></DD +><DT +>UINT16 maxrsize</DT +><DD +><P +>same as request</P +></DD +><DT +>UINT32 assocgid</DT +><DD +><P +>zero</P +></DD +><DT +>* secondaddr USE RPC_Address</DT +><DD +><P +>the address string, as described earlier</P +></DD +><DT +>UINT8[]</DT +><DD +><P +>4-byte alignment padding, against SMB header</P +></DD +><DT +>UINT8 numresults</DT +><DD +><P +>the number of results (0x01)</P +></DD +><DT +>UINT8[]</DT +><DD +><P +>4-byte alignment padding, against SMB header</P +></DD +><DT +>UINT16 result</DT +><DD +><P +>result (0x00 = accept)</P +></DD +><DT +>UINT16 reason</DT +><DD +><P +>reason (0x00 = no reason specified)</P +></DD +><DT +>* transfersyntax USE RPC_Iface</DT +><DD +><P +>the transfer syntax from the request</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1798">RPC_ReqNorm RW</H4 +><P +>the remainder of the packet after the header for every other other request</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32 allochint</DT +><DD +><P +>the size of the stub data in bytes</P +></DD +><DT +>UINT16 prescontext</DT +><DD +><P +>presentation context identifier (0x0)</P +></DD +><DT +>UINT16 opnum</DT +><DD +><P +>operation number (0x15)</P +></DD +><DT +>* stub USE TvPacket</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" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1818">RPC_ResNorm RW</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32 allochint</DT +><DD +><P +># size of the stub data in bytes</P +></DD +><DT +>UINT16 prescontext</DT +><DD +><P +># presentation context identifier (same as request)</P +></DD +><DT +>UINT8 cancelcount</DT +><DD +><P +># cancel count? (0x0)</P +></DD +><DT +>UINT8 reserved</DT +><DD +><P +># 0 - one byte padding</P +></DD +><DT +>* stub USE TvPacket</DT +><DD +><P +># the remainder of the reply</P +></DD +></DL +></DIV +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1841">Tail</H3 +><P +>The end of each of the NTLSA and NETLOGON named pipes ends with:</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>......</DT +><DD +><P +>end of data</P +></DD +><DT +>UINT32</DT +><DD +><P +>return code</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1853">RPC Bind / Bind Ack</H3 +><P +>RPC Binds are the process of associating an RPC pipe (e.g \PIPE\lsarpc) +with a "transfer syntax" (see RPC_Iface structure). The purpose for doing +this is unknown.</P +><P +><I +CLASS="EMPHASIS" +>Note: The RPC_ResBind SMB Transact request is sent with two uint16 setup parameters. The first is 0x0026; the second is the file handle + returned by the SMBopenX Transact response.</I +></P +><P +><I +CLASS="EMPHASIS" +>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</I +></P +><P +><I +CLASS="EMPHASIS" +>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:</I +></P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>initial SMBopenX request:</DT +><DD +><P +>RPC_ResBind response:</P +></DD +><DT +>"\\PIPE\\srvsvc"</DT +><DD +><P +>"\\PIPE\\ntsvcs"</P +></DD +><DT +>"\\PIPE\\samr"</DT +><DD +><P +>"\\PIPE\\lsass"</P +></DD +><DT +>"\\PIPE\\lsarpc"</DT +><DD +><P +>"\\PIPE\\lsass"</P +></DD +><DT +>"\\PIPE\\wkssvc"</DT +><DD +><P +>"\\PIPE\\wksvcs"</P +></DD +><DT +>"\\PIPE\\NETLOGON"</DT +><DD +><P +>"\\PIPE\\NETLOGON"</P +></DD +></DL +></DIV +><P +><I +CLASS="EMPHASIS" +>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.</I +></P +><P +>Request:</P +><P +></P +><TABLE +BORDER="0" +><TBODY +><TR +><TD +>RPC_Packet</TD +></TR +><TR +><TD +>RPC_ReqBind</TD +></TR +></TBODY +></TABLE +><P +></P +><P +>Response:</P +><P +></P +><TABLE +BORDER="0" +><TBODY +><TR +><TD +>RPC_Packet</TD +></TR +><TR +><TD +>RPC_ResBind</TD +></TR +></TBODY +></TABLE +><P +></P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1897">NTLSA Transact Named Pipe</H3 +><P +>The sequence of actions taken on this pipe are:</P +><P +></P +><TABLE +BORDER="0" +><TBODY +><TR +><TD +>Establish a connection to the IPC$ share (SMBtconX). use encrypted passwords.</TD +></TR +><TR +><TD +>Open an RPC Pipe with the name "\\PIPE\\lsarpc". 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 +></TBODY +></TABLE +><P +></P +><P +>Defines for this pipe, identifying the query are:</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>LSA Open Policy:</DT +><DD +><P +>0x2c</P +></DD +><DT +>LSA Query Info Policy:</DT +><DD +><P +>0x07</P +></DD +><DT +>LSA Enumerate Trusted Domains:</DT +><DD +><P +>0x0d</P +></DD +><DT +>LSA Open Secret:</DT +><DD +><P +>0xff</P +></DD +><DT +>LSA Lookup SIDs:</DT +><DD +><P +>0xfe</P +></DD +><DT +>LSA Lookup Names:</DT +><DD +><P +>0xfd</P +></DD +><DT +>LSA Close:</DT +><DD +><P +>0x00</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1938">LSA Open Policy</H3 +><P +><I +CLASS="EMPHASIS" +>Note: The policy handle can be anything you like.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1942">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>buffer pointer</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>server name - unicode string starting with two '\'s</P +></DD +><DT +>OBJ_ATTR</DT +><DD +><P +>object attributes</P +></DD +><DT +>UINT32</DT +><DD +><P +>1 - desired access</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1961">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>POL_HND</DT +><DD +><P +>LSA policy handle</P +></DD +><DT +>return</DT +><DD +><P +>0 - indicates success</P +></DD +></DL +></DIV +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1972">LSA Query Info Policy</H3 +><P +><I +CLASS="EMPHASIS" +>Note: The info class in response must be the same as that in the request.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1976">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>POL_HND</DT +><DD +><P +>LSA policy handle</P +></DD +><DT +>UINT16</DT +><DD +><P +>info class (also a policy handle?)</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN1987">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer</P +></DD +><DT +>UINT16</DT +><DD +><P +>info class (same as info class in request).</P +></DD +></DL +></DIV +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>switch (info class) +case 3: +case 5: +{ +DOM_INFO domain info, levels 3 and 5 (are the same). +} + +return 0 - indicates success</PRE +></TD +></TR +></TABLE +></P +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2000">LSA Enumerate Trusted Domains</H3 +><DIV +CLASS="SECT3" +><H4 +CLASS="SECT3" +><A +NAME="AEN2002">Request</H4 +><P +>no extra data</P +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2005">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>0 - enumeration context</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - entries read</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - trust information</P +></DD +><DT +>return</DT +><DD +><P +>0x8000 001a - "no trusted domains" success code</P +></DD +></DL +></DIV +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2024">LSA Open Secret</H3 +><DIV +CLASS="SECT3" +><H4 +CLASS="SECT3" +><A +NAME="AEN2026">Request</H4 +><P +>no extra data</P +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2029">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>0 - undocumented</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - undocumented</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - undocumented</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - undocumented</P +></DD +><DT +>UINT32</DT +><DD +><P +>0 - undocumented</P +></DD +></DL +></DIV +><P +>return 0x0C00 0034 - "no such secret" success code</P +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2053">LSA Close</H3 +><DIV +CLASS="SECT3" +><H4 +CLASS="SECT3" +><A +NAME="AEN2055">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>POL_HND</DT +><DD +><P +>policy handle to be closed</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2062">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>POL_HND</DT +><DD +><P +>0s - closed policy handle (all zeros)</P +></DD +></DL +></DIV +><P +>return 0 - indicates success</P +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2070">LSA Lookup SIDS</H3 +><P +><I +CLASS="EMPHASIS" +>Note: num_entries in response must be same as num_entries in request.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2074">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>POL_HND</DT +><DD +><P +>LSA policy handle</P +></DD +><DT +>UINT32</DT +><DD +><P +>num_entries</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented domain SID buffer pointer</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented domain name buffer pointer</P +></DD +><DT +>VOID*[num_entries] undocumented domain SID pointers to be looked up.</DT +><DD +><P +>DOM_SID[num_entries] domain SIDs to be looked up.</P +></DD +><DT +>char[16]</DT +><DD +><P +>completely undocumented 16 bytes.</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2101">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>DOM_REF</DT +><DD +><P +>domain reference response</P +></DD +><DT +>UINT32</DT +><DD +><P +>num_entries (listed above)</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer</P +></DD +><DT +>UINT32</DT +><DD +><P +>num_entries (listed above)</P +></DD +><DT +>DOM_SID2[num_entries]</DT +><DD +><P +>domain SIDs (from Request, listed above).</P +></DD +><DT +>UINT32</DT +><DD +><P +>num_entries (listed above)</P +></DD +></DL +></DIV +><P +>return 0 - indicates success</P +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2129">LSA Lookup Names</H3 +><P +><I +CLASS="EMPHASIS" +>Note: num_entries in response must be same as num_entries in request.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2133">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>POL_HND</DT +><DD +><P +>LSA policy handle</P +></DD +><DT +>UINT32</DT +><DD +><P +>num_entries</P +></DD +><DT +>UINT32</DT +><DD +><P +>num_entries</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented domain SID buffer pointer</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented domain name buffer pointer</P +></DD +><DT +>NAME[num_entries]</DT +><DD +><P +>names to be looked up.</P +></DD +><DT +>char[]</DT +><DD +><P +>undocumented bytes - falsely translated SID structure?</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2164">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>DOM_REF</DT +><DD +><P +>domain reference response</P +></DD +><DT +>UINT32</DT +><DD +><P +>num_entries (listed above)</P +></DD +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer</P +></DD +><DT +>UINT32</DT +><DD +><P +>num_entries (listed above)</P +></DD +><DT +>DOM_RID[num_entries]</DT +><DD +><P +>domain SIDs (from Request, listed above).</P +></DD +><DT +>UINT32</DT +><DD +><P +>num_entries (listed above)</P +></DD +></DL +></DIV +><P +>return 0 - indicates success</P +></DIV +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN2192">NETLOGON rpc Transact Named Pipe</H2 +><P +>The sequence of actions taken on this pipe are:</P +><P +></P +><TABLE +BORDER="0" +><TBODY +><TR +><TD +>tablish a connection to the IPC$ share (SMBtconX). use encrypted passwords.</TD +></TR +><TR +><TD +>en an RPC Pipe with the name "\\PIPE\\NETLOGON". 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 +></TBODY +></TABLE +><P +></P +><P +>Defines for this pipe, identifying the query are</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>LSA Request Challenge:</DT +><DD +><P +>0x04</P +></DD +><DT +>LSA Server Password Set:</DT +><DD +><P +>0x06</P +></DD +><DT +>LSA SAM Logon:</DT +><DD +><P +>0x02</P +></DD +><DT +>LSA SAM Logoff:</DT +><DD +><P +>0x03</P +></DD +><DT +>LSA Auth 2:</DT +><DD +><P +>0x0f</P +></DD +><DT +>LSA Logon Control:</DT +><DD +><P +>0x0e</P +></DD +></DL +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2231">LSA Request Challenge</H3 +><P +><I +CLASS="EMPHASIS" +>Note: logon server name starts with two '\' characters and is upper case.</I +></P +><P +><I +CLASS="EMPHASIS" +>Note: logon client is the machine, not the user.</I +></P +><P +><I +CLASS="EMPHASIS" +>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).</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2239">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>logon server unicode string</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>logon client unicode string</P +></DD +><DT +>char[8]</DT +><DD +><P +>client challenge</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2258">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>char[8]</DT +><DD +><P +>server challenge</P +></DD +></DL +></DIV +><P +>return 0 - indicates success</P +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2266">LSA Authenticate 2</H3 +><P +><I +CLASS="EMPHASIS" +>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).</I +></P +><P +><I +CLASS="EMPHASIS" +>Note: neg_flags in the response is the same as that in the request.</I +></P +><P +><I +CLASS="EMPHASIS" +>Note: you must take a copy of the client-calculated credentials received here, because they will be used in subsequent authentication packets.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2274">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>LOG_INFO</DT +><DD +><P +>client identification info</P +></DD +><DT +>char[8]</DT +><DD +><P +>client-calculated credentials</P +></DD +><DT +>UINT8[]</DT +><DD +><P +>padding to 4-byte align with start of SMB header.</P +></DD +><DT +>UINT32</DT +><DD +><P +>neg_flags - negotiated flags (usual value is 0x0000 01ff)</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2293">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>char[8]</DT +><DD +><P +>server credentials.</P +></DD +><DT +>UINT32</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" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2305">LSA Server Password Set</H3 +><P +><I +CLASS="EMPHASIS" +>Note: the new password is suspected to be a DES encryption using the old password to generate the key.</I +></P +><P +><I +CLASS="EMPHASIS" +>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).</I +></P +><P +><I +CLASS="EMPHASIS" +>Note: the server credentials are constructed from the client-calculated credentials and the client time + 1 second.</I +></P +><P +><I +CLASS="EMPHASIS" +>Note: you must take a copy of the client-calculated credentials received here, because they will be used in subsequent authentication packets.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2315">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>CLNT_INFO</DT +><DD +><P +>client identification/authentication info</P +></DD +><DT +>char[]</DT +><DD +><P +>new password - undocumented.</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2326">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>CREDS</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" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2334">LSA SAM Logon</H3 +><P +><I +CLASS="EMPHASIS" +>Note: valid_user is True iff the username and password hash are valid for + the requested domain.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2338">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>SAM_INFO</DT +><DD +><P +>sam_id structure</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2345">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer</P +></DD +><DT +>CREDS</DT +><DD +><P +>server credentials. server time stamp appears to be ignored.</P +></DD +></DL +></DIV +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>if (valid_user) +{ + UINT16 3 - switch value indicating USER_INFO structure. + VOID* non-zero - pointer to USER_INFO structure + USER_INFO user logon information + + UINT32 1 - Authoritative response; 0 - Non-Auth? + + return 0 - indicates success +} +else +{ + UINT16 0 - switch value. value to indicate no user presumed. + VOID* 0x0000 0000 - indicates no USER_INFO structure. + + UINT32 1 - Authoritative response; 0 - Non-Auth? + + return 0xC000 0064 - NT_STATUS_NO_SUCH_USER. +}</PRE +></TD +></TR +></TABLE +></P +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2358">LSA SAM Logoff</H3 +><P +><I +CLASS="EMPHASIS" +>Note: presumably, the SAM_INFO structure is validated, and a (currently + undocumented) error code returned if the Logoff is invalid.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2362">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>SAM_INFO</DT +><DD +><P +>sam_id structure</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2369">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>undocumented buffer pointer</P +></DD +><DT +>CREDS</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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN2381">\\MAILSLOT\NET\NTLOGON</H2 +><P +><I +CLASS="EMPHASIS" +>Note: mailslots will contain a response mailslot, to which the response + should be sent. the target NetBIOS name is REQUEST_NAME<20>, where + REQUEST_NAME is the name of the machine that sent the request.</I +></P +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2385">Query for PDC</H3 +><P +><I +CLASS="EMPHASIS" +>Note: NTversion, LMNTtoken, LM20token in response are the same as those given in the request.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2389">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT16</DT +><DD +><P +>0x0007 - Query for PDC</P +></DD +><DT +>STR</DT +><DD +><P +>machine name</P +></DD +><DT +>STR</DT +><DD +><P +>response mailslot</P +></DD +><DT +>UINT8[]</DT +><DD +><P +>padding to 2-byte align with start of mailslot.</P +></DD +><DT +>UNISTR</DT +><DD +><P +>machine name</P +></DD +><DT +>UINT32</DT +><DD +><P +>NTversion</P +></DD +><DT +>UINT16</DT +><DD +><P +>LMNTtoken</P +></DD +><DT +>UINT16</DT +><DD +><P +>LM20token</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2424">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT16</DT +><DD +><P +>0x000A - Respose to Query for PDC</P +></DD +><DT +>STR</DT +><DD +><P +>machine name (in uppercase)</P +></DD +><DT +>UINT8[]</DT +><DD +><P +>padding to 2-byte align with start of mailslot.</P +></DD +><DT +>UNISTR</DT +><DD +><P +>machine name</P +></DD +><DT +>UNISTR</DT +><DD +><P +>domain name</P +></DD +><DT +>UINT32</DT +><DD +><P +>NTversion (same as received in request)</P +></DD +><DT +>UINT16</DT +><DD +><P +>LMNTtoken (same as received in request)</P +></DD +><DT +>UINT16</DT +><DD +><P +>LM20token (same as received in request)</P +></DD +></DL +></DIV +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2459">SAM Logon</H3 +><P +><I +CLASS="EMPHASIS" +>Note: machine name in response is preceded by two '\' characters.</I +></P +><P +><I +CLASS="EMPHASIS" +>Note: NTversion, LMNTtoken, LM20token in response are the same as those given in the request.</I +></P +><P +><I +CLASS="EMPHASIS" +>Note: user name in the response is presumably the same as that in the request.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2467">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT16</DT +><DD +><P +>0x0012 - SAM Logon</P +></DD +><DT +>UINT16</DT +><DD +><P +>request count</P +></DD +><DT +>UNISTR</DT +><DD +><P +>machine name</P +></DD +><DT +>UNISTR</DT +><DD +><P +>user name</P +></DD +><DT +>STR</DT +><DD +><P +>response mailslot</P +></DD +><DT +>UINT32</DT +><DD +><P +>alloweable account</P +></DD +><DT +>UINT32</DT +><DD +><P +>domain SID size</P +></DD +><DT +>char[sid_size]</DT +><DD +><P +>domain SID, of sid_size bytes.</P +></DD +><DT +>UINT8[]</DT +><DD +><P +>???? padding to 4? 2? -byte align with start of mailslot.</P +></DD +><DT +>UINT32</DT +><DD +><P +>NTversion</P +></DD +><DT +>UINT16</DT +><DD +><P +>LMNTtoken</P +></DD +><DT +>UINT16</DT +><DD +><P +>LM20token</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2518">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT16</DT +><DD +><P +>0x0013 - Response to SAM Logon</P +></DD +><DT +>UNISTR</DT +><DD +><P +>machine name</P +></DD +><DT +>UNISTR</DT +><DD +><P +>user name - workstation trust account</P +></DD +><DT +>UNISTR</DT +><DD +><P +>domain name </P +></DD +><DT +>UINT32</DT +><DD +><P +>NTversion</P +></DD +><DT +>UINT16</DT +><DD +><P +>LMNTtoken</P +></DD +><DT +>UINT16</DT +><DD +><P +>LM20token</P +></DD +></DL +></DIV +></DIV +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN2549">SRVSVC Transact Named Pipe</H2 +><P +>Defines for this pipe, identifying the query are:</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>Net Share Enum</DT +><DD +><P +>0x0f</P +></DD +><DT +>Net Server Get Info</DT +><DD +><P +>0x15</P +></DD +></DL +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2561">Net Share Enum</H3 +><P +><I +CLASS="EMPHASIS" +>Note: share level and switch value in the response are presumably the same as those in the request.</I +></P +><P +><I +CLASS="EMPHASIS" +>Note: cifsrap2.txt (section 5) may be of limited assistance here.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2567">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>VOID*</DT +><DD +><P +>pointer (to server name?)</P +></DD +><DT +>UNISTR2</DT +><DD +><P +>server name</P +></DD +><DT +>UINT8[]</DT +><DD +><P +>padding to get unicode string 4-byte aligned with the start of the SMB header.</P +></DD +><DT +>UINT32</DT +><DD +><P +>share level</P +></DD +><DT +>UINT32</DT +><DD +><P +>switch value</P +></DD +><DT +>VOID*</DT +><DD +><P +>pointer to SHARE_INFO_1_CTR</P +></DD +><DT +>SHARE_INFO_1_CTR</DT +><DD +><P +>share info with 0 entries</P +></DD +><DT +>UINT32</DT +><DD +><P +>preferred maximum length (0xffff ffff)</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2602">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>share level</P +></DD +><DT +>UINT32</DT +><DD +><P +>switch value</P +></DD +><DT +>VOID*</DT +><DD +><P +>pointer to SHARE_INFO_1_CTR</P +></DD +><DT +>SHARE_INFO_1_CTR</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" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2622">Net Server Get Info</H3 +><P +><I +CLASS="EMPHASIS" +>Note: level is the same value as in the request.</I +></P +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2626">Request</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UNISTR2</DT +><DD +><P +>server name</P +></DD +><DT +>UINT32</DT +><DD +><P +>switch level</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2637">Response</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>UINT32</DT +><DD +><P +>switch level</P +></DD +><DT +>VOID*</DT +><DD +><P +>pointer to SERVER_INFO_101</P +></DD +><DT +>SERVER_INFO_101</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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN2653">Cryptographic side of NT Domain Authentication</H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN2655">Definitions</H3 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>Add(A1,A2)</DT +><DD +><P +>Intel byte ordered addition of corresponding 4 byte words in arrays A1 and A2</P +></DD +><DT +>E(K,D)</DT +><DD +><P +>DES ECB encryption of 8 byte data D using 7 byte key K</P +></DD +><DT +>lmowf()</DT +><DD +><P +>Lan man hash</P +></DD +><DT +>ntowf()</DT +><DD +><P +>NT hash</P +></DD +><DT +>PW</DT +><DD +><P +>md4(machine_password) == md4(lsadump $machine.acc) == +pwdump(machine$) (initially) == md4(lmowf(unicode(machine)))</P +></DD +><DT +>ARC4(K,Lk,D,Ld)</DT +><DD +><P +>ARC4 encryption of data D of length Ld with key K of length Lk</P +></DD +><DT +>v[m..n(,l)]</DT +><DD +><P +>subset of v from bytes m to n, optionally padded with zeroes to length l</P +></DD +><DT +>Cred(K,D)</DT +><DD +><P +>E(K[7..7,7],E(K[0..6],D)) computes a credential</P +></DD +><DT +>Time()</DT +><DD +><P +>4 byte current time</P +></DD +><DT +>Cc,Cs</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" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2698">Protocol</H3 +><P +>C->S ReqChal,Cc S->C Cs</P +><P +>C & S compute session key Ks = E(PW[9..15],E(PW[0..6],Add(Cc,Cs)))</P +><P +>C: Rc = Cred(Ks,Cc) C->S Authenticate,Rc S: Rs = Cred(Ks,Cs), +assert(Rc == Cred(Ks,Cc)) S->C Rs C: assert(Rs == Cred(Ks,Cs))</P +><P +>On joining the domain the client will optionally attempt to change its +password and the domain controller may refuse to update it depending +on registry settings. This will also occur weekly afterwards.</P +><P +>C: Tc = Time(), Rc' = Cred(Ks,Rc+Tc) C->S ServerPasswordSet,Rc',Tc, +arc4(Ks[0..7,16],lmowf(randompassword()) C: Rc = Cred(Ks,Rc+Tc+1) S: +assert(Rc' == Cred(Ks,Rc+Tc)), Ts = Time() S: Rs' = Cred(Ks,Rs+Tc+1) +S->C Rs',Ts C: assert(Rs' == Cred(Ks,Rs+Tc+1)) S: Rs = Rs'</P +><P +>User: U with password P wishes to login to the domain (incidental data +such as workstation and domain omitted)</P +><P +>C: Tc = Time(), Rc' = Cred(Ks,Rc+Tc) C->S NetLogonSamLogon,Rc',Tc,U, +arc4(Ks[0..7,16],16,ntowf(P),16), arc4(Ks[0..7,16],16,lmowf(P),16) S: +assert(Rc' == Cred(Ks,Rc+Tc)) assert(passwords match those in SAM) S: +Ts = Time()</P +><P +>S->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)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2708">Comments</H3 +><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 +key to encrypt NT and LM one way functions of passwords which are +password equivalents. Any user who logs in before the machine has been +rebooted a second time will have their password equivalent exposed. Of +course the new machine password is exposed at this time anyway.</P +><P +>None of the returned user info such as logon script, profile path and +SIDs *appear* to be protected by anything other than the TCP checksum.</P +><P +>The server time stamps appear to be ignored.</P +><P +>The client sends a ReturnAuthenticator in the SamLogon request which I +can't find a use for. However its time is used as the timestamp +returned by the server.</P +><P +>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" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN2715">SIDs and RIDs</H2 +><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 +><P +></P +><TABLE +BORDER="0" +><TBODY +><TR +><TD +>revision-NN-SubAuth1-SubAuth2-SubAuth3... </TD +></TR +><TR +><TD +>revision-0xNNNNNNNNNNNN-SubAuth1-SubAuth2-SubAuth3...</TD +></TR +></TBODY +></TABLE +><P +></P +><P +>currently, the SID revision is 1. +The Sub-Authorities are known as Relative IDs (RIDs).</P +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2723">Well-known SIDs</H3 +><DIV +CLASS="SECT3" +><H4 +CLASS="SECT3" +><A +NAME="AEN2725">Universal well-known SIDs</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>Null SID</DT +><DD +><P +>S-1-0-0</P +></DD +><DT +>World</DT +><DD +><P +>S-1-1-0</P +></DD +><DT +>Local</DT +><DD +><P +>S-1-2-0</P +></DD +><DT +>Creator Owner ID</DT +><DD +><P +>S-1-3-0</P +></DD +><DT +>Creator Group ID</DT +><DD +><P +>S-1-3-1</P +></DD +><DT +>Creator Owner Server ID</DT +><DD +><P +>S-1-3-2</P +></DD +><DT +>Creator Group Server ID</DT +><DD +><P +>S-1-3-3</P +></DD +><DT +>(Non-unique IDs)</DT +><DD +><P +>S-1-4</P +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2760">NT well-known SIDs</H4 +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +>NT Authority</DT +><DD +><P +>S-1-5</P +></DD +><DT +>Dialup</DT +><DD +><P +>S-1-5-1</P +></DD +><DT +>Network</DT +><DD +><P +>S-1-5-2</P +></DD +><DT +>Batch</DT +><DD +><P +>S-1-5-3</P +></DD +><DT +>Interactive</DT +><DD +><P +>S-1-5-4</P +></DD +><DT +>Service</DT +><DD +><P +>S-1-5-6</P +></DD +><DT +>AnonymousLogon(aka null logon session)</DT +><DD +><P +>S-1-5-7</P +></DD +><DT +>Proxy</DT +><DD +><P +>S-1-5-8</P +></DD +><DT +>ServerLogon(aka domain controller account)</DT +><DD +><P +>S-1-5-8</P +></DD +><DT +>(Logon IDs)</DT +><DD +><P +>S-1-5-5-X-Y</P +></DD +><DT +>(NT non-unique IDs)</DT +><DD +><P +>S-1-5-0x15-...</P +></DD +><DT +>(Built-in domain)</DT +><DD +><P +>s-1-5-0x20</P +></DD +></DL +></DIV +></DIV +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2811">Well-known RIDS</H3 +><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" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2814">Well-known RID users</H4 +><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 +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2828">Well-known RID groups</H4 +><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 +CLASS="SECT3" +><HR><H4 +CLASS="SECT3" +><A +NAME="AEN2846">Well-known RID aliases</H4 +><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 +></BODY +></HTML +>
\ No newline at end of file diff --git a/docs/htmldocs/Samba-HOWTO-Collection.html b/docs/htmldocs/Samba-HOWTO-Collection.html index ffb6939e17..71e27a2e80 100644 --- a/docs/htmldocs/Samba-HOWTO-Collection.html +++ b/docs/htmldocs/Samba-HOWTO-Collection.html @@ -1,10 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <HTML ><HEAD ><TITLE >SAMBA Project Documentation</TITLE ><META NAME="GENERATOR" -CONTENT="Modular DocBook HTML Stylesheet Version 1.57"></HEAD +CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ +"></HEAD ><BODY CLASS="BOOK" BGCOLOR="#FFFFFF" @@ -15,31 +17,24 @@ ALINK="#0000FF" ><DIV CLASS="BOOK" ><A -NAME="SAMBA-PROJECT-DOCUMENTATION" -></A -><DIV +NAME="SAMBA-PROJECT-DOCUMENTATION"><DIV CLASS="TITLEPAGE" ><H1 CLASS="TITLE" ><A -NAME="SAMBA-PROJECT-DOCUMENTATION" ->SAMBA Project Documentation</A -></H1 +NAME="SAMBA-PROJECT-DOCUMENTATION">SAMBA Project Documentation</H1 ><H3 CLASS="AUTHOR" ><A -NAME="AEN4" ->SAMBA Team</A -></H3 +NAME="AEN4">SAMBA Team</H3 ><HR></DIV ><HR><H1 ><A -NAME="AEN8" ->Abstract</A -></H1 +NAME="AEN8">Abstract</H1 ><P -><EM ->Last Update</EM +><I +CLASS="EMPHASIS" +>Last Update</I > : Thu Aug 15 12:48:45 CDT 2002</P ><P >This book is a collection of HOWTOs added to Samba documentation over the years. @@ -73,34 +68,34 @@ CLASS="TOC" >Table of Contents</B ></DT ><DT ->1. <A +><A HREF="#INSTALL" >How to Install and Test SAMBA</A ></DT ><DD ><DL ><DT ->1.1. <A +><A HREF="#AEN20" >Step 0: Read the man pages</A ></DT ><DT ->1.2. <A +><A HREF="#AEN28" >Step 1: Building the Binaries</A ></DT ><DT ->1.3. <A +><A HREF="#AEN56" >Step 2: The all important step</A ></DT ><DT ->1.4. <A +><A HREF="#AEN60" >Step 3: Create the smb configuration file.</A ></DT ><DT ->1.5. <A +><A HREF="#AEN74" >Step 4: Test your config file with <B @@ -109,76 +104,76 @@ CLASS="COMMAND" ></A ></DT ><DT ->1.6. <A +><A HREF="#AEN80" >Step 5: Starting the smbd and nmbd</A ></DT ><DD ><DL ><DT ->1.6.1. <A +><A HREF="#AEN90" >Step 5a: Starting from inetd.conf</A ></DT ><DT ->1.6.2. <A +><A HREF="#AEN119" >Step 5b. Alternative: starting it as a daemon</A ></DT ></DL ></DD ><DT ->1.7. <A +><A HREF="#AEN135" >Step 6: Try listing the shares available on your server</A ></DT ><DT ->1.8. <A +><A HREF="#AEN144" >Step 7: Try connecting with the unix client</A ></DT ><DT ->1.9. <A +><A HREF="#AEN160" >Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT, Win2k, OS/2, etc... client</A ></DT ><DT ->1.10. <A +><A HREF="#AEN174" >What If Things Don't Work?</A ></DT ><DD ><DL ><DT ->1.10.1. <A +><A HREF="#AEN179" >Diagnosing Problems</A ></DT ><DT ->1.10.2. <A +><A HREF="#AEN183" >Scope IDs</A ></DT ><DT ->1.10.3. <A +><A HREF="#AEN186" >Choosing the Protocol Level</A ></DT ><DT ->1.10.4. <A +><A HREF="#AEN195" >Printing from UNIX to a Client PC</A ></DT ><DT ->1.10.5. <A -HREF="#AEN199" +><A +HREF="#AEN200" >Locking</A ></DT ><DT ->1.10.6. <A -HREF="#AEN208" +><A +HREF="#AEN209" >Mapping Usernames</A ></DT ></DL @@ -186,139 +181,139 @@ HREF="#AEN208" ></DL ></DD ><DT ->2. <A +><A HREF="#DIAGNOSIS" >Diagnosing your samba server</A ></DT ><DD ><DL ><DT ->2.1. <A -HREF="#AEN222" +><A +HREF="#AEN223" >Introduction</A ></DT ><DT ->2.2. <A -HREF="#AEN227" +><A +HREF="#AEN228" >Assumptions</A ></DT ><DT ->2.3. <A -HREF="#AEN237" +><A +HREF="#AEN238" >Tests</A ></DT ><DD ><DL ><DT ->2.3.1. <A -HREF="#AEN239" +><A +HREF="#AEN240" >Test 1</A ></DT ><DT ->2.3.2. <A -HREF="#AEN245" +><A +HREF="#AEN246" >Test 2</A ></DT ><DT ->2.3.3. <A -HREF="#AEN251" +><A +HREF="#AEN252" >Test 3</A ></DT ><DT ->2.3.4. <A -HREF="#AEN266" +><A +HREF="#AEN267" >Test 4</A ></DT ><DT ->2.3.5. <A -HREF="#AEN271" +><A +HREF="#AEN272" >Test 5</A ></DT ><DT ->2.3.6. <A -HREF="#AEN277" +><A +HREF="#AEN278" >Test 6</A ></DT ><DT ->2.3.7. <A -HREF="#AEN285" +><A +HREF="#AEN286" >Test 7</A ></DT ><DT ->2.3.8. <A -HREF="#AEN311" +><A +HREF="#AEN312" >Test 8</A ></DT ><DT ->2.3.9. <A -HREF="#AEN328" +><A +HREF="#AEN329" >Test 9</A ></DT ><DT ->2.3.10. <A -HREF="#AEN333" +><A +HREF="#AEN334" >Test 10</A ></DT ><DT ->2.3.11. <A -HREF="#AEN339" +><A +HREF="#AEN340" >Test 11</A ></DT ></DL ></DD ><DT ->2.4. <A -HREF="#AEN344" +><A +HREF="#AEN345" >Still having troubles?</A ></DT ></DL ></DD ><DT ->3. <A +><A HREF="#INTEGRATE-MS-NETWORKS" >Integrating MS Windows networks with Samba</A ></DT ><DD ><DL ><DT ->3.1. <A -HREF="#AEN361" +><A +HREF="#AEN362" >Agenda</A ></DT ><DT ->3.2. <A -HREF="#AEN383" +><A +HREF="#AEN384" >Name Resolution in a pure Unix/Linux world</A ></DT ><DD ><DL ><DT ->3.2.1. <A -HREF="#AEN399" +><A +HREF="#AEN400" ><TT CLASS="FILENAME" >/etc/hosts</TT ></A ></DT ><DT ->3.2.2. <A -HREF="#AEN415" +><A +HREF="#AEN416" ><TT CLASS="FILENAME" >/etc/resolv.conf</TT ></A ></DT ><DT ->3.2.3. <A -HREF="#AEN426" +><A +HREF="#AEN427" ><TT CLASS="FILENAME" >/etc/host.conf</TT ></A ></DT ><DT ->3.2.4. <A -HREF="#AEN434" +><A +HREF="#AEN435" ><TT CLASS="FILENAME" >/etc/nsswitch.conf</TT @@ -327,93 +322,79 @@ CLASS="FILENAME" ></DL ></DD ><DT ->3.3. <A -HREF="#AEN446" +><A +HREF="#AEN447" >Name resolution as used within MS Windows networking</A ></DT ><DD ><DL ><DT ->3.3.1. <A -HREF="#AEN458" +><A +HREF="#AEN459" >The NetBIOS Name Cache</A ></DT ><DT ->3.3.2. <A -HREF="#AEN463" +><A +HREF="#AEN464" >The LMHOSTS file</A ></DT ><DT ->3.3.3. <A -HREF="#AEN471" +><A +HREF="#AEN472" >HOSTS file</A ></DT ><DT ->3.3.4. <A -HREF="#AEN476" +><A +HREF="#AEN477" >DNS Lookup</A ></DT ><DT ->3.3.5. <A -HREF="#AEN479" +><A +HREF="#AEN480" >WINS Lookup</A ></DT ></DL ></DD ><DT ->3.4. <A -HREF="#AEN491" +><A +HREF="#AEN492" >How browsing functions and how to deploy stable and dependable browsing using Samba</A ></DT ><DT ->3.5. <A -HREF="#AEN501" +><A +HREF="#AEN502" >MS Windows security options and how to configure Samba for seemless integration</A ></DT ><DD ><DL ><DT ->3.5.1. <A -HREF="#AEN529" +><A +HREF="#AEN530" >Use MS Windows NT as an authentication server</A ></DT ><DT ->3.5.2. <A -HREF="#AEN537" +><A +HREF="#AEN538" >Make Samba a member of an MS Windows NT security domain</A ></DT ><DT ->3.5.3. <A -HREF="#AEN554" +><A +HREF="#AEN555" >Configure Samba as an authentication server</A ></DT -><DD -><DL -><DT ->3.5.3.1. <A -HREF="#AEN561" ->Users</A -></DT -><DT ->3.5.3.2. <A -HREF="#AEN566" ->MS Windows NT Machine Accounts</A -></DT -></DL -></DD ></DL ></DD ><DT ->3.6. <A -HREF="#AEN571" +><A +HREF="#AEN572" >Conclusions</A ></DT ></DL ></DD ><DT ->4. <A +><A HREF="#PAM" >Configuring PAM for distributed but centrally managed authentication</A @@ -421,39 +402,39 @@ managed authentication</A ><DD ><DL ><DT ->4.1. <A -HREF="#AEN592" +><A +HREF="#AEN593" >Samba and PAM</A ></DT ><DT ->4.2. <A -HREF="#AEN636" +><A +HREF="#AEN637" >Distributed Authentication</A ></DT ><DT ->4.3. <A -HREF="#AEN643" +><A +HREF="#AEN644" >PAM Configuration in smb.conf</A ></DT ></DL ></DD ><DT ->5. <A +><A HREF="#MSDFS" >Hosting a Microsoft Distributed File System tree on Samba</A ></DT ><DD ><DL ><DT ->5.1. <A -HREF="#AEN663" +><A +HREF="#AEN664" >Instructions</A ></DT ><DD ><DL ><DT ->5.1.1. <A -HREF="#AEN698" +><A +HREF="#AEN699" >Notes</A ></DT ></DL @@ -461,144 +442,144 @@ HREF="#AEN698" ></DL ></DD ><DT ->6. <A +><A HREF="#UNIX-PERMISSIONS" >UNIX Permission Bits and Windows NT Access Control Lists</A ></DT ><DD ><DL ><DT ->6.1. <A -HREF="#AEN718" +><A +HREF="#AEN719" >Viewing and changing UNIX permissions using the NT security dialogs</A ></DT ><DT ->6.2. <A -HREF="#AEN727" +><A +HREF="#AEN728" >How to view file security on a Samba share</A ></DT ><DT ->6.3. <A -HREF="#AEN738" +><A +HREF="#AEN739" >Viewing file ownership</A ></DT ><DT ->6.4. <A -HREF="#AEN758" +><A +HREF="#AEN759" >Viewing file or directory permissions</A ></DT ><DD ><DL ><DT ->6.4.1. <A -HREF="#AEN773" +><A +HREF="#AEN774" >File Permissions</A ></DT ><DT ->6.4.2. <A -HREF="#AEN787" +><A +HREF="#AEN788" >Directory Permissions</A ></DT ></DL ></DD ><DT ->6.5. <A -HREF="#AEN794" +><A +HREF="#AEN795" >Modifying file or directory permissions</A ></DT ><DT ->6.6. <A -HREF="#AEN816" +><A +HREF="#AEN817" >Interaction with the standard Samba create mask parameters</A ></DT ><DT ->6.7. <A -HREF="#AEN880" +><A +HREF="#AEN881" >Interaction with the standard Samba file attribute mapping</A ></DT ></DL ></DD ><DT ->7. <A +><A HREF="#PRINTING" >Printing Support in Samba 2.2.x</A ></DT ><DD ><DL ><DT ->7.1. <A -HREF="#AEN901" +><A +HREF="#AEN902" >Introduction</A ></DT ><DT ->7.2. <A -HREF="#AEN923" +><A +HREF="#AEN924" >Configuration</A ></DT ><DD ><DL ><DT ->7.2.1. <A -HREF="#AEN934" +><A +HREF="#AEN935" >Creating [print$]</A ></DT ><DT ->7.2.2. <A -HREF="#AEN969" +><A +HREF="#AEN970" >Setting Drivers for Existing Printers</A ></DT ><DT ->7.2.3. <A -HREF="#AEN986" +><A +HREF="#AEN987" >Support a large number of printers</A ></DT ><DT ->7.2.4. <A -HREF="#AEN997" +><A +HREF="#AEN998" >Adding New Printers via the Windows NT APW</A ></DT ><DT ->7.2.5. <A -HREF="#AEN1022" +><A +HREF="#AEN1028" >Samba and Printer Ports</A ></DT ></DL ></DD ><DT ->7.3. <A -HREF="#AEN1030" +><A +HREF="#AEN1036" >The Imprints Toolset</A ></DT ><DD ><DL ><DT ->7.3.1. <A -HREF="#AEN1034" +><A +HREF="#AEN1040" >What is Imprints?</A ></DT ><DT ->7.3.2. <A -HREF="#AEN1044" +><A +HREF="#AEN1050" >Creating Printer Driver Packages</A ></DT ><DT ->7.3.3. <A -HREF="#AEN1047" +><A +HREF="#AEN1053" >The Imprints server</A ></DT ><DT ->7.3.4. <A -HREF="#AEN1051" +><A +HREF="#AEN1057" >The Installation Client</A ></DT ></DL ></DD ><DT ->7.4. <A -HREF="#AEN1073" +><A +HREF="#AEN1079" ><A NAME="MIGRATION" ></A @@ -607,424 +588,342 @@ NAME="MIGRATION" ></DL ></DD ><DT ->8. <A -HREF="#PRINTING_DEBUG" +><A +HREF="#PRINTINGDEBUG" >Debugging Printing Problems</A ></DT ><DD ><DL ><DT ->8.1. <A -HREF="#AEN1119" +><A +HREF="#AEN1125" >Introduction</A ></DT ><DT ->8.2. <A -HREF="#AEN1135" +><A +HREF="#AEN1141" >Debugging printer problems</A ></DT ><DT ->8.3. <A -HREF="#AEN1144" +><A +HREF="#AEN1150" >What printers do I have?</A ></DT ><DT ->8.4. <A -HREF="#AEN1152" +><A +HREF="#AEN1158" >Setting up printcap and print servers</A ></DT ><DT ->8.5. <A -HREF="#AEN1180" +><A +HREF="#AEN1186" >Job sent, no output</A ></DT ><DT ->8.6. <A -HREF="#AEN1191" +><A +HREF="#AEN1197" >Job sent, strange output</A ></DT ><DT ->8.7. <A -HREF="#AEN1203" +><A +HREF="#AEN1209" >Raw PostScript printed</A ></DT ><DT ->8.8. <A -HREF="#AEN1206" +><A +HREF="#AEN1212" >Advanced Printing</A ></DT ><DT ->8.9. <A -HREF="#AEN1209" +><A +HREF="#AEN1215" >Real debugging</A ></DT ></DL ></DD ><DT ->9. <A -HREF="#SECURITY_LEVELS" +><A +HREF="#SECURITYLEVELS" >Security levels</A ></DT ><DD ><DL ><DT ->9.1. <A -HREF="#AEN1222" +><A +HREF="#AEN1228" >Introduction</A ></DT ><DT ->9.2. <A -HREF="#AEN1233" +><A +HREF="#AEN1239" >More complete description of security levels</A ></DT ></DL ></DD ><DT ->10. <A +><A HREF="#DOMAIN-SECURITY" >security = domain in Samba 2.x</A ></DT ><DD ><DL ><DT ->10.1. <A -HREF="#AEN1266" +><A +HREF="#AEN1272" >Joining an NT Domain with Samba 2.2</A ></DT ><DT ->10.2. <A -HREF="#AEN1330" +><A +HREF="#AEN1336" >Samba and Windows 2000 Domains</A ></DT ><DT ->10.3. <A -HREF="#AEN1335" +><A +HREF="#AEN1341" >Why is this better than security = server?</A ></DT ></DL ></DD ><DT ->11. <A +><A HREF="#WINBIND" >Unified Logons between Windows NT and UNIX using Winbind</A ></DT ><DD ><DL ><DT ->11.1. <A -HREF="#AEN1388" +><A +HREF="#AEN1394" >Abstract</A ></DT ><DT ->11.2. <A -HREF="#AEN1392" +><A +HREF="#AEN1398" >Introduction</A ></DT ><DT ->11.3. <A -HREF="#AEN1405" +><A +HREF="#AEN1411" >What Winbind Provides</A ></DT ><DD ><DL ><DT ->11.3.1. <A -HREF="#AEN1412" +><A +HREF="#AEN1418" >Target Uses</A ></DT ></DL ></DD ><DT ->11.4. <A -HREF="#AEN1416" +><A +HREF="#AEN1422" >How Winbind Works</A ></DT ><DD ><DL ><DT ->11.4.1. <A -HREF="#AEN1421" +><A +HREF="#AEN1427" >Microsoft Remote Procedure Calls</A ></DT ><DT ->11.4.2. <A -HREF="#AEN1425" +><A +HREF="#AEN1431" >Name Service Switch</A ></DT ><DT ->11.4.3. <A -HREF="#AEN1441" +><A +HREF="#AEN1447" >Pluggable Authentication Modules</A ></DT ><DT ->11.4.4. <A -HREF="#AEN1449" +><A +HREF="#AEN1455" >User and Group ID Allocation</A ></DT ><DT ->11.4.5. <A -HREF="#AEN1453" +><A +HREF="#AEN1459" >Result Caching</A ></DT ></DL ></DD ><DT ->11.5. <A -HREF="#AEN1456" +><A +HREF="#AEN1462" >Installation and Configuration</A ></DT ><DD ><DL ><DT ->11.5.1. <A -HREF="#AEN1463" +><A +HREF="#AEN1469" >Introduction</A ></DT ><DT ->11.5.2. <A -HREF="#AEN1476" +><A +HREF="#AEN1482" >Requirements</A ></DT ><DT ->11.5.3. <A -HREF="#AEN1490" +><A +HREF="#AEN1496" >Testing Things Out</A ></DT -><DD -><DL -><DT ->11.5.3.1. <A -HREF="#AEN1501" ->Configure and compile SAMBA</A -></DT -><DT ->11.5.3.2. <A -HREF="#AEN1520" ->Configure <TT -CLASS="FILENAME" ->nsswitch.conf</TT -> and the -winbind libraries</A -></DT -><DT ->11.5.3.3. <A -HREF="#AEN1553" ->Configure smb.conf</A -></DT -><DT ->11.5.3.4. <A -HREF="#AEN1569" ->Join the SAMBA server to the PDC domain</A -></DT -><DT ->11.5.3.5. <A -HREF="#AEN1580" ->Start up the winbindd daemon and test it!</A -></DT -><DT ->11.5.3.6. <A -HREF="#AEN1616" ->Fix the init.d startup scripts</A -></DT -><DT ->11.5.3.7. <A -HREF="#AEN1648" ->Configure Winbind and PAM</A -></DT -></DL -></DD ></DL ></DD ><DT ->11.6. <A -HREF="#AEN1705" +><A +HREF="#AEN1711" >Limitations</A ></DT ><DT ->11.7. <A -HREF="#AEN1715" +><A +HREF="#AEN1721" >Conclusion</A ></DT ></DL ></DD ><DT ->12. <A +><A HREF="#SAMBA-PDC" >How to Configure Samba 2.2 as a Primary Domain Controller</A ></DT ><DD ><DL ><DT ->12.1. <A -HREF="#AEN1735" +><A +HREF="#AEN1741" >Prerequisite Reading</A ></DT ><DT ->12.2. <A -HREF="#AEN1741" +><A +HREF="#AEN1747" >Background</A ></DT ><DT ->12.3. <A -HREF="#AEN1780" +><A +HREF="#AEN1786" >Configuring the Samba Domain Controller</A ></DT ><DT ->12.4. <A -HREF="#AEN1823" +><A +HREF="#AEN1829" >Creating Machine Trust Accounts and Joining Clients to the Domain</A ></DT ><DD ><DL ><DT ->12.4.1. <A -HREF="#AEN1842" +><A +HREF="#AEN1848" >Manual Creation of Machine Trust Accounts</A ></DT ><DT ->12.4.2. <A -HREF="#AEN1877" +><A +HREF="#AEN1883" >"On-the-Fly" Creation of Machine Trust Accounts</A ></DT ><DT ->12.4.3. <A -HREF="#AEN1886" +><A +HREF="#AEN1892" >Joining the Client to the Domain</A ></DT ></DL ></DD ><DT ->12.5. <A -HREF="#AEN1901" +><A +HREF="#AEN1907" >Common Problems and Errors</A ></DT ><DT ->12.6. <A -HREF="#AEN1949" +><A +HREF="#AEN1955" >System Policies and Profiles</A ></DT ><DT ->12.7. <A -HREF="#AEN1993" +><A +HREF="#AEN1999" >What other help can I get?</A ></DT ><DT ->12.8. <A -HREF="#AEN2107" +><A +HREF="#AEN2113" >Domain Control for Windows 9x/ME</A ></DT ><DD ><DL ><DT ->12.8.1. <A -HREF="#AEN2133" +><A +HREF="#AEN2139" >Configuration Instructions: Network Logons</A ></DT ><DT ->12.8.2. <A -HREF="#AEN2152" +><A +HREF="#AEN2158" >Configuration Instructions: Setting up Roaming User Profiles</A ></DT -><DD -><DL -><DT ->12.8.2.1. <A -HREF="#AEN2160" ->Windows NT Configuration</A -></DT -><DT ->12.8.2.2. <A -HREF="#AEN2168" ->Windows 9X Configuration</A -></DT -><DT ->12.8.2.3. <A -HREF="#AEN2176" ->Win9X and WinNT Configuration</A -></DT -><DT ->12.8.2.4. <A -HREF="#AEN2183" ->Windows 9X Profile Setup</A -></DT -><DT ->12.8.2.5. <A -HREF="#AEN2219" ->Windows NT Workstation 4.0</A -></DT -><DT ->12.8.2.6. <A -HREF="#AEN2232" ->Windows NT Server</A -></DT -><DT ->12.8.2.7. <A -HREF="#AEN2235" ->Sharing Profiles between W95 and NT Workstation 4.0</A -></DT -></DL -></DD ></DL ></DD ><DT ->12.9. <A -HREF="#AEN2245" +><A +HREF="#AEN2251" >DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba</A ></DT ></DL ></DD ><DT ->13. <A +><A HREF="#SAMBA-BDC" >How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</A ></DT ><DD ><DL ><DT ->13.1. <A -HREF="#AEN2281" +><A +HREF="#AEN2287" >Prerequisite Reading</A ></DT ><DT ->13.2. <A -HREF="#AEN2285" +><A +HREF="#AEN2291" >Background</A ></DT ><DT ->13.3. <A -HREF="#AEN2293" +><A +HREF="#AEN2299" >What qualifies a Domain Controller on the network?</A ></DT ><DD ><DL ><DT ->13.3.1. <A -HREF="#AEN2296" +><A +HREF="#AEN2302" >How does a Workstation find its domain controller?</A ></DT ><DT ->13.3.2. <A -HREF="#AEN2299" +><A +HREF="#AEN2305" >When is the PDC needed?</A ></DT ></DL ></DD ><DT ->13.4. <A -HREF="#AEN2302" +><A +HREF="#AEN2308" >Can Samba be a Backup Domain Controller?</A ></DT ><DT ->13.5. <A -HREF="#AEN2306" +><A +HREF="#AEN2312" >How do I set up a Samba BDC?</A ></DT ><DD ><DL ><DT ->13.5.1. <A -HREF="#AEN2322" +><A +HREF="#AEN2329" >How do I replicate the smbpasswd file?</A ></DT ></DL @@ -1032,333 +931,377 @@ HREF="#AEN2322" ></DL ></DD ><DT ->14. <A +><A HREF="#SAMBA-LDAP-HOWTO" >Storing Samba's User/Machine Account information in an LDAP Directory</A ></DT ><DD ><DL ><DT ->14.1. <A -HREF="#AEN2343" +><A +HREF="#AEN2350" >Purpose</A ></DT ><DT ->14.2. <A -HREF="#AEN2363" +><A +HREF="#AEN2370" >Introduction</A ></DT ><DT ->14.3. <A -HREF="#AEN2392" +><A +HREF="#AEN2399" >Supported LDAP Servers</A ></DT ><DT ->14.4. <A -HREF="#AEN2397" +><A +HREF="#AEN2404" >Schema and Relationship to the RFC 2307 posixAccount</A ></DT ><DT ->14.5. <A -HREF="#AEN2409" +><A +HREF="#AEN2416" >Configuring Samba with LDAP</A ></DT ><DD ><DL ><DT ->14.5.1. <A -HREF="#AEN2411" +><A +HREF="#AEN2418" >OpenLDAP configuration</A ></DT ><DT ->14.5.2. <A -HREF="#AEN2428" +><A +HREF="#AEN2435" >Configuring Samba</A ></DT ></DL ></DD ><DT ->14.6. <A -HREF="#AEN2456" +><A +HREF="#AEN2463" >Accounts and Groups management</A ></DT ><DT ->14.7. <A -HREF="#AEN2461" +><A +HREF="#AEN2468" >Security and sambaAccount</A ></DT ><DT ->14.8. <A -HREF="#AEN2481" +><A +HREF="#AEN2488" >LDAP specials attributes for sambaAccounts</A ></DT ><DT ->14.9. <A -HREF="#AEN2551" +><A +HREF="#AEN2558" >Example LDIF Entries for a sambaAccount</A ></DT ><DT ->14.10. <A -HREF="#AEN2559" +><A +HREF="#AEN2566" >Comments</A ></DT ></DL ></DD ><DT ->15. <A +><A HREF="#IMPROVED-BROWSING" >Improved browsing in samba</A ></DT ><DD ><DL ><DT ->15.1. <A -HREF="#AEN2570" +><A +HREF="#AEN2577" >Overview of browsing</A ></DT ><DT ->15.2. <A -HREF="#AEN2574" +><A +HREF="#AEN2581" >Browsing support in samba</A ></DT ><DT ->15.3. <A -HREF="#AEN2583" +><A +HREF="#AEN2590" >Problem resolution</A ></DT ><DT ->15.4. <A -HREF="#AEN2590" +><A +HREF="#AEN2597" >Browsing across subnets</A ></DT ><DD ><DL ><DT ->15.4.1. <A -HREF="#AEN2595" +><A +HREF="#AEN2602" >How does cross subnet browsing work ?</A ></DT ></DL ></DD ><DT ->15.5. <A -HREF="#AEN2630" +><A +HREF="#AEN2637" >Setting up a WINS server</A ></DT ><DT ->15.6. <A -HREF="#AEN2649" +><A +HREF="#AEN2656" >Setting up Browsing in a WORKGROUP</A ></DT ><DT ->15.7. <A -HREF="#AEN2667" +><A +HREF="#AEN2674" >Setting up Browsing in a DOMAIN</A ></DT ><DT ->15.8. <A -HREF="#AEN2677" +><A +HREF="#AEN2684" >Forcing samba to be the master</A ></DT ><DT ->15.9. <A -HREF="#AEN2686" +><A +HREF="#AEN2693" >Making samba the domain master</A ></DT ><DT ->15.10. <A -HREF="#AEN2704" +><A +HREF="#AEN2711" >Note about broadcast addresses</A ></DT ><DT ->15.11. <A -HREF="#AEN2707" +><A +HREF="#AEN2714" >Multiple interfaces</A ></DT ></DL ></DD ><DT ->16. <A +><A HREF="#SPEED" >Samba performance issues</A ></DT ><DD ><DL ><DT ->16.1. <A -HREF="#AEN2725" +><A +HREF="#AEN2732" >Comparisons</A ></DT ><DT ->16.2. <A -HREF="#AEN2731" +><A +HREF="#AEN2738" >Oplocks</A ></DT ><DD ><DL ><DT ->16.2.1. <A -HREF="#AEN2733" +><A +HREF="#AEN2740" >Overview</A ></DT ><DT ->16.2.2. <A -HREF="#AEN2741" +><A +HREF="#AEN2748" >Level2 Oplocks</A ></DT ><DT ->16.2.3. <A -HREF="#AEN2747" +><A +HREF="#AEN2754" >Old 'fake oplocks' option - deprecated</A ></DT ></DL ></DD ><DT ->16.3. <A -HREF="#AEN2751" +><A +HREF="#AEN2758" >Socket options</A ></DT ><DT ->16.4. <A -HREF="#AEN2758" +><A +HREF="#AEN2765" >Read size</A ></DT ><DT ->16.5. <A -HREF="#AEN2763" +><A +HREF="#AEN2770" >Max xmit</A ></DT ><DT ->16.6. <A -HREF="#AEN2768" +><A +HREF="#AEN2775" >Locking</A ></DT ><DT ->16.7. <A -HREF="#AEN2772" +><A +HREF="#AEN2779" >Share modes</A ></DT ><DT ->16.8. <A -HREF="#AEN2777" +><A +HREF="#AEN2784" >Log level</A ></DT ><DT ->16.9. <A -HREF="#AEN2780" +><A +HREF="#AEN2787" >Wide lines</A ></DT ><DT ->16.10. <A -HREF="#AEN2783" +><A +HREF="#AEN2790" >Read raw</A ></DT ><DT ->16.11. <A -HREF="#AEN2788" +><A +HREF="#AEN2795" >Write raw</A ></DT ><DT ->16.12. <A -HREF="#AEN2792" +><A +HREF="#AEN2799" >Read prediction</A ></DT ><DT ->16.13. <A -HREF="#AEN2799" +><A +HREF="#AEN2806" >Memory mapping</A ></DT ><DT ->16.14. <A -HREF="#AEN2804" +><A +HREF="#AEN2811" >Slow Clients</A ></DT ><DT ->16.15. <A -HREF="#AEN2808" +><A +HREF="#AEN2815" >Slow Logins</A ></DT ><DT ->16.16. <A -HREF="#AEN2811" +><A +HREF="#AEN2818" >Client tuning</A ></DT ><DT ->16.17. <A -HREF="#AEN2843" +><A +HREF="#AEN2850" >My Results</A ></DT ></DL ></DD ><DT ->17. <A -HREF="#OS2" ->OS2 Client HOWTO</A +><A +HREF="#OTHER-CLIENTS" +>Samba and other CIFS clients</A ></DT ><DD ><DL ><DT ->17.1. <A -HREF="#AEN2860" ->FAQs</A +><A +HREF="#AEN2871" +>Macintosh clients?</A +></DT +><DT +><A +HREF="#AEN2880" +>OS2 Client</A ></DT ><DD ><DL ><DT ->17.1.1. <A -HREF="#AEN2862" +><A +HREF="#AEN2882" >How can I configure OS/2 Warp Connect or OS/2 Warp 4 as a client for Samba?</A ></DT ><DT ->17.1.2. <A -HREF="#AEN2877" +><A +HREF="#AEN2897" >How can I configure OS/2 Warp 3 (not Connect), OS/2 1.2, 1.3 or 2.x for Samba?</A ></DT ><DT ->17.1.3. <A -HREF="#AEN2886" +><A +HREF="#AEN2906" >Are there any other issues when OS/2 (any version) is used as a client?</A ></DT ><DT ->17.1.4. <A -HREF="#AEN2890" +><A +HREF="#AEN2910" >How do I get printer driver download working for OS/2 clients?</A ></DT ></DL ></DD +><DT +><A +HREF="#AEN2920" +>Windows for Workgroups</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN2922" +>Use latest TCP/IP stack from Microsoft</A +></DT +><DT +><A +HREF="#AEN2927" +>Delete .pwl files after password change</A +></DT +><DT +><A +HREF="#AEN2932" +>Configure WfW password handling</A +></DT +><DT +><A +HREF="#AEN2936" +>Case handling of passwords</A +></DT ></DL ></DD ><DT ->18. <A +><A +HREF="#AEN2941" +>Windows '95/'98</A +></DT +><DT +><A +HREF="#AEN2957" +>Windows 2000 Service Pack 2</A +></DT +></DL +></DD +><DT +><A HREF="#CVS-ACCESS" >HOWTO Access Samba source code via CVS</A ></DT ><DD ><DL ><DT ->18.1. <A -HREF="#AEN2906" +><A +HREF="#AEN2981" >Introduction</A ></DT ><DT ->18.2. <A -HREF="#AEN2911" +><A +HREF="#AEN2986" >CVS Access to samba.org</A ></DT ><DD ><DL ><DT ->18.2.1. <A -HREF="#AEN2914" +><A +HREF="#AEN2989" >Access via CVSweb</A ></DT ><DT ->18.2.2. <A -HREF="#AEN2919" +><A +HREF="#AEN2994" >Access via cvs</A ></DT ></DL @@ -1366,66 +1309,86 @@ HREF="#AEN2919" ></DL ></DD ><DT ->19. <A +><A HREF="#BUGREPORT" >Reporting Bugs</A ></DT ><DD ><DL ><DT ->19.1. <A -HREF="#AEN2954" +><A +HREF="#AEN3029" >Introduction</A ></DT ><DT ->19.2. <A -HREF="#AEN2961" +><A +HREF="#AEN3036" >General info</A ></DT ><DT ->19.3. <A -HREF="#AEN2967" +><A +HREF="#AEN3042" >Debug levels</A ></DT ><DT ->19.4. <A -HREF="#AEN2984" +><A +HREF="#AEN3059" >Internal errors</A ></DT ><DT ->19.5. <A -HREF="#AEN2994" +><A +HREF="#AEN3069" >Attaching to a running process</A ></DT ><DT ->19.6. <A -HREF="#AEN2997" +><A +HREF="#AEN3072" >Patches</A ></DT ></DL ></DD ><DT ><A -HREF="#AEN3002" ->Index</A +HREF="#GROUPMAPPING" +>Group mapping HOWTO</A +></DT +><DT +><A +HREF="#PORTABILITY" +>Portability</A +></DT +><DD +><DL +><DT +><A +HREF="#AEN3119" +>HPUX</A +></DT +><DT +><A +HREF="#AEN3124" +>SCO Unix</A +></DT +><DT +><A +HREF="#AEN3128" +>DNIX</A ></DT ></DL +></DD +></DL ></DIV ><DIV CLASS="CHAPTER" ><HR><H1 ><A -NAME="INSTALL" ->Chapter 1. How to Install and Test SAMBA</A -></H1 +NAME="INSTALL">How to Install and Test SAMBA</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN20" ->1.1. Step 0: Read the man pages</A -></H1 +NAME="AEN20">Step 0: Read the man pages</H2 ><P >The man pages distributed with SAMBA contain lots of useful info that will help to get you started. @@ -1452,12 +1415,10 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN28" ->1.2. Step 1: Building the Binaries</A -></H1 +NAME="AEN28">Step 1: Building the Binaries</H2 ><P >To do this, first run the program <B CLASS="COMMAND" @@ -1551,12 +1512,10 @@ CLASS="USERINPUT" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN56" ->1.3. Step 2: The all important step</A -></H1 +NAME="AEN56">Step 2: The all important step</H2 ><P >At this stage you must fetch yourself a coffee or other drink you find stimulating. Getting the rest @@ -1568,12 +1527,10 @@ NAME="AEN56" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN60" ->1.4. Step 3: Create the smb configuration file.</A -></H1 +NAME="AEN60">Step 3: Create the smb configuration file.</H2 ><P >There are sample configuration files in the examples subdirectory in the distribution. I suggest you read them @@ -1633,16 +1590,14 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN74" ->1.5. Step 4: Test your config file with +NAME="AEN74">Step 4: Test your config file with <B CLASS="COMMAND" >testparm</B -></A -></H1 +></H2 ><P >It's important that you test the validity of your <TT @@ -1657,12 +1612,10 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN80" ->1.6. Step 5: Starting the smbd and nmbd</A -></H1 +NAME="AEN80">Step 5: Starting the smbd and nmbd</H2 ><P >You must choose to start smbd and nmbd either as daemons or from <B @@ -1697,12 +1650,10 @@ CLASS="COMMAND" request.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN90" ->1.6.1. Step 5a: Starting from inetd.conf</A -></H2 +NAME="AEN90">Step 5a: Starting from inetd.conf</H3 ><P >NOTE; The following will be different if you use NIS or NIS+ to distributed services maps.</P @@ -1810,12 +1761,10 @@ CLASS="COMMAND" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN119" ->1.6.2. Step 5b. Alternative: starting it as a daemon</A -></H2 +NAME="AEN119">Step 5b. Alternative: starting it as a daemon</H3 ><P >To start the server as a daemon you should create a script something like this one, perhaps calling @@ -1876,13 +1825,11 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN135" ->1.7. Step 6: Try listing the shares available on your - server</A -></H1 +NAME="AEN135">Step 6: Try listing the shares available on your + server</H2 ><P ><TT CLASS="PROMPT" @@ -1917,12 +1864,10 @@ CLASS="COMMAND" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN144" ->1.8. Step 7: Try connecting with the unix client</A -></H1 +NAME="AEN144">Step 7: Try connecting with the unix client</H2 ><P ><TT CLASS="PROMPT" @@ -1980,13 +1925,11 @@ CLASS="USERINPUT" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN160" ->1.9. Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT, - Win2k, OS/2, etc... client</A -></H1 +NAME="AEN160">Step 8: Try connecting from a DOS, WfWg, Win9x, WinNT, + Win2k, OS/2, etc... client</H2 ><P >Try mounting disks. eg:</P ><P @@ -2029,12 +1972,10 @@ CLASS="USERINPUT" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN174" ->1.10. What If Things Don't Work?</A -></H1 +NAME="AEN174">What If Things Don't Work?</H2 ><P >If nothing works and you start to think "who wrote this pile of trash" then I suggest you do step 2 again (and @@ -2052,12 +1993,10 @@ NAME="AEN174" easier. </P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN179" ->1.10.1. Diagnosing Problems</A -></H2 +NAME="AEN179">Diagnosing Problems</H3 ><P >If you have installation problems then go to <TT @@ -2068,12 +2007,10 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN183" ->1.10.2. Scope IDs</A -></H2 +NAME="AEN183">Scope IDs</H3 ><P >By default Samba uses a blank scope ID. This means all your windows boxes must also have a blank scope ID. @@ -2084,12 +2021,10 @@ NAME="AEN183" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN186" ->1.10.3. Choosing the Protocol Level</A -></H2 +NAME="AEN186">Choosing the Protocol Level</H3 ><P >The SMB protocol has many dialects. Currently Samba supports 5, called CORE, COREPLUS, LANMAN1, @@ -2125,30 +2060,29 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN195" ->1.10.4. Printing from UNIX to a Client PC</A -></H2 +NAME="AEN195">Printing from UNIX to a Client PC</H3 ><P >To use a printer that is available via a smb-based - server from a unix host you will need to compile the + server from a unix host with LPR you will need to compile the smbclient program. You then need to install the script "smbprint". Read the instruction in smbprint for more details. </P ><P >There is also a SYSV style script that does much the same thing called smbprint.sysv. It contains instructions.</P +><P +>See the CUPS manual for information about setting up + printing from a unix host with CUPS to a smb-based server. </P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN199" ->1.10.5. Locking</A -></H2 +NAME="AEN200">Locking</H3 ><P >One area which sometimes causes trouble is locking.</P ><P @@ -2203,12 +2137,10 @@ NAME="AEN199" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN208" ->1.10.6. Mapping Usernames</A -></H2 +NAME="AEN209">Mapping Usernames</H3 ><P >If you have different usernames on the PCs and the unix server then take a look at the "username map" option. @@ -2220,17 +2152,13 @@ NAME="AEN208" CLASS="CHAPTER" ><HR><H1 ><A -NAME="DIAGNOSIS" ->Chapter 2. Diagnosing your samba server</A -></H1 +NAME="DIAGNOSIS">Diagnosing your samba server</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN222" ->2.1. Introduction</A -></H1 +NAME="AEN223">Introduction</H2 ><P >This file contains a list of tests you can perform to validate your Samba server. It also tells you what the likely cause of the problem @@ -2247,12 +2175,10 @@ ignore your email.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN227" ->2.2. Assumptions</A -></H1 +NAME="AEN228">Assumptions</H2 ><P >In all of the tests I assume you have a Samba server called BIGSERVER and a PC called ACLIENT both in workgroup TESTGROUP. I also assume the @@ -2297,20 +2223,16 @@ best way to check this is with "testparm smb.conf"</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN237" ->2.3. Tests</A -></H1 +NAME="AEN238">Tests</H2 ><DIV CLASS="SECT2" -><H2 +><H3 CLASS="SECT2" ><A -NAME="AEN239" ->2.3.1. Test 1</A -></H2 +NAME="AEN240">Test 1</H3 ><P >In the directory in which you store your smb.conf file, run the command "testparm smb.conf". If it reports any errors then your smb.conf @@ -2327,12 +2249,10 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN245" ->2.3.2. Test 2</A -></H2 +NAME="AEN246">Test 2</H3 ><P >Run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from the unix box. If you don't get a valid response then your TCP/IP @@ -2353,12 +2273,10 @@ this is done via the ipfwadm program.)</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN251" ->2.3.3. Test 3</A -></H2 +NAME="AEN252">Test 3</H3 ><P >Run the command "smbclient -L BIGSERVER" on the unix box. You should get a list of available shares back. </P @@ -2442,12 +2360,10 @@ correct and that Samba has correctly noted these in the log.nmb file.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN266" ->2.3.4. Test 4</A -></H2 +NAME="AEN267">Test 4</H3 ><P >Run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the IP address of your Samba server back.</P @@ -2463,12 +2379,10 @@ inetd.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN271" ->2.3.5. Test 5</A -></H2 +NAME="AEN272">Test 5</H3 ><P >run the command <B CLASS="COMMAND" @@ -2484,12 +2398,10 @@ client in the above test.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN277" ->2.3.6. Test 6</A -></H2 +NAME="AEN278">Test 6</H3 ><P >Run the command <B CLASS="COMMAND" @@ -2518,12 +2430,10 @@ not correct. (Refer to TEST 3 notes above).</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN285" ->2.3.7. Test 7</A -></H2 +NAME="AEN286">Test 7</H3 ><P >Run the command <B CLASS="COMMAND" @@ -2607,12 +2517,10 @@ CLASS="COMMAND" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN311" ->2.3.8. Test 8</A -></H2 +NAME="AEN312">Test 8</H3 ><P >On the PC type the command <B CLASS="COMMAND" @@ -2667,12 +2575,10 @@ the hosts.allow file for your client (or subnet, etc.)</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN328" ->2.3.9. Test 9</A -></H2 +NAME="AEN329">Test 9</H3 ><P >Run the command <B CLASS="COMMAND" @@ -2691,12 +2597,10 @@ fixes things you may need the username mapping option.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN333" ->2.3.10. Test 10</A -></H2 +NAME="AEN334">Test 10</H3 ><P >Run the command <B CLASS="COMMAND" @@ -2717,12 +2621,10 @@ an election is held at startup.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN339" ->2.3.11. Test 11</A -></H2 +NAME="AEN340">Test 11</H3 ><P >From file manager try to browse the server. Your samba server should appear in the browse list of your local workgroup (or the one you @@ -2745,12 +2647,10 @@ for encrypted passwords (refer to the Makefile).</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN344" ->2.4. Still having troubles?</A -></H1 +NAME="AEN345">Still having troubles?</H2 ><P >Try the mailing list or newsgroup, or use the ethereal utility to sniff the problem. The official samba mailing list can be reached at @@ -2774,17 +2674,13 @@ TARGET="_top" CLASS="CHAPTER" ><HR><H1 ><A -NAME="INTEGRATE-MS-NETWORKS" ->Chapter 3. Integrating MS Windows networks with Samba</A -></H1 +NAME="INTEGRATE-MS-NETWORKS">Integrating MS Windows networks with Samba</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN361" ->3.1. Agenda</A -></H1 +NAME="AEN362">Agenda</H2 ><P >To identify the key functional mechanisms of MS Windows networking to enable the deployment of Samba as a means of extending and/or @@ -2846,12 +2742,10 @@ TYPE="a" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN383" ->3.2. Name Resolution in a pure Unix/Linux world</A -></H1 +NAME="AEN384">Name Resolution in a pure Unix/Linux world</H2 ><P >The key configuration files covered in this section are:</P ><P @@ -2888,15 +2782,13 @@ CLASS="FILENAME" ></UL ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN399" ->3.2.1. <TT +NAME="AEN400"><TT CLASS="FILENAME" >/etc/hosts</TT -></A -></H2 +></H3 ><P >Contains a static list of IP Addresses and names. eg:</P @@ -2978,15 +2870,13 @@ becomes available.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN415" ->3.2.2. <TT +NAME="AEN416"><TT CLASS="FILENAME" >/etc/resolv.conf</TT -></A -></H2 +></H3 ><P >This file tells the name resolution libraries:</P ><P @@ -3016,15 +2906,13 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN426" ->3.2.3. <TT +NAME="AEN427"><TT CLASS="FILENAME" >/etc/host.conf</TT -></A -></H2 +></H3 ><P ><TT CLASS="FILENAME" @@ -3054,15 +2942,13 @@ man page for host.conf for further details.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN434" ->3.2.4. <TT +NAME="AEN435"><TT CLASS="FILENAME" >/etc/nsswitch.conf</TT -></A -></H2 +></H3 ><P >This file controls the actual name resolution targets. The file typically has resolver object specifications as follows:</P @@ -3132,12 +3018,10 @@ which both the samba machine and the MS Windows machine belong.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN446" ->3.3. Name resolution as used within MS Windows networking</A -></H1 +NAME="AEN447">Name resolution as used within MS Windows networking</H2 ><P >MS Windows networking is predicated about the name each machine is given. This name is known variously (and inconsistently) as @@ -3226,12 +3110,10 @@ Since we are primarily concerned with TCP/IP this demonstration is limited to this area.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN458" ->3.3.1. The NetBIOS Name Cache</A -></H2 +NAME="AEN459">The NetBIOS Name Cache</H3 ><P >All MS Windows machines employ an in memory buffer in which is stored the NetBIOS names and IP addresses for all external @@ -3253,12 +3135,10 @@ is called "nmblookup".</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN463" ->3.3.2. The LMHOSTS file</A -></H2 +NAME="AEN464">The LMHOSTS file</H3 ><P >This file is usually located in MS Windows NT 4.0 or 2000 in <TT @@ -3365,12 +3245,10 @@ CLASS="PROGRAMLISTING" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN471" ->3.3.3. HOSTS file</A -></H2 +NAME="AEN472">HOSTS file</H3 ><P >This file is usually located in MS Windows NT 4.0 or 2000 in <TT @@ -3387,12 +3265,10 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN476" ->3.3.4. DNS Lookup</A -></H2 +NAME="AEN477">DNS Lookup</H3 ><P >This capability is configured in the TCP/IP setup area in the network configuration facility. If enabled an elaborate name resolution sequence @@ -3407,12 +3283,10 @@ lookup is used.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN479" ->3.3.5. WINS Lookup</A -></H2 +NAME="AEN480">WINS Lookup</H3 ><P >A WINS (Windows Internet Name Server) service is the equivaent of the rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores @@ -3468,13 +3342,11 @@ of the WINS server.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN491" ->3.4. How browsing functions and how to deploy stable and -dependable browsing using Samba</A -></H1 +NAME="AEN492">How browsing functions and how to deploy stable and +dependable browsing using Samba</H2 ><P >As stated above, MS Windows machines register their NetBIOS names (i.e.: the machine name for each service type in operation) on start @@ -3535,13 +3407,11 @@ and so on.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN501" ->3.5. MS Windows security options and how to configure -Samba for seemless integration</A -></H1 +NAME="AEN502">MS Windows security options and how to configure +Samba for seemless integration</H2 ><P >MS Windows clients may use encrypted passwords as part of a challenege/response authentication model (a.k.a. NTLMv1) or @@ -3657,8 +3527,9 @@ CLASS="PARAMETER" >password level</I ></TT > must be set to the maximum -number of upper case letter which <EM ->could</EM +number of upper case letter which <I +CLASS="EMPHASIS" +>could</I > appear is a password. Note that is the server OS uses the traditional DES version of crypt(), then a <TT @@ -3677,12 +3548,10 @@ where ever Samba is used. There are three configuration possibilities for support of encrypted passwords:</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN529" ->3.5.1. Use MS Windows NT as an authentication server</A -></H2 +NAME="AEN530">Use MS Windows NT as an authentication server</H3 ><P >This method involves the additions of the following parameters in the smb.conf file:</P @@ -3722,12 +3591,10 @@ to prevent logons by other than MS Windows clients.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN537" ->3.5.2. Make Samba a member of an MS Windows NT security domain</A -></H2 +NAME="AEN538">Make Samba a member of an MS Windows NT security domain</H3 ><P >This method involves additon of the following paramters in the smb.conf file:</P ><P @@ -3794,12 +3661,10 @@ this HOWTO collection.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN554" ->3.5.3. Configure Samba as an authentication server</A -></H2 +NAME="AEN555">Configure Samba as an authentication server</H3 ><P >This mode of authentication demands that there be on the Unix/Linux system both a Unix style account as well as an @@ -3840,12 +3705,10 @@ to be created for each user, as well as for each MS Windows NT/2000 machine. The following structure is required.</P ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN561" ->3.5.3.1. Users</A -></H3 +NAME="AEN562">Users</H4 ><P >A user account that may provide a home directory should be created. The following Linux system commands are typical of @@ -3872,12 +3735,10 @@ CLASS="PROGRAMLISTING" ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN566" ->3.5.3.2. MS Windows NT Machine Accounts</A -></H3 +NAME="AEN567">MS Windows NT Machine Accounts</H4 ><P >These are required only when Samba is used as a domain controller. Refer to the Samba-PDC-HOWTO for more details.</P @@ -3902,12 +3763,10 @@ CLASS="PROGRAMLISTING" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN571" ->3.6. Conclusions</A -></H1 +NAME="AEN572">Conclusions</H2 ><P >Samba provides a flexible means to operate as...</P ><P @@ -3941,18 +3800,14 @@ NAME="AEN571" CLASS="CHAPTER" ><HR><H1 ><A -NAME="PAM" ->Chapter 4. Configuring PAM for distributed but centrally -managed authentication</A -></H1 +NAME="PAM">Configuring PAM for distributed but centrally +managed authentication</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN592" ->4.1. Samba and PAM</A -></H1 +NAME="AEN593">Samba and PAM</H2 ><P >A number of Unix systems (eg: Sun Solaris), as well as the xxxxBSD family and Linux, now utilize the Pluggable Authentication @@ -4187,7 +4042,7 @@ password required /lib/security/pam_smbpass.so nodelay smbconf=/etc/samba. ></P ><P >Note: PAM allows stacking of authentication mechanisms. It is -also possible to pass information obtained within on PAM module through +also possible to pass information obtained within one PAM module through to the next module in the PAM stack. Please refer to the documentation for your particular system implementation for details regarding the specific capabilities of PAM in this environment. Some Linux implmentations also @@ -4206,12 +4061,10 @@ PAM documentation for further helpful information.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN636" ->4.2. Distributed Authentication</A -></H1 +NAME="AEN637">Distributed Authentication</H2 ><P >The astute administrator will realize from this that the combination of <TT @@ -4239,12 +4092,10 @@ reduction of wide area network authentication traffic.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN643" ->4.3. PAM Configuration in smb.conf</A -></H1 +NAME="AEN644">PAM Configuration in smb.conf</H2 ><P >There is an option in smb.conf called <A HREF="smb.conf.5.html#OBEYPAMRESTRICTIONS" @@ -4282,17 +4133,13 @@ CLASS="COMMAND" CLASS="CHAPTER" ><HR><H1 ><A -NAME="MSDFS" ->Chapter 5. Hosting a Microsoft Distributed File System tree on Samba</A -></H1 +NAME="MSDFS">Hosting a Microsoft Distributed File System tree on Samba</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN663" ->5.1. Instructions</A -></H1 +NAME="AEN664">Instructions</H2 ><P >The Distributed File System (or Dfs) provides a means of separating the logical view of files and directories that users @@ -4444,12 +4291,10 @@ CLASS="USERINPUT" takes users directly to the appropriate shares on the network.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN698" ->5.1.1. Notes</A -></H2 +NAME="AEN699">Notes</H3 ><P ></P ><UL @@ -4480,18 +4325,14 @@ NAME="AEN698" CLASS="CHAPTER" ><HR><H1 ><A -NAME="UNIX-PERMISSIONS" ->Chapter 6. UNIX Permission Bits and Windows NT Access Control Lists</A -></H1 +NAME="UNIX-PERMISSIONS">UNIX Permission Bits and Windows NT Access Control Lists</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN718" ->6.1. Viewing and changing UNIX permissions using the NT - security dialogs</A -></H1 +NAME="AEN719">Viewing and changing UNIX permissions using the NT + security dialogs</H2 ><P >New in the Samba 2.0.4 release is the ability for Windows NT clients to use their native security settings dialog box to @@ -4524,34 +4365,38 @@ CLASS="CONSTANT" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN727" ->6.2. How to view file security on a Samba share</A -></H1 +NAME="AEN728">How to view file security on a Samba share</H2 ><P >From an NT 4.0 client, single-click with the right mouse button on any file or directory in a Samba mounted drive letter or UNC path. When the menu pops-up, click - on the <EM ->Properties</EM + on the <I +CLASS="EMPHASIS" +>Properties</I > entry at the bottom of the menu. This brings up the normal file properties dialog box, but with Samba 2.0.4 this will have a new tab along the top - marked <EM ->Security</EM + marked <I +CLASS="EMPHASIS" +>Security</I >. Click on this tab and you - will see three buttons, <EM ->Permissions</EM + will see three buttons, <I +CLASS="EMPHASIS" +>Permissions</I >, - <EM ->Auditing</EM ->, and <EM ->Ownership</EM + <I +CLASS="EMPHASIS" +>Auditing</I +>, and <I +CLASS="EMPHASIS" +>Ownership</I >. - The <EM ->Auditing</EM + The <I +CLASS="EMPHASIS" +>Auditing</I > button will cause either an error message <SPAN CLASS="ERRORNAME" @@ -4570,12 +4415,10 @@ CLASS="COMMAND" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN738" ->6.3. Viewing file ownership</A -></H1 +NAME="AEN739">Viewing file ownership</H2 ><P >Clicking on the <B CLASS="COMMAND" @@ -4637,8 +4480,9 @@ CLASS="COMMAND" it will display a dialog box complaining that the user you are currently logged onto the NT client cannot be found). The reason for this is that changing the ownership of a file is a privileged - operation in UNIX, available only to the <EM ->root</EM + operation in UNIX, available only to the <I +CLASS="EMPHASIS" +>root</I > user. As clicking on this button causes NT to attempt to change the ownership of a file to the current user logged into the NT @@ -4648,20 +4492,19 @@ CLASS="COMMAND" and allow a user with Administrator privilege connected to a Samba 2.0.4 server as root to change the ownership of files on both a local NTFS filesystem or remote mounted NTFS - or Samba drive. This is available as part of the <EM + or Samba drive. This is available as part of the <I +CLASS="EMPHASIS" >Seclib - </EM + </I > NT security library written by Jeremy Allison of the Samba Team, available from the main Samba ftp site.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN758" ->6.4. Viewing file or directory permissions</A -></H1 +NAME="AEN759">Viewing file or directory permissions</H2 ><P >The third button is the <B CLASS="COMMAND" @@ -4718,12 +4561,10 @@ CLASS="COMMAND" are displayed first.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN773" ->6.4.1. File Permissions</A -></H2 +NAME="AEN774">File Permissions</H3 ><P >The standard UNIX user/group/world triple and the corresponding "read", "write", "execute" permissions @@ -4780,12 +4621,10 @@ CLASS="COMMAND" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN787" ->6.4.2. Directory Permissions</A -></H2 +NAME="AEN788">Directory Permissions</H3 ><P >Directories on an NT NTFS file system have two different sets of permissions. The first set of permissions @@ -4812,12 +4651,10 @@ CLASS="COMMAND" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN794" ->6.5. Modifying file or directory permissions</A -></H1 +NAME="AEN795">Modifying file or directory permissions</H2 ><P >Modifying file and directory permissions is as simple as changing the displayed permissions in the dialog box, and @@ -4910,13 +4747,11 @@ CLASS="COMMAND" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN816" ->6.6. Interaction with the standard Samba create mask - parameters</A -></H1 +NAME="AEN817">Interaction with the standard Samba create mask + parameters</H2 ><P >Note that with Samba 2.0.5 there are four new parameters to control this interaction. These are :</P @@ -4975,8 +4810,9 @@ CLASS="PARAMETER" >security mask</I ></TT > - mask may be treated as a set of bits the user is <EM ->not</EM + mask may be treated as a set of bits the user is <I +CLASS="EMPHASIS" +>not</I > allowed to change, and one bits are those the user is allowed to change. </P @@ -5183,13 +5019,11 @@ CLASS="PARAMETER" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN880" ->6.7. Interaction with the standard Samba file attribute - mapping</A -></H1 +NAME="AEN881">Interaction with the standard Samba file attribute + mapping</H2 ><P >Samba maps some of the DOS attribute bits (such as "read only") into the UNIX permissions of a file. This means there can @@ -5233,17 +5067,13 @@ CLASS="COMMAND" CLASS="CHAPTER" ><HR><H1 ><A -NAME="PRINTING" ->Chapter 7. Printing Support in Samba 2.2.x</A -></H1 +NAME="PRINTING">Printing Support in Samba 2.2.x</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN901" ->7.1. Introduction</A -></H1 +NAME="AEN902">Introduction</H2 ><P >Beginning with the 2.2.0 release, Samba supports the native Windows NT printing mechanisms implemented via @@ -5309,9 +5139,10 @@ As a side note, Samba does not use these drivers in any way to process spooled files. They are utilized entirely by the clients.</P ><P >The following MS KB article, may be of some help if you are dealing with -Windows 2000 clients: <EM +Windows 2000 clients: <I +CLASS="EMPHASIS" >How to Add Printers with No User -Interaction in Windows 2000</EM +Interaction in Windows 2000</I ></P ><P ><A @@ -5322,30 +5153,40 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN923" ->7.2. Configuration</A -></H1 +NAME="AEN924">Configuration</H2 ><DIV CLASS="WARNING" ><P ></P ><TABLE CLASS="WARNING" -BORDER="1" WIDTH="100%" +BORDER="0" ><TR ><TD +WIDTH="25" ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/warning.gif" +HSPACE="5" +ALT="Warning"></TD +><TH +ALIGN="LEFT" +VALIGN="CENTER" ><B >[print$] vs. [printer$]</B -></TD +></TH ></TR ><TR ><TD +> </TD +><TD ALIGN="LEFT" +VALIGN="TOP" ><P >Previous versions of Samba recommended using a share named [printer$]. This name was taken from the printer$ service created by Windows 9x @@ -5377,7 +5218,7 @@ CLASS="PARAMETER" >printer driver file</I ></TT -> parameter, are being depreciated and should not +> parameter, are being deprecated and should not be used in new installations. For more information on this change, you should refer to the <A HREF="#MIGRATION" @@ -5390,12 +5231,10 @@ of this document.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN934" ->7.2.1. Creating [print$]</A -></H2 +NAME="AEN935">Creating [print$]</H3 ><P >In order to support the uploading of printer driver files, you must first configure a file share named [print$]. @@ -5471,11 +5310,35 @@ site is configured. If users will be guaranteed to have an account on the Samba host, then this is a non-issue.</P ><DIV CLASS="NOTE" -><BLOCKQUOTE -CLASS="NOTE" ><P +></P +><TABLE +CLASS="NOTE" +WIDTH="100%" +BORDER="0" +><TR +><TD +WIDTH="25" +ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/note.gif" +HSPACE="5" +ALT="Note"></TD +><TH +ALIGN="LEFT" +VALIGN="CENTER" ><B ->Author's Note: </B +>Author's Note</B +></TH +></TR +><TR +><TD +> </TD +><TD +ALIGN="LEFT" +VALIGN="TOP" +><P >The non-issue is that if all your Windows NT users are guaranteed to be authenticated by the Samba server (such as a domain member server and the NT user has already been validated by the Domain Controller in @@ -5493,7 +5356,9 @@ CLASS="COMMAND" > in the [global] section as well. Make sure you understand what this parameter does before using it though. --jerry</P -></BLOCKQUOTE +></TD +></TR +></TABLE ></DIV ><P >In order for a Windows NT print server to support @@ -5529,18 +5394,30 @@ CLASS="WARNING" ></P ><TABLE CLASS="WARNING" -BORDER="1" WIDTH="100%" +BORDER="0" ><TR ><TD +WIDTH="25" ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/warning.gif" +HSPACE="5" +ALT="Warning"></TD +><TH +ALIGN="LEFT" +VALIGN="CENTER" ><B >ATTENTION! REQUIRED PERMISSIONS</B -></TD +></TH ></TR ><TR ><TD +> </TD +><TD ALIGN="LEFT" +VALIGN="TOP" ><P >In order to currently add a new driver to you Samba host, one of two conditions must hold true:</P @@ -5593,18 +5470,17 @@ that matches the printer shares defined on your Samba host.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN969" ->7.2.2. Setting Drivers for Existing Printers</A -></H2 +NAME="AEN970">Setting Drivers for Existing Printers</H3 ><P >The initial listing of printers in the Samba host's Printers folder will have no real printer driver assigned to them. By default, in Samba 2.2.0 this driver name was set to -<EM ->NO PRINTER DRIVER AVAILABLE FOR THIS PRINTER</EM +<I +CLASS="EMPHASIS" +>NO PRINTER DRIVER AVAILABLE FOR THIS PRINTER</I >. Later versions changed this to a NULL string to allow the use tof the local Add Printer Wizard on NT/2000 clients. @@ -5612,15 +5488,16 @@ Attempting to view the printer properties for a printer which has this default driver assigned will result in the error message:</P ><P -><EM +><I +CLASS="EMPHASIS" >Device settings cannot be displayed. The driver for the specified printer is not installed, only spooler properties will be displayed. Do you want to install the -driver now?</EM +driver now?</I ></P ><P >Click "No" in the error dialog and you will be presented with -the printer properties window. The way assign a driver to a +the printer properties window. The way to assign a driver to a printer is to either</P ><P ></P @@ -5665,12 +5542,10 @@ permissions to the "Everyone" well-known group.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN986" ->7.2.3. Support a large number of printers</A -></H2 +NAME="AEN987">Support a large number of printers</H3 ><P >One issue that has arisen during the development phase of Samba 2.2 is the need to support driver downloads for @@ -5740,12 +5615,10 @@ Successfully set hp-print to driver HP LaserJet 4000 Series PS.</PRE ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN997" ->7.2.4. Adding New Printers via the Windows NT APW</A -></H2 +NAME="AEN998">Adding New Printers via the Windows NT APW</H3 ><P >By default, Samba offers all printer shares defined in <TT CLASS="FILENAME" @@ -5831,7 +5704,7 @@ CLASS="PARAMETER" > is executed under the context of the connected user, not necessarily a root account.</P ><P ->There is a complementing <A +>There is a complementary <A HREF="smb.conf.5.html#DELETEPRINTERCOMMAND" TARGET="_top" ><TT @@ -5843,15 +5716,85 @@ printer command</I ></A > for removing entries from the "Printers..." folder.</P +><P +>The following is an example <A +HREF="smb.conf.5.html#ADDPRINTERCOMMAN" +TARGET="_top" +><TT +CLASS="PARAMETER" +><I +>add printer command</I +></TT +></A +> script. It adds the appropriate entries to <TT +CLASS="FILENAME" +>/etc/printcap.local</TT +> (change that to what you need) and returns a line of 'Done' which is needed for the whole process to work.</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>#!/bin/sh + +# Script to insert a new printer entry into printcap.local +# +# $1, printer name, used as the descriptive name +# $2, share name, used as the printer name for Linux +# $3, port name +# $4, driver name +# $5, location, used for the device file of the printer +# $6, win9x location + +# +# Make sure we use the location that RedHat uses for local printer defs +PRINTCAP=/etc/printcap.local +DATE=`date +%Y%m%d-%H%M%S` +LP=lp +RESTART="service lpd restart" + +# Keep a copy +cp $PRINTCAP $PRINTCAP.$DATE +# Add the printer to $PRINTCAP +echo "" >> $PRINTCAP +echo "$2|$1:\\" >> $PRINTCAP +echo " :sd=/var/spool/lpd/$2:\\" >> $PRINTCAP +echo " :mx=0:ml=0:sh:\\" >> $PRINTCAP +echo " :lp=/usr/local/samba/var/print/$5.prn:" >> $PRINTCAP + +touch "/usr/local/samba/var/print/$5.prn" >> /tmp/printadd.$$ 2>&1 +chown $LP "/usr/local/samba/var/print/$5.prn" >> /tmp/printadd.$$ 2>&1 + +mkdir /var/spool/lpd/$2 +chmod 700 /var/spool/lpd/$2 +chown $LP /var/spool/lpd/$2 +#echo $1 >> "/usr/local/samba/var/print/$5.prn" +#echo $2 >> "/usr/local/samba/var/print/$5.prn" +#echo $3 >> "/usr/local/samba/var/print/$5.prn" +#echo $4 >> "/usr/local/samba/var/print/$5.prn" +#echo $5 >> "/usr/local/samba/var/print/$5.prn" +#echo $6 >> "/usr/local/samba/var/print/$5.prn" +$RESTART >> "/usr/local/samba/var/print/$5.prn" +# Not sure if this is needed +touch /usr/local/samba/lib/smb.conf +# +# You need to return a value, but I am not sure what it means. +# +echo "Done" +exit 0</PRE +></TD +></TR +></TABLE ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1022" ->7.2.5. Samba and Printer Ports</A -></H2 +NAME="AEN1028">Samba and Printer Ports</H3 ><P >Windows NT/2000 print servers associate a port with each printer. These normally take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the @@ -5883,12 +5826,10 @@ that generates a listing of ports on a system.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1030" ->7.3. The Imprints Toolset</A -></H1 +NAME="AEN1036">The Imprints Toolset</H2 ><P >The Imprints tool set provides a UNIX equivalent of the Windows NT Add Printer Wizard. For complete information, please @@ -5901,12 +5842,10 @@ TARGET="_top" only provide a brief introduction to the features of Imprints.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1034" ->7.3.1. What is Imprints?</A -></H2 +NAME="AEN1040">What is Imprints?</H3 ><P >Imprints is a collection of tools for supporting the goals of</P @@ -5933,12 +5872,10 @@ NAME="AEN1034" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1044" ->7.3.2. Creating Printer Driver Packages</A -></H2 +NAME="AEN1050">Creating Printer Driver Packages</H3 ><P >The process of creating printer driver packages is beyond the scope of this document (refer to Imprints.txt also included @@ -5949,12 +5886,10 @@ NAME="AEN1044" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1047" ->7.3.3. The Imprints server</A -></H2 +NAME="AEN1053">The Imprints server</H3 ><P >The Imprints server is really a database server that may be queried via standard HTTP mechanisms. Each printer @@ -5962,19 +5897,18 @@ NAME="AEN1047" downloading of the package. Each package is digitally signed via GnuPG which can be used to verify that package downloaded is actually the one referred in the Imprints database. It is - <EM ->not</EM + <I +CLASS="EMPHASIS" +>not</I > recommended that this security check be disabled.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1051" ->7.3.4. The Installation Client</A -></H2 +NAME="AEN1057">The Installation Client</H3 ><P >More information regarding the Imprints installation client is available in the <TT @@ -6072,15 +6006,13 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1073" ->7.4. <A +NAME="AEN1079"><A NAME="MIGRATION" ></A ->Migration to from Samba 2.0.x to 2.2.x</A -></H1 +>Migration to from Samba 2.0.x to 2.2.x</H2 ><P >Given that printer driver management has changed (we hope improved) in 2.2 over prior releases, migration from an existing setup to 2.2 can @@ -6151,18 +6083,30 @@ CLASS="WARNING" ></P ><TABLE CLASS="WARNING" -BORDER="1" WIDTH="100%" +BORDER="0" ><TR ><TD +WIDTH="25" ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/warning.gif" +HSPACE="5" +ALT="Warning"></TD +><TH +ALIGN="LEFT" +VALIGN="CENTER" ><B >Achtung!</B -></TD +></TH ></TR ><TR ><TD +> </TD +><TD ALIGN="LEFT" +VALIGN="TOP" ><P >The following <TT CLASS="FILENAME" @@ -6231,17 +6175,13 @@ disabled by default.</P CLASS="CHAPTER" ><HR><H1 ><A -NAME="PRINTING_DEBUG" ->Chapter 8. Debugging Printing Problems</A -></H1 +NAME="PRINTINGDEBUG">Debugging Printing Problems</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN1119" ->8.1. Introduction</A -></H1 +NAME="AEN1125">Introduction</H2 ><P >This is a short description of how to debug printing problems with Samba. This describes how to debug problems with printing from a SMB @@ -6338,12 +6278,10 @@ the lpq output.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1135" ->8.2. Debugging printer problems</A -></H1 +NAME="AEN1141">Debugging printer problems</H2 ><P >One way to debug printing problems is to start by replacing these command with shell scripts that record the arguments and the contents @@ -6413,12 +6351,10 @@ various print queues.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1144" ->8.3. What printers do I have?</A -></H1 +NAME="AEN1150">What printers do I have?</H2 ><P >You can use the 'testprns' program to check to see if the printer name you are using is recognized by Samba. For example, you can @@ -6460,12 +6396,10 @@ CLASS="PROGRAMLISTING" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1152" ->8.4. Setting up printcap and print servers</A -></H1 +NAME="AEN1158">Setting up printcap and print servers</H2 ><P >You may need to set up some printcaps for your Samba system to use. It is strongly recommended that you use the facilities provided by @@ -6553,12 +6487,10 @@ it reread the printcap information.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1180" ->8.5. Job sent, no output</A -></H1 +NAME="AEN1186">Job sent, no output</H2 ><P >This is the most frustrating part of printing. You may have sent the job, verified that the job was forwarded, set up a wrapper around @@ -6616,12 +6548,10 @@ convert the file to a format appropriate for your printer.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1191" ->8.6. Job sent, strange output</A -></H1 +NAME="AEN1197">Job sent, strange output</H2 ><P >Once you have the job printing, you can then start worrying about making it print nicely.</P @@ -6680,12 +6610,10 @@ PostScript. The multiple ^D may cause an additional page of output.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1203" ->8.7. Raw PostScript printed</A -></H1 +NAME="AEN1209">Raw PostScript printed</H2 ><P >This is a problem that is usually caused by either the print spooling system putting information at the start of the print job that makes @@ -6695,12 +6623,10 @@ Format Detection' on your printer.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1206" ->8.8. Advanced Printing</A -></H1 +NAME="AEN1212">Advanced Printing</H2 ><P >Note that you can do some pretty magic things by using your imagination with the "print command" option and some shell scripts. @@ -6711,12 +6637,10 @@ printer.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1209" ->8.9. Real debugging</A -></H1 +NAME="AEN1215">Real debugging</H2 ><P >If the above debug tips don't help, then maybe you need to bring in the bug guns, system tracing. See Tracing.txt in this directory.</P @@ -6726,17 +6650,13 @@ the bug guns, system tracing. See Tracing.txt in this directory.</P CLASS="CHAPTER" ><HR><H1 ><A -NAME="SECURITY_LEVELS" ->Chapter 9. Security levels</A -></H1 +NAME="SECURITYLEVELS">Security levels</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN1222" ->9.1. Introduction</A -></H1 +NAME="AEN1228">Introduction</H2 ><P >Samba supports the following options to the global smb.conf parameter</P ><P @@ -6786,12 +6706,10 @@ Windows NT server, the later natively capable of encrypted password support.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1233" ->9.2. More complete description of security levels</A -></H1 +NAME="AEN1239">More complete description of security levels</H2 ><P >A SMB server tells the client at startup what "security level" it is running. There are two options "share level" and "user level". Which @@ -6883,17 +6801,13 @@ schemes by which the two could be kept in sync.</P CLASS="CHAPTER" ><HR><H1 ><A -NAME="DOMAIN-SECURITY" ->Chapter 10. security = domain in Samba 2.x</A -></H1 +NAME="DOMAIN-SECURITY">security = domain in Samba 2.x</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN1266" ->10.1. Joining an NT Domain with Samba 2.2</A -></H1 +NAME="AEN1272">Joining an NT Domain with Samba 2.2</H2 ><P >Assume you have a Samba 2.x server with a NetBIOS name of <TT @@ -7119,12 +7033,10 @@ CLASS="COMMAND" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1330" ->10.2. Samba and Windows 2000 Domains</A -></H1 +NAME="AEN1336">Samba and Windows 2000 Domains</H2 ><P >Many people have asked regarding the state of Samba's ability to participate in a Windows 2000 Domain. Samba 2.2 is able to act as a member server of a Windows @@ -7144,12 +7056,10 @@ Computers" MMC (Microsoft Management Console) plugin.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1335" ->10.3. Why is this better than security = server?</A -></H1 +NAME="AEN1341">Why is this better than security = server?</H2 ><P >Currently, domain security in Samba doesn't free you from having to create local Unix users to represent the users attaching @@ -7213,8 +7123,9 @@ CLASS="COMMAND" user is authenticated, making a Samba server truly plug and play in an NT domain environment. Watch for this code soon.</P ><P -><EM ->NOTE:</EM +><I +CLASS="EMPHASIS" +>NOTE:</I > Much of the text of this document was first published in the Web magazine <A HREF="http://www.linuxworld.com" @@ -7233,23 +7144,20 @@ TARGET="_top" CLASS="CHAPTER" ><HR><H1 ><A -NAME="WINBIND" ->Chapter 11. Unified Logons between Windows NT and UNIX using Winbind</A -></H1 +NAME="WINBIND">Unified Logons between Windows NT and UNIX using Winbind</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN1388" ->11.1. Abstract</A -></H1 +NAME="AEN1394">Abstract</H2 ><P >Integration of UNIX and Microsoft Windows NT through a unified logon has been considered a "holy grail" in heterogeneous computing environments for a long time. We present - <EM ->winbind</EM + <I +CLASS="EMPHASIS" +>winbind</I >, a component of the Samba suite of programs as a solution to the unified logon problem. Winbind uses a UNIX implementation @@ -7261,12 +7169,10 @@ NAME="AEN1388" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1392" ->11.2. Introduction</A -></H1 +NAME="AEN1398">Introduction</H2 ><P >It is well known that UNIX and Microsoft Windows NT have different models for representing user and group information and @@ -7315,12 +7221,10 @@ NAME="AEN1392" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1405" ->11.3. What Winbind Provides</A -></H1 +NAME="AEN1411">What Winbind Provides</H2 ><P >Winbind unifies UNIX and Windows NT account management by allowing a UNIX box to become a full member of a NT domain. Once @@ -7357,12 +7261,10 @@ NAME="AEN1405" location (on the domain controller).</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1412" ->11.3.1. Target Uses</A -></H2 +NAME="AEN1418">Target Uses</H3 ><P >Winbind is targeted at organizations that have an existing NT based domain infrastructure into which they wish @@ -7381,12 +7283,10 @@ NAME="AEN1412" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1416" ->11.4. How Winbind Works</A -></H1 +NAME="AEN1422">How Winbind Works</H2 ><P >The winbind system is designed around a client/server architecture. A long running <B @@ -7401,12 +7301,10 @@ CLASS="COMMAND" in detail below.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1421" ->11.4.1. Microsoft Remote Procedure Calls</A -></H2 +NAME="AEN1427">Microsoft Remote Procedure Calls</H3 ><P >Over the last two years, efforts have been underway by various Samba Team members to decode various aspects of @@ -7427,12 +7325,10 @@ NAME="AEN1421" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1425" ->11.4.2. Name Service Switch</A -></H2 +NAME="AEN1431">Name Service Switch</H3 ><P >The Name Service Switch, or NSS, is a feature that is present in many UNIX operating systems. It allows system @@ -7507,12 +7403,10 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1441" ->11.4.3. Pluggable Authentication Modules</A -></H2 +NAME="AEN1447">Pluggable Authentication Modules</H3 ><P >Pluggable Authentication Modules, also known as PAM, is a system for abstracting authentication and authorization @@ -7556,12 +7450,10 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1449" ->11.4.4. User and Group ID Allocation</A -></H2 +NAME="AEN1455">User and Group ID Allocation</H3 ><P >When a user or group is created under Windows NT is it allocated a numerical relative identifier (RID). This is @@ -7582,12 +7474,10 @@ NAME="AEN1449" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1453" ->11.4.5. Result Caching</A -></H2 +NAME="AEN1459">Result Caching</H3 ><P >An active system can generate a lot of user and group name lookups. To reduce the network cost of these lookups winbind @@ -7605,12 +7495,10 @@ NAME="AEN1453" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1456" ->11.5. Installation and Configuration</A -></H1 +NAME="AEN1462">Installation and Configuration</H2 ><P >Many thanks to John Trostel <A HREF="mailto:jtrostel@snapserver.com" @@ -7632,12 +7520,10 @@ Future revisions of this document will incorporate that information.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1463" ->11.5.1. Introduction</A -></H2 +NAME="AEN1469">Introduction</H3 ><P >This HOWTO describes the procedures used to get winbind up and running on my RedHat 7.1 system. Winbind is capable of providing access @@ -7653,8 +7539,9 @@ somewhat to fit the way your distribution works.</P ><UL ><LI ><P -> <EM ->Why should I to this?</EM +> <I +CLASS="EMPHASIS" +>Why should I to this?</I > </P ><P @@ -7666,8 +7553,9 @@ somewhat to fit the way your distribution works.</P ></LI ><LI ><P -> <EM ->Who should be reading this document?</EM +> <I +CLASS="EMPHASIS" +>Who should be reading this document?</I > </P ><P @@ -7683,26 +7571,27 @@ somewhat to fit the way your distribution works.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1476" ->11.5.2. Requirements</A -></H2 +NAME="AEN1482">Requirements</H3 ><P >If you have a samba configuration file that you are currently -using... <EM ->BACK IT UP!</EM +using... <I +CLASS="EMPHASIS" +>BACK IT UP!</I > If your system already uses PAM, -<EM +<I +CLASS="EMPHASIS" >back up the <TT CLASS="FILENAME" >/etc/pam.d</TT > directory -contents!</EM +contents!</I > If you haven't already made a boot disk, -<EM ->MAKE ONE NOW!</EM +<I +CLASS="EMPHASIS" +>MAKE ONE NOW!</I ></P ><P >Messing with the pam configuration files can make it nearly impossible @@ -7741,12 +7630,10 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1490" ->11.5.3. Testing Things Out</A -></H2 +NAME="AEN1496">Testing Things Out</H3 ><P >Before starting, it is probably best to kill off all the SAMBA related daemons running on your server. Kill off all <B @@ -7786,12 +7673,10 @@ CLASS="FILENAME" > RPMs installed.</P ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN1501" ->11.5.3.1. Configure and compile SAMBA</A -></H3 +NAME="AEN1507">Configure and compile SAMBA</H4 ><P >The configuration and compilation of SAMBA is pretty straightforward. The first three steps may not be necessary depending upon @@ -7861,16 +7746,14 @@ It will also build the winbindd executable and libraries. </P ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN1520" ->11.5.3.2. Configure <TT +NAME="AEN1526">Configure <TT CLASS="FILENAME" >nsswitch.conf</TT > and the -winbind libraries</A -></H3 +winbind libraries</H4 ><P >The libraries needed to run the <B CLASS="COMMAND" @@ -7975,12 +7858,10 @@ and echos back a check to you.</P ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN1553" ->11.5.3.3. Configure smb.conf</A -></H3 +NAME="AEN1559">Configure smb.conf</H4 ><P >Several parameters are needed in the smb.conf file to control the behavior of <B @@ -8059,12 +7940,10 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN1569" ->11.5.3.4. Join the SAMBA server to the PDC domain</A -></H3 +NAME="AEN1575">Join the SAMBA server to the PDC domain</H4 ><P >Enter the following command to make the SAMBA server join the PDC domain, where <TT @@ -8105,12 +7984,10 @@ is your DOMAIN name.</P ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN1580" ->11.5.3.5. Start up the winbindd daemon and test it!</A -></H3 +NAME="AEN1586">Start up the winbindd daemon and test it!</H4 ><P >Eventually, you will want to modify your smb startup script to automatically invoke the winbindd daemon when the other parts of @@ -8246,20 +8123,16 @@ CLASS="COMMAND" ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN1616" ->11.5.3.6. Fix the init.d startup scripts</A -></H3 +NAME="AEN1622">Fix the init.d startup scripts</H4 ><DIV CLASS="SECT4" -><H4 +><H5 CLASS="SECT4" ><A -NAME="AEN1618" ->11.5.3.6.1. Linux</A -></H4 +NAME="AEN1624">Linux</H5 ><P >The <B CLASS="COMMAND" @@ -8368,12 +8241,10 @@ CLASS="PROGRAMLISTING" ></DIV ><DIV CLASS="SECT4" -><HR><H4 +><HR><H5 CLASS="SECT4" ><A -NAME="AEN1635" ->11.5.3.6.2. Solaris</A -></H4 +NAME="AEN1641">Solaris</H5 ><P >On solaris, you need to modify the <TT @@ -8448,12 +8319,10 @@ esac</PRE ></DIV ><DIV CLASS="SECT4" -><HR><H4 +><HR><H5 CLASS="SECT4" ><A -NAME="AEN1642" ->11.5.3.6.3. Restarting</A -></H4 +NAME="AEN1648">Restarting</H5 ><P >If you restart the <B CLASS="COMMAND" @@ -8472,12 +8341,10 @@ if you were a local user.</P ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN1648" ->11.5.3.7. Configure Winbind and PAM</A -></H3 +NAME="AEN1654">Configure Winbind and PAM</H4 ><P >If you have made it this far, you know that winbindd and samba are working together. If you want to use winbind to provide authentication for other @@ -8530,12 +8397,10 @@ CLASS="COMMAND" ></P ><DIV CLASS="SECT4" -><HR><H4 +><HR><H5 CLASS="SECT4" ><A -NAME="AEN1665" ->11.5.3.7.1. Linux/FreeBSD-specific PAM configuration</A -></H4 +NAME="AEN1671">Linux/FreeBSD-specific PAM configuration</H5 ><P >The <TT CLASS="FILENAME" @@ -8704,12 +8569,10 @@ double prompts for passwords.</P ></DIV ><DIV CLASS="SECT4" -><HR><H4 +><HR><H5 CLASS="SECT4" ><A -NAME="AEN1698" ->11.5.3.7.2. Solaris-specific configuration</A -></H4 +NAME="AEN1704">Solaris-specific configuration</H5 ><P >The /etc/pam.conf needs to be changed. I changed this file so that my Domain users can logon both locally as well as telnet.The following are the changes @@ -8800,12 +8663,10 @@ configured in the pam.conf.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1705" ->11.6. Limitations</A -></H1 +NAME="AEN1711">Limitations</H2 ><P >Winbind has a number of limitations in its current released version that we hope to overcome in future @@ -8841,12 +8702,10 @@ NAME="AEN1705" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1715" ->11.7. Conclusion</A -></H1 +NAME="AEN1721">Conclusion</H2 ><P >The winbind system, through the use of the Name Service Switch, Pluggable Authentication Modules, and appropriate @@ -8860,17 +8719,13 @@ NAME="AEN1715" CLASS="CHAPTER" ><HR><H1 ><A -NAME="SAMBA-PDC" ->Chapter 12. How to Configure Samba 2.2 as a Primary Domain Controller</A -></H1 +NAME="SAMBA-PDC">How to Configure Samba 2.2 as a Primary Domain Controller</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN1735" ->12.1. Prerequisite Reading</A -></H1 +NAME="AEN1741">Prerequisite Reading</H2 ><P >Before you continue reading in this chapter, please make sure that you are comfortable with configuring basic files services @@ -8893,25 +8748,40 @@ of this HOWTO Collection.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1741" ->12.2. Background</A -></H1 +NAME="AEN1747">Background</H2 ><DIV CLASS="NOTE" -><BLOCKQUOTE +><P +></P +><TABLE CLASS="NOTE" +WIDTH="100%" +BORDER="0" +><TR +><TD +WIDTH="25" +ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/note.gif" +HSPACE="5" +ALT="Note"></TD +><TD +ALIGN="LEFT" +VALIGN="TOP" ><P -><B ->Note: </B -><EM ->Author's Note:</EM +><I +CLASS="EMPHASIS" +>Author's Note:</I > This document is a combination of David Bannon's "Samba 2.2 PDC HOWTO" and "Samba NT Domain FAQ". Both documents are superseded by this one.</P -></BLOCKQUOTE +></TD +></TR +></TABLE ></DIV ><P >Versions of Samba prior to release 2.2 had marginal capabilities to act @@ -9025,12 +8895,10 @@ concepts. They will be mentioned only briefly here.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1780" ->12.3. Configuring the Samba Domain Controller</A -></H1 +NAME="AEN1786">Configuring the Samba Domain Controller</H2 ><P >The first step in creating a working Samba PDC is to understand the parameters necessary in smb.conf. I will not @@ -9246,13 +9114,11 @@ Admins" style accounts.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1823" ->12.4. Creating Machine Trust Accounts and Joining Clients to the -Domain</A -></H1 +NAME="AEN1829">Creating Machine Trust Accounts and Joining Clients to the +Domain</H2 ><P >A machine trust account is a Samba account that is used to authenticate a client machine (rather than a user) to the Samba @@ -9320,12 +9186,10 @@ CLASS="FILENAME" ></UL ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1842" ->12.4.1. Manual Creation of Machine Trust Accounts</A -></H2 +NAME="AEN1848">Manual Creation of Machine Trust Accounts</H3 ><P >The first step in manually creating a machine trust account is to manually create the corresponding Unix account in @@ -9458,18 +9322,30 @@ CLASS="WARNING" ></P ><TABLE CLASS="WARNING" -BORDER="1" WIDTH="100%" +BORDER="0" ><TR ><TD +WIDTH="25" ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/warning.gif" +HSPACE="5" +ALT="Warning"></TD +><TH +ALIGN="LEFT" +VALIGN="CENTER" ><B >Join the client to the domain immediately</B -></TD +></TH ></TR ><TR ><TD +> </TD +><TD ALIGN="LEFT" +VALIGN="TOP" ><P > Manually creating a machine trust account using this method is the equivalent of creating a machine trust account on a Windows NT PDC using @@ -9487,12 +9363,10 @@ ALIGN="LEFT" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1877" ->12.4.2. "On-the-Fly" Creation of Machine Trust Accounts</A -></H2 +NAME="AEN1883">"On-the-Fly" Creation of Machine Trust Accounts</H3 ><P >The second (and recommended) way of creating machine trust accounts is simply to allow the Samba server to create them as needed when the client @@ -9533,12 +9407,10 @@ CLASS="PROGRAMLISTING" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN1886" ->12.4.3. Joining the Client to the Domain</A -></H2 +NAME="AEN1892">Joining the Client to the Domain</H3 ><P >The procedure for joining a client to the domain varies with the version of Windows.</P @@ -9547,8 +9419,9 @@ version of Windows.</P ><UL ><LI ><P -><EM ->Windows 2000</EM +><I +CLASS="EMPHASIS" +>Windows 2000</I ></P ><P > When the user elects to join the client to a domain, Windows prompts for @@ -9571,8 +9444,9 @@ CLASS="FILENAME" ></LI ><LI ><P -><EM ->Windows NT</EM +><I +CLASS="EMPHASIS" +>Windows NT</I ></P ><P > If the machine trust account was created manually, on the @@ -9593,12 +9467,10 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1901" ->12.5. Common Problems and Errors</A -></H1 +NAME="AEN1907">Common Problems and Errors</H2 ><P ></P ><P @@ -9606,8 +9478,9 @@ NAME="AEN1901" ><UL ><LI ><P -> <EM ->I cannot include a '$' in a machine name.</EM +> <I +CLASS="EMPHASIS" +>I cannot include a '$' in a machine name.</I > </P ><P @@ -9631,10 +9504,11 @@ CLASS="COMMAND" ></LI ><LI ><P -> <EM +> <I +CLASS="EMPHASIS" >I get told "You already have a connection to the Domain...." or "Cannot join domain, the credentials supplied conflict with an - existing set.." when creating a machine trust account.</EM + existing set.." when creating a machine trust account.</I > </P ><P @@ -9661,8 +9535,9 @@ CLASS="COMMAND" ></LI ><LI ><P -> <EM ->The system can not log you on (C000019B)....</EM +> <I +CLASS="EMPHASIS" +>The system can not log you on (C000019B)....</I > </P ><P @@ -9689,9 +9564,10 @@ CLASS="COMMAND" ></LI ><LI ><P -> <EM +> <I +CLASS="EMPHASIS" >The machine trust account for this computer either does not - exist or is not accessible.</EM + exist or is not accessible.</I > </P ><P @@ -9725,9 +9601,10 @@ CLASS="PARAMETER" ></LI ><LI ><P -> <EM +> <I +CLASS="EMPHASIS" >When I attempt to login to a Samba Domain from a NT4/W2K workstation, - I get a message about my account being disabled.</EM + I get a message about my account being disabled.</I > </P ><P @@ -9792,12 +9669,10 @@ CLASS="FILENAME" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1949" ->12.6. System Policies and Profiles</A -></H1 +NAME="AEN1955">System Policies and Profiles</H2 ><P >Much of the information necessary to implement System Policies and Roving User Profiles in a Samba domain is the same as that for @@ -9815,8 +9690,9 @@ Profiles and Policies in Windows NT 4.0</A ><UL ><LI ><P -> <EM ->What about Windows NT Policy Editor?</EM +> <I +CLASS="EMPHASIS" +>What about Windows NT Policy Editor?</I > </P ><P @@ -9828,12 +9704,14 @@ CLASS="FILENAME" CLASS="COMMAND" >poledit.exe</B > which - is included with NT Server but <EM ->not NT Workstation</EM + is included with NT Server but <I +CLASS="EMPHASIS" +>not NT Workstation</I >. There is a Policy Editor on a NTws - but it is not suitable for creating <EM ->Domain Policies</EM + but it is not suitable for creating <I +CLASS="EMPHASIS" +>Domain Policies</I >. Further, although the Windows 95 Policy Editor can be installed on an NT Workstation/Server, it will not @@ -9874,8 +9752,9 @@ CLASS="COMMAND" ></LI ><LI ><P -> <EM ->Can Win95 do Policies?</EM +> <I +CLASS="EMPHASIS" +>Can Win95 do Policies?</I > </P ><P @@ -9900,8 +9779,9 @@ CLASS="FILENAME" ></LI ><LI ><P -> <EM ->How do I get 'User Manager' and 'Server Manager'</EM +> <I +CLASS="EMPHASIS" +>How do I get 'User Manager' and 'Server Manager'</I > </P ><P @@ -9949,12 +9829,10 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN1993" ->12.7. What other help can I get?</A -></H1 +NAME="AEN1999">What other help can I get?</H2 ><P >There are many sources of information available in the form of mailing lists, RFC's and documentation. The docs that come @@ -9965,9 +9843,10 @@ general SMB topics such as browsing.</P ><UL ><LI ><P -> <EM +> <I +CLASS="EMPHASIS" >What are some diagnostics tools I can use to debug the domain logon - process and where can I find them?</EM + process and where can I find them?</I > </P ><P @@ -10037,9 +9916,10 @@ TARGET="_top" ></LI ><LI ><P -> <EM +> <I +CLASS="EMPHASIS" >How do I install 'Network Monitor' on an NT Workstation - or a Windows 9x box?</EM + or a Windows 9x box?</I > </P ><P @@ -10154,8 +10034,9 @@ TARGET="_top" ></LI ><LI ><P -> The <EM ->Development</EM +> The <I +CLASS="EMPHASIS" +>Development</I > document on the Samba mirrors might mention your problem. If so, it might mean that the developers are working on it.</P @@ -10212,8 +10093,9 @@ TARGET="_top" ><UL ><LI ><P -> <EM ->How do I get help from the mailing lists?</EM +> <I +CLASS="EMPHASIS" +>How do I get help from the mailing lists?</I > </P ><P @@ -10288,8 +10170,9 @@ TARGET="_top" ></LI ><LI ><P ->You might include <EM ->partial</EM +>You might include <I +CLASS="EMPHASIS" +>partial</I > log files written at a debug level set to as much as 20. Please don't send the entire log but enough to give the context of the @@ -10311,8 +10194,9 @@ TARGET="_top" ></LI ><LI ><P -> <EM ->How do I get off the mailing lists?</EM +> <I +CLASS="EMPHASIS" +>How do I get off the mailing lists?</I > </P ><P @@ -10345,26 +10229,41 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2107" ->12.8. Domain Control for Windows 9x/ME</A -></H1 +NAME="AEN2113">Domain Control for Windows 9x/ME</H2 ><DIV CLASS="NOTE" -><BLOCKQUOTE +><P +></P +><TABLE CLASS="NOTE" +WIDTH="100%" +BORDER="0" +><TR +><TD +WIDTH="25" +ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/note.gif" +HSPACE="5" +ALT="Note"></TD +><TD +ALIGN="LEFT" +VALIGN="TOP" ><P -><B ->Note: </B >The following section contains much of the original DOMAIN.txt file previously included with Samba. Much of -the material is based on what went into the book <EM +the material is based on what went into the book <I +CLASS="EMPHASIS" >Special -Edition, Using Samba</EM +Edition, Using Samba</I >, by Richard Sharpe.</P -></BLOCKQUOTE +></TD +></TR +></TABLE ></DIV ><P >A domain and a workgroup are exactly the same thing in terms of network @@ -10459,12 +10358,10 @@ TYPE="1" ></OL ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2133" ->12.8.1. Configuration Instructions: Network Logons</A -></H2 +NAME="AEN2139">Configuration Instructions: Network Logons</H3 ><P >The main difference between a PDC and a Windows 9x logon server configuration is that</P @@ -10489,18 +10386,30 @@ CLASS="WARNING" ></P ><TABLE CLASS="WARNING" -BORDER="1" WIDTH="100%" +BORDER="0" ><TR ><TD +WIDTH="25" ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/warning.gif" +HSPACE="5" +ALT="Warning"></TD +><TH +ALIGN="LEFT" +VALIGN="CENTER" ><B >security mode and master browsers</B -></TD +></TH ></TR ><TR ><TD +> </TD +><TD ALIGN="LEFT" +VALIGN="TOP" ><P >There are a few comments to make in order to tie up some loose ends. There has been much debate over the issue of whether @@ -10553,33 +10462,34 @@ for its domain.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2152" ->12.8.2. Configuration Instructions: Setting up Roaming User Profiles</A -></H2 +NAME="AEN2158">Configuration Instructions: Setting up Roaming User Profiles</H3 ><DIV CLASS="WARNING" ><P ></P ><TABLE CLASS="WARNING" -BORDER="1" WIDTH="100%" +BORDER="0" ><TR ><TD +WIDTH="25" ALIGN="CENTER" -><B ->Warning</B -></TD -></TR -><TR +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/warning.gif" +HSPACE="5" +ALT="Warning"></TD ><TD ALIGN="LEFT" +VALIGN="TOP" ><P -><EM ->NOTE!</EM +><I +CLASS="EMPHASIS" +>NOTE!</I > Roaming profiles support is different for Win9X and WinNT.</P ></TD @@ -10600,12 +10510,10 @@ including a separate field for the location of the user's profiles. This means that support for profiles is different for Win9X and WinNT.</P ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN2160" ->12.8.2.1. Windows NT Configuration</A -></H3 +NAME="AEN2166">Windows NT Configuration</H4 ><P >To support WinNT clients, in the [global] section of smb.conf set the following (for example):</P @@ -10631,25 +10539,39 @@ If you are using a samba server for the profiles, you _must_ make the share specified in the logon path browseable. </P ><DIV CLASS="NOTE" -><BLOCKQUOTE +><P +></P +><TABLE CLASS="NOTE" +WIDTH="100%" +BORDER="0" +><TR +><TD +WIDTH="25" +ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/note.gif" +HSPACE="5" +ALT="Note"></TD +><TD +ALIGN="LEFT" +VALIGN="TOP" ><P -><B ->Note: </B >[lkcl 26aug96 - we have discovered a problem where Windows clients can maintain a connection to the [homes] share in between logins. The [homes] share must NOT therefore be used in a profile path.]</P -></BLOCKQUOTE +></TD +></TR +></TABLE ></DIV ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN2168" ->12.8.2.2. Windows 9X Configuration</A -></H3 +NAME="AEN2174">Windows 9X Configuration</H4 ><P >To support Win9X clients, you must use the "logon home" parameter. Samba has now been fixed so that "net use/home" now works as well, and it, too, relies @@ -10684,12 +10606,10 @@ specified \\%L\%U for "logon home".</P ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN2176" ->12.8.2.3. Win9X and WinNT Configuration</A -></H3 +NAME="AEN2182">Win9X and WinNT Configuration</H4 ><P >You can support profiles for both Win9X and WinNT clients by setting both the "logon home" and "logon path" parameters. For example:</P @@ -10710,24 +10630,38 @@ logon path = \\%L\profiles\%U</PRE ></P ><DIV CLASS="NOTE" -><BLOCKQUOTE +><P +></P +><TABLE CLASS="NOTE" +WIDTH="100%" +BORDER="0" +><TR +><TD +WIDTH="25" +ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/note.gif" +HSPACE="5" +ALT="Note"></TD +><TD +ALIGN="LEFT" +VALIGN="TOP" ><P -><B ->Note: </B >I have not checked what 'net use /home' does on NT when "logon home" is set as above.</P -></BLOCKQUOTE +></TD +></TR +></TABLE ></DIV ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN2183" ->12.8.2.4. Windows 9X Profile Setup</A -></H3 +NAME="AEN2189">Windows 9X Profile Setup</H4 ><P >When a user first logs in on Windows 9X, the file user.DAT is created, as are folders "Start Menu", "Desktop", "Programs" and "Nethood". @@ -10832,8 +10766,9 @@ TYPE="1" ></LI ><LI ><P -> <EM ->WARNING</EM +> <I +CLASS="EMPHASIS" +>WARNING</I > - before deleting the contents of the directory listed in the ProfilePath (this is likely to be c:\windows\profiles\username), @@ -10878,30 +10813,44 @@ differences are with the equivalent samba trace.</P ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN2219" ->12.8.2.5. Windows NT Workstation 4.0</A -></H3 +NAME="AEN2225">Windows NT Workstation 4.0</H4 ><P >When a user first logs in to a Windows NT Workstation, the profile NTuser.DAT is created. The profile location can be now specified through the "logon path" parameter. </P ><DIV CLASS="NOTE" -><BLOCKQUOTE +><P +></P +><TABLE CLASS="NOTE" +WIDTH="100%" +BORDER="0" +><TR +><TD +WIDTH="25" +ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/note.gif" +HSPACE="5" +ALT="Note"></TD +><TD +ALIGN="LEFT" +VALIGN="TOP" ><P -><B ->Note: </B >[lkcl 10aug97 - i tried setting the path to \\samba-server\homes\profile, and discovered that this fails because a background process maintains the connection to the [homes] share which does _not_ close down in between user logins. you have to have \\samba-server\%L\profile, where user is the username created from the [homes] share].</P -></BLOCKQUOTE +></TD +></TR +></TABLE ></DIV ><P >There is a parameter that is now available for use with NT Profiles: @@ -10932,11 +10881,25 @@ NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN turns a profile into a mandatory one.</P ><DIV CLASS="NOTE" -><BLOCKQUOTE +><P +></P +><TABLE CLASS="NOTE" +WIDTH="100%" +BORDER="0" +><TR +><TD +WIDTH="25" +ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/note.gif" +HSPACE="5" +ALT="Note"></TD +><TD +ALIGN="LEFT" +VALIGN="TOP" ><P -><B ->Note: </B >[lkcl 10aug97 - i notice that NT Workstation tells me that it is downloading a profile from a slow link. whether this is actually the case, or whether there is some configuration issue, as yet unknown, @@ -10955,17 +10918,17 @@ workstation for clear-text passwords].</P >[lkcl 25aug97 - more comments received about NT profiles: the case of the profile _matters_. the file _must_ be called NTuser.DAT or, for a mandatory profile, NTuser.MAN].</P -></BLOCKQUOTE +></TD +></TR +></TABLE ></DIV ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN2232" ->12.8.2.6. Windows NT Server</A -></H3 +NAME="AEN2238">Windows NT Server</H4 ><P >There is nothing to stop you specifying any path that you like for the location of users' profiles. Therefore, you could specify that the @@ -10974,30 +10937,40 @@ that SMB server supports encrypted passwords.</P ></DIV ><DIV CLASS="SECT3" -><HR><H3 +><HR><H4 CLASS="SECT3" ><A -NAME="AEN2235" ->12.8.2.7. Sharing Profiles between W95 and NT Workstation 4.0</A -></H3 +NAME="AEN2241">Sharing Profiles between W95 and NT Workstation 4.0</H4 ><DIV CLASS="WARNING" ><P ></P ><TABLE CLASS="WARNING" -BORDER="1" WIDTH="100%" +BORDER="0" ><TR ><TD +WIDTH="25" ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/warning.gif" +HSPACE="5" +ALT="Warning"></TD +><TH +ALIGN="LEFT" +VALIGN="CENTER" ><B >Potentially outdated or incorrect material follows</B -></TD +></TH ></TR ><TR ><TD +> </TD +><TD ALIGN="LEFT" +VALIGN="TOP" ><P >I think this is all bogus, but have not deleted it. (Richard Sharpe)</P ></TD @@ -11022,47 +10995,73 @@ unlikely to exist on a Win95-only host].</P NTuser.DAT files in the same profile directory.</P ><DIV CLASS="NOTE" -><BLOCKQUOTE +><P +></P +><TABLE CLASS="NOTE" +WIDTH="100%" +BORDER="0" +><TR +><TD +WIDTH="25" +ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/note.gif" +HSPACE="5" +ALT="Note"></TD +><TD +ALIGN="LEFT" +VALIGN="TOP" ><P -><B ->Note: </B >[lkcl 25aug97 - there are some issues to resolve with downloading of NT profiles, probably to do with time/date stamps. i have found that NTuser.DAT is never updated on the workstation after the first time that it is copied to the local workstation profile directory. this is in contrast to w95, where it _does_ transfer / update profiles correctly].</P -></BLOCKQUOTE +></TD +></TR +></TABLE ></DIV ></DIV ></DIV ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2245" ->12.9. DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba</A -></H1 +NAME="AEN2251">DOMAIN_CONTROL.txt : Windows NT Domain Control & Samba</H2 ><DIV CLASS="WARNING" ><P ></P ><TABLE CLASS="WARNING" -BORDER="1" WIDTH="100%" +BORDER="0" ><TR ><TD +WIDTH="25" ALIGN="CENTER" +VALIGN="TOP" +><IMG +SRC="./stylesheet-images/warning.gif" +HSPACE="5" +ALT="Warning"></TD +><TH +ALIGN="LEFT" +VALIGN="CENTER" ><B >Possibly Outdated Material</B -></TD +></TH ></TR ><TR ><TD +> </TD +><TD ALIGN="LEFT" +VALIGN="TOP" ><P > This appendix was originally authored by John H Terpstra of the Samba Team and is included here for posterity. @@ -11072,8 +11071,9 @@ ALIGN="LEFT" ></TABLE ></DIV ><P -><EM ->NOTE :</EM +><I +CLASS="EMPHASIS" +>NOTE :</I > The term "Domain Controller" and those related to it refer to one specific method of authentication that can underly an SMB domain. Domain Controllers @@ -11163,17 +11163,13 @@ within its registry.</P CLASS="CHAPTER" ><HR><H1 ><A -NAME="SAMBA-BDC" ->Chapter 13. How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</A -></H1 +NAME="SAMBA-BDC">How to Act as a Backup Domain Controller in a Purely Samba Controlled Domain</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN2281" ->13.1. Prerequisite Reading</A -></H1 +NAME="AEN2287">Prerequisite Reading</H2 ><P >Before you continue reading in this chapter, please make sure that you are comfortable with configuring a Samba PDC @@ -11185,12 +11181,10 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2285" ->13.2. Background</A -></H1 +NAME="AEN2291">Background</H2 ><P >What is a Domain Controller? It is a machine that is able to answer logon requests from workstations in a Windows NT Domain. Whenever a @@ -11239,12 +11233,10 @@ others. This will not be covered in this document.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2293" ->13.3. What qualifies a Domain Controller on the network?</A -></H1 +NAME="AEN2299">What qualifies a Domain Controller on the network?</H2 ><P >Every machine that is a Domain Controller for the domain SAMBA has to register the NetBIOS group name SAMBA#1c with the WINS server and/or @@ -11256,12 +11248,10 @@ Microsoft Domain implementation requires the domain master browser to be on the same machine as the PDC.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2296" ->13.3.1. How does a Workstation find its domain controller?</A -></H2 +NAME="AEN2302">How does a Workstation find its domain controller?</H3 ><P >A NT workstation in the domain SAMBA that wants a local user to be authenticated has to find the domain controller for SAMBA. It does @@ -11275,12 +11265,10 @@ the domain controller, asking for approval.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2299" ->13.3.2. When is the PDC needed?</A -></H2 +NAME="AEN2305">When is the PDC needed?</H3 ><P >Whenever a user wants to change his password, this has to be done on the PDC. To find the PDC, the workstation does a NetBIOS name query @@ -11291,12 +11279,10 @@ the password change is done.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2302" ->13.4. Can Samba be a Backup Domain Controller?</A -></H1 +NAME="AEN2308">Can Samba be a Backup Domain Controller?</H2 ><P >With version 2.2, no. The native NT SAM replication protocols have not yet been fully implemented. The Samba Team is working on @@ -11310,12 +11296,10 @@ service logon requests whenever the PDC is down.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2306" ->13.5. How do I set up a Samba BDC?</A -></H1 +NAME="AEN2312">How do I set up a Samba BDC?</H2 ><P >Several things have to be done:</P ><P @@ -11323,10 +11307,16 @@ NAME="AEN2306" ><UL ><LI ><P ->The file private/MACHINE.SID identifies the domain. When a samba -server is first started, it is created on the fly and must never be -changed again. This file has to be the same on the PDC and the BDC, -so the MACHINE.SID has to be copied from the PDC to the BDC.</P +>The domain SID has to be the same on the PDC and the BDC. This used to +be stored in the file private/MACHINE.SID. This file is not created +anymore since Samba 2.2.5 or even earlier. Nowadays the domain SID is +stored in the file private/secrets.tdb. Simply copying the secrets.tdb +from the PDC to the BDC does not work, as the BDC would +generate a new SID for itself and override the domain SID with this +new BDC SID.</P +><P +>To retrieve the domain SID from the PDC or an existing BDC and store it in the +secrets.tdb, execute 'net rpc getsid' on the BDC.</P ></LI ><LI ><P @@ -11380,12 +11370,10 @@ no' forces the BDC not to register SAMBA#1b which as a unique NetBIOS name is reserved for the Primary Domain Controller.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2322" ->13.5.1. How do I replicate the smbpasswd file?</A -></H2 +NAME="AEN2329">How do I replicate the smbpasswd file?</H3 ><P >Replication of the smbpasswd file is sensitive. It has to be done whenever changes to the SAM are made. Every user's password change is @@ -11405,17 +11393,13 @@ password.</P CLASS="CHAPTER" ><HR><H1 ><A -NAME="SAMBA-LDAP-HOWTO" ->Chapter 14. Storing Samba's User/Machine Account information in an LDAP Directory</A -></H1 +NAME="SAMBA-LDAP-HOWTO">Storing Samba's User/Machine Account information in an LDAP Directory</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN2343" ->14.1. Purpose</A -></H1 +NAME="AEN2350">Purpose</H2 ><P >This document describes how to use an LDAP directory for storing Samba user account information traditionally stored in the smbpasswd(5) file. It is @@ -11478,12 +11462,10 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2363" ->14.2. Introduction</A -></H1 +NAME="AEN2370">Introduction</H2 ><P >Traditionally, when configuring <A HREF="smb.conf.5.html#ENCRYPTPASSWORDS" @@ -11595,12 +11577,10 @@ the details of configuring these packages are beyond the scope of this document. ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2392" ->14.3. Supported LDAP Servers</A -></H1 +NAME="AEN2399">Supported LDAP Servers</H2 ><P >The LDAP samdb code in 2.2.3 has been developed and tested using the OpenLDAP 2.0 server and client libraries. The same code should be able to work with @@ -11620,12 +11600,10 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2397" ->14.4. Schema and Relationship to the RFC 2307 posixAccount</A -></H1 +NAME="AEN2404">Schema and Relationship to the RFC 2307 posixAccount</H2 ><P >Samba 2.2.3 includes the necessary schema file for OpenLDAP 2.0 in <TT @@ -11688,20 +11666,16 @@ information in NIS while the network is transitioning to a full LDAP infrastruct ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2409" ->14.5. Configuring Samba with LDAP</A -></H1 +NAME="AEN2416">Configuring Samba with LDAP</H2 ><DIV CLASS="SECT2" -><H2 +><H3 CLASS="SECT2" ><A -NAME="AEN2411" ->14.5.1. OpenLDAP configuration</A -></H2 +NAME="AEN2418">OpenLDAP configuration</H3 ><P >To include support for the sambaAccount object in an OpenLDAP directory server, first copy the samba.schema file to slapd's configuration directory.</P @@ -11796,12 +11770,10 @@ index rid eq ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2428" ->14.5.2. Configuring Samba</A -></H2 +NAME="AEN2435">Configuring Samba</H3 ><P >The following parameters are available in smb.conf only with <TT CLASS="PARAMETER" @@ -11925,12 +11897,10 @@ CLASS="REPLACEABLE" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2456" ->14.6. Accounts and Groups management</A -></H1 +NAME="AEN2463">Accounts and Groups management</H2 ><P >As users accounts are managed thru the sambaAccount objectclass, you should modify you existing administration tools to deal with sambaAccount attributes.</P @@ -11950,12 +11920,10 @@ groups).</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2461" ->14.7. Security and sambaAccount</A -></H1 +NAME="AEN2468">Security and sambaAccount</H2 ><P >There are two important points to remember when discussing the security of sambaAccount entries in the directory.</P @@ -11964,15 +11932,17 @@ of sambaAccount entries in the directory.</P ><UL ><LI ><P -><EM ->Never</EM +><I +CLASS="EMPHASIS" +>Never</I > retrieve the lmPassword or ntPassword attribute values over an unencrypted LDAP session.</P ></LI ><LI ><P -><EM ->Never</EM +><I +CLASS="EMPHASIS" +>Never</I > allow non-admin users to view the lmPassword or ntPassword attribute values.</P ></LI @@ -12030,12 +12000,10 @@ access to attrs=lmPassword,ntPassword ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2481" ->14.8. LDAP specials attributes for sambaAccounts</A -></H1 +NAME="AEN2488">LDAP specials attributes for sambaAccounts</H2 ><P >The sambaAccount objectclass is composed of the following attributes:</P ><P @@ -12241,12 +12209,10 @@ something other than the default (e.g. \\MOBY\becky).</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2551" ->14.9. Example LDIF Entries for a sambaAccount</A -></H1 +NAME="AEN2558">Example LDIF Entries for a sambaAccount</H2 ><P >The following is a working LDIF with the inclusion of the posixAccount objectclass:</P ><P @@ -12317,12 +12283,10 @@ ntPassword: 878D8014606CDA29677A44EFA1353FC7</PRE ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2559" ->14.10. Comments</A -></H1 +NAME="AEN2566">Comments</H2 ><P >Please mail all comments regarding this HOWTO to <A HREF="mailto:jerry@samba.org" @@ -12336,17 +12300,13 @@ last updated to reflect the Samba 2.2.3 release. </P CLASS="CHAPTER" ><HR><H1 ><A -NAME="IMPROVED-BROWSING" ->Chapter 15. Improved browsing in samba</A -></H1 +NAME="IMPROVED-BROWSING">Improved browsing in samba</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN2570" ->15.1. Overview of browsing</A -></H1 +NAME="AEN2577">Overview of browsing</H2 ><P >SMB networking provides a mechanism by which clients can access a list of machines in a network, a so-called "browse list". This list @@ -12365,12 +12325,10 @@ that can NOT be provided by any other means of name resolution.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2574" ->15.2. Browsing support in samba</A -></H1 +NAME="AEN2581">Browsing support in samba</H2 ><P >Samba now fully supports browsing. The browsing is supported by nmbd and is also controlled by options in the smb.conf file (see smb.conf(5)).</P @@ -12410,12 +12368,10 @@ example. See "remote announce" in the smb.conf man page. </P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2583" ->15.3. Problem resolution</A -></H1 +NAME="AEN2590">Problem resolution</H2 ><P >If something doesn't work then hopefully the log.nmb file will help you track down the problem. Try a debug level of 2 or 3 for finding @@ -12444,12 +12400,10 @@ in smb.conf)</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2590" ->15.4. Browsing across subnets</A -></H1 +NAME="AEN2597">Browsing across subnets</H2 ><P >With the release of Samba 1.9.17(alpha1 and above) Samba has been updated to enable it to support the replication of browse lists @@ -12475,12 +12429,10 @@ of a WINS server given to them by a DHCP server, or by manual configuration settings) for Samba this is in the smb.conf file.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2595" ->15.4.1. How does cross subnet browsing work ?</A -></H2 +NAME="AEN2602">How does cross subnet browsing work ?</H3 ><P >Cross subnet browsing is a complicated dance, containing multiple moving parts. It has taken Microsoft several years to get the code @@ -12732,12 +12684,10 @@ TYPE="1" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2630" ->15.5. Setting up a WINS server</A -></H1 +NAME="AEN2637">Setting up a WINS server</H2 ><P >Either a Samba machine or a Windows NT Server machine may be set up as a WINS server. To set a Samba machine to be a WINS server you must @@ -12815,12 +12765,10 @@ browsing on networks that contain NT Domains.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2649" ->15.6. Setting up Browsing in a WORKGROUP</A -></H1 +NAME="AEN2656">Setting up Browsing in a WORKGROUP</H2 ><P >To set up cross subnet browsing on a network containing machines in up to be in a WORKGROUP, not an NT Domain you need to set up one @@ -12926,12 +12874,10 @@ CLASS="PROGRAMLISTING" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2667" ->15.7. Setting up Browsing in a DOMAIN</A -></H1 +NAME="AEN2674">Setting up Browsing in a DOMAIN</H2 ><P >If you are adding Samba servers to a Windows NT Domain then you must not set up a Samba server as a domain master browser. @@ -12986,12 +12932,10 @@ CLASS="COMMAND" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2677" ->15.8. Forcing samba to be the master</A -></H1 +NAME="AEN2684">Forcing samba to be the master</H2 ><P >Who becomes the "master browser" is determined by an election process using broadcasts. Each election packet contains a number of parameters @@ -13034,12 +12978,10 @@ the current domain master browser fail.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2686" ->15.9. Making samba the domain master</A -></H1 +NAME="AEN2693">Making samba the domain master</H2 ><P >The domain master is responsible for collating the browse lists of multiple subnets so that browsing can occur between subnets. You can @@ -13107,12 +13049,10 @@ TYPE="1" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2704" ->15.10. Note about broadcast addresses</A -></H1 +NAME="AEN2711">Note about broadcast addresses</H2 ><P >If your network uses a "0" based broadcast address (for example if it ends in a 0) then you will strike problems. Windows for Workgroups @@ -13121,12 +13061,10 @@ that browsing and name lookups won't work.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2707" ->15.11. Multiple interfaces</A -></H1 +NAME="AEN2714">Multiple interfaces</H2 ><P >Samba now supports machines with multiple network interfaces. If you have multiple interfaces then you will need to use the "interfaces" @@ -13137,17 +13075,13 @@ option in smb.conf to configure them. See smb.conf(5) for details.</P CLASS="CHAPTER" ><HR><H1 ><A -NAME="SPEED" ->Chapter 16. Samba performance issues</A -></H1 +NAME="SPEED">Samba performance issues</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN2725" ->16.1. Comparisons</A -></H1 +NAME="AEN2732">Comparisons</H2 ><P >The Samba server uses TCP to talk to the client. Thus if you are trying to see if it performs well you should really compare it to @@ -13173,20 +13107,16 @@ systems.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2731" ->16.2. Oplocks</A -></H1 +NAME="AEN2738">Oplocks</H2 ><DIV CLASS="SECT2" -><H2 +><H3 CLASS="SECT2" ><A -NAME="AEN2733" ->16.2.1. Overview</A -></H2 +NAME="AEN2740">Overview</H3 ><P >Oplocks are the way that SMB clients get permission from a server to locally cache file operations. If a server grants an oplock @@ -13217,12 +13147,10 @@ code did follows.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2741" ->16.2.2. Level2 Oplocks</A -></H2 +NAME="AEN2748">Level2 Oplocks</H3 ><P >With Samba 2.0.5 a new capability - level2 (read only) oplocks is supported (although the option is off by default - see the smb.conf @@ -13241,12 +13169,10 @@ read-ahread cache copies of these files.</P ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2747" ->16.2.3. Old 'fake oplocks' option - deprecated</A -></H2 +NAME="AEN2754">Old 'fake oplocks' option - deprecated</H3 ><P >Samba can also fake oplocks, by granting a oplock whenever a client asks for one. This is controlled using the smb.conf option "fake @@ -13262,12 +13188,10 @@ at the same time you can get data corruption.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2751" ->16.3. Socket options</A -></H1 +NAME="AEN2758">Socket options</H2 ><P >There are a number of socket options that can greatly affect the performance of a TCP based server like Samba.</P @@ -13290,12 +13214,10 @@ Microsoft TCP/IP stack is slow in sending tcp ACKs.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2758" ->16.4. Read size</A -></H1 +NAME="AEN2765">Read size</H2 ><P >The option "read size" affects the overlap of disk reads/writes with network reads/writes. If the amount of data being transferred in @@ -13316,12 +13238,10 @@ pointless and will cause you to allocate memory unnecessarily.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2763" ->16.5. Max xmit</A -></H1 +NAME="AEN2770">Max xmit</H2 ><P >At startup the client and server negotiate a "maximum transmit" size, which limits the size of nearly all SMB commands. You can set the @@ -13339,12 +13259,10 @@ of less than 2048 is likely to cause severe problems.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2768" ->16.6. Locking</A -></H1 +NAME="AEN2775">Locking</H2 ><P >By default Samba does not implement strict locking on each read/write call (although it did in previous versions). If you enable strict @@ -13356,12 +13274,10 @@ filesystems, but could be quite high even on local disks.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2772" ->16.7. Share modes</A -></H1 +NAME="AEN2779">Share modes</H2 ><P >Some people find that opening files is very slow. This is often because of the "share modes" code needed to fully implement the dos @@ -13386,12 +13302,10 @@ things much faster. See the Makefile for how to enable this.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2777" ->16.8. Log level</A -></H1 +NAME="AEN2784">Log level</H2 ><P >If you set the log level (also known as "debug level") higher than 2 then you may suffer a large drop in performance. This is because the @@ -13400,12 +13314,10 @@ expensive. </P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2780" ->16.9. Wide lines</A -></H1 +NAME="AEN2787">Wide lines</H2 ><P >The "wide links" option is now enabled by default, but if you disable it (for better security) then you may suffer a performance hit in @@ -13414,12 +13326,10 @@ resolving filenames. The performance loss is lessened if you have ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2783" ->16.10. Read raw</A -></H1 +NAME="AEN2790">Read raw</H2 ><P >The "read raw" operation is designed to be an optimised, low-latency file read operation. A server may choose to not support it, @@ -13436,12 +13346,10 @@ testing can really tell.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2788" ->16.11. Write raw</A -></H1 +NAME="AEN2795">Write raw</H2 ><P >The "write raw" operation is designed to be an optimised, low-latency file write operation. A server may choose to not support it, @@ -13453,12 +13361,10 @@ case you may wish to change this option.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2792" ->16.12. Read prediction</A -></H1 +NAME="AEN2799">Read prediction</H2 ><P >Samba can do read prediction on some of the SMB commands. Read prediction means that Samba reads some extra data on the last file it @@ -13479,12 +13385,10 @@ as "Write" under NT) which do lots of very small reads on a file.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2799" ->16.13. Memory mapping</A -></H1 +NAME="AEN2806">Memory mapping</H2 ><P >Samba supports reading files via memory mapping them. One some machines this can give a large boost to performance, on others it @@ -13500,12 +13404,10 @@ no".</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2804" ->16.14. Slow Clients</A -></H1 +NAME="AEN2811">Slow Clients</H2 ><P >One person has reported that setting the protocol to COREPLUS rather than LANMAN2 gave a dramatic speed improvement (from 10k/s to 150k/s).</P @@ -13517,12 +13419,10 @@ protocol. Lowering the "read size" might also help.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2808" ->16.15. Slow Logins</A -></H1 +NAME="AEN2815">Slow Logins</H2 ><P >Slow logins are almost always due to the password checking time. Using the lowest practical "password level" will improve things a lot. You @@ -13530,12 +13430,10 @@ could also enable the "UFC crypt" option in the Makefile.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2811" ->16.16. Client tuning</A -></H1 +NAME="AEN2818">Client tuning</H2 ><P >Often a speed problem can be traced to the client. The client (for example Windows for Workgroups) can often be tuned for better TCP @@ -13634,12 +13532,10 @@ staggering.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2843" ->16.17. My Results</A -></H1 +NAME="AEN2850">My Results</H2 ><P >Some people want to see real numbers in a document like this, so here they are. I have a 486sx33 client running WfWg 3.11 with the 3.11b @@ -13666,26 +13562,66 @@ here someday ...</P CLASS="CHAPTER" ><HR><H1 ><A -NAME="OS2" ->Chapter 17. OS2 Client HOWTO</A -></H1 +NAME="OTHER-CLIENTS">Samba and other CIFS clients</H1 +><P +>This chapter contains client-specific information.</P ><DIV CLASS="SECT1" -><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2860" ->17.1. FAQs</A -></H1 +NAME="AEN2871">Macintosh clients?</H2 +><P +>Yes. <A +HREF="http://www.thursby.com/" +TARGET="_top" +>Thursby</A +> now have a CIFS Client / Server called DAVE - see</P +><P +>They test it against Windows 95, Windows NT and samba for +compatibility issues. At the time of writing, DAVE was at version +1.0.1. The 1.0.0 to 1.0.1 update is available as a free download from +the Thursby web site (the speed of finder copies has been greatly +enhanced, and there are bug-fixes included).</P +><P +> +Alternatives - There are two free implementations of AppleTalk for +several kinds of UNIX machnes, and several more commercial ones. +These products allow you to run file services and print services +natively to Macintosh users, with no additional support required on +the Macintosh. The two free omplementations are +<A +HREF="http://www.umich.edu/~rsug/netatalk/" +TARGET="_top" +>Netatalk</A +>, and +<A +HREF="http://www.cs.mu.oz.au/appletalk/atalk.html" +TARGET="_top" +>CAP</A +>. +What Samba offers MS +Windows users, these packages offer to Macs. For more info on these +packages, Samba, and Linux (and other UNIX-based systems) see +<A +HREF="http://www.eats.com/linux_mac_win.html" +TARGET="_top" +>http://www.eats.com/linux_mac_win.html</A +></P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN2880">OS2 Client</H2 ><DIV CLASS="SECT2" -><H2 +><H3 CLASS="SECT2" ><A -NAME="AEN2862" ->17.1.1. How can I configure OS/2 Warp Connect or - OS/2 Warp 4 as a client for Samba?</A -></H2 +NAME="AEN2882">How can I configure OS/2 Warp Connect or + OS/2 Warp 4 as a client for Samba?</H3 ><P >A more complete answer to this question can be found on <A @@ -13738,13 +13674,11 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2877" ->17.1.2. How can I configure OS/2 Warp 3 (not Connect), - OS/2 1.2, 1.3 or 2.x for Samba?</A -></H2 +NAME="AEN2897">How can I configure OS/2 Warp 3 (not Connect), + OS/2 1.2, 1.3 or 2.x for Samba?</H3 ><P >You can use the free Microsoft LAN Manager 2.2c Client for OS/2 from @@ -13791,13 +13725,11 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2886" ->17.1.3. Are there any other issues when OS/2 (any version) - is used as a client?</A -></H2 +NAME="AEN2906">Are there any other issues when OS/2 (any version) + is used as a client?</H3 ><P >When you do a NET VIEW or use the "File and Print Client Resource Browser", no Samba servers show up. This can @@ -13813,13 +13745,11 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2890" ->17.1.4. How do I get printer driver download working - for OS/2 clients?</A -></H2 +NAME="AEN2910">How do I get printer driver download working + for OS/2 clients?</H3 ><P >First, create a share called [PRINTDRV] that is world-readable. Copy your OS/2 driver files there. Note @@ -13828,7 +13758,7 @@ NAME="AEN2890" driver from an OS/2 system.</P ><P >Install the NT driver first for that printer. Then, - add to your smb.conf a parameter, "os2 driver map = + add to your smb.conf a parameter, os2 driver map = <TT CLASS="REPLACEABLE" ><I @@ -13844,8 +13774,11 @@ CLASS="REPLACEABLE" name of the NT driver name to the OS/2 driver name as follows:</P ><P -><nt driver name> = <os2 driver - name>.<device name>, e.g.: +><B +CLASS="COMMAND" +>nt driver name = os2 "driver + name"."device name"</B +>, e.g.: HP LaserJet 5L = LASERJET.HP LaserJet 5L</P ><P >You can have multiple drivers mapped in this file.</P @@ -13859,22 +13792,228 @@ CLASS="REPLACEABLE" </P ></DIV ></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN2920">Windows for Workgroups</H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN2922">Use latest TCP/IP stack from Microsoft</H3 +><P +>Use the latest TCP/IP stack from microsoft if you use Windows +for workgroups.</P +><P +>The early TCP/IP stacks had lots of bugs.</P +><P +> +Microsoft has released an incremental upgrade to their TCP/IP 32-Bit +VxD drivers. The latest release can be found on their ftp site at +ftp.microsoft.com, located in /peropsys/windows/public/tcpip/wfwt32.exe. +There is an update.txt file there that describes the problems that were +fixed. New files include WINSOCK.DLL, TELNET.EXE, WSOCK.386, VNBT.386, +WSTCP.386, TRACERT.EXE, NETSTAT.EXE, and NBTSTAT.EXE.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2927">Delete .pwl files after password change</H3 +><P +>WfWg does a lousy job with passwords. I find that if I change my +password on either the unix box or the PC the safest thing to do is to +delete the .pwl files in the windows directory. The PC will complain about not finding the files, but will soon get over it, allowing you to enter the new password.</P +><P +> +If you don't do this you may find that WfWg remembers and uses the old +password, even if you told it a new one.</P +><P +> +Often WfWg will totally ignore a password you give it in a dialog box.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2932">Configure WfW password handling</H3 +><P +>There is a program call admincfg.exe +on the last disk (disk 8) of the WFW 3.11 disk set. To install it +type EXPAND A:\ADMINCFG.EX_ C:\WINDOWS\ADMINCFG.EXE Then add an icon +for it via the "Progam Manager" "New" Menu. This program allows you +to control how WFW handles passwords. ie disable Password Caching etc +for use with <B +CLASS="COMMAND" +>security = user</B +></P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2936">Case handling of passwords</H3 +><P +>Windows for Workgroups uppercases the password before sending it to the server. Unix passwords can be case-sensitive though. Check the <A +HREF="smb.conf.5.html" +TARGET="_top" +>smb.conf(5)</A +> information on <B +CLASS="COMMAND" +>password level</B +> to specify what characters samba should try to uppercase when checking.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN2941">Windows '95/'98</H2 +><P +>When using Windows 95 OEM SR2 the following updates are recommended where Samba +is being used. Please NOTE that the above change will affect you once these +updates have been installed.</P +><P +> +There are more updates than the ones mentioned here. You are referred to the +Microsoft Web site for all currently available updates to your specific version +of Windows 95.</P +><P +></P +><OL +TYPE="1" +><LI +><P +>Kernel Update: KRNLUPD.EXE</P +></LI +><LI +><P +>Ping Fix: PINGUPD.EXE</P +></LI +><LI +><P +>RPC Update: RPCRTUPD.EXE</P +></LI +><LI +><P +>TCP/IP Update: VIPUPD.EXE</P +></LI +><LI +><P +>Redirector Update: VRDRUPD.EXE</P +></LI +></OL +><P +>Also, if using MS OutLook it is desirable to install the OLEUPD.EXE fix. This +fix may stop your machine from hanging for an extended period when exiting +OutLook and you may also notice a significant speedup when accessing network +neighborhood services.</P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN2957">Windows 2000 Service Pack 2</H2 +><P +> +There are several annoyances with Windows 2000 SP2. One of which +only appears when using a Samba server to host user profiles +to Windows 2000 SP2 clients in a Windows domain. This assumes +that Samba is a member of the domain, but the problem will +likely occur if it is not.</P +><P +> +In order to server profiles successfully to Windows 2000 SP2 +clients (when not operating as a PDC), Samba must have +<B +CLASS="COMMAND" +>nt acl support = no</B +> +added to the file share which houses the roaming profiles. +If this is not done, then the Windows 2000 SP2 client will +complain about not being able to access the profile (Access +Denied) and create multiple copies of it on disk (DOMAIN.user.001, +DOMAIN.user.002, etc...). See the +<A +HREF="smb.conf.5.html" +TARGET="_top" +>smb.conf(5)</A +> man page +for more details on this option. Also note that the +<B +CLASS="COMMAND" +>nt acl support</B +> parameter was formally a global parameter in +releases prior to Samba 2.2.2.</P +><P +> +The following is a minimal profile share:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> [profile] + path = /export/profile + create mask = 0600 + directory mask = 0700 + nt acl support = no + read only = no</PRE +></TD +></TR +></TABLE +></P +><P +>The reason for this bug is that the Win2k SP2 client copies +the security descriptor for the profile which contains +the Samba server's SID, and not the domain SID. The client +compares the SID for SAMBA\user and realizes it is +different that the one assigned to DOMAIN\user. Hence the reason +for the "access denied" message.</P +><P +>By disabling the <B +CLASS="COMMAND" +>nt acl support</B +> parameter, Samba will send +the Win2k client a response to the QuerySecurityDescriptor +trans2 call which causes the client to set a default ACL +for the profile. This default ACL includes </P +><P +><B +CLASS="COMMAND" +>DOMAIN\user "Full Control"</B +></P +><P +><I +CLASS="EMPHASIS" +>NOTE : This bug does not occur when using winbind to +create accounts on the Samba host for Domain users.</I +></P +></DIV ></DIV ><DIV CLASS="CHAPTER" ><HR><H1 ><A -NAME="CVS-ACCESS" ->Chapter 18. HOWTO Access Samba source code via CVS</A -></H1 +NAME="CVS-ACCESS">HOWTO Access Samba source code via CVS</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN2906" ->18.1. Introduction</A -></H1 +NAME="AEN2981">Introduction</H2 ><P >Samba is developed in an open environment. Developers use CVS (Concurrent Versioning System) to "checkin" (also known as @@ -13891,12 +14030,10 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2911" ->18.2. CVS Access to samba.org</A -></H1 +NAME="AEN2986">CVS Access to samba.org</H2 ><P >The machine samba.org runs a publicly accessible CVS repository for access to the source code of several packages, @@ -13904,12 +14041,10 @@ including samba, rsync and jitterbug. There are two main ways of accessing the CVS server on this host.</P ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2914" ->18.2.1. Access via CVSweb</A -></H2 +NAME="AEN2989">Access via CVSweb</H3 ><P >You can access the source code via your favourite WWW browser. This allows you to access the contents of @@ -13925,12 +14060,10 @@ TARGET="_top" ></DIV ><DIV CLASS="SECT2" -><HR><H2 +><HR><H3 CLASS="SECT2" ><A -NAME="AEN2919" ->18.2.2. Access via cvs</A -></H2 +NAME="AEN2994">Access via cvs</H3 ><P >You can also access the source code via a normal cvs client. This gives you much more control over you can @@ -14036,17 +14169,13 @@ CLASS="COMMAND" CLASS="CHAPTER" ><HR><H1 ><A -NAME="BUGREPORT" ->Chapter 19. Reporting Bugs</A -></H1 +NAME="BUGREPORT">Reporting Bugs</H1 ><DIV CLASS="SECT1" -><H1 +><H2 CLASS="SECT1" ><A -NAME="AEN2954" ->19.1. Introduction</A -></H1 +NAME="AEN3029">Introduction</H2 ><P >The email address for bug reports is samba@samba.org</P ><P @@ -14073,12 +14202,10 @@ at http://samba.org/samba/ </P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2961" ->19.2. General info</A -></H1 +NAME="AEN3036">General info</H2 ><P >Before submitting a bug report check your config for silly errors. Look in your log files for obvious messages that tell you that @@ -14098,12 +14225,10 @@ time, and exactly what the results were.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2967" ->19.3. Debug levels</A -></H1 +NAME="AEN3042">Debug levels</H2 ><P >If the bug has anything to do with Samba behaving incorrectly as a server (like refusing to open a file) then the log files will probably @@ -14177,12 +14302,10 @@ large volume of log data.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2984" ->19.4. Internal errors</A -></H1 +NAME="AEN3059">Internal errors</H2 ><P >If you get a "INTERNAL ERROR" message in your log files it means that Samba got an unexpected signal while running. It is probably a @@ -14221,12 +14344,10 @@ useful. </P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2994" ->19.5. Attaching to a running process</A -></H1 +NAME="AEN3069">Attaching to a running process</H2 ><P >Unfortunately some unixes (in particular some recent linux kernels) refuse to dump a core file if the task has changed uid (which smbd @@ -14238,12 +14359,10 @@ where it occurred.</P ></DIV ><DIV CLASS="SECT1" -><HR><H1 +><HR><H2 CLASS="SECT1" ><A -NAME="AEN2997" ->19.6. Patches</A -></H1 +NAME="AEN3072">Patches</H2 ><P >The best sort of bug report is one that includes a fix! If you send us patches please use <B @@ -14258,20 +14377,304 @@ your do the diff against a clean version of the source and let me know exactly what version you used. </P ></DIV ></DIV +><DIV +CLASS="CHAPTER" ><HR><H1 ><A -NAME="AEN3002" ->Index</A -></H1 -><DL -><DT ->Primary Domain Controller, - <A -HREF="x1741.htm" ->Background</A -> - </DT -></DL +NAME="GROUPMAPPING">Group mapping HOWTO</H1 +><P +> +Starting with Samba 3.0 alpha 2, a new group mapping function is available. The +current method (likely to change) to manage the groups is a new command called +<B +CLASS="COMMAND" +>smbgroupedit</B +>.</P +><P +>The first immediate reason to use the group mapping on a PDC, is that +the <B +CLASS="COMMAND" +>domain admin group</B +> of <TT +CLASS="FILENAME" +>smb.conf</TT +> is +now gone. This parameter was used to give the listed users local admin rights +on their workstations. It was some magic stuff that simply worked but didn't +scale very well for complex setups.</P +><P +>Let me explain how it works on NT/W2K, to have this magic fade away. +When installing NT/W2K on a computer, the installer program creates some users +and groups. Notably the 'Administrators' group, and gives to that group some +privileges like the ability to change the date and time or to kill any process +(or close too) running on the local machine. The 'Administrator' user is a +member of the 'Administrators' group, and thus 'inherit' the 'Administrators' +group privileges. If a 'joe' user is created and become a member of the +'Administrator' group, 'joe' has exactly the same rights as 'Administrator'.</P +><P +>When a NT/W2K machine is joined to a domain, during that phase, the "Domain +Administrators' group of the PDC is added to the 'Administrators' group of the +workstation. Every members of the 'Domain Administrators' group 'inherit' the +rights of the 'Administrators' group when logging on the workstation.</P +><P +>You are now wondering how to make some of your samba PDC users members of the +'Domain Administrators' ? That's really easy.</P +><P +></P +><OL +TYPE="1" +><LI +><P +>create a unix group (usually in <TT +CLASS="FILENAME" +>/etc/group</TT +>), let's call it domadm</P +></LI +><LI +><P +>add to this group the users that must be Administrators. For example if you want joe,john and mary, your entry in <TT +CLASS="FILENAME" +>/etc/group</TT +> will look like:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="90%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>domadm:x:502:joe,john,mary</PRE +></TD +></TR +></TABLE +></P +></LI +><LI +><P +>Map this domadm group to the <B +CLASS="COMMAND" +>domain admins</B +> group by running the command:</P +><P +><B +CLASS="COMMAND" +>smbgroupedit -c "Domain Admins" -u domadm</B +></P +></LI +></OL +><P +>You're set, joe, john and mary are domain administrators !</P +><P +>Like the Domain Admins group, you can map any arbitrary Unix group to any NT +group. You can also make any Unix group a domain group. For example, on a domain +member machine (an NT/W2K or a samba server running winbind), you would like to +give access to a certain directory to some users who are member of a group on +your samba PDC. Flag that group as a domain group by running:</P +><P +><B +CLASS="COMMAND" +>smbgroupedit -a unixgroup -td</B +></P +><P +>You can list the various groups in the mapping database like this</P +><P +><B +CLASS="COMMAND" +>smbgroupedit -v</B +></P +></DIV +><DIV +CLASS="CHAPTER" +><HR><H1 +><A +NAME="PORTABILITY">Portability</H1 +><P +>Samba works on a wide range of platforms but the interface all the +platforms provide is not always compatible. This chapter contains +platform-specific information about compiling and using samba.</P +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN3119">HPUX</H2 +><P +>HP's implementation of supplementary groups is, er, non-standard (for +hysterical reasons). There are two group files, /etc/group and +/etc/logingroup; the system maps UIDs to numbers using the former, but +initgroups() reads the latter. Most system admins who know the ropes +symlink /etc/group to /etc/logingroup (hard link doesn't work for reasons +too stupid to go into here). initgroups() will complain if one of the +groups you're in in /etc/logingroup has what it considers to be an invalid +ID, which means outside the range [0..UID_MAX], where UID_MAX is (I think) +60000 currently on HP-UX. This precludes -2 and 65534, the usual 'nobody' +GIDs.</P +><P +>If you encounter this problem, make sure that the programs that are failing +to initgroups() be run as users not in any groups with GIDs outside the +allowed range.</P +><P +>This is documented in the HP manual pages under setgroups(2) and passwd(4).</P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN3124">SCO Unix</H2 +><P +> +If you run an old version of SCO Unix then you may need to get important +TCP/IP patches for Samba to work correctly. Without the patch, you may +encounter corrupt data transfers using samba.</P +><P +>The patch you need is UOD385 Connection Drivers SLS. It is available from +SCO (ftp.sco.com, directory SLS, files uod385a.Z and uod385a.ltr.Z).</P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN3128">DNIX</H2 +><P +>DNIX has a problem with seteuid() and setegid(). These routines are +needed for Samba to work correctly, but they were left out of the DNIX +C library for some reason.</P +><P +>For this reason Samba by default defines the macro NO_EID in the DNIX +section of includes.h. This works around the problem in a limited way, +but it is far from ideal, some things still won't work right.</P +><P +> +To fix the problem properly you need to assemble the following two +functions and then either add them to your C library or link them into +Samba.</P +><P +> +put this in the file <TT +CLASS="FILENAME" +>setegid.s</TT +>:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> .globl _setegid +_setegid: + moveq #47,d0 + movl #100,a0 + moveq #1,d1 + movl 4(sp),a1 + trap #9 + bccs 1$ + jmp cerror +1$: + clrl d0 + rts</PRE +></TD +></TR +></TABLE +></P +><P +>put this in the file <TT +CLASS="FILENAME" +>seteuid.s</TT +>:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +> .globl _seteuid +_seteuid: + moveq #47,d0 + movl #100,a0 + moveq #0,d1 + movl 4(sp),a1 + trap #9 + bccs 1$ + jmp cerror +1$: + clrl d0 + rts</PRE +></TD +></TR +></TABLE +></P +><P +>after creating the above files you then assemble them using</P +><P +><B +CLASS="COMMAND" +>as seteuid.s</B +></P +><P +><B +CLASS="COMMAND" +>as setegid.s</B +></P +><P +>that should produce the files <TT +CLASS="FILENAME" +>seteuid.o</TT +> and +<TT +CLASS="FILENAME" +>setegid.o</TT +></P +><P +>then you need to add these to the LIBSM line in the DNIX section of +the Samba Makefile. Your LIBSM line will then look something like this:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>LIBSM = setegid.o seteuid.o -ln</PRE +></TD +></TR +></TABLE +></P +><P +> +You should then remove the line:</P +><P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>#define NO_EID</PRE +></TD +></TR +></TABLE +></P +><P +>from the DNIX section of <TT +CLASS="FILENAME" +>includes.h</TT +></P +></DIV +></DIV ></DIV ></BODY ></HTML |