~ubuntu-branches/ubuntu/maverick/samba/maverick-security

« back to all changes in this revision

Viewing changes to docs/htmldocs/Samba3-Developers-Guide/debug.html

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-01-29 06:16:15 UTC
  • mfrom: (0.27.9 upstream) (0.34.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100129061615-37hs6xqpsdhjq3ld
Tags: 2:3.4.5~dfsg-1ubuntu1
* Merge from debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/smb.conf:
    - Add "(Samba, Ubuntu)" to server string.
    - Comment out the default [homes] share, and add a comment about "valid users = %s"
      to show users how to restrict access to \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are allowed to create
      public shares in additon to authenticated ones.
    - add map to guest = Bad user, maps bad username to gues access.
  + debian/samba-common.conf:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/mksambapasswd.awk:
    - Do not add user with UID less than 1000 to smbpasswd.
  + debian/control: 
    - Make libswbclient0 replace/conflict with hardy's likewise-open.
    - Don't build against ctdb, since its not in main yet.
  + debian/rules:
    - Enable "native" PIE hardening.
    - Add BIND_NOW to maximize benefit of RELRO hardening.
  + Add ufw integration:
    - Created debian/samba.ufw.profile.
    - debian/rules, debian/samba.dirs, debian/samba.files: install
  + Add apoort hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + debian/rules, debian/samba.if-up: allow "NetworkManager" as a recognized address
    family... it's obviously /not/ an address family, but it's what gets
    sent when using NM, so we'll cope for now.  (LP: #462169). Taken from karmic-proposed.
  + debian/control: Recommend keyutils for smbfs (LP: #493565)
  + Dropped patches:
    - debian/patches/security-CVE-2009-3297.patch: No longer needed
    - debian/patches/fix-too-many-open-files.patch: No longer needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�4.�The samba DEBUG system</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part�II.�Samba Basics"><link rel="prev" href="architecture.html" title="Chapter�3.�Samba Architecture"><link rel="next" href="internals.html" title="Chapter�5.�Samba Internals"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter�4.�The samba DEBUG system</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="architecture.html">Prev</a>�</td><th width="60%" align="center">Part�II.�Samba Basics</th><td width="20%" align="right">�<a accesskey="n" href="internals.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="debug"></a>Chapter�4.�The samba DEBUG system</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Chris</span> <span class="surname">Hertel</span></h3></div></div><div><p class="pubdate">July 1998</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="debug.html#id2556945">New Output Syntax</a></span></dt><dt><span class="sect1"><a href="debug.html#id2557054">The DEBUG() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2557160">The DEBUGADD() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2557196">The DEBUGLVL() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2557287">New Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#id2557292">dbgtext()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2557308">dbghdr()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2557327">format_debug_text()</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2556945"></a>New Output Syntax</h2></div></div></div><p>
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�4.�The samba DEBUG system</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part�II.�Samba Basics"><link rel="prev" href="architecture.html" title="Chapter�3.�Samba Architecture"><link rel="next" href="internals.html" title="Chapter�5.�Samba Internals"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter�4.�The samba DEBUG system</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="architecture.html">Prev</a>�</td><th width="60%" align="center">Part�II.�Samba Basics</th><td width="20%" align="right">�<a accesskey="n" href="internals.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter�4.�The samba DEBUG system"><div class="titlepage"><div><div><h2 class="title"><a name="debug"></a>Chapter�4.�The samba DEBUG system</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Chris</span> <span class="surname">Hertel</span></h3></div></div><div><p class="pubdate">July 1998</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="debug.html#id2563001">New Output Syntax</a></span></dt><dt><span class="sect1"><a href="debug.html#id2563111">The DEBUG() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2563216">The DEBUGADD() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2563252">The DEBUGLVL() Macro</a></span></dt><dt><span class="sect1"><a href="debug.html#id2563343">New Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#id2563348">dbgtext()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2563364">dbghdr()</a></span></dt><dt><span class="sect2"><a href="debug.html#id2563383">format_debug_text()</a></span></dt></dl></dd></dl></div><div class="sect1" title="New Output Syntax"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2563001"></a>New Output Syntax</h2></div></div></div><p>
2
2
   The syntax of a debugging log file is represented as:
3
3
</p><pre class="programlisting">
4
4
  &gt;debugfile&lt; :== { &gt;debugmsg&lt; }
25
25
</p><p>
26
26
LINE is the line number of the debug statement that generated the
27
27
message.
28
 
</p><p>Basically, what that all means is:</p><div class="orderedlist"><ol type="1"><li><p>
 
28
</p><p>Basically, what that all means is:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
29
29
A debugging log file is made up of debug messages.
30
 
</p></li><li><p>
 
30
</p></li><li class="listitem"><p>
31
31
Each debug message is made up of a header and text. The header is
32
32
separated from the text by a newline.
33
 
</p></li><li><p>
 
33
</p></li><li class="listitem"><p>
34
34
The header begins with the timestamp and debug level of the
35
35
message enclosed in brackets. The filename, function, and line
36
36
number at which the message was generated follow. The filename is
38
38
parenthesis which contain the line number. Depending upon the
39
39
compiler, the function name may be missing (it is generated by the
40
40
__FUNCTION__ macro, which is not universally implemented, dangit).
41
 
</p></li><li><p>
 
41
</p></li><li class="listitem"><p>
42
42
The message text is made up of zero or more lines, each terminated
43
43
by a newline.
44
44
</p></li></ol></div><p>Here's some example output:</p><pre class="programlisting">
51
51
Note that in the above example the function names are not listed on
52
52
the header line. That's because the example above was generated on an
53
53
SGI Indy, and the SGI compiler doesn't support the __FUNCTION__ macro.
54
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2557054"></a>The DEBUG() Macro</h2></div></div></div><p>
 
54
</p></div><div class="sect1" title="The DEBUG() Macro"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2563111"></a>The DEBUG() Macro</h2></div></div></div><p>
55
55
Use of the DEBUG() macro is unchanged. DEBUG() takes two parameters.
56
56
The first is the message level, the second is the body of a function
57
57
call to the Debug1() function.
102
102
    [1998/07/30 16:00:51, 0] file.c:function(261)
103
103
      .
104
104
</pre><p>Which isn't much use. The format buffer kludge fixes this problem.
105
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2557160"></a>The DEBUGADD() Macro</h2></div></div></div><p>
 
105
</p></div><div class="sect1" title="The DEBUGADD() Macro"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2563216"></a>The DEBUGADD() Macro</h2></div></div></div><p>
106
106
In addition to the kludgey solution to the broken line problem
107
107
described above, there is a clean solution. The DEBUGADD() macro never
108
108
generates a header. It will append new text to the current debug
116
116
      This is the first line.
117
117
      This is the second line.
118
118
      This is the third line.
119
 
</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2557196"></a>The DEBUGLVL() Macro</h2></div></div></div><p>
 
119
</pre></div><div class="sect1" title="The DEBUGLVL() Macro"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2563252"></a>The DEBUGLVL() Macro</h2></div></div></div><p>
120
120
One of the problems with the DEBUG() macro was that DEBUG() lines
121
121
tended to get a bit long. Consider this example from
122
122
nmbd_sendannounce.c:
143
143
    dbgtext( "on subnet %s ", subrec-&gt;subnet_name );
144
144
    dbgtext( "for workgroup %s\n", work-&gt;work_group );
145
145
    }
146
 
</pre><p>(The dbgtext() function is explained below.)</p><p>There are a few advantages to this scheme:</p><div class="orderedlist"><ol type="1"><li><p>
 
146
</pre><p>(The dbgtext() function is explained below.)</p><p>There are a few advantages to this scheme:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
147
147
The test is performed only once.
148
 
</p></li><li><p>
 
148
</p></li><li class="listitem"><p>
149
149
You can allocate variables off of the stack that will only be used
150
150
within the DEBUGLVL() block.
151
 
</p></li><li><p>
 
151
</p></li><li class="listitem"><p>
152
152
Processing that is only relevant to debug output can be contained
153
153
within the DEBUGLVL() block.
154
 
</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2557287"></a>New Functions</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557292"></a>dbgtext()</h3></div></div></div><p>
 
154
</p></li></ol></div></div><div class="sect1" title="New Functions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2563343"></a>New Functions</h2></div></div></div><div class="sect2" title="dbgtext()"><div class="titlepage"><div><div><h3 class="title"><a name="id2563348"></a>dbgtext()</h3></div></div></div><p>
155
155
This function prints debug message text to the debug file (and
156
156
possibly to syslog) via the format buffer. The function uses a
157
157
variable argument list just like printf() or Debug1(). The
160
160
 
161
161
If you use DEBUGLVL() you will probably print the body of the
162
162
message using dbgtext(). 
163
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557308"></a>dbghdr()</h3></div></div></div><p>
 
163
</p></div><div class="sect2" title="dbghdr()"><div class="titlepage"><div><div><h3 class="title"><a name="id2563364"></a>dbghdr()</h3></div></div></div><p>
164
164
This is the function that writes a debug message header.
165
165
Headers are not processed via the format buffer. Also note that
166
166
if the format buffer is not empty, a call to dbghdr() will not
168
168
</p><p>
169
169
It is not likely that this function will be called directly. It
170
170
is used by DEBUG() and DEBUGADD().
171
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2557327"></a>format_debug_text()</h3></div></div></div><p>
 
171
</p></div><div class="sect2" title="format_debug_text()"><div class="titlepage"><div><div><h3 class="title"><a name="id2563383"></a>format_debug_text()</h3></div></div></div><p>
172
172
This is a static function in debug.c. It stores the output text
173
173
for the body of the message in a buffer until it encounters a
174
174
newline. When the newline character is found, the buffer is