SAMBA Developers Guide

Edited by

Jelmer R. Vernooij

Abstract

Last Update : Fri Oct 10noo:59:58 CEST 2003

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 (and will always be) incomplete. The most recent version of this document can be found at http://devel.samba.org/. Please send updates to Jelmer Vernooij.

This documentation is distributed under the GNU General Public License (GPL) version 2. A copy of the license is included with the Samba source distribution. A copy can be found on-line at http://www.fsf.org/licenses/gpl.txt


Table of Contents

Attributions
I. The protocol
1. Definition of NetBIOS Protocol and Name Resolution Modes
NETBIOS
BROADCAST NetBIOS
NBNS NetBIOS
2. NetBIOS in a Unix World
Introduction
Usernames
File Ownership
Passwords
Locking
Deny Modes
Trapdoor UIDs
Port numbers
Protocol Complexity
3. NT Domain RPC's
Introduction
Sources
Credits
Notes and Structures
Notes
Enumerations
Structures
MSRPC over Transact Named Pipe
MSRPC Pipes
Header
Tail
RPC Bind / Bind Ack
NTLSA Transact Named Pipe
LSA Open Policy
LSA Query Info Policy
LSA Enumerate Trusted Domains
LSA Open Secret
LSA Close
LSA Lookup SIDS
LSA Lookup Names
NETLOGON rpc Transact Named Pipe
LSA Request Challenge
LSA Authenticate 2
LSA Server Password Set
LSA SAM Logon
LSA SAM Logoff
\\MAILSLOT\NET\NTLOGON
Query for PDC
SAM Logon
SRVSVC Transact Named Pipe
Net Share Enum
Net Server Get Info
Cryptographic side of NT Domain Authentication
Definitions
Protocol
Comments
SIDs and RIDs
Well-known SIDs
Well-known RIDS
II. Samba Basics
4. Samba Architecture
Introduction
Multithreading and Samba
Threading smbd
Threading nmbd
nbmd Design
5. The samba DEBUG system
New Output Syntax
The DEBUG() Macro
The DEBUGADD() Macro
The DEBUGLVL() Macro
New Functions
dbgtext()
dbghdr()
format_debug_text()
6. Samba Internals
Character Handling
The new functions
Macros in byteorder.h
CVAL(buf,pos)
PVAL(buf,pos)
SCVAL(buf,pos,val)
SVAL(buf,pos)
IVAL(buf,pos)
SVALS(buf,pos)
IVALS(buf,pos)
SSVAL(buf,pos,val)
SIVAL(buf,pos,val)
SSVALS(buf,pos,val)
SIVALS(buf,pos,val)
RSVAL(buf,pos)
RIVAL(buf,pos)
RSSVAL(buf,pos,val)
RSIVAL(buf,pos,val)
LAN Manager Samba API
Parameters
Return value
Code character table
7. Coding Suggestions
8. Contributing code
9. Modules
Advantages
Loading modules
Static modules
Shared modules
Writing modules
Static/Shared selection in configure.in
III. Samba Subsystems
10. The Upcoming SAM System
Security in the 'new SAM'
Standalone from UNIX
Handles and Races in the new SAM
Layers
Application
SAM Interface
SAM Modules
SAM Modules
Special Module: sam_passdb
sam_ads
Memory Management
Testing
11. RPC Pluggable Modules
About
General Overview
12. VFS Modules
The Samba (Posix) VFS layer
The general interface
Possible VFS operation layers
The Interaction between the Samba VFS subsystem and the modules
Initialization and registration
How the Modules handle per connection data
Upgrading to the New VFS Interface
Upgrading from 2.2.* and 3.0aplha modules
Some Notes
Implement TRANSPARENT functions
Implement OPAQUE functions
13. The registry subsystem
Planned backends
Data structures
External interface
Utility functions
Writing backends
Memory allocation
14. The smb.conf file
Lexical Analysis
Handling of Whitespace
Handling of Line Continuation
Line Continuation Quirks
Syntax
About params.c
15. Samba WINS Internals
WINS Failover
16. LanMan and NT Password Encryption
Introduction
How does it work?
The smbpasswd file
IV. Debugging and tracing
17. Tracing samba system calls
18. Finding useful information on windows
Netlogon debugging output
19. Samba Printing Internals
Abstract
Printing Interface to Various Back ends
Print Queue TDB's
ChangeID and Client Caching of Printer Information
Windows NT/2K Printer Change Notify
V. Appendices
20. Notes to packagers
Versioning
Modules

Attributions

Definition of NetBIOS Protocol and Name Resolution Modes

  • Luke Leighton

NetBIOS in a Unix World

  • Andrew Tridgell

NT Domain RPC's

Samba Architecture

  • Dan Shearer

The samba DEBUG system

  • Chris Hertel

Samba Internals

Coding Suggestions

  • Steve French

  • Simo Sorce

  • Andrew Bartlett

  • Tim Potter

  • Martin Pool

Contributing code

Modules

The Upcoming SAM System

  • Andrew Bartlett

RPC Pluggable Modules

VFS Modules

The registry subsystem

The smb.conf file

  • Chris Hertel

Samba WINS Internals

  • Gerald Carter

LanMan and NT Password Encryption

Tracing samba system calls

  • Andrew Tridgell

Finding useful information on windows

Samba Printing Internals

  • Gerald Carter

Notes to packagers

  • Jelmer Vernooij

The protocol

Chapter 1. Definition of NetBIOS Protocol and Name Resolution Modes

Luke Leighton

12 June 1997

NETBIOS

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.

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.

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'.

[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].

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.

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.

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.

NetBIOS names are either UNIQUE or GROUP. Only one application can claim a UNIQUE NetBIOS name on a network.

There are two kinds of NetBIOS Name resolution: Broadcast and Point-to-Point.

BROADCAST NetBIOS

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.

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!].

NBNS NetBIOS

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).

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.

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.

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].

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.

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.

Chapter 2. NetBIOS in a Unix World

Andrew Tridgell

April 1995

Introduction

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.

It was written to help out a person who was writing a paper on unix to PC connectivity.

Usernames

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.

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.

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.

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.

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.

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).

File Ownership

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.

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.

There are several possible solutions to this problem, including username mapping, and forcing a specific username for particular shares.

Passwords

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.

Unix passwords are case sensitive. So if users use mixed case passwords they are in trouble.

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).

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.

Locking

Since samba 2.2, samba supports other types of locking as well. This section is outdated.

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.

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.

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.

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.

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.

Deny Modes

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.

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.

Trapdoor UIDs

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.

Note that you can also get the "trapdoor uid" message for other reasons. Please see the FAQ for details.

Port numbers

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.

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.

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.

Protocol Complexity

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.

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.

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.

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.

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.

Chapter 3. NT Domain RPC's

Luke Leighton

Duncan Stansfield

01 November 97(version 0.0.24)

Introduction

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 http://mailhost.cb1.com/~lkcl/cifsntdomain.txt, controlled by Luke.

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.

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.

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.

A copy is available from:

http://ntbugtraq.rc.on.ca/SCRIPTS/WA.EXE?A2=ind9708;L=ntbugtraq;O=A;P=2935

http://mailhost.cb1.com/~lkcl/crypt.html

A c-code implementation, provided by Linus Nordberg of this protocol is available from:

http://samba.org/cgi-bin/mfs/01/digest/1997/97aug/0391.html

http://mailhost.cb1.com/~lkcl/crypt.txt

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:

HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters

Incorrect direct editing of the registry can cause your machine to fail. Then again, so can incorrect implementation of this protocol. See "Liability:" above.

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.

This document is by no means complete or authoritative. Missing sections include, but are not limited to:

  1. Mappings of RIDs to usernames (and vice-versa).

  2. What a User ID is and what a Group ID is.

  3. The exact meaning/definition of various magic constants or enumerations.

  4. 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.

  5. 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].

Sources

cket Traces from Netmonitor (Service Pack 1 and above)
ul Ashton and Luke Leighton's other "NT Domain" doc.
FS documentation - cifs6.txt
FS documentation - cifsrap2.txt

Credits

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.
Duncan Stansfield: low-level analysis of MSRPC Pipes.
Linus Nordberg: producing c-code from Paul's crypto spec.
Windows Sourcer development team

Notes and Structures

Notes

  1. 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.

  2. In the UDP NTLOGON Mailslots, some "Structures", described here, appear to be 2-byte aligned with the start of the mailslot, at their start.

  3. 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.

  4. 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.

  5. 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.

Enumerations

MSRPC Header type

command number in the msrpc packet header

MSRPC_Request:

0x00

MSRPC_Response:

0x02

MSRPC_Bind:

0x0B

MSRPC_BindAck:

0x0C

MSRPC Packet info

The meaning of these flags is undocumented

FirstFrag:

0x01

LastFrag:

0x02

NotaFrag:

0x04

RecRespond:

0x08

NoMultiplex:

0x10

NotForIdemp:

0x20

NotforBcast:

0x40

NoUuid:

0x80

Structures

VOID *

sizeof VOID* is 32 bits.

char

sizeof char is 8 bits.

UTIME

UTIME is 32 bits, indicating time in seconds since 01jan1970. documented in cifs6.txt (section 3.5 page, page 30).

NTTIME

NTTIME is 64 bits. documented in cifs6.txt (section 3.5 page, page 30).

DOM_SID (domain SID structure)

UINT32

num of sub-authorities in domain SID

UINT8

SID revision number

UINT8

num of sub-authorities in domain SID

UINT8[6]

6 bytes for domain SID - Identifier Authority.

UINT16[n_subauths]

domain SID sub-authorities

Note: the domain SID is documented elsewhere.

STR (string)

STR (string) is a char[] : a null-terminated string of ascii characters.

UNIHDR (unicode string header)

UINT16

length of unicode string

UINT16

max length of unicode string

UINT32

4 - undocumented.

UNIHDR2 (unicode string header plus buffer pointer)

UNIHDR

unicode string header

VOID*

undocumented buffer pointer

UNISTR (unicode string)

UINT16[]

null-terminated string of unicode characters.

NAME (length-indicated unicode string)

UINT32

length of unicode string

UINT16[]

null-terminated string of unicode characters.

UNISTR2 (aligned unicode string)

UINT8[]

padding to get unicode string 4-byte aligned with the start of the SMB header.

UINT32

max length of unicode string

UINT32

0 - undocumented

UINT32

length of unicode string

UINT16[]

string of uncode characters

OBJ_ATTR (object attributes)

UINT32

0x18 - length (in bytes) including the length field.

VOID*

0 - root directory (pointer)

VOID*

0 - object name (pointer)

UINT32

0 - attributes (undocumented)

VOID*

0 - security descriptior (pointer)

UINT32

0 - security quality of service

POL_HND (LSA policy handle)

char[20]

policy handle

DOM_SID2 (domain SID structure, SIDS stored in unicode)

UINT32

5 - SID type

UINT32

0 - undocumented

UNIHDR2

domain SID unicode string header

UNISTR

domain SID unicode string

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.

Note: the SID type indicates, for example, an alias; a well-known group etc. this is documented somewhere.

DOM_RID (domain RID structure)

UINT32

5 - well-known SID. 1 - user SID (see ShowACLs)

UINT32

5 - undocumented

UINT32

domain RID

UINT32

0 - domain index out of above reference domains

LOG_INFO (server, account, client structure)

Note: logon server name starts with two '\' characters and is upper case.

Note: account name is the logon client name from the LSA Request Challenge, with a $ on the end of it, in upper case.

VOID*

undocumented buffer pointer

UNISTR2

logon server unicode string

UNISTR2

account name unicode string

UINT16

sec_chan - security channel type

UNISTR2

logon client machine unicode string

CLNT_SRV (server, client names structure)

Note: logon server name starts with two '\' characters and is upper case.

VOID*

undocumented buffer pointer

UNISTR2

logon server unicode string

VOID*

undocumented buffer pointer

UNISTR2

logon client machine unicode string

CREDS (credentials + time stamp)

char[8]

credentials

UTIME

time stamp

CLNT_INFO2 (server, client structure, client credentials)

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.

CLNT_SRV

client and server names

UINT8[]

???? padding, for 4-byte alignment with SMB header.

VOID*

pointer to client credentials.

CREDS

client-calculated credentials + client time

CLNT_INFO (server, account, client structure, client credentials)

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.

LOG_INFO

logon account info

CREDS

client-calculated credentials + client time

ID_INFO_1 (id info structure, auth level 1)

VOID*

ptr_id_info_1

UNIHDR

domain name unicode header

UINT32

param control

UINT64

logon ID

UNIHDR

user name unicode header

UNIHDR

workgroup name unicode header

char[16]

arc4 LM OWF Password

char[16]

arc4 NT OWF Password

UNISTR2

domain name unicode string

UNISTR2

user name unicode string

UNISTR2

workstation name unicode string

SAM_INFO (sam logon/logoff id info structure)

Note: presumably, the return credentials is supposedly for the server to verify that the credential chain hasn't been compromised.

CLNT_INFO2

client identification/authentication info

VOID*

pointer to return credentials.

CRED

return credentials - ignored.

UINT16

logon level

UINT16

switch value

        switch (switch_value)
        case 1:
        {
            ID_INFO_1     id_info_1;
        }

GID (group id info)

UINT32

group id

UINT32

user attributes (only used by NT 3.1 and 3.51)

DOM_REF (domain reference info)

VOID*

undocumented buffer pointer.

UINT32

num referenced domains?

VOID*

undocumented domain name buffer pointer.

UINT32

32 - max number of entries

UINT32

4 - num referenced domains?

UNIHDR2

domain name unicode string header

UNIHDR2[num_ref_doms-1]

referenced domain unicode string headers

UNISTR

domain name unicode string

DOM_SID[num_ref_doms]

referenced domain SIDs

DOM_INFO (domain info, levels 3 and 5 are the same))

UINT8[]

??? padding to get 4-byte alignment with start of SMB header

UINT16

domain name string length * 2

UINT16

domain name string length * 2

VOID*

undocumented domain name string buffer pointer

VOID*

undocumented domain SID string buffer pointer

UNISTR2

domain name (unicode string)

DOM_SID

domain SID

USER_INFO (user logon info)

Note: it would be nice to know what the 16 byte user session key is for.

NTTIME

logon time

NTTIME

logoff time

NTTIME

kickoff time

NTTIME

password last set time

NTTIME

password can change time

NTTIME

password must change time

UNIHDR

username unicode string header

UNIHDR

user's full name unicode string header

UNIHDR

logon script unicode string header

UNIHDR

profile path unicode string header

UNIHDR

home directory unicode string header

UNIHDR

home directory drive unicode string header

UINT16

logon count

UINT16

bad password count

UINT32

User ID

UINT32

Group ID

UINT32

num groups

VOID*

undocumented buffer pointer to groups.

UINT32

user flags

char[16]

user session key

UNIHDR

logon server unicode string header

UNIHDR

logon domain unicode string header

VOID*

undocumented logon domain id pointer

char[40]

40 undocumented padding bytes. future expansion?

UINT32

0 - num_other_sids?

VOID*

NULL - undocumented pointer to other domain SIDs.

UNISTR2

username unicode string

UNISTR2

user's full name unicode string

UNISTR2

logon script unicode string

UNISTR2

profile path unicode string

UNISTR2

home directory unicode string

UNISTR2

home directory drive unicode string

UINT32

num groups

GID[num_groups]

group info

UNISTR2

logon server unicode string

UNISTR2

logon domain unicode string

DOM_SID

domain SID

DOM_SID[num_sids]

other domain SIDs?

SH_INFO_1_PTR (pointers to level 1 share info strings)

Note: see cifsrap2.txt section5, page 10.

0 for shi1_type indicates a Disk.
1 for shi1_type indicates a Print Queue.
2 for shi1_type indicates a Device.
3 for shi1_type indicates an IPC pipe.
0x8000 0000 (top bit set in shi1_type) indicates a hidden share.
VOID*

shi1_netname - pointer to net name

UINT32

shi1_type - type of share. 0 - undocumented.

VOID*

shi1_remark - pointer to comment.

SH_INFO_1_STR (level 1 share info strings)

UNISTR2

shi1_netname - unicode string of net name

UNISTR2

shi1_remark - unicode string of comment.

SHARE_INFO_1_CTR

share container with 0 entries:

UINT32

0 - EntriesRead

UINT32

0 - Buffer

share container with > 0 entries:

UINT32

EntriesRead

UINT32

non-zero - Buffer

UINT32

EntriesRead

SH_INFO_1_PTR[EntriesRead]

share entry pointers

SH_INFO_1_STR[EntriesRead]

share entry strings

UINT8[]

padding to get unicode string 4-byte aligned with start of the SMB header.

UINT32

EntriesRead

UINT32

0 - padding

SERVER_INFO_101

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.

SV_TYPE_WORKSTATION

0x00000001 All workstations

SV_TYPE_SERVER

0x00000002 All servers

SV_TYPE_SQLSERVER

0x00000004 Any server running with SQL server

SV_TYPE_DOMAIN_CTRL

0x00000008 Primary domain controller

SV_TYPE_DOMAIN_BAKCTRL

0x00000010 Backup domain controller

SV_TYPE_TIME_SOURCE

0x00000020 Server running the timesource service

SV_TYPE_AFP

0x00000040 Apple File Protocol servers

SV_TYPE_NOVELL

0x00000080 Novell servers

SV_TYPE_DOMAIN_MEMBER

0x00000100 Domain Member

SV_TYPE_PRINTQ_SERVER

0x00000200 Server sharing print queue

SV_TYPE_DIALIN_SERVER

0x00000400 Server running dialin service.

SV_TYPE_XENIX_SERVER

0x00000800 Xenix server

SV_TYPE_NT

0x00001000 NT server

SV_TYPE_WFW

0x00002000 Server running Windows for

SV_TYPE_SERVER_NT

0x00008000 Windows NT non DC server

SV_TYPE_POTENTIAL_BROWSER

0x00010000 Server that can run the browser service

SV_TYPE_BACKUP_BROWSER

0x00020000 Backup browser server

SV_TYPE_MASTER_BROWSER

0x00040000 Master browser server

SV_TYPE_DOMAIN_MASTER

0x00080000 Domain Master Browser server

SV_TYPE_LOCAL_LIST_ONLY

0x40000000 Enumerate only entries marked "local"

SV_TYPE_DOMAIN_ENUM

0x80000000 Enumerate Domains. The pszServer and pszDomain parameters must be NULL.

UINT32

500 - platform_id

VOID*

pointer to name

UINT32

5 - major version

UINT32

4 - minor version

UINT32

type (SV_TYPE_... bit field)

VOID*

pointer to comment

UNISTR2

sv101_name - unicode string of server name

UNISTR2

sv_101_comment - unicode string of server comment.

UINT8[]

padding to get unicode string 4-byte aligned with start of the SMB header.

MSRPC over Transact Named Pipe

For details on the SMB Transact Named Pipe, see cifs6.txt

MSRPC Pipes

The MSRPC is conducted over an SMB Transact Pipe with a name of \PIPE\. You must first obtain a 16 bit file handle, by sending a SMBopenX with the pipe name \PIPE\srvsvc for example. You can then perform an SMB Trans, and must carry out an SMBclose on the file handle once you are finished.

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.

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.

MSRPC Responses are sent as response data inside standard SMB Trans responses, with the MSRPC Header, MSRPC Data and MSRPC tail.

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.

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.

To be resolved:

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:

        initial SMBopenX request:         RPC API command 0x26 params:
        "\\PIPE\\lsarpc"                  0x65 0x63; 0x72 0x70; 0x44 0x65;
        "\\PIPE\\srvsvc"                  0x73 0x76; 0x4E 0x00; 0x5C 0x43;

Header

[section to be rewritten, following receipt of work by Duncan Stansfield]

Interesting note: if you set packed data representation to 0x0100 0000 then all 4-byte and 2-byte word ordering is turned around!

The start of each of the NTLSA and NETLOGON named pipes begins with:

offset: 00

Variable type: UINT8

Variable data: 5 - RPC major version

offset: 01

Variable type: UINT8

Variable data: 0 - RPC minor version

offset: 02

Variable type: UINT8

Variable data: 2 - RPC response packet

offset: 03

Variable type: UINT8

Variable data: 3 - (FirstFrag bit-wise or with LastFrag)

offset: 04

Variable type: UINT32

Variable data: 0x1000 0000 - packed data representation

offset: 08

Variable type: UINT16

Variable data: fragment length - data size (bytes) inc header and tail.

offset: 0A

Variable type: UINT16

Variable data: 0 - authentication length

offset: 0C

Variable type: UINT32

Variable data: call identifier. matches 12th UINT32 of incoming RPC data.

offset: 10

Variable type: UINT32

Variable data: allocation hint - data size (bytes) minus header and tail.

offset: 14

Variable type: UINT16

Variable data: 0 - presentation context identifier

offset: 16

Variable type: UINT8

Variable data: 0 - cancel count

offset: 17

Variable type: UINT8

Variable data: in replies: 0 - reserved; in requests: opnum - see #defines.

offset: 18

Variable type: ......

Variable data: start of data (goes on for allocation_hint bytes)

RPC_Packet for request, response, bind and bind acknowledgement

UINT8 versionmaj

reply same as request (0x05)

UINT8 versionmin

reply same as request (0x00)

UINT8 type

one of the MSRPC_Type enums

UINT8 flags

reply same as request (0x00 for Bind, 0x03 for Request)

UINT32 representation

reply same as request (0x00000010)

UINT16 fraglength

the length of the data section of the SMB trans packet

UINT16 authlength

UINT32 callid

call identifier. (e.g. 0x00149594)

* stub USE TvPacket

the remainder of the packet depending on the "type"

Interface identification

the interfaces are numbered. as yet I haven't seen more than one interface used on the same pipe name srvsvc

abstract (0x4B324FC8, 0x01D31670, 0x475A7812, 0x88E16EBF, 0x00000003)
transfer (0x8A885D04, 0x11C91CEB, 0x0008E89F, 0x6048102B, 0x00000002)

RPC_Iface RW

UINT8 byte[16]

16 bytes of number

UINT32 version

the interface number

RPC_ReqBind RW

the remainder of the packet after the header if "type" was Bind in the response header, "type" should be BindAck

UINT16 maxtsize

maximum transmission fragment size (0x1630)

UINT16 maxrsize

max receive fragment size (0x1630)

UINT32 assocgid

associated group id (0x0)

UINT32 numelements

the number of elements (0x1)

UINT16 contextid

presentation context identifier (0x0)

UINT8 numsyntaxes

the number of syntaxes (has always been 1?)(0x1)

UINT8[]

4-byte alignment padding, against SMB header

* abstractint USE RPC_Iface

num and vers. of interface client is using

* transferint USE RPC_Iface

num and vers. of interface to use for replies

RPC_Address RW

UINT16 length

length of the string including null terminator

* port USE string

the string above in single byte, null terminated form

RPC_ResBind RW

the response to place after the header in the reply packet

UINT16 maxtsize

same as request

UINT16 maxrsize

same as request

UINT32 assocgid

zero

* secondaddr USE RPC_Address

the address string, as described earlier

UINT8[]

4-byte alignment padding, against SMB header

UINT8 numresults

the number of results (0x01)

UINT8[]

4-byte alignment padding, against SMB header

UINT16 result

result (0x00 = accept)

UINT16 reason

reason (0x00 = no reason specified)

* transfersyntax USE RPC_Iface

the transfer syntax from the request

RPC_ReqNorm RW

the remainder of the packet after the header for every other other request

UINT32 allochint

the size of the stub data in bytes

UINT16 prescontext

presentation context identifier (0x0)

UINT16 opnum

operation number (0x15)

* stub USE TvPacket

a packet dependent on the pipe name (probably the interface) and the op number)

RPC_ResNorm RW

UINT32 allochint

# size of the stub data in bytes

UINT16 prescontext

# presentation context identifier (same as request)

UINT8 cancelcount

# cancel count? (0x0)

UINT8 reserved

# 0 - one byte padding

* stub USE TvPacket

# the remainder of the reply

Tail

The end of each of the NTLSA and NETLOGON named pipes ends with:

......

end of data

UINT32

return code

RPC Bind / Bind Ack

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.

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.

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

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:

initial SMBopenX request:

RPC_ResBind response:

"\\PIPE\\srvsvc"

"\\PIPE\\ntsvcs"

"\\PIPE\\samr"

"\\PIPE\\lsass"

"\\PIPE\\lsarpc"

"\\PIPE\\lsass"

"\\PIPE\\wkssvc"

"\\PIPE\\wksvcs"

"\\PIPE\\NETLOGON"

"\\PIPE\\NETLOGON"

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.

Request:

RPC_Packet
RPC_ReqBind

Response:

RPC_Packet
RPC_ResBind

NTLSA Transact Named Pipe

The sequence of actions taken on this pipe are:

Establish a connection to the IPC$ share (SMBtconX). use encrypted passwords.
Open an RPC Pipe with the name "\\PIPE\\lsarpc". Store the file handle.
Using the file handle, send a Set Named Pipe Handle state to 0x4300.
Send an LSA Open Policy request. Store the Policy Handle.
Using the Policy Handle, send LSA Query Info Policy requests, etc.
Using the Policy Handle, send an LSA Close.
Close the IPC$ share.

Defines for this pipe, identifying the query are:

LSA Open Policy:

0x2c

LSA Query Info Policy:

0x07

LSA Enumerate Trusted Domains:

0x0d

LSA Open Secret:

0xff

LSA Lookup SIDs:

0xfe

LSA Lookup Names:

0xfd

LSA Close:

0x00

LSA Open Policy

Note: The policy handle can be anything you like.

Request

VOID*

buffer pointer

UNISTR2

server name - unicode string starting with two '\'s

OBJ_ATTR

object attributes

UINT32

1 - desired access

Response

POL_HND

LSA policy handle

return

0 - indicates success

LSA Query Info Policy

Note: The info class in response must be the same as that in the request.

Request

POL_HND

LSA policy handle

UINT16

info class (also a policy handle?)

Response

VOID*

undocumented buffer pointer

UINT16

info class (same as info class in request).

switch (info class)
case 3:
case 5:
{
DOM_INFO domain info, levels 3 and 5 (are the same).
}

return    0 - indicates success

LSA Enumerate Trusted Domains

Request

no extra data

Response

UINT32

0 - enumeration context

UINT32

0 - entries read

UINT32

0 - trust information

return

0x8000 001a - "no trusted domains" success code

LSA Open Secret

Request

no extra data

Response

UINT32

0 - undocumented

UINT32

0 - undocumented

UINT32

0 - undocumented

UINT32

0 - undocumented

UINT32

0 - undocumented

return 0x0C00 0034 - "no such secret" success code

LSA Close

Request

POL_HND

policy handle to be closed

Response

POL_HND

0s - closed policy handle (all zeros)

return 0 - indicates success

LSA Lookup SIDS

Note: num_entries in response must be same as num_entries in request.

Request

POL_HND

LSA policy handle

UINT32

num_entries

VOID*

undocumented domain SID buffer pointer

VOID*

undocumented domain name buffer pointer

VOID*[num_entries] undocumented domain SID pointers to be looked up.

DOM_SID[num_entries] domain SIDs to be looked up.

char[16]

completely undocumented 16 bytes.

Response

DOM_REF

domain reference response

UINT32

num_entries (listed above)

VOID*

undocumented buffer pointer

UINT32

num_entries (listed above)

DOM_SID2[num_entries]

domain SIDs (from Request, listed above).

UINT32

num_entries (listed above)

return 0 - indicates success

LSA Lookup Names

Note: num_entries in response must be same as num_entries in request.

Request

POL_HND

LSA policy handle

UINT32

num_entries

UINT32

num_entries

VOID*

undocumented domain SID buffer pointer

VOID*

undocumented domain name buffer pointer

NAME[num_entries]

names to be looked up.

char[]

undocumented bytes - falsely translated SID structure?

Response

DOM_REF

domain reference response

UINT32

num_entries (listed above)

VOID*

undocumented buffer pointer

UINT32

num_entries (listed above)

DOM_RID[num_entries]

domain SIDs (from Request, listed above).

UINT32

num_entries (listed above)

return 0 - indicates success

NETLOGON rpc Transact Named Pipe

The sequence of actions taken on this pipe are:

tablish a connection to the IPC$ share (SMBtconX). use encrypted passwords.
en an RPC Pipe with the name "\\PIPE\\NETLOGON". Store the file handle.
ing the file handle, send a Set Named Pipe Handle state to 0x4300.
eate Client Challenge. Send LSA Request Challenge. Store Server Challenge.
lculate Session Key. Send an LSA Auth 2 Challenge. Store Auth2 Challenge.
lc/Verify Client Creds. Send LSA Srv PW Set. Calc/Verify Server Creds.
lc/Verify Client Creds. Send LSA SAM Logon . Calc/Verify Server Creds.
lc/Verify Client Creds. Send LSA SAM Logoff. Calc/Verify Server Creds.
ose the IPC$ share.

Defines for this pipe, identifying the query are

LSA Request Challenge:

0x04

LSA Server Password Set:

0x06

LSA SAM Logon:

0x02

LSA SAM Logoff:

0x03

LSA Auth 2:

0x0f

LSA Logon Control:

0x0e

LSA Request Challenge

Note: logon server name starts with two '\' characters and is upper case.

Note: logon client is the machine, not the user.

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).

Request

VOID*

undocumented buffer pointer

UNISTR2

logon server unicode string

UNISTR2

logon client unicode string

char[8]

client challenge

Response

char[8]

server challenge

return 0 - indicates success

LSA Authenticate 2

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).

Note: neg_flags in the response is the same as that in the request.

Note: you must take a copy of the client-calculated credentials received here, because they will be used in subsequent authentication packets.

Request

LOG_INFO

client identification info

char[8]

client-calculated credentials

UINT8[]

padding to 4-byte align with start of SMB header.

UINT32

neg_flags - negotiated flags (usual value is 0x0000 01ff)

Response

char[8]

server credentials.

UINT32

neg_flags - same as neg_flags in request.

return 0 - indicates success. failure value unknown.

LSA Server Password Set

Note: the new password is suspected to be a DES encryption using the old password to generate the key.

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).

Note: the server credentials are constructed from the client-calculated credentials and the client time + 1 second.

Note: you must take a copy of the client-calculated credentials received here, because they will be used in subsequent authentication packets.

Request

CLNT_INFO

client identification/authentication info

char[]

new password - undocumented.

Response

CREDS

server credentials. server time stamp appears to be ignored.

return 0 - indicates success; 0xC000 006a indicates failure

LSA SAM Logon

Note: valid_user is True iff the username and password hash are valid for the requested domain.

Request

SAM_INFO

sam_id structure

Response

VOID*

undocumented buffer pointer

CREDS

server credentials. server time stamp appears to be ignored.

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.
}

LSA SAM Logoff

Note: presumably, the SAM_INFO structure is validated, and a (currently undocumented) error code returned if the Logoff is invalid.

Request

SAM_INFO

sam_id structure

Response

VOID*

undocumented buffer pointer

CREDS

server credentials. server time stamp appears to be ignored.

return 0 - indicates success. undocumented failure indication.

\\MAILSLOT\NET\NTLOGON

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.

Query for PDC

Note: NTversion, LMNTtoken, LM20token in response are the same as those given in the request.

Request

UINT16

0x0007 - Query for PDC

STR

machine name

STR

response mailslot

UINT8[]

padding to 2-byte align with start of mailslot.

UNISTR

machine name

UINT32

NTversion

UINT16

LMNTtoken

UINT16

LM20token

Response

UINT16

0x000A - Respose to Query for PDC

STR

machine name (in uppercase)

UINT8[]

padding to 2-byte align with start of mailslot.

UNISTR

machine name

UNISTR

domain name

UINT32

NTversion (same as received in request)

UINT16

LMNTtoken (same as received in request)

UINT16

LM20token (same as received in request)

SAM Logon

Note: machine name in response is preceded by two '\' characters.

Note: NTversion, LMNTtoken, LM20token in response are the same as those given in the request.

Note: user name in the response is presumably the same as that in the request.

Request

UINT16

0x0012 - SAM Logon

UINT16

request count

UNISTR

machine name

UNISTR

user name

STR

response mailslot

UINT32

alloweable account

UINT32

domain SID size

char[sid_size]

domain SID, of sid_size bytes.

UINT8[]

???? padding to 4? 2? -byte align with start of mailslot.

UINT32

NTversion

UINT16

LMNTtoken

UINT16

LM20token

Response

UINT16

0x0013 - Response to SAM Logon

UNISTR

machine name

UNISTR

user name - workstation trust account

UNISTR

domain name

UINT32

NTversion

UINT16

LMNTtoken

UINT16

LM20token

SRVSVC Transact Named Pipe

Defines for this pipe, identifying the query are:

Net Share Enum

0x0f

Net Server Get Info

0x15

Net Share Enum

Note: share level and switch value in the response are presumably the same as those in the request.

Note: cifsrap2.txt (section 5) may be of limited assistance here.

Request

VOID*

pointer (to server name?)

UNISTR2

server name

UINT8[]

padding to get unicode string 4-byte aligned with the start of the SMB header.

UINT32

share level

UINT32

switch value

VOID*

pointer to SHARE_INFO_1_CTR

SHARE_INFO_1_CTR

share info with 0 entries

UINT32

preferred maximum length (0xffff ffff)

Response

UINT32

share level

UINT32

switch value

VOID*

pointer to SHARE_INFO_1_CTR

SHARE_INFO_1_CTR

share info (only added if share info ptr is non-zero)

return 0 - indicates success

Net Server Get Info

Note: level is the same value as in the request.

Request

UNISTR2

server name

UINT32

switch level

Response

UINT32

switch level

VOID*

pointer to SERVER_INFO_101

SERVER_INFO_101

server info (only added if server info ptr is non-zero)

return 0 - indicates success

Cryptographic side of NT Domain Authentication

Definitions

Add(A1,A2)

Intel byte ordered addition of corresponding 4 byte words in arrays A1 and A2

E(K,D)

DES ECB encryption of 8 byte data D using 7 byte key K

lmowf()

Lan man hash

ntowf()

NT hash

PW

md4(machine_password) == md4(lsadump $machine.acc) == pwdump(machine$) (initially) == md4(lmowf(unicode(machine)))

ARC4(K,Lk,D,Ld)

ARC4 encryption of data D of length Ld with key K of length Lk

v[m..n(,l)]

subset of v from bytes m to n, optionally padded with zeroes to length l

Cred(K,D)

E(K[7..7,7],E(K[0..6],D)) computes a credential

Time()

4 byte current time

Cc,Cs

8 byte client and server challenges Rc,Rs: 8 byte client and server credentials

Protocol

C->S ReqChal,Cc
S->C Cs
C & S compute session key Ks = E(PW[9..15],E(PW[0..6],Add(Cc,Cs)))
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))

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.

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'

User: U with password P wishes to login to the domain (incidental data such as workstation and domain omitted)

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()
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)

Comments

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.

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.

The server time stamps appear to be ignored.

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.

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.

SIDs and RIDs

SIDs and RIDs are well documented elsewhere.

A SID is an NT Security ID (see DOM_SID structure). They are of the form:

revision-NN-SubAuth1-SubAuth2-SubAuth3...
revision-0xNNNNNNNNNNNN-SubAuth1-SubAuth2-SubAuth3...

currently, the SID revision is 1. The Sub-Authorities are known as Relative IDs (RIDs).

Well-known SIDs

Universal well-known SIDs

Null SID

S-1-0-0

World

S-1-1-0

Local

S-1-2-0

Creator Owner ID

S-1-3-0

Creator Group ID

S-1-3-1

Creator Owner Server ID

S-1-3-2

Creator Group Server ID

S-1-3-3

(Non-unique IDs)

S-1-4

NT well-known SIDs

NT Authority

S-1-5

Dialup

S-1-5-1

Network

S-1-5-2

Batch

S-1-5-3

Interactive

S-1-5-4

Service

S-1-5-6

AnonymousLogon(aka null logon session)

S-1-5-7

Proxy

S-1-5-8

ServerLogon(aka domain controller account)

S-1-5-8

(Logon IDs)

S-1-5-5-X-Y

(NT non-unique IDs)

S-1-5-0x15-...

(Built-in domain)

s-1-5-0x20

Well-known RIDS

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.

Well-known RID users

Groupname: DOMAIN_USER_RID_ADMIN

????: 0x0000

RID: 01F4

Groupname: DOMAIN_USER_RID_GUEST

????: 0x0000

RID: 01F5

Well-known RID groups

Groupname: DOMAIN_GROUP_RID_ADMINS

????: 0x0000

RID: 0200

Groupname: DOMAIN_GROUP_RID_USERS

????: 0x0000

RID: 0201

Groupname: DOMAIN_GROUP_RID_GUESTS

????: 0x0000

RID: 0202

Well-known RID aliases

Groupname: DOMAIN_ALIAS_RID_ADMINS

????: 0x0000

RID: 0220

Groupname: DOMAIN_ALIAS_RID_USERS

????: 0x0000

RID: 0221

Groupname: DOMAIN_ALIAS_RID_GUESTS

????: 0x0000

RID: 0222

Groupname: DOMAIN_ALIAS_RID_POWER_USERS

????: 0x0000

RID: 0223

Groupname: DOMAIN_ALIAS_RID_ACCOUNT_OPS

????: 0x0000

RID: 0224

Groupname: DOMAIN_ALIAS_RID_SYSTEM_OPS

????: 0x0000

RID: 0225

Groupname: DOMAIN_ALIAS_RID_PRINT_OPS

????: 0x0000

RID: 0226

Groupname: DOMAIN_ALIAS_RID_BACKUP_OPS

????: 0x0000

RID: 0227

Groupname: DOMAIN_ALIAS_RID_REPLICATOR

????: 0x0000

RID: 0228

Samba Basics

Chapter 4. Samba Architecture

Dan Shearer

November 1997

Introduction

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.

It also tries to answer some of the frequently asked questions such as:

  1. Is Samba secure when running on Unix? The xyz platform? What about the root priveliges issue?

  2. Pros and cons of multithreading in various parts of Samba

  3. Why not have a separate process for name resolution, WINS, and browsing?

Multithreading and Samba

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.

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.)

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.

Threading smbd

A few problems that would arise from a threaded smbd are:

  1. 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).

  2. if one thread dies (eg. a seg fault) then all threads die. We can immediately throw robustness out the window.

  3. 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.

  4. 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.

  5. the per process file descriptor limit would mean that we could only support a limited number of clients.

  6. we couldn't use the system locking calls as the locking context of fcntl() is a process, not a thread.

Threading nmbd

This would be ideal, but gets sunk by portability requirements.

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)

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?)

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.

nbmd Design

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.

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.

Chapter 5. The samba DEBUG system

Chris Hertel

July 1998

New Output Syntax

The syntax of a debugging log file is represented as:

  >debugfile< :== { >debugmsg< }

  >debugmsg<  :== >debughdr< '\n' >debugtext<

  >debughdr<  :== '[' TIME ',' LEVEL ']' FILE ':' [FUNCTION] '(' LINE ')'

  >debugtext< :== { >debugline< }

  >debugline< :== TEXT '\n'

TEXT is a string of characters excluding the newline character.

LEVEL is the DEBUG level of the message (an integer in the range 0..10).

TIME is a timestamp.

FILE is the name of the file from which the debug message was generated.

FUNCTION is the function from which the debug message was generated.

LINE is the line number of the debug statement that generated the message.

Basically, what that all means is:

  1. A debugging log file is made up of debug messages.

  2. Each debug message is made up of a header and tiv>

    OR
    OrWINS support. "parthe name of the file f debug sationctions
    dbgtext()
    id250050> FS work div>

    Originally Andrew used recursion to simulate a multi-threaded environment, which use the stack enormously>The s librBUGLVL() MacroWell-ionalidebuggiorderedl

    <,itle" sch asdebuggibodye f deThis is tciv class="sDIt haure which. debug ="sel b thexa, the triesh4> TIME is de stns we w { >de stdw {,nts ofn at is nasling :== '[' TIME ',' LEVEL ']' FILE GLVL() 0, ( "ata in na %siordered.\n", el TIME is de stns we w { >de made up ofivinder l/p>

    FUt vee clwhatf() ="id25imposescape(P),16server time /av>

    abov wexa, thethatnerateorderedl
    < nd tigtde 0. Mgm >a at:
    < 0?) and mlwhatdermessage is ifbuggiorderedl
    qua class="sf the c/div>Reyle="cserver.

    w { >>

    FUabov wexa, thenot nearlng it methould; :== '[' TIME ',' LEVEL ']' FILE ': [/dt>/07/30 16:00:51, 0]fivindc:This is (128) 9104">ata in na "parthe name.p> TIME is ort. civ clasGLVL() M if onssect2"sxt()<.== { >lass=" up ofivins/a>Rd249d t, the ca ="id25imposbent an tries toflushinfowire /p>

    file frothe n

    ugte/lifeuggibent an tof shs="pyli>

    GLVL()0, ("True") );p': d>re 9104">GLVL()0, ("Fa>re") );p': GLVL()0, (".\n") );p> TIME is Wing is line of thebent a, we w { >(ME um of tlst) Mear to betrue) not nelookwould o a ; :== '[' TIME ',' LEVEL ']' FILE ': [/dt>/07/30 16:00:51, 0]fivindc:This is (256) 9104">atn clstpear to b ': [/dt>/07/30 16:00:51, 0]fivindc:This is (258) 9104">arue ': [/dt>/07/30 16:00:51, 0]fivindc:This is (261) 9104">.p> TIME isWtries t ver threclienTine of thebent a kamegefivx is v/a>Reymust>

    Originally Andrew used recursion to simulate a multi-threaded environment, which use the stack enormously3>

    It's Functionsid clasf line of thebent aothe ="py.ebughdr< '\ns=" unctions

    ORdYli>

    f a oo chn immediatoff one three firaring rds. nt rbehe wir>dPkes it ide on-the- nt rrefrypt e thawir>

    Add(A1,A2)

    Intel byte ordered additt()ER_INFO_1 structure, in the LSA SAM e">ple abent ao9363">vsllwhatf()u all mea ss="orden>Rd249d to ="id2500145">Ne. ifen at andunctiiwhich wspan>

    Add(A1,A2)

    Intel byte ordered additt()<18>

    Add(A1,A2)

    Intel byte ordered additt()<38>New ER_INFO_1 structure, in the LSA SAM e">he sauggibodye f clthe name one abent ao9beforite nugs d t2">

    ents,e fro f clthe name bodynmbd is se ths

    6

    November 1997

    The DEBUG() Macro
    Thacros in byteorder.h
    CVAL(buf,pos)
    PVAL(buf,pos)
    SCVAL(buf,pos,val)
    SVAL(buf,pos)
    IVAL(buf,pos)
    SVALS(buf,pos)
    IVALS(buf,pos)
    SSVAL(buf,pos,val)
    SIVAL(buf,pos,val)
    SSVALS(buf,pos,val)
    SIVALS(buf,pos,val)
    RSVAL(buf,pos)
    RIVAL(buf,pos)
    RSSVAL(buf,pos,val)
    RSIVAL(buf,pos,val)
    LAN Manager Samba API
    Parameters
    Return value
    Code character table
    7. Coding Suggestions
    8. Contributing cod

This would be ideal, but gets sunk by portability requirements.

Andrew tried to write a test tacros>< byteorder.h

Originally Andrew used recursion to simulate a multi-threaded environment, which use the stack enormouslyd2500 It's F>CVAL(buf,pos)CVAthis sts impwould o a ; :== d specific (currently they would be global). B pacef=*up. <="tismb.ure v>

aqiacro>
xa, th, UTF-8s tofn Ne nmbd. se less pos)uasiansaef="#conttigsave to n Ne bd.)UCS2p> Thenf shbe- was fth"unixup. Cematoctbutamp.

w>ple abent aoaring rds.SAM.

all t s="tlass=n at>Cemaamp.

w>en oef="#conttigtfth the on-the an">aqiacro> The pshref="#conttigtts ofn at>Cematocialisa pont_ass=push_MThis is ct packont_ass.

iablest s="tybent aot>ple a(less pos))"unixup. <>lasa s="tybent av>
Cematoci is thandou cankont_p.

akingosh_p. e princlls altiv clase pri(Kile k/p>< less robmp.

wsa inenTine e="id24sg rds. Howathat la a gield>"titl/a>Rd/p>< loaveutodingage is="cermine ifbuggiRd/p>< >ork()Rd/p><,avermathayg rds. ooseli><'t finociali/p>ork()e sauga usermposbacurrenlls alt la . Yli>h4>STR_UNICODEass STR_ASCIIt la a. Fs="tie="tismbd/forma>

ntlyr_aakinsrvlyr_as altciv classkont_/kosh_MThis is sa >ive servers tonaliis sudde.t div>h4>ws asciiass /p>ork(enTinust. Tha makeog file is e depeinev"nhe cne e="id24sgrt. aef=cnv.cas altciv classkont_/kosh_MThis is so>oa href="#id2500502">dviv cvfsMThis is sft thiunixup. Rd24aposto4w, eref="#id250v>

This would be ideal, but gets sunk by portability requirements.

Andrew tried to write a test t7gfile<>PVAL(buf,pos)"titlepa>

d bybos)uado fftigt)
Add(A1,A2)

Intel byte ordered additt()buf,p>d by/div><,pos,val)

Add(A1,A2)

Intel byte ordered additt()b7 Archites)d bybos)uado fftigt)

Add(A1,A2)

Intel byte ordered additt()b with a S,pos,val)d by/div><

Add(A1,A2)

Intel byte ordered additt()802"> ItI,pos,val)d by/div><

Add(A1,A2)

Intel byte ordered additt()82500 It,val)ER_INFO_1 structure, in the LSA SAMear tos>d by/div><

Add(A1,A2)

Intel byte ordered additt()826"> ItI,po)ER_INFO_1 structure, in the LSA SAMear tos>d by/div><

Add(A1,A2)

Intel byte ordered additt()838>LAN Manager SaER_INFO_1 structure, in the LSA SAMtigs>d byunally dhous pe(16 bi< Mngtyte-h a the functiado fftigt)

Add(A1,A2)

Intel byte ordered additt()>SIVAsal 0I34">LAN Manager SaER_INFO_1 structure, in the LSA SAMtigs>d byunally dh32 bi

Add(A1,A2)

Intel byte ordered additt()>62>LAN Manager SaER_INFO_1 structure, in the LSA SAMtigs>d byous pe(16 bi< Mally dhngtyte-h a the functiado fftigt)

Add(A1,A2)

Intel byte ordered additt()>73VAsal 0I34"S>LAN Manager SaER_INFO_1 structure, in the LSA SAMtigs>d byolly dh32 bi

Add(A1,A2)

Intel byte ordered additt()>8file<RS,pos,val)d by/div><

Add(A1,A2)

Intel byte ordered additt()89f,p>d by/div><

Add(A1,A2)

Intel byte ordered additt()#id25e<RS934">LAN Manager SaER_INFO_1 structure, in the LSA SAMtigs>d by/div><

This would be ideal, but gets sunk by portability requirements.

Andrew tried to write a test tut are quturn valueS>egance, pa is ctli> TIME is ver.

<93 s dntnts.transac4999plasciv ca eam /avapieclass="sect3" lang="en">
eg file. Yli>sh Thentigttsat wdiv>)/llistruf sh dAo"ASCIIZhp.

ext ofb63">
keser tabl)ustan>e all meana(bd in NT not mucturn valuews bacurrhaventan>e all meana(bd t ofbdd not mucmanugjmpplies e uct" new maws aggest adRd249dhref="#id2500502">dAo"ASCIIZhp.

ext ofb63">uct" retty messy. Sothe gtde bepear to bhref="#id2500502">dAoyckeser tabl)y. Soegance, pa is ,nafincipe" "Ss<"plaser tabl>Wef="#id2500502">dAo"unally dh16 biuct" retty mestmenPestump>)/ref="#id2500502">dAo"ASCIIZhp.

ext ofb63">subretty mest new mash Thenbepear to b/llifnnol subretty mest e Say,auga usermposise f a lan-ent an Thenbepti
Add(A1,A2)

Intel byte ordered additt( href=e<R#CodingSuggesER_INFO_1 structure, in the LSA SAM e"acear to b keser tabl)(e prinmatocs likeser), not multiogdle is an>e all mea ha sCodinork(en chievwdiv>)/ref="#id2500502">dAo"adjn cuddeh

i="en">byh

)/ermessage is s="sode nmbd fle k/p>ent ansh Thenhreadsherear to b e princiwdiv>ple cltear to b uct" >ent a/ref="#id2500502">dA c"en">retty mest ear to b/lhe xthea makns is thatre threadk lang it woulbepmbd f file is bos)stear to bhref="#id250v>
functionaliifbuggses tombd estultnork(enli>eliv sucCem>rlaser,0)"erver.

sch askeser tab/h4>st"S34">rlaser,2)"eene xtheah16 biode nmbd fle k/ear to b uct" >ent anwdivi>

ear to b uct" >ent anine thastorrnt of>ear to b uct" retty mestmeme /av>Rurpe="erver.

v/rdikeser tab/( triesh4>st"S34">rlaser,4)" M retng it methto tru>g="en">g="en">frypear to b ifb comple>ent anspread>dN a c"en">dD a ="ur pos)ssgtyte-h a thunally dhe functref="#id2500502">dB a pos)s(>expre="cs madraiupporASCIItdigits)ref="#id2500502">dz a ="ur pos)s fftigtple aNULL< erminaquesp. dl a ="ur pos)s fftigtplelan-sermposs uses theef="#id2500502">db woutfftigtple="titl>expre="cs madraiupporASCIItdigits)ref="#id2500502">dr e principleear to b uct" >ent a??

ent a??

Chris Herte3

7. 3 November 1997

TableStdt>nts

New Ou7

TableMassnnnts

Nnly ansi-C constructs (usiSoey ag ansslas dduork()lo>S>vardiv ccncye f cltork(enTiimemonce, pex']' FIstrnce, ps Gtte">div> nmbd Gtte">div> krov on key K

looset rrewire ps thttp://lxr.uppux.no/s"urce/Dance, pa is /3http://www.fsf.org TIMp/thandards_toc.html>vardeheiv class="sm in dint as="ly LEVELmctt neo>hreadine ofbu.

Basicsformppornt =ode wcgeo on"ing asny agsh Thenuseli>CVAork()lo.a><>w>enk. ThThis is fol) aq OSes de>ex']' FI,can mas ihenCIFS/nts.earle>???ing ase Tinust. Thlo wouldit is a my>buildhas asocialica24999pi>h an tdvialiSAFE_FREEiieotdvdo verialibdvdo verialip. cpn usedp. inn (ialipafe_* e is a slos)r an tent ane/tarunaref="#id2500502">dvdo verialiget dv TCliciat r dduortot qua ifie pron>Rdrm>Rd24aposnotThis is so>obustRdrm >nt r(ode wfryp#d in NT away)ref="#id2500502">d wden>Rd24aposs>va_ fun owf o"irglass=d24agn

et ands="sVA_COPY>va_ fun estamp. sing>
fSEGVpifen atdo vehref="#id2500502">dvdisc"ur2">iwhg="en">cessir an tdvdo ver TCliciat rnonameect2"sxt()ncyref="#id2500502">dvdo ver TCliciat rexterotThis is so(thayg. Thauto>
    pley Lto.h)r an tncyref="#id2500502">dvwhg=h a thpafethPVAL(bwden>unRd/p FIsaMBso(seeMpos)dve /avUp>ork()earlice.6owe akingosh_*>akinakev"se_p.

    This is s.h an tdvDo vereE ume Eng fuht>nt h an taialip. OSes d u must Unix?dlocking callEhsh

    fcoex']'o>nesto f cltn>uname f DATA_BLOB both"length specifiedppos)-dct"mh an tdvTre w>

dvDo vereccnmbds liSAM_ACCOUNT retty messdirecthe,athaygrh Thenbepacle="cs via pdb_getc..) Mormapdb_setc..) MThis is s.h an tncyref="#id2500502">dvDo ver Howaa>Rd24s i: directhelyby ssttle" sa sdb,ha and m ands=". aeHow_Rd24s i:letuftabe"#e.h an tdvTry lasialissh hatfi tyhtabe woupp. obustRs is thref="#id2500502">dvUandt vee cCforword h"/ *iieotC++forword tfth the/a>Rd/do f cltC99 shandard,hode weldtablendth"C>ge">vinrsstruf shaclepngt>.ref="#id2500502">dvTry laslling gance, pa is both"an>e all meas usedp. ty mestdv TClain63">e pri( f cltork(,ad byent i>fryppickurrha repGoxy>dvKeepoth wicopetnarrrmdiv> that we are

This is s/ immedia sharottwdenowirtRs is th. Wetdo vep anss"ur epagepreaanksfou. dvUand all meanl princ (laskeepo
??? specific all meaaes d.>ata in nlassnche plylbmkome ntcfor-cgmmusea in#idp>dvThinkgresx sodells WhT uniqtan sy anytrk(enIfgt>resx ock ie thatugg9964cit s=e depeente ref="#id250v>
r. Wine res imtdo d oti>CVAork(e funccpeaceedmethousi sitexpecinmatocamlist r. Wine adisF>CVAthave gar. Wines WhT unVAL(bu caodenmene xthe llrew wden>a lclass="author">Chris Herteine ofbu. FILE>

8. 3 November 1997

TableJelmUn1">

TableR.nts

ooij1">8. Cont class="firode nmb DEBUGtte">ge "clear: beailto:jelmUn@div><.org">jelmUn@div><.org>iv>
wort>ple s>s"urce>
INFSed. x sine ofbu. uork()lo>s>s>s>
P

etdiscu(shlirgetmodifice.6owe n at. Thgoaposto4are lllwi/dtm
sd fle k/p>s's-cp>wr /av. se lll f cltork( WhT uniqtan sigv>< debug v>le nnt yli>

f void s rndiposy any/p>

mbddffe gaotilllpg it methtringthef shgoaposto4are igtt>ple cltuniqup>reswdivi im

???ing agthef sh cltoringcdo a hr div>
Pat mes(pletpacp>
    dinta-uivb>v>< debug ifny agnt =modify higaocopy>

    f/p>i ad>

      < b/span>cvs dinta-uivb>vdiv>
      < debud specific ingmazNTntly thuy would disce global)Do verods, yacopy>ork(fdt>ogsage. Durlice.(flllank()es)ustnes voidnmeef="#id2500502">Tustty anypat m/li>Do ver >sepl typdpat mes( NFSneilirgetdintasithdiv> thav>h star a makriskef shgett

      atglodypat mmc mdivc>h x howorlllwi/dt/liissustmeef="#id2500502">Mre s
      Begivx iclas>epwiielh>s>epzdoma.div><.org/"trirget="_top">>epzdomaAthis s>
      Srnddfea messpat mes a ibl<, and mdxt ofpointer twess robm pat mma ushavewas s mtruuo robm "clear: beailto:div><-technsage@div><.org"trirget="_top">Siv><-technsagetunih neo>a u(ong="en"><)l'ownt>s'lll f cltork( y a>hadetmodifice.6owe to. Wet. Tha pterse pso, b lllpgeowirebodyetrndiclas'let ong="en">p despons(fdt>
      ing="en">smbddthe otlllanmdivty anypat mmor-rtabforword h"whyt>

      fivxty anypat mm>mbdre-set:cit ubefor ylinypat mmis>ive svnmeef="#it>a lclass="author">Chris Hertemodules61>9. Modulesns"> November 1997

      The DEBUG() Macro
      T1842">A>
      Cod1907leStarottmodulesnsdt>Cod194t2"Sef=edtmodulesnsdt>
      Writiposmodulesnsdt>
      Cod2016leStarot/Sef=edtseoes is tuf, onfigmes.nnntdt>

      This would be ideal, but gets sunk by portability requirements.

      Andrew tried to write a test 1842">ntdtA>CVAmodulesAthis sthasathat sformppor2>

      earlently rie=dnc="0/p>umme c="Sds, b ntly thtr">td>Transpaas="tloadiposof>rearottusedpef=edtmodules (nootr">td>Sds, b seoes is tbetwrnetpef=edtusedp.arottmodules divorefigmesy/p><tr">td>"preloadtmodules".

      <= or-incan tppo pcross enis or-osmedi/modulesnststiitr">tr">td>Noo
      tr">td>A pted/p>ndic. Tha are fae toklu/spM/smedi cod

      This would be ideal, but gets sunk by portability requirements.

      Andrew tried to write a test 188a he<Loadiposmodulesnshat used only ansi-C constructs (usiSon'tsubrhis swiielh>xa, ths s="ssa sdbasubrhis sthas: h :== '[' TIME ',' LEVEL ']' FILE NTSTATUSismb_eag c>r_sa sdb(pri(le ans fortot TIME is Tread all mean rds.ryptiv ?: ="sle" in and asa is boall mean f clth dulenple eag c>r-itseof. class="sect3" lang="en">

      vinssa arsto f in and asa is boall meas e sauggi p.arottmodules

      ents,subrhis s.>ata in nabd in N. Fs=">xa, ths ingtheobustthingnthel(dt>ionamee/orefig/spatt>): h :== '[' TIME ',' LEVEL ']' FILE /* 0tarottin aboall meas */ #d in Nusearot_in a_pdb {tpdb_mysql_in a(); pdb_ldap_in a(); pdb_smbRd24sd_in a(); pdb_ db am_in a(); pdb_gud TIME is TraseMThis is sfsh Thenbeptiv ?: =eforeetpacpubrhis sthe- was.>atado sh Thenbepdo d ws ofthatpubrhis sthe-in and as b ss=ionali was.>ref="#iiv cliablelist">

      Add(A1,A2)

      Intel byte ordered additt( 94t2"sal 0ef=edtmodulesnsER_INFO_1 structure, in the LSA SAM If- asubrhis stt2edl)a certan sed/p>nd, i>ras.>I tonevbd/p>ndras alea/lys s="ssubrhis stsh Then a ptsmb_u me_module(nd). Tread all meantrdehede loadt cltoringcdoh duleniables certan spath ($LIBDIR/subrhis s/bd/p>nd.so).>I tonevionalim which ts nt'bd/p>nd' estamp>Inh,tsmb_u me_module()ntrdehede loadt clth duleniableuggi absoou. spath specifiedp nt'bd/p>nd' Unix? TAfincismb_u me_module()nhasaurnetexecu. <,fthatpubrhis st sh Then Howayby sf f clth dulenhasaurneteag c>ras.>ref="#iiv clv>

      This would be ideal, but gets sunk by portability requirements.

      Andrew tried to write a test a965">sal Writiposmodulesnshat used only ansi-C constructs (usiort. modulenhowf o"in and asa is boall mea. Fs="modules current = nonameed , andp>pubrhis sivi>_bd/p>ndivi>_in a'. Fs=">x#id250 modules (aring rds.nowirtryppuilt-ine bd.)>nt rd are fae toaomodule)ptread nd_in a() in a_module()). Tr y Ltosket e sauggseMThis is sfa ; :== '[' TIME ',' LEVEL ']' FILE NTSTATUSiin a_module(void);p> TIME isTread all meansh Then a ptone ed. Mul eag cra is boall measenTine e="id24nsh Then sCodinNT_STATUS_OK s asuccnmbdorma NT_STATUS_UNSUCCESSFULass=d. Mul warutpn">erronytrk( s af armes.Unix? TFs=">xa, ths pdb_ldap_in a()nine thas: :== '[' TIME ',' LEVEL ']' FILE NTSTATUSipdb_ldap_in a(void) { smb_eag c>r_sa sdb(PASSDB_INTERFACE_VERSION, "ldapp><",tpdb_in a_ldapp><);psmb_eag c>r_sa sdb(PASSDB_INTERFACE_VERSION, "ldapp><_nua",tpdb_in a_ldapp><_nua);p sCodinNT_STATUS_OK; }p> TIME iablelist">

      Add(A1,A2)

      Intel byte ordered additt(2016lesal 0tarot/Sef=edtseoes is tuf, onfigmes.nnntER_INFO_1 structure, in the LSA SAM Son'tmPVAL(buf, onfigmes.nnd>

        vardiv cd in Ns usedpubres curre . Thnec)ssshall sauggirhis stlass imtoringcd. All"modules curresh Then ryppuilt ="sd iaultnhreads mb>varde fae'd iault_modules'. Fs=">xa, ths f ldapMead ound, pdb_ldapMeadadenmatocpubrhis sivi>_bd/p>ndivi>, objThiuivinsivi>, klu/spM<ivi>, subrhis stta><ivi>, searot_ac4999ivi>, sef=ed_ac4999ivi>) aMB_SUBSYSTEM)pubrhis sivi>,depivinivi>) > TIME isTre9expivinm or- acertan spubrhis sthe-oneviothatre tciv e uggi in and asa is boall meas e sauggip.arotst adpuilt notmodules.Unix? Th iquiremenreit cne fa"UGtt>@SUBSYSTEM_MODULES@ivi> notMre sithdian rds. rypeait cndo>epagen f cltklu/spiclas>eil

        BasYli>hthreare s

      1. uivinsstsearot_in a_pubrhis s;
      <>eil

      Anmirgin-left: 0.5in; mirgin-r sta: 0.5in;"

      Intel byte oe /antER_Iis Traustthingnthela makestam onfigmes.nndcgmmuseptiv ?: aMB_MODULE_PROVIVES(). Treadhe- was fs="modules curreeag c>r-less , b th

      Add(A1,A2)
    Intel byte ordered additt(211 Archite>The DEBUG() Macro
class="a"#id2501160p><">10enTineUpcgm FIsaAM Shis s>
Her.h s usedR cnssiot muc>CVAaAM)
s>
Cod2346leAprlice.6ownsdt>Cod235 AraAM I fube"#ensdt>Cod2382AraAM Modulesnsdt>
Cod2406leSpeciworModule:dp><_sa sdbnsdt>Cod2426">p><_adsnsdt>
n valueord )
Tust FInsdt>11./RPCtPtumb OcroModulesnsdt>
G
    12. VFSoModulesnsdt>
    Cod2855leTcltg
      Cod2952f=P is thaVFSoopn"ing a>layt>s>
      TcltI fubas is tbetwrnet cltn>
      Cod303f="In and azing ar mbdreg cra is nsdt>Cod3183">HrmitlepModulesther.h p aninen"id2499eata>
      UpEVEdaposto4w, NCVAVFSoI fube"#ensdt>
      Cod3393">UpEVEdaposiable2.2.*>akin3.0aplhatmodulesnsdt>
      Cod3829leIarle>??? TRANSPARENTboall measnsdt>Cod3849leIarle>??? OPAQUEboall measnsdt>13enTinereg cry pubrhis s
      P>ndi)
      Dct" retty mest)
      UtSes d oall measnsdt>ncl oo cis nsdt>
      Cod432500Her.hCod435 ArHer.hCod441f="Ln Nu>
      Sye txnsdt>
      Cod4553>
      TcltsmbRd24sd ivin

      class="author">Chris Hertep><">>10. TineUpcgm FIsaAM Shis s><"> November 1997

      This would be ideal, but gets sunk by portability requirements.

      Andrew tried to write a test 21SIVAchiteecurs deiot muc'>CVAaAM')???ing athe 'securs d'der ccnmbdore oolsise n>a 'ah2on atro shadathatmo>???'mb5.is, at:cit howfn sinelepng"enNTbACLse fun/lix sodel'magic' 'ah2on atro s'n Hows.Unix? TWads okc rk,tormathat>CVAtetty mes i(bd ally dh>xa, ths ws ofn a <_get_acl"en"_by_ite (ortot SAM_CONTEXT *ore ext fortot NT_USER_TOKENt*acle="_tok TIME is Tra ore extc

      frypNULL<(at:cis- was s mtformlbmkome/exve gabe utt

      eccnmbdsoks us'bdsokf makb>

      eccnmbdd alredkestas p anuggiaCL, fs="Rd24apospletpacpeeccnmbdseent.rver.

      douniq/s us nt rhreadone douniq, keepmethtrsitehs'unqua ified' s us /li>a 'her.h 'd achievsitopaqv class="snesto f S>

      eccnmbd Howmposisedo d ="sle" aAM moduled anTinere ta 'choka>e pri'/llis >ahlo eof dffe gat>ple cltdiv>asubrhis stlasehs

      we.nowirt'acc on??i ' fs=g s tocamHowafs="contced24s i:s,emi="cs snestriid2499etc/lli infurmathatSAM tocbThnlintens>isn'tca24999erver.

      ea teccnmbd Howmposisef shher.h : ="sle" infube"#e)etseof)is iv class="sdint as="tearle>???ing as ingare rikadon/llFs=">xa, ths on ADS, yli>

      f shsetaa>Rd24s i: e/taba lan-SSLninen"id249/llOhe o ed/p>ndich4>we.noas s mreweadshievpolicy up ple cltuodules.anTinyg rds.na mee shreadaccnmbdso 'helldr' u cedmestdormaglody>xa, ths lasavoid mi=>ndichy aggest adceosedpleyusdtt

      wholgiaCL issusclass="snem /avis>xa, tha-rbind asathats usesirecthe)rver. <',o triestformi s="s'rm"'torma'se"'tr. Wines pleear to 'ACCESS_DENIED'Mfth"tl//pwycurr bustf shabletde bepearrievl>

      ndd achievnem abild bynoas ple.pecif"sle" NT_TOKENt499ewire opn"ing a,tormaaforms e sa'objThiuf s pre=???'mde bep/p>i add']' FIui=>l>
      <_up/a><_acl"en")sle" infub250 detailic. Thaby sfuwas.>fort. /saurnethadetlass="stbjThi >/saurnetflambdd,hod madasavoid raceporney Ko dlos) s="orspavoid vio/vltg
        x#id250 aCLhmanipula is ctlellalidoplookups bacurr
        s would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a test 22ter">CVAaAM'the-oningt>f> rkd a Acl"en"wyf shpreex']' FIsio"unixn Thenbeptind-gte d aWet>/vlta fare nnt ustgle=eforeetp

        s would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a test 2283">>CVAaAM)CVAaAM'ts imthasatrias s me"#e)es)ied an">aqiOSes de>??? lass liSAMR uftabe"#e.lli cgeo on"iSAMRds mb>p ign>??? > Mu,h tyhta e woulnmbdor, thxder lso,"mostpe depeiasssd fln>ftformdrver. flnAMRdh4>

        Basiing="en">CVAork()he-onev onfliid2/p updtypdp mustd aWet>/vltrikan a s uss disit ytiv clr y Lpn"ti s used*s/vl*hw, eriv ,dd claifen a do ver list 2n /p>

        Basicsh"tl/a,kseeMwurreI'vepdo d hatrpc_isso bust>nt rupdtypdtl//pwycurr >/vlt*an mly*pamlist:.ref="#id2500502">d' onfliid2/p'vupdtyps: Chingnthelwetdo vepdn masCVAtamdseent)e bd.)nctiextagn a ushfficignthelfthxs thaso 'd ny' a> sch asupdtyp/lli do vepforeseeMloowmposrec i:s howewirhref="#id250/u

        s would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a test 234er"e<Layt>s>

        Add(A1,A2)

        Intel byte ordered additt(2346lentdtAprlice.6ownsER_INFO_1 structure, in the LSA SAM e"a in n>obustsmbd,hoamresttormawurrowirt>nd-s useeait cn>??? >et>/vl or-pdbedi>

        Add(A1,A2)

        Intel byte ordered additt(235 Ar>vardiv cher.h retty mest,itlepg<"/tigtr. Wines on teosedretty mestrarmau v one-onevpublottintabe"#e.llTmucap lice.6ow layt>dh4>a 'cre ext'mde bepsa sas s mtfo infube"#e)r. Wines, d>resasd iault,kself-in and asppo ine extc rds.rypshavli?:d achievlay us findiclmucap Lpritypdbd/p>nd

        Add(A1,A2)

        Intel byte ordered additt(2382Ar>ap lice.6owsdirecthe,a"nl"sbe utt

        soiot mucher.h s,tormaeaceivmposrequdsodt>ple(say Mor tDAPvmodifice.6ow arst.llTmuch dulensitexpecinm ple'

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a test 2401Ar>

        Add(A1,A2)

        Intel byte ordered additt(2406le><_sa sdbnsER_INFO_1 structure, in the LSA SAM INFSed. i sauggrads mb>ritiposatmodule curreeaadstex']' FIssa sdbaed/p>ndi,tormatranspleSAM eaities.an(A makkont FIstct" dt>nevt>sha-rrtabbds liSAMaa>Rd24db uftabe"#e.hef="#iiv cliablelist">

        Add(A1,A2)

        Intel byte ordered additt(2426">><_adsnsER_INFO_1 structure, in the LSA SAM e"a in nonevionali f cltnAM modulel)ustnes< mdivc><- uniql"sbey, andI.noasnmatocaoSedine.(f> imtwi/dtm(neo>div>u v onsan Ay tabfDirectg">ntDAPv The p,psuismedi/i sawhg="nda ,ixed-mrk()DC. Whitheingthethingnthelbe Torestcs by ssttWin2kvisopetcurrle isAD)DC.rver. 2.2/3.0 an">aqiOld ldapvmodule, aby sfuwmethoubadstork(.ref="#iiv clv>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a test 2451Ar>n valueord )

        '>CVAaAM'tddt>??? dffe gaa makineleto b etseof), andgett

        a sane.earle>???ing athe mnmvalueord ctli>???NT no Rd24dbder lso,"ould sa sdb,ht>nmvalueord aeadhmkome ntcggradbey, anduggiaPIseiot muc'>CVAaAM'ed/ f sh and'pdb_in a()'ass=dn e is a slo.anTinyga and mcl oo cgi>CV ebjThis.anEnumn"ing a's dustsl staln dint as=",aormaocthiren49rb ntly,i tyhtabe wouper-eleord ctl(tha enumn"ing aboall meas ear to>anaarrly>w>en TIME isTv>'numb'm a,awhith: :== '[' TIME ',' LEVEL ']' FILE NTSTATUSis><_get_acl"en"_by_sid(ortot SAM_CONTEXT *ore ext fortot NT_USER_TOKENt*acle="_tok TIME isAforctypdya her.h usedp.orbbds licl oo cis ine extceanaringher.h .>

        BasI th<_enum_acl"en"s(ortot SAM_CONTEXT *ore ext fortot NT_USER_TOKENt*acle="_tok TIME v>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a test 2525">>w>en=yppiec)the (oftwarb,tandoa>thetertan ln no exlepnis ctIniextagnmethtrsit>CVAthbrhis s, wet>/vltrikan i adrestcs,htnde rnderi( f . Wo on y Ltocolserver. li>a 'cthrde'eSAM ore ext f>

        so was ="sle" nest fle k/phis s, useptin loadta> skesetltorefigmeing aboithdi class=???NTe bd.)nctset>/vl alea/ly-e svnm visml>w>ete]' FId anIeexpecitnAM module>div>s
        bin/samrest
      <> TIME is (hreadloadl)a >CVAore ext fuwmethuggi>CVAADS moduled aTr yeser tab)is ' oo cis 'i f cltldapvis TIME is (ear tostampid).rver. CVAaAM'the-NTbACL bacur,fuggradldompbepadcgmmusepto .pecif"sanaarbitre clNTbACLe bd.)fs="crmlbtm93 s 'rhis s' ="sd iault.ref="#iiv clv>

      class="author">Chris Herterpc-klu/sp">>

      11. RPCtPtumb OcroModulesns"> November 1997

      The DEBUG() Macro
    T2662>
    G

      This would be ideal, but gets sunk by portability requirements.

      Andrew tried to write a test 2662>APvih Th.0 it)d ac19rMiterettytple cltetertumb OShlo d fln> skeignthiuit>/lix ic all meaacinmSandp>

      s would be ideal, but gets sunk by portability requirements.

      Andrew tried to write a ted252662><77">G

        <<.t)iign>???bustsmbustle()ntrdehede lawrnetpeflibrbitrwas =" kup_ t>pipoivin><<.ffindurrei dotlask wriconaya her(Ie ro><<.ns ex#id2adon/llbut oss , LSAmpporcurre f shher.h :t>mUn@dld '>< ?ing atuod was fsr.)nction addiformdrver. nsdb(sizevoid);p> T:== d specific immedintly thpan class="sect1">
      Vri(le mal/pf filets pRPCsonevintabe"Ucet>pleaam#d i class="sect1hadh?'mbntlem> ?: RPCSSDB_INTERFACE_VERlmUn1">vdiv>
      >pleCrpc Ttread Tasd fleeadd pipovb>vdiv>
      >pleSapvistread Tasd fleeadd pipovb>vdiv>
      inssa arsttpi_s onotn /asftvdiv>
      >pleal/pf filetpi_s onotn

      class="author">Chris H1160vsp">> November 1997

      27 Mayar mm2003
      The DEBUG() Macro
      Cod2855leTcltg
        Cod2952f=P is thaVFSoopn"ing a>layt>s>
        TcltI fubas is tbetwrnet cltn>
        Cod303f="In and azing ar mbdreg cra is nsdt>Cod3183">HrmitlepModulesther.h p aninen"id2499eata>
        UpEVEdaposto4w, NCVAVFSoI fube"#ensdt>
        Cod3393">UpEVEdaposiable2.2.*>akin3.0aplhatmodulesnsdt>
        Cod3829leIarle>??? TRANSPARENTboall measnsdt>Cod3849leIarle>??? OPAQUEboallss.nnntdt>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a tid252825">>9leTcltn>

        Add(A1,A2)

        Intel byte ordered addiCod2825">>9leTcltg

          fo thaVFSoopn"inSAM ho116_op_32p*,hreada lall oka>euio (,aorlesther.ka>euio i: io s onott116_opsndi,tore Son'tmPVconstrunindgthe tyhehct ytiv cal/p>pn"in. (E iss >mplookt>iona116efig/spndi,tt>iona116_on'tmPefig/sp.<_ _116_op_32p* { ?: th_OP_NOOP = -1, ... /* F Whal/p>pn"ing*/ ?: th_OP_OPEN, ?: th_OP_CLOSE, ?: th_OP_READ, ?: th_OP_WRITE, ?: th_OP_LSEEK, ?: th_OP_SENDFILE, ... ?: th_OP_LAST }o116_op_32p*oid);p> TIME isTs onotta()nine s(Is tha lall andrlesther.ka>euid was fs= al/p>pn"in.ta) :== '[' TIME ',' LEVEL ']' Fs onott116_opsn{ s onott116_fn_.ka>euid { ... /* F Whal/p>pn"ing*/ sdb((*dom )(s onott116_lesthe_s onott*lesthe, s onotta()ninen"i_s onott*c()n, s fortot ui_s onott*fspnusdb(rdvoi ssize_b((*l al)(s onott116_lesthe_s onott*lesthe, s onottli>ui_s onott*fspnusdb(rd, rspav*2499, size_b(nvoi ssize_b((*atasl)(s onott116_lesthe_s onott*lesthe, s onottli>ui_s onott*fspnusdb(rd, s forrspav*2499, size_b(nvoi ?: OFF_T((*lseek)(s onott116_lesthe_s onott*lesthe, s onottli>ui_s onott*fspnusdb(rd, ?: OFF_T(offsetnusdb(ths cevoi ssize_b((*dre-onf i(s onott116_lesthe_s onott*lesthe, ign>??rd, li>ui_s onott*fspnusdb(rposrd, s forDATA_BLOBt*l aldlay ?: OFF_T(offsetnusize_b(**acl"; ... }halsoi s onott116_al/pher_.ka>euid { ... /* F Whal/p>pn"ing*/ s onott116_lesthe_s onott*dom ; s onott116_lesthe_s onott*maaqu; s onott116_lesthe_s onott*l al; s onott116_lesthe_s onott*atasl; s onott116_lesthe_s onott*lseek; s onott116_lesthe_s onott*dre-onf ; ... }hal/pher; }nit);p> TIME is Ton'tmPVSHOULD Thenbep hehct yt>w>e116hal/p>pn"i. DO NO clN 'ACta()n->pn"ing*/ maam#d i ?: th_OPEN(c()n, fniq-nurnets i:ode) \ ((c()n)-> TIME v>

          Add(A1,A2)

          Intel byte ordered addiCod2925">52f=P is thaVFSoopn"ing a>laytesnsER_INFO_1 structure, in the LSA SAM e"ultnwdiareiv>so was ="s fuwmetha()n->r-less aln dint iepn"inelyevsitopadi,tormatpaint ag a>lawmpose thdr' usn. O,i tyhypwdiareiv>so /vl lo>u Writiettats uagnot fuw fumb Oieocolserver.M>la. Ositopa6ow lais was fs="mod <',o tthelearlejThiuag-onevilesAthisporci Mul(oDB-ups bann an a>lawmposedtt

          itime e o krov neanarely hise6ow lais v>so .h Tor-eal/p>pn"i. ta) :== '[' TIME ',' LEVEL ']' F32p*aam s><_ _116_op_6ow la{ ?: th_LAYER_NOOP = -1, /* -n N. xt fuwiltpn"ing, prieexlepr*/ ?: th_LAYER_??? OPA= 0, /* -n oSesm"a il,purredidopnt yt>w>fth"ttieyoneto b ets*/ ?: th_LAYER_??? TRANSPA, /* -ndd aN wire opn"ingsporciamyp lysfuwmow laa? TAf*/ /* dis ('ing ly*pax']' FIsso FIst*/ ?: th_LAYER_LOGGER, /* -nLogs 2499, sporciamyp lysfuwmow l, loggWritiaydidop*/ /* d lasialiStuiv_dounie_, andp> TIME v>ng cod

          This would be ideal, but gets sunk by portability requirements.

          Andrew tried to write a t="ch3025">>9leTcltI fubas is tbetwrnet cltn>

          Add(A1,A2)

          Intel byte ordered add>Cod3025">3f="In and azing ar mbdreg cra iesnsER_INFO_1 structure, in the LSA As Tor-e cltn>nAM modut/v ta) :== '[' TIME ',' LEVEL ']' ILE NTSTA116_Fs=">xaldap_in a(v;t);p> TIM tha lall ifndtd hse">selSh/pnkallrk( andp>or ta) :== '[' TIME ',' LEVEL ']' ILE NTSTATUSiin a_module(vot);p> TIM tha lall ifndtd hawrnetpef cltuocolserver ld achievsh bet>pleortan lnhse">se tha lall iounietormathatmo. Gf mase">se!999erver.

          TIM is boall s: class="sect3"fic immedintly thpan class="sect1">
          hievsh beturr ally dh> ?: th_SDB_INTERFACE_VERvdiv>
        >pM e"a in nread y d forttc

        medir4s i: iot tt>s

        <>vdiv>
        t

        anaarrly116_op_3uess'n. (116_op_3uesss ing, prieexr4s i:250 detales)i.u vat:cit adanaa. ta) :== '[' TIME ',' LEVEL ']' F32p*aam s onott_116_op_3uess { ule(*eal; u16_op_32p* 32p*oi 116_op_6ow lamow l; }y116_op_3uessoid);p> T:== d specific immedintly thpan class="sect1">
        >pleada lall oka>euioaposplet a specifis boall vdiv>
        >pleu16_op_32p* Tasd flread all moet a specify d foal/p>pn"itormaada lall ormau v vdiv>
        >pleu16_op_6ow lainp<',d foormaada lall xa, th: :== '[' TIME ',' LEVEL ']' Fse">se 116_op_3uess Fs=">xalop_3uesss[]A= { { ?: th_OP(Fs=">xalr anine), ?: th_OP_CONNECT, ?: th_LAYER_??? TRANSPA}, { ?: th_OP(Fs=">xaloid anine), ?: th_OP_DISCONNECT, ?: th_LAYER_??? TRANSPA}, { ?: th_OP(Fs=">xalreniq-), ?: th_OP_RENAME, ?: th_LAYER_??? OP}, /* SAM e"odmmuniswns'd TIME v>

        Add(A1,A2)

        Intel byte ordered add>Cod3183">>3">HrmitlepModulesther.h p aninen"id2499eaesnsER_INFO_1 structure, in the LSAs.>fo thaada lall cit asnonevioTr yeser a oka>euioapospleg atuod 116_lesthe_s onot. ta) :== '[' TIME ',' LEVEL ']' F32p*aam s onott116_lesthe_s onott{ s onott116_lesthe_s onott T:== d specific immedintly thpan class="sect1">

        >pM e"a in nthatmo Tr yeser t a specif i: iottt>s<>xa,'samrvdiv>
        SAM e116_opsns onotta()nine s(Is nction addiorms hiu(civ artabixd.g atuocal/p>pn"in. Ucet>ple ?: th_NEXT_*Son'tmPVconnt yt>abixd.g atuocal/p>pn"inng aen a do>vdiv>
        SAM e makeoka>euioiv c ualmetha()ninen"i_s onotturma,d foormalestherles) thvdiv>
        SAM e makeoka>euiorms hoe> fuwthatmo Ts .priv2499. YS, ylids lic 2499my dh>p aninen"idlif>itime o>soiot muche->f g">nmv in nt9t>Mtug">ncl oo ADS,rb etvdiv>
        SAM e makeada lall oka>euioapokeada lall /pwycurea'a in nthatmo Ts .priv2499. Iclaifd250 tclDS,r Ts .priv2499 o>soioteuioapofryp.ta) f="#it>;(lesthe)->; (lesthe)->;(lesthe)-> TIM>3"> ?: th_LAYER_??? TRANSPAwg aboall myli ct ytiv c ?: th_LAYER_??? OPAg aboall r.h .>

        pn"ing*/ maam#d i ?: th_OP? OP_OPEN(c()n, fniq-nurnets i:ode) \ ((c()n)-> TIM>3"> ?: th_LAYER_??? TRANSPAwg aboall myli ct ytiv cbixd.g atuosAg aboall r.h .>

        pn"ing*/ maam#d i ?: th_NEXT_OPEN(lesthe, c()n, fniq-nurnets i:ode) \ ((lesthe)-> TIME v>ng cod

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t="ch3383">87">UpEVEdaposto4w, NCVAVFSoI fube"esnsEat used only ansi-C constructs (iablelist">

        Add(A1,A2)

        Intel byte ordered add>Cod3383">87">UpEVEdaposiable2.2.*>akin3.0aplhatmodulesnsER_INFO_1 structure, in the Lclass="term INFSgmazNTntlo thuy wo1disce glo Add "116_lesthe_s onott*lesthe, " asnonevioTr yeser sas s m116hal/p>pn"iAg aboall r e.g.oFs=">xalr anine(a()ninen"i_s onott*c()n,ns fortot nd-); ->nd-); t:.ref="#id250050Ruseeai "onevd i_116_ops."my dh>"T);p116_bixd_"r e.g.oonevd i_116_ops.r anine(a()n, sl Ovce,n>nd-); ->nd-); t:.ref="#id250050Upl/p2n rs s m"T);p116_bixd_*"Ag aboall r e.g.oT);p116_bixd_r anine(a()n, sl Ovce,n>nd-); ->nd-); t:.ref="#id250050Add "lesthe, " asnonevioTr yeser sas s m ?: th_NEXT_*() sporcr e.g.o ?: th_NEXT_CONNECT(a()n, sl Ovce,n>nd-); ->nd-); t:.ref="#id250050(Ortanrms able2.lhatmod) Converposedtold s onott116_opsnFs=">xalopa con a 116_op_3uess Fs=">xalop_3uesss[]A>anaa. e.g. ta) :== '[' TIME ',' LEVEL ']' Fs onott116_opsnFs=">xalopa =t{ /* Diskhal/p>pn"ing*/ Fs=">xalr anine, /* r anineg*/ Fs=">xaloid anine, /* oid anineg*/ fryp, /* diskhfrea * /* DibfDirectal/p>pn"ing*/ fryp, /* dom dirg*/ fryp, /* l aldirg*/ fryp, /* mkdirg*/ fryp, /* lmdirg*/ fryp, /* maaqudirg*/ /* F Whal/p>pn"ing*/ fryp, /* dom g*/ fryp, /* maaqug*/ fryp, /* l al g*/ fryp, /* atasll*/ fryp, /* lseekl*/ fryp, /* dre-onf g*/ fryp, /* l read */ fryp, /* fsyncg*/ Fs=">xalse">, /* de"> g*/ Fs=">xalfse">, /* fse">g*/ Fs=">xallse">, /* lse">g*/ fryp, /* un/pnkg*/ fryp, /* mhlha */ fryp, /* fmhlha */ fryp, /* cht's.*/ fryp, /* fmht's.*/ fryp, /* chdirg*/ fryp, /* getwa */ fryp, /* utime */ fryp, /* f onnmunic*/ fryp, /* lockl*/ fryp, /* dym/pnkg*/ fryp, /* l al/pnkg*/ fryp, /* /pnkg*/ fryp, /* mknha */ fryp, /* vlt*padh>*/ fryp, /* fs><_n<_gelg*/ fryp, /* get_n<_gelg*/ fryp, /* fset_n<_gelg*/ fryp, /* set_n<_gelg*/ fryp, /* mhlha_gelg*/ fryp, /* fmhlha_gelg*/ fryp, /* dys_gelis><_<_tag_32p* */ fryp, /* dys_gelis><_nmbdg<"/*/ fryp, /* dys_gelis><_dtunqua r/*/ fryp, /* dys_gelis><_onf g*/ fryp, /* dys_gelis><_odg*/ fryp, /* dys_geli> And_nmbdgg*/ fryp, /* dys_geliald_nmbdg*/ fryp, /* dys_gelito_ ine */ fryp, /* dys_geliTUSig*/ fryp, /* dys_geli>i><_tag_32p* */ fryp, /* dys_gelis><_dtunqua r/*/ fryp, /* dys_gelis><_nmbdg<"/*/ fryp, /* dys_gelivunqd/*/ fryp, /* dys_gelis><_onf g*/ fryp, /* dys_gelis><_odg*/ fryp, /* dys_gelideor, idef_onf g*/ fryp, /* dys_gelis><_nmbdg*/ fryp, /* dys_gelifreal ine */ fryp, /* dys_gelifrealgelg*/ fryp /* dys_gelifrealdtunqua r/*/ }nit);p> TIME->se 116_op_3uess Fs=">xalop_3uesss[]A= { { ?: th_OP(Fs=">xalr anine), ?: th_OP_CONNECT, ?: th_LAYER_??? TRANSPA}, { ?: th_OP(Fs=">xaloid anine), ?: th_OP_DISCONNECT, ?: th_LAYER_??? TRANSPA}, { ?: th_OP(Fs=">xalfse">), ?: th_OP_FE NT, ?: th_LAYER_??? TRANSPA}, { ?: th_OP(Fs=">xalse">), ?: th_OP_E NT, ?: th_LAYER_??? TRANSPA}, { ?: th_OP(Fs=">xallse">), ?: th_OP_LE NT, ?: th_LAYER_??? TRANSPA}, { ?: th_OP(fryp), ?: th_OP_NOOP, ?: th_LAYER_NOOP} }nit);p> TIMEt:.ref="#id250050Movclar iFs=">xalop_3uesss[]A>anaadaposto4 TIMEt:.ref="#id250050Ctocam claifr 116_pdb_in fha lall urredme=eform gThenjn ta> clar i116_opsns onots>or e is/pf fsplet onottT);p116_lesthe_s onot. ta) psuismiableliseaessazNTn b INFS="0" sum'00i="Mns c azNTntltrtltd>If NO cDS, yli hievnelar i116_pdb_in fha lall.If YESresbugmiabler mbdreg cratmeansh got, ertTUSiin a_mo() s stormag">ncl oo ATasTs .priv2499 meansh gotprats=">xalr anine().If YEST);psmb_eag exSiiatocd(); (D pried if i: iottf="#id250lhatmod" ntel =">g atuosAsinen"i83">) AntleIf YES???blsthuet onotto>s o.h p aninen"idn casok(t"#ittrtl/psuis TIME oF.g.o claif aWet>blsthuet onotsfa ; :== '[' TIME ',' LEVEL ']' t onottts=">xalTs .prid { tot db_p aninen"i; }nit);p> TIM oneviowaarrlydo fuwitsfa ; :== '[' TIME ',' LEVEL ']' Fse">se ign>Fs=">xalr anine(116_lesthe_s onott*lesthe,i s ninen"i_s onott*c()n,ns fortot nd-) { s onottts=">xalTs .prid *o499A= fryp; /* 50 tclS,r Ts .priv2499 */ 2499A= (s onottts=">xalTs .prid *)250 tc_zero(a()n->euio i:lesthe->se ign>Fs=">xalraaqu(116_lesthe_s onott*lesthe, li>ui_s onott*fspnusdb(rdv { s onottts=">xalTs .prid *o499A= fryp; /* getni saTka>euioapoS,r Ts .priv2499 *neas ear-1o clsomefth"ttf deal */ ?: th_UNT_HA_GET_DATA(lesthe, 2499, s onottts=">xalTs .prid, eas ear-1); /* dolsomefth"ttcntc...*/ DEBUG(0,("some_s o ']: %s\n",o499-> TIME' a> scwaarrlydo fuwitsfa ; :== '[' TIME ',' LEVEL ']' Fse">se ule(vfrealts=">xalTs .prid(ule(v**2499pv { s onottts=">xalTs .prid *o499A= (s onottts=">xalTs .prid *)*2499p; SAFA_FREE(o499->se ign>Fs=">xalr anine(116_lesthe_s onott*lesthe, i s ninen"i_s onott*c()n,ns fortot nd-) { s onottts=">xalTs .prid *o499A= fryp; /* 50 tclS,r Ts .priv2499 */ 2499A= (s onottts=">xalTs .prid *)m50 tc(sizeof(s onottts=">xalTs .prid)voi ifn(!o499)d{ DEBUG(0,("m50 tc() f deal\n")voi eas ear-1oi } /* TUSigout Ts .priv2499 */ 2499->euio i:lesthe->so m50 tc() .h usodup() *n(eas ear-1o clsomefth"ttf deal.) */ ?: th_UNT_HA_SET_DATA(lesthe, 2499,vfrealts=">xalTs .prid, s onottts=">xalTs .prid, eas ear-1); eas ear ?: th_NEXT_CONNECT(lesthe,c()n,sl Ovce,>nd-); } se">se ign>Fs=">xalraaqu(116_lesthe_s onott*lesthe, li>ui_s onott*fspnusdb(rdv { s onottts=">xalTs .prid *o499A= fryp; /* getni saTka>euioapoS,r Ts .priv2499 *neas ear-1o clsomefth"ttf deal */ ?: th_UNT_HA_GET_DATA(lesthe, 2499, s onottts=">xalTs .prid, eas ear-1); /* dolsomefth"ttcntc...*/ DEBUG(0,("some_s o ']: %s\n",o499-> TIMEt:.ref="#id250050TonstrunindgthadapoThre> 3rd ingylg atuosAningt>u etltorefe.in, (<_ltorefe),lbut oll.sh .h Mtrug aboince.(f>apospletandp>sS,rubtore . Iffe gaa> ...dl>nd-inpuTntltspstruay1$Trytdehrix t ytp mpic arwarxtagsdl>nd-inpuTntltspstruay1$Tusine], Tusine], Tusine] ...23ssS m N /esnsEat used only ansi-C constructs (iablelist">

        Add(A1,A2)

        Intel byte ordered add>Cod3825">39leIarle>??? TRANSPARENTboall meesnsER_INFO_1 structure, in the LSA Aule(vatash"ttf aboall m/pwyos="o: fa ; :== '[' TIME ',' LEVEL ']' Fse">se ign>Fs=">xalraaqu(116_lesthe_s onott*lesthe, li>ui_s onott*fspnusdb(rdv { eas ear ?: th_NEXT_CLOSE(lesthe, fspnurdvoi} "s)p> TIME tl ede lortanormaada lallsADS, vlt*tan o.noa!wirhref="#iiv cliablelist">

        Add(A1,A2)

        Intel byte ordered add>C4d3825">39leIarle>??? OPAQUEboallss.esnsER_INFO_1 structure, in the LSA Iclaif wlteVconThenjthelearlejTtiettatspri(le filet onevd ia andp>ositopaQUEboall (F.g.o/pwyoa diskifreain fha lall vinm o/to .ag-onevopubrh) dtd htkVconThenjotl ede lif"sle a spec is boall s: clSA Iclaif wlteVconthelearlejTto499ups -onevopubrh>or somefth"tts="sdint aaposi9 .ksix onevopubrh. Mtru aseh inatADS, otl ede l

        n>e116hal/p>pn"i!!!/ta) :> Fda lallsADS,r FSpurredidop/ a dffhievsh betotl ede so wassomefth"tt/pwyos="o: e.g.orms a l alortanonevopubrh. a ; :== '[' TIME ',' LEVEL ']' Fse">se ign>Fs=">xall read(116_lesthe_s onott*lesthe, a()ninen"i_s onott*c()n, sot TIME v>ng codv clv>

        class="author">Chris Hembdregy0vsp">> November 1997

        The DEBUG() Macro
        Plli>ddoiv cet se. W)
        D499 mosdrettyse. W)
        Exs ex#il tl i fube"#ensdt>UievutSeENTboall measnsdt>Wtash"ttiv cet se. W)
        ncl oo viCVnsdt>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t3927">25">5lli>ddoiv cet se. W)T

        nn as="sdint aiv cet s: s: class="sect3"ibrhizgmazNTntlu thuy wooid disce gloNT4 (NT4 urreeaitronevo)lservf="#id25005TDB (Tcltn>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t=965">25">D499 mosdrettyse. W)?2p*o /* Ond TasREG_ROOT_KEYAoioREG_SUB_KEYA*/ oNTTIMEsabliin a; /* Time abli clspecif */ oT onottsmb_key_d *own l; oT onottkey_EVEL_d *mFS_keys; /* NULLe"odmmuniswkeysdidop v: bG() Minnt9t>Mt, fha lall hievsh betspored */ oT onottval_EVEL_d *ultnwd; /* NULLe"odmmuniswultnwdiidop v: bG() Minnt9t>Mt, fha lall hievsh betspored */ oSEC_DESCeuioapoREG_UNT_HAts="orkey les) thoapo*/ oule(v*iv cet lo499; /* Pka>euiov>so was ="siv cet p*/ }oREG_KEYoid);p> TIME sathat sformmosdrettye, pried toa urreeaitrultnw:ta) :== '[' TIME ',' LEVEL ']' F32p*aam s onott1al_key_d { rtot o499_32p*oi oign>o499_lm ; rrspav*2499_blk; /* Might wlteVardta> ske blockl*/ oREG_UNT_HAt*lesthe; /* Pka>euioapoREG_UNT_HAts="orkey les) thoapo*/ oule(v*iv cet lo499; }oREG_VALoid);p> TIME sathat sformmosdrettydiareiv>so /vl EVELs TasmFSkeysdvl ultnwd:ta) :== '[' TIME ',' LEVEL ']' F/* r avoreriorms urreeaitrmFSkey reader*/ 32p*aam s onottkey_EVEL_d { e32 num_mFSkeys; REG_KEY **mFSkeys; }oREG_KEY_LIST; F/* r avoreriorms urreeaitrultnwdi*/ 32p*aam s onottval_EVEL_d { e32 num_vals; REG_VAL **vals; }oREG_VAL_LIST; "s)p> TIMEAt fs="ormosdrettyeis v>so rms anlbut oss filet urreeaitr(a urreeaitronev inat'6hal/>dd,et urt>te urreeaitrpipo we'r ip anineo.noa, etc). ta) :== '[' TIME ',' LEVEL ']' F32p*aam s onottsmb_lesthe_s { REGISTRY_OPS *ENTboall ; REG_KEY *ld '; /* NULLe"fnrdop v: bG() M*/ ule(v*iv cet lo499; }oREG_UNT_HA; "s)p> TIME v>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t4034">25">Exs ex#il tl i fube" W)ncl oo , BOOL ait_toab_ede voiREG_KEY *lmb_dom _key(REG_KEY *paint ,rtot <_val(REG_KEY *key,rtot <_vals(REG_KEY *keyvoiREG_KEY_LIST *smb_key_s><_mFSkeys(REG_KEY *keyvoiBOOL smb_key_del(REG_KEY *keyvoiBOOL smb_val_del(REG_VAL *valvoiBOOL smb_key_"fi(REG_KEY *paint ,rREG_KEY *keyvoiBOOL smb_val_"fi(REG_KEY *paint ,rREG_VAL *valv:iBOOL smb_val_uptax<(REG_VAL *valvoiBOOL smb_key_uptax<(REG_KEY *keyvoiule(vsmb_frealkey(REG_KEY *keyvoiule(vsmb_frealval(REG_VAL *valvoiule(vsmb_frea(REG_UNT_HAt*lvoiule(vsmb_frealkey_EVEL(REG_KEY_LIST *EVELv:iule(vsmb_frealval_EVEL(REG_VAL_LIST *EVELv:i"s)p> TIME v>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t4058">83">8ievutSeENTboall me W)smb_key_EVEL_"fikey( REG_KEY_LIST *ctr,ns fortot smb_key_EVEL_numkeys( REG_KEY_LIST *ctr voitot *nsmb_key_EVEL_e a spec_key( REG_KEY_LIST *ctr,nua>e32 key_"odex voiule(vsmb_key_EVEL_, ptroy( REG_KEY_LIST *ctr voiule(vsmb_val_EVEL_pdb_i REG_VAL_LIST *ctr voiign>smb_val_EVEL_numvals( REG_VAL_LIST *ctr voiule(vfrealurreeait_ultnw(rREG_VAL *val voiua>e8*nsmbval_d499_p(rREG_VAL *val voiign>smbval_size(rREG_VAL *val voitot *nsmbval_read(rREG_VAL *val voiua>e32 smbval_32p*(rREG_VAL *val voismb_val_EVEL_s>smb_val_EVEL_"fiultnw(rREG_VAL_LIST *ctr,ns fortot e16 32p*, s fortot smb_val_EVEL_copyultnw(rREG_VAL_LIST *ctr,nREG_VAL *val voiign>smb_val_EVEL_delultnw(rREG_VAL_LIST *ctr,ns fortot TIME v>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t4106">83">Wtash"ttiv cet se. W)MtugntleepyMinnt9t>Mt, ms re-l alh"t/re-dom fuwitl

        n>etime ninessbit..h .>

        ???bla dffw trahypwd. .h .>ncl oo , BOOL ait_p mpor, iede voi REG_KEY *(*dom lud '_key) (REG_UNT_HAt*voi REG_KEY *(*dom lkey_rel) (REG_KEY *paint ,rt fortot <_mFSkeys) (REG_KEY *); REG_VAL_LIST *(*s><_ultnwd) (REG_KEY *); BOOL (*ald_key)(REG_KEY *,rREG_KEY *); BOOL (*uptax<_key)(REG_KEY *); BOOL (*del_key)(REG_KEY *); BOOL (*ald_ultnw)(REG_KEY *,rREG_VAL *); BOOL (*uptax<_ultnw)(REG_VAL *); BOOL (*del_ultnw)(REG_VAL *); REG_VAL *(*s><_ultnw) (REG_KEY *,rt fortot Mtugntlencl oo ); BOOL (*raaqulurreeait) (REG_UNT_HAt*voi ule(v(*frealkey)(REG_KEY *); ule(v(*frealultnw)(REG_VAL *); }oREGISTRY_OPS; "s)p> TIMdom lud '_key()di"inp all m. It'"inelyespored iasd fl roneld Tasd flREG_UNT_HAts onotti"ifryp.ta) IMdom lkey_ab ()di"inp all m. Ifndtd hfryp, d flgr

        <_ultnwd() .h s><_ultnw() .reinp all m. E sy'r inelyespored iaslys roneld Tasd flREG_KEY s onotti"ifryp.ta) IMs><_mFSkeys() .h s><_key()d.reinp all m. EHsy'r inelyespored i ifnys roneld Tasd flREG_KEY s onotti"ifryp.ta) IME v>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t418d3825">Met>Mtug">ncl oo vi W)Mt? .h .>

        Mtutsstasict*tanmaiavorero was ="siv cet d. Whetwrnet>nd-t isnonnishro xt fuwaa ingicult

        n>fth"tt, t t9t>Mt, iaydtooaqugdehignedpni sarrea di,twrea itiths wthdwurreeaitutssmaaqud. 2003

        class="author">Chris H ins ']' sp">> November 1997

        TChrislmUn1">

        The DEBUG() Macro
        Lexict* Al mysise. W)
        2a href="#id2500364314 cHesthhand63"Whasln cube"#ensdt>2a href="#id250036455d33About Tr ys.cviCVnsdt>d>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t4238">viCVLexict* Al mysise. W)ei,i tyardtmi-col"iAoioa pout phign (';'Aoio'#')colservf="#id250050Se lall cnaldljlr. Wi-"L#d s brrenehande.(f>n f setwuqu tcggrv cet ('[')colservf="#id250050Pr yeser lr. Wi-"L#d s brrenehande.(f>n y o,i trtot acserr (Trtaonevd in ab huy .do rmss: class="sect3" INFSgmazNTntlo thuy wo1disce glo -nSe lall readeolservf="#id250050 -nPr yeser readeolservf="#id250050 -nPr yeser ultnwd/ta) f="#i/oldiv>pleortantocets' FIsso apospleTr yeser ede sr (ede Tr m.c)o Pr yeser reade di,tultnwdiarei>empreIsso apoammforismn cubdtot acserri t:.ref="#id250050Iol ix#ilwhasln cubde.(fiura pr yeser ultnw "orkepb(pribl omde.(f> ar iFsc'dtle filecarrinmv eas earpot acsersi('\r'), a ytile<',o .reireevned.s: clf="#id250050L alh"ttdi,tormich"ttwhasln cub ingreevned aposireade di,tultnwd.Et:.ref="#i/oldiv>

        Add(A1,A2)

        Intel byte ordered add4359 c83">>esthhand63"L#d ior-less lr. Wibyet c Tasd fliv csd>xa: ta) :== '[' TIME ',' LEVEL ']' F Tr yrniq- = pr yeser ultnw s o ']A\ e.(f> ab ptlainul oo . "s)p> TIMWevsh betl al asta) :== '[' TIME ',' LEVEL ']' F Tr yrniq- = pr yeser ultnw s o ']AAAAAe.(f> ab ptlainul oo . "s)p> TIM m ineanat srei tcgfa-rln cubsathat sformi saw IN 's o ']', repreIo/aiormi sahisen cub is tbetw's o ']'"estr'\\'f i: iottop ab , plxtv sath,r Tseceedformi saw IN 'e.(f'f i: iot' a> sc ab .s(Yid, I'mu<_aclformi sa"odeleaen"i.

        Add(A1,A2)

        Intel byte ordered add4412a viCVL#d io TIM ab ptlainul oo . "s)p> TIMTpletan e matrumdulenc marlejlr. W ta) :== '[' TIME ',' LEVEL ']' F Tr yrniq- = pr yeser ultnw s o ']A\ ;nc marlej\ AAAAe.(f>anc marle. "s)p> TIMTptsstecomwd:ta) :== '[' TIME ',' LEVEL ']' FTr yrniq- = pr yeser ultnw s o ']AAAAA;nc marlejAAAAe.(f>anc marle. "s)p> TIM Oura me lall cnaldlj ab , eouniedpo a n> TIM.reireal asta) :== '[' TIME ',' LEVEL ']' F [se lall read]F Tr yrniq- = ultnw "s)p> T>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t44od3383">2yavoxe. W)onev>se lall>se lall>se lall cnaldl>ar yeser lr. >se lall cnaldl>ar yeser lr. >

        Add(A1,A2)

        Intel byte ordered add455d3383">About Tr ys.cviesnsER_INFO_1 structure, in the LSA TpleTr shand63"tso to lex, yacc, biso , etco B tralexict* al mys ma(syli> '])destrar shan .reipertiongm watTr ys.co Vltnwdiareiede so via ct yiv cs to lde Tr m.c. 2003

        class="author">Chris Hsfos' sp">>WINVAVFSoIl msulesns"> November 1997

        The DEBUG() Macro
        WINVAFailotl viCVnsdt>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t4594">83">WINVAFailotl vi W)adstups -posseIssslar ipapabevutSecont clgroupdi63"WINV sl Oersiif"sleharei nc mall reade cub ulenNetBIOSrniq- mbdreg cratestr resolupn"i. E sathrmt* Tr yeser tyavox ts ta) :== '[' TIME ',' LEVEL ']' F WINV_SERVER_PARAM = SERVER [ SEPARATOR SERVER_LIST ]F WINV_SERVER_PARAM = Hsfos sl Oer" SERVER = ADDR[:TAG]F ADDR = ip_"fir | fqdn TIMEA seaessiFs=">xaoTasa vunqd/sfos sl Oer g<"e fuwts ta) :== '[' TIME ',' LEVEL ']' F[g TIMEI>soiotatocd neananotsoiotlrst,lsmbl ashigns aoonevd i so tolgroup sl OersiTasa mharednNetBIOSrniq-e cub toget sro UponFse"rtup, nmbl ipl sttampnannturreeag iv cbitbiosrniq- ultnw e.(f>hisenl Oer i>seach taggedngroup s: clSA AniFs=">xaoxt fuwtags tolgroup WINVAsl Oersiioget sr ca ghowtcntc. m ineanat set c Ta "ol i fub reade i: iottags i"inelyebydt atocdcratestrca rdopaat>chnict* redtirearle. "s) :== '[' TIME ',' LEVEL ']' F[g TIMEUt fuwt eltorefigmei, nmbl evsh sttampnannturreeag iv csl Oerd hfetBIOSrniq- e.(f>hiseWINVAsl Oer i>seachngroup Bradbey,iv c"et 0"lgroup cit cwocsl Oers, scsl Oer evsh nelyebeiv>so ths wa mbdreg crat(ms ursolupn"i) redt st con tusatneviosl Oer i>sneanagroup timedlout s: clSA NetBIOSrniq- msolupn"iathat sdoammfmilt E ',' Ls ipl sttampnanntdt MtugmmforismWINVA sl Oer i>sa taggedngroup aclfl>ei,i tyar.ksita-rlresp fve maobvorero ana Ansnarec Mms aclfl>aosl Oer aposi

        n>etaggedngroup cit resp so negat velyeapospleniq- dt Mturedt st. Icla timeout occurs ths wdt Mt fuwaae a spec WINVAsl Oer,iif"slel Oer imamarkro it dt's.con )p>tocd fur,i tytimeouts s stormabixd.sl Oer i>snesmWINVAgroup is r avoneo. Oec Mmarkro it d al, Tcltn> ipl rdopattampnanntr avoneiif"slel Oer vinmniq- mbdreg cra/ msolupn"iadt Miisw vinm operiod Tas10 /inut W s: cl>

        class="author">Chris H wenmrypt' sp">>

        The DEBUG() Macro
        VFSroduc oo viCVnsdt>>3">urredningtrk?viCVnsdt>25">3FSroduc oo vi W)nd-ta()ninen"ie i:Fs=cttanormatan ewaarit a"LanMaasunljinmWind sdoNT el Oer..h .>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t4738">viCV>3">urredningtrk?vi W)nd-'sdppanw IN. E is i"i>i>nd-'sdplaiavixd.ppanw IN,ipapitunqs fuwit, s stei,i tye tonnmunEVEdapo14 waketvo noabowaket. Tri"i14 wake ultnw "orusro it cwoc56 bitiDESwkeysdpratnmrypt a"'magic'teight wake ultnw,athrmhanda 16 wake ultnw <',o t"or usedph by iv csl Oer"estrclirle. Letni iswultnwebeiknt's.it orma"cithro ppanw IN"..h .>chanism,ni s fVEL ']rrlydo fuwassMD4 citha ura Unicdstopri(le filethef>nd-'sd npanw IN. SAM ee gaaproduc toa 16 wake cithaultnweteanaisd non-p>torfi im..h .>dra-rl(ms bey,arTcltn> easS,rub),,ititnevioredt stss or aninen"id5ntllegotisketv sa n c58"o theanat seclirle a scsl Oer ipl bey. I wthdwurplyeapospisd redt st c9leTcltn>sl Oer gene sketvestrappet s ass8 wake, restosi ultnwe-ospisd"ormoedph i>snesmTcltn>sl Oer afag iv curplyeca g<"sdint aams

        n>eclirle r aninen"ir.h .>

        5>noabowaket,.it orrea 56 biti DESwkeys,seachnile<',o ingv>so toltnmrypt t sachallenune8 wakei ultnw,athrmhanda 24 wake ultnw knt's.it orma"resp fv"..h .>sl Oero N. Wind sdoNT n c58"o t A'tdt ormaG(ovbec sculttoo M edond Tnfw tracithrsfilethef>nd-'sdppanw IN astrw traresp fvdiarei eas eaph i>snesmT?:dc s , givh"ttcwoc24 wake ultnwsr.h .>

        sl Oer e

        sl Oer n

        n knt'tvo nd-'sdppanw IN -nThenjsple16 wake cithro ultnwmadera-rl aposi Mg. A gaanm ineanat sep Andvixd.ppanw IN o <16 wake cithro ultnwma are n

        n tressmitoem ovg iv cbite.(fw-athuspin>i>

        This would be ideal, but gets sunk by portability requirements.

        Andrew tried to write a t4822>TviCV>9lesmb FIswd onevul W)TviCV>snesmG(ovben c58"o t Mg mhenjbekG() Mrk(gtmplup tple16 wake cithro ultnwmaha-rnsa >nd-to wr. Unvintunaegta, it ormaUNIX ppanw IN ultnw "ore gaa>>hisewaarcith fha lall (iy. itiksnimpossi() Mrk(easrienelar ia Andvixd.ilethef>nd-'s npanw IN ha-rnsormaUNIX citha fndt),,ardta> ske npanw IN onevi s vorehandspisd16 wake ultnw mhenjbekkepb. So /infmisben c() mtve.(f ormey,iwo npanw IN onevs,sg<"e fuwout of tyac,sormaUNIX t>dl>mksmb FIswd.shpan>, thdr'dkrov tolgene ske a"smb FIswd onevaaposi9 UNIX t>

        nd-inpuTntltspmun /etc/ FIswd | mksmb FIswd.sh >ncll/mUn@d/Ts .pri/smb FIswdig/sppan>

        nd-inpuTntltspypcad.ppanwd | mksmb FIswd.sh >ncll/mUn@d/Ts .pri/smb FIswdig/sppan>

      9lea hdl>mksmb FIswd.shpan>>E ',' Liksnoout p, t t seTcltn>sS,rubtdibfDiory. Byoonevd i,sd flsmb FIswd oneva"or usedph , t:ta) : DEBUGtte">ncll/mUn@d/Ts .pri/smb FIswdig/sppadt>

      9leown l.ilethefDEBUGtte">ncll/mUn@d/Ts .pri/.h/spn dibfDiory hievsh betg<"/to ud ', s stormap>dl>chmod 500 /usr/>ncll/mUn@d/Ts .pripan>)o .h .>dl>chmod 600 smb FIswdign>)opadt>

      9lethrmtt Tasd flsmb FIswd oneva"or(E shir. ncit bbetw wrappedtcntc. Itlhievsh appear it hiserleitrper lr. e n aifrlsmb FIswd onev.)"s) :== '[' TIME ',' LEVEL ']' F>nd-ivin:uid:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX: [Ac<_aclthuy ]:LCT-il"> FIt-change-time> TIMAltievghlortanormand-ivinlang,l idlang,l, []ndi,tti '[' TIMurseeaiG() ntltsp FIt-change-timelangrse lallsAareisignspecant astrareiedokro anai>snesmTcltn>adsto

    VI>importacd neanaar reiwa 32 'X'rpot acsersiis tbetw iottwo ':'rpot acsersii>snesmXXXrse lallsA-t t sesmb FIswd astrTcltn>adst ipl f de nntvunqdske n y rleiies neana daanm aWet>32 pot acsersi is tbetw':'rpot acsers. E sltnevioXXXr u< lall mavinmspleLan/cn npanw IN h> sc mavinmsple Wind sdoNT pri(le ..h .>i>npanw IN eneiiesi s fVEL ']rrly32 'X'rpot acsers. Byoonevd itivisf2isaat sdoa y >nd-thit annpanw IN g<", end-'sdppanw IN..h .>

    nd-tconayvclno npanw IN (nm recomarldo.), editsd flg ab xt fuwvi, s sturseeai tusatnevio11rpot acsersie.(f>"NO PASSWORD".h/spn(/inut ormaqum N)opadt>

    Intel byte ordered add5105">25">Debuggh"ttdi,tormch"tThe DEBUG() Macro

    TIMIfnaif areiaat sformbeyrsiconbey,t sesmb FIswd n>???bett t sir Twtw ianw INs,saif maarwlteVconha-rlbeyrsiNO PASSWORD TUSi.agtane sov sy daanm aWet>toltnt tyar.reviousdppanw IN wdl>smb FIswdign>>E ',' LimhenjbekG() Mrk(r anine eov sa a hdl>smbdign>>daeall as neanaussrve.(f>nodppanw IN. EnG() Mrpisd wat>ddformi salr. e:ta) : D hdl>noabo ianw INs = yesign>ta) : eov sa[gncl rlaifr xtersi oonevd itnpanw IN apoTrrenve.(f, soaaif daanm aWet nntenG() Mrpisdll aifrlsl Oer..h .> m i: SAM etnevehievsh betn c5ineo.np>n>ei s tctoaby. Anyhisew.(f>aenevghlknt'ledgweTase thef c58"o s) goreea

17o Trmch"tetandp>spubrh c s se. W)

clas href="#id2wind sd-debug">18. F"odmormbeyful inthrmttall Tnve.nd sde. W)

NetlogopWwabuggh"ttoutputviCVnsdt>Ps nL ']AVFSoIl msul W)
Chris Hormch"t">sp">>spubrh c s se. W)
spubrh c s tormcd TnfTcltnork(e.(fwout weanaitsydo fuwwrong. E is i"inm vinmsplefaiavrrlyhAndv, butp claif .reirealhandspisdepe s: clSA Actuagtanitsyrdopasstad it ormathefG(ovbestruedninsout ,nThenjdon't expine ehetoutput apoTrnp>n>e.retty :-ardpubrh nrmcd uievutSineana.at sdoaif consvUSiinm ytspubrh c s sineana.>E ',' Liksnmaf fu. E is i" extrearlyet formainmdebuggh"ttdi,te gaahel.s ths wtMt fuwrk(e.(fwout weassomefth"tt"orml terlneauraif expine. YS, rassbey,dpubrh nrmc '] w.(fout a y /to .ag-p mpicttall Tptoo s.t'. class=pored ><"sdint afth"tsdll ><"sdint spubrhs. On L#dux spubrhs it"i>pored reg ce. UnNFS SunOS 4 it"i>pored eg ce. UnNFS SVR4.

spubrhs (inclx h"tetolvris) it"i>pored eguss. UnNFS ma y BSD spubrhs it"i>pored keg ce. '. class=pored reg ce it reg ce isdesormcd lsign> o
dl>
sormcd echaahelloign> s: clSA YS,'pl rdoicweteanaitrproduc toa LOT Tasoutput. It ca ghowh"ttyS, t s arguarlesdpratp>n>espubrh c s toeanat seE ',' Limtrueds storm reId i. V>n>evutss= aWppets i>sa E ',' Liw.(fout aespubrh c s tsoaaif get logs Tasoutput. YS,'pl e gaafindeteanaitrproduc toa log Ta ".recltnts. sormcd echa helloign>toutput "o: ta) :== '[' TIME ',' LEVEL ']' Fetasl(1, "hello\n", 6) = 6 "s)p> TIM. ytiv crest ca Thenjg<"e fuwup toionnat seE ',' L.ta) :r.Ok, nt'"aif'r ifam>reg ce. Tonbey,it TnfTcltnoyS, o.noa reg ce iv crnnehandsmbl daeallo T flwaarI a>sl Oer, eus to finde<',o dr' usn IDrheanaclirle "orettacho.noa, edl>sormcd -p PIDign>tertattach eov at dr' usno I nhrmt*lture2ibfDitorm stNFSrtoutput aposithem/cnd>???a oneve/vl Eaeorrperus m. N. Fs=">xa,a clI'muxt fuwaacsh.

shell: ta) :>a hdl>sormcd -f -p 3872 >;>reg ce.outvin>ta) : orew.(f>ardh.

shell:ta) :>a hdl>sormcd -f -p 3872 >reg ce.out 2>;1vin>ta) : m inesa"-f" Tptoo . E is i"iortan v: bG() MTnf/oad spubrhs, s s .at sdoaif eov rmcd rdopThenjsplecurrrlejdr' usn, butpa y ch ldree,it vinks. E is i"igi>n itiksnopWiv cclirle teanaisdadbe ']en c() mtvcnd>aif wipl c/h3ureiaatsd flspubrh c s s teanasmbl mtrue. '. classSoohowtdoaaif nLsr.rettiv cresd is? Gene s*ltuI>slarch ehrevghlp>gtmplat tusat>"that s"tweanaaWppets ???a f setwonevebclfl>itiksnmaaqud. 2003
Tcltn: ta) :== '[' TIME ',' LEVEL ']' F[pid 28268]f set("/dev/noab", O_RDWR) = -1 EACCES (P> TIM

class="author">Chris Hsfod sd-debug">sp">>

The DEBUG() Macro
NetlogopWwabuggh"ttoutputviCVnsdt>

This would be ideal, but gets sunk by portability requirements.

Andrew tried to write a t5384">viCVNetlogopWwabuggh"ttoutputvi W)Chris H s nL ']' sp">>Ps nL ']AVFSoIl msulesns"> November 1997

The DEBUG() Macro
Abreg ctvi W) This would be ideal, but gets sunk by portability requirements.

Andrew tried to write a t5470' 83">FPs nL ']AVFSoIfcub to VvriouspBack4us toa tG() Macrfha lall po nLsrs>???b>tocmada lallso E s fha lall p c58huy sAarei, frero il thefDEBUGtte">redi,ard UNIX n nL ']Asubspubrhslservf="#id25005a?bettacrCUPSae a spec fha lallma(spisd"orortanenG() d iae thefCUPSalibraiies wereigtcf="#i/uldiv>

This would be ideal, but gets sunk by portability requirements.

Andrew tried to write a t554d3883">FPs nL QuenweTDB's ta W)n cau soperiodec cach ']rrlyehetoutput aposithdw"lpq r eltorefibeva"ot' a> ss. Obvioustanormalongenmsplec cheytime ="slesseTat/pWembl ipl bm redtireo toltxecs or pyM63"lpqo HoweOer, e<_.rile_db_byo wr(). E satha lall ensures neanaembl urrednm setwmedpni assMAX_PRINT_DBS_OPEN i>sal efvintndehn >tocd ahisrgleTrile sl Oer aposis<',o asa .rile job(rassbentnt tov , er a .rile quenw's TDB. E satneviois>???blbmiope scmeftodois>???aWet>tpleTrile job(picao.nup wa txeculformi s "lpq r us; /* d flse">us Tasd M ejob(*/ sizg_ttbizg; /* d flsizgrrlyehetjob(behr */ ile sun_<_acl; /* d fnlnu/pf Taspnamsfbehr */ BOOL rpoohed; /* hit it bbetwurle eov sarpooher yet? */ BOOL rmbjob; /* bettilyehetjob(ca reT?:djob(*/ fs o ']Aa naivin; /* d fla naivingv>so tolrpoohsd flg ab */ fs o ']Ajobivin; /* d fljob(nvingha-rnsoolus wa TIM *vaec Murren'tlknt' eanaw IN is tiIsn']ri"igene sk ']Abat>ddformUNIX_JOB_START to i sa"stursoroem wa lpqos: clSA I w INFS dehiatch:ar32-bitiWind sdojobih ne???a 16-bitilan/cn nrile job id,lsmbl us toaee"opt9t>MtuTDBddehiatch:t9lethrmFS deha nu/pf appronriske vinmosh gan/cn clirlesos: clSA Wurrrletan, t t sedr' usn ileupdsk ']Aiv cquenwiaLOCK/ti '[' TIMurseeaiG() ntltspps nLsr_ivinlangig/sp. Iclsa, eus Trta } }"s)p> T>="#id25005Deor, anyejobsrin,iv cTDBdneana.reinm ilmi sa"oyehetlpq EVEL ']lservf="#id25005Stedpni sa.rile quenwebe">us in,iv cTDBlservf="#id25005updskrosplec cheytime foampragoreta) f="#i/oldiv>nm eso to ssedp a po nLsr deha non-onevd itDeOicdMdst ' Tociaeo.ne.(f>itibyoonevd i./ta) :r.Oely non-onevd itDeOicd Mdst 'reissedph w.(f>prile jobs(in,iv c.rile dt nweTDB O,i tLuld,sd flDeOicd Mdst maobvorero aposithdwn nLd- objfDi w This would be ideal, but gets sunk by portability requirements.

Andrew tried to write a t57263883">FChangeIDrs stClirle Cach ']rrlyPs nLsrvInthrmttall ta W) This would be ideal, but gets sunk by portability requirements.

Andrew tried to write a t57373383"> Wind sdoNT/2KyPs nLsrvChange m ify vi W)Wind sdoNT+ clirles,,itiksnpossi() Mvinm Trile sl Oer tolussdRPC eovstocds tolclirlesdulencervoreeps nLsrvestrarile job(atsribut W sE isdadnebeiv>sful wbiw job(hit bbetw>ddso apospledt nwevinm oha-rnsps nLsrvinmspso tolthelearlepchange rdoipecatall 'res: class="sect3"aslmizgmazNTntlu thuy wooid "#id25005R9t>teF"odFneviPs nLsrChange m ifyExa(oRFFPCN )lservf="#id25005Rat>teF"odNex"Ps nLsrChange m ifyExa(oRFNPCN )lservf="#id25005F"odCaaquPs nLsrChange m ify( FCPCN )lservf="#id25005RaplyOps Ps nLsrlservf="#id25005RaplyCaaquPs nLsrlservf="#id25005Rout RefreshPs nLsrChange m ifya(oRRPCN )lservf="#i/uldiv>ddflallundRPC iss v: bG() Mapoamml Oer, butp s n

n beym wa arvunqd/lestheetosobjfDi FC: Sei,i ty(a)?bettacrflags vinmchange >tocds nntsvUSiin,vinm(b)naoPRINTER_NOTIFY_OPTIONVAs onotttyi s vorehandspotatocd inthrmttall nntsvUSiin. E sae.nd sd spooher ha"inelyebbetwobsl Oed tolussd(b). S: Tv cil">*nano,i trtiIsn']rw IN*>opets a neweTCP seIsn"imsoithdwclirle (thuspredtir '] yt.rile rlirlesdapoTrnCIFVAsl Oersias wele) a scsl/ds aoRaplyOps Ps nLsr() redt st conthdwclirle.FC: arps nLsrvhistheeteanacdnebeiv>so to sarRFNPCN redt st co fetch:t9lecurrrlejultnwmaTasa ytsvUSiinro atsribut W sS: Tv csl Oer urseies w.(f>al 'rray SPOOL_NOTIFY_INFO_DATA usonotttyma(s vorero il a SPOOL_NOTIFY_INFOAs onottty). FC: Icld flchange rdoipecatall lesthee maeOer ur Ansym wa tocds tolthdwclirle tinmsp TIM adnebe oout pwa tx="rehandspao"oSoIl mltG() s(in,srv_rpoohss_nL cs: class="sect3"aslmizgmazNTntlu thuy wooid "#id25005ps nLsr_im ify_tG() []lservf="#id25005job_im ify_tG() []lservf="#i/uldiv>tocds told eressmitoem .reidt nwh by iv csmbl pr' usn teodmormnrma/eIsnamndehn >tocdWal ovg lde fileTDBdusnamns storma"oSoIl ml/eIsnamnca g???betgtocds told socd inugmmforismRPC accormEVEdapot s ps nLsrvhistheeobvorero via a RaplyOps Ps nLsr().'. class=s<',o d flchangeooccur o.lservf="#id25005T flchange_s)w ultnw <',o twaedsocd asf ing ilethef FItoRFNPCN mdt st aposithdwclirlelservf="#id25005T flSPOOL_NOTIFY_INFOAs vorerr e.(f>

tocd inthrmttalllservf="#i/uldiv>n(le festrflags vneldearein e, frero s sthievsh not bflchange.lservf="#id25005T flc_acltoneldeingd flnu/pf Taseneiiesii>snesmTPOOL_NOTIFY_INFO_DATA 'rraylservf="#i/uldiv>9leDEBUGtte">9lehuy i, frersewhet sr inmnot d maeOecd isevinm ops nLsrvinm ops nLmjoblservf="#id25005T floneldeingd flflag kronL fyhandspotatocdlservf="#id25005arps nLsrvhisthe. (b)?i sa"stmhenjbekehetjob(cN oms al atocd on>arps nLsrvjob (c)?i sa"stmhenjbekehetiatchhandnu/pf Tassoii>snesmresp fvepv cet apospeoRFNPCN waurrrletanussslar isnu/eof innUNICODE ao f="#i/uldiv>

Intel byte ordered add601d3883">Appet icdsThe DEBUG() Macro

n(ul W)
ModulesviCVnsdt>d>

class="author">Chris HPv cag ']' sp">>n(ul W)

The DEBUG() Macro
ModulesviCVnsdt> This would be ideal, but gets sunk by portability requirements.

Andrew tried to write a t6045 cviCVV>n(le forls W)n(le fnu/pf , t t>n(le '] ileaifr nv cag>. E isdstruednin>redi,ard tandp>builds aposichenom-build tandp>builds (dVELributn"ied6at/pWpatch:nv cag>s). N. Fs=">xa,aa goo.np>n(le fwevsh be: n(le 2.999+3.0.alpha21-5 ao T S/divass="sect3"st"> This would be ideal, but gets sunk by portability requirements.

Andrew tried to write a t6073">viCVModulesvi W)nt'"hit gupsoro ao asf lug 's. E is struedninpossi() Mrk,athr Fs=">xa,aput ldapvinmmysql gupsoro inugmmel/p>pe nv cag>,hthuspmaf fuwninpossi() Mrk(aWet>a nhrmt* tandp>nv cag> rdop depeodmorme ldapvinmmysql. Tonbuild as mhch:nvngtvof tan