This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.
[samba.git] / docs / htmldocs / using_samba / ch08_01.html
1 <HTML>
2 <HEAD>
3 <TITLE>
4 [Chapter 8] Additional Samba Information </title><META NAME="DC.title" CONTENT=""><META NAME="DC.creator" CONTENT=""><META NAME="DC.publisher" CONTENT="O'Reilly &amp; Associates, Inc."><META NAME="DC.date" CONTENT="1999-11-05T21:35:49Z"><META NAME="DC.type" CONTENT="Text.Monograph"><META NAME="DC.format" CONTENT="text/html" SCHEME="MIME"><META NAME="DC.source" CONTENT="" SCHEME="ISBN"><META NAME="DC.language" CONTENT="en-US"><META NAME="generator" CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"></head>
5 <BODY BGCOLOR="#FFFFFF" TEXT="#000000" link="#990000" vlink="#0000CC">
6 <table BORDER="0" CELLPADDING="0" CELLSPACING="0" width="90%">
7 <tr>
8 <td width="25%" valign="TOP">
9 <img hspace=10 vspace=10 src="gifs/samba.s.gif" 
10 alt="Using Samba" align=left valign=top border=0>
11 </td>
12 <td height="105" valign="TOP">
13 <br>
14 <H2>Using Samba</H2>
15 <font size="-1">
16 Robert Eckstein, David Collier-Brown, Peter Kelly
17 <br>1st Edition November 1999
18 <br>1-56592-449-5, Order Number: 4495
19 <br>416 pages, $34.95
20 </font>
21 <p> <a href="http://www.oreilly.com/catalog/samba/">Buy the hardcopy</a>
22 <p><a href="index.html">Table of Contents</a>
23 </td>
24 </tr>
25 </table>
26 <hr size=1 noshade>
27 <!--sample chapter begins -->
28
29 <center>
30 <DIV CLASS="htmlnav">
31 <TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0">
32 <TR>
33 <TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172">
34 <A CLASS="sect1" HREF="ch07_03.html" TITLE="7.3 Name Resolution with Samba">
35 <IMG SRC="gifs/txtpreva.gif" ALT="Previous: 7.3 Name Resolution with Samba" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171">
36 <B>
37 <FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">
38 Chapter 8</font></b></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172">
39 <A CLASS="sect1" HREF="ch08_02.html" TITLE="8.2 Magic Scripts">
40 <IMG SRC="gifs/txtnexta.gif" ALT="Next: 8.2 Magic Scripts" BORDER="0"></a></td></tr></table>&nbsp;<hr noshade size=1></center>
41 </div>
42 <blockquote>
43 <div class="samplechapter">
44 <H1 CLASS="chapter">
45 <A CLASS="title" NAME="ch08-74589">
46 8. Additional Samba Information </a></h1><DIV CLASS="htmltoc">
47 <P>
48 <B>
49 Contents:</b><br>
50 <A CLASS="sect1" HREF="#ch08-56646" TITLE="8.1 Supporting Programmers">
51 Supporting Programmers</a><br>
52 <A CLASS="sect1" HREF="ch08_02.html" TITLE="8.2 Magic Scripts">
53 Magic Scripts</a><br>
54 <A CLASS="sect1" HREF="ch08_03.html" TITLE="8.3 Internationalization">
55 Internationalization</a><br>
56 <A CLASS="sect1" HREF="ch08_04.html" TITLE="8.4 WinPopup Messages">
57 WinPopup Messages</a><br>
58 <A CLASS="sect1" HREF="ch08_05.html" TITLE="8.5 Recently Added Options">
59 Recently Added Options</a><br>
60 <A CLASS="sect1" HREF="ch08_06.html" TITLE="8.6 Miscellaneous Options">
61 Miscellaneous Options</a><br>
62 <A CLASS="sect1" HREF="ch08_07.html" TITLE="8.7 Backups with smbtar">
63 Backups with smbtar</a></p><P>
64 </p></div><P CLASS="para">
65 This chapter wraps up our coverage of the <I CLASS="filename">
66 smb.conf</i> configuration file with some miscellaneous options that can perform a variety of tasks. We will talk briefly about options for supporting programmers, internationalization, messages, and common Windows bugs. For the most part, you will use these options only in isolated circumstances. We also cover performing automated backups with the <I CLASS="filename">
67 smbtar</i> command at the end of this chapter. So without further ado, let's jump into our first subject: options to help programmers.</p><DIV CLASS="sect1">
68 <H2 CLASS="sect1">
69 <A CLASS="title" NAME="s1"></a>
70 <A CLASS="title" NAME="ch08-56646">
71 8.1 Supporting Programmers</a></h2><P CLASS="para">If you have programmers accessing your Samba server, you'll want to be aware of the special options listed in <A CLASS="xref" HREF="ch08_01.html#ch08-73167">
72 Table 8.1</a>. </p><br>
73 <TABLE CLASS="table" BORDER="1" CELLPADDING="3">
74 <CAPTION CLASS="table">
75 <A CLASS="title" NAME="ch08-73167">
76 Table 8.1: Programming Configuration Options </a></caption><THEAD CLASS="thead">
77 <TR CLASS="row" VALIGN="TOP">
78 <TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1">
79 <P CLASS="para">
80 Option</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1">
81 <P CLASS="para">
82 Parameters</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1">
83 <P CLASS="para">
84 Function</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1">
85 <P CLASS="para">
86 Default</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1">
87 <P CLASS="para">
88 Scope</p></th></tr></thead><TBODY CLASS="tbody">
89 <TR CLASS="row" VALIGN="TOP">
90 <TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
91 <P CLASS="para">
92 <CODE CLASS="literal">
93 time server</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
94 <P CLASS="para">
95 boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
96 <P CLASS="para">
97 If <CODE CLASS="literal">
98 yes</code>, <EM CLASS="emphasis">
99 nmbd</em> announces itself as a SMB time service to Windows clients.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
100 <P CLASS="para">
101 <CODE CLASS="literal">
102 no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
103 <P CLASS="para">
104 Global</p></td></tr><TR CLASS="row" VALIGN="TOP">
105 <TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
106 <P CLASS="para">
107 <CODE CLASS="literal">
108 time offset</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
109 <P CLASS="para">
110 numerical (number of minutes)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
111 <P CLASS="para">
112 Adds a specified number of minutes to the reported time.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
113 <P CLASS="para">
114 <CODE CLASS="literal">
115 0</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
116 <P CLASS="para">
117 Global</p></td></tr><TR CLASS="row" VALIGN="TOP">
118 <TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
119 <P CLASS="para">
120 <CODE CLASS="literal">
121 dos filetimes</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
122 <P CLASS="para">
123 boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
124 <P CLASS="para">
125 Allows non-owners of a file to change its time if they can write to it.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
126 <P CLASS="para">
127 <CODE CLASS="literal">
128 no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
129 <P CLASS="para">
130 Share</p></td></tr><TR CLASS="row" VALIGN="TOP">
131 <TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
132 <P CLASS="para">
133 <CODE CLASS="literal">
134 dos filetime</code></p><P CLASS="para">
135 <CODE CLASS="literal">
136 resolution</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
137 <P CLASS="para">
138 boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
139 <P CLASS="para">
140 Causes file times to be rounded to the next even second.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
141 <P CLASS="para">
142 <CODE CLASS="literal">
143 no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
144 <P CLASS="para">
145 Share</p></td></tr><TR CLASS="row" VALIGN="TOP">
146 <TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
147 <P CLASS="para">
148 <CODE CLASS="literal">
149 fake directory create times</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
150 <P CLASS="para">
151 boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
152 <P CLASS="para">
153 Sets directory times to avoid a MS <EM CLASS="emphasis">
154 nmake</em> bug.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
155 <P CLASS="para">
156 <CODE CLASS="literal">
157 no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
158 <P CLASS="para">
159 Share</p></td></tr></tbody></table><DIV CLASS="sect2">
160 <H3 CLASS="sect2">
161 <A CLASS="title" NAME="ch08-pgfId-958487">
162 8.1.1 Time Synchronization</a></h3><P CLASS="para">Time synchronization can be very important to programmers. Consider the following options:</p><PRE CLASS="programlisting">
163 time service = yes
164 dos filetimes = yes
165 fake directory create times = yes
166 dos filetime resolution = yes
167 delete readonly = yes</pre><P CLASS="para">
168 If you set these options, Samba shares will provide the kind of compatible file times that Visual C++, <EM CLASS="emphasis">
169 nmake</em>, and other Microsoft programming tools require. Otherwise, PC <EM CLASS="emphasis">
170 make</em> programs will tend to think that all the files in a directory need to be recompiled every time. Obviously, this is not the behavior you want.</p><DIV CLASS="sect3">
171 <H4 CLASS="sect3">
172 <A CLASS="title" NAME="ch08-pgfId-958495">
173 8.1.1.1 time server</a></h4><P CLASS="para">
174 If your Samba server has an accurate clock, or if it's a client of one of the Unix network time servers, you can instruct it to advertise itself as an SMB time server by setting the <CODE CLASS="literal">
175 time</code> <CODE CLASS="literal">
176 server</code> option as follows:</p><PRE CLASS="programlisting">
177 [global]
178         time service = yes</pre><P CLASS="para">
179 The client will still have to request the correct time with the following DOS command, substituting the Samba server name in at the appropriate point:</p><PRE CLASS="programlisting">
180 C:\NET TIME \\<CODE CLASS="replaceable"><I>server</i></code> /YES /SET</pre><P CLASS="para">
181 This command can be placed in a Windows logon script (see <a href="ch06_01.html"><b>Chapter 6, <CITE CLASS="chapter">Users, Security, and Domains </cite></b></a>).</p><P CLASS="para">
182 By default, the <CODE CLASS="literal">
183 time</code> <CODE CLASS="literal">
184 server</code> option is normally set to <CODE CLASS="literal">
185 no</code>. If you turn this service on, you can use the command above to keep the client clocks from drifting. Time synchronization is important to clients using programs such as <EM CLASS="emphasis">
186 make</em>, which compile based on the last time the file was changed. Incorrectly synchronized times can cause such programs to either remake all files in a directory, which wastes time, or not recompile a source file that was just modified because of a slight clock drift.</p></div><DIV CLASS="sect3">
187 <H4 CLASS="sect3">
188 <A CLASS="title" NAME="ch08-pgfId-958501">
189 8.1.1.2 time offset</a></h4><P CLASS="para">
190 To deal with clients that don't process daylight savings time properly, Samba provides the <CODE CLASS="literal">
191 time</code> <CODE CLASS="literal">
192 offset</code> option. If set, it adds the specified number of minutes to the current time. This is handy if you're in Newfoundland and Windows doesn't know about the 30-minute time difference there:</p><PRE CLASS="programlisting">
193 [global]
194         time offset = 30</pre></div><DIV CLASS="sect3">
195 <H4 CLASS="sect3">
196 <A CLASS="title" NAME="ch08-pgfId-958505">
197 8.1.1.3 dos filetimes</a></h4><P CLASS="para">
198 Traditionally, only the root user and the owner of a file can change its last-modified date on a Unix system. The share-level <CODE CLASS="literal">
199 dos</code> <CODE CLASS="literal">
200 filetimes</code> option allows the Samba server to mimic the characteristics of a DOS/Windows machine: any user can change the last modified date on a file in that share if he or she has write permission to it. In order to do this, Samba uses its root privileges to modify the timestamp on the file. </p><P CLASS="para">
201 By default, this option is disabled. Setting this option to <CODE CLASS="literal">
202 yes</code> is often necessary to allow PC <EM CLASS="emphasis">
203 make</em> programs to work properly. Without it, they cannot change the last-modified date themselves. This often results in the program thinking <EM CLASS="emphasis">
204 all</em> files need recompiling when they really don't. </p></div><DIV CLASS="sect3">
205 <H4 CLASS="sect3">
206 <A CLASS="title" NAME="ch08-pgfId-958509">
207 8.1.1.4 dos filetime resolution</a></h4><P CLASS="para">
208 <CODE CLASS="literal">
209 dos</code> <CODE CLASS="literal">
210 filetime</code> <CODE CLASS="literal">
211 resolution</code> is share-level option. If set to <CODE CLASS="literal">
212 yes</code>, Samba will arrange to have the file times rounded to the closest two-second boundary. This option exists primarily to satisfy a quirk in Windows that prevents Visual C++ from correctly recognizing that a file has not changed. You can enable it as follows:</p><PRE CLASS="programlisting">
213 [data]
214         dos filetime resolution = yes</pre><P CLASS="para">
215 We recommend using this option only if you are using Microsoft Visual C++ on a Samba share that supports opportunistic locking.</p></div><DIV CLASS="sect3">
216 <H4 CLASS="sect3">
217 <A CLASS="title" NAME="ch08-pgfId-958515">
218 8.1.1.5 fake directory create times</a></h4><P CLASS="para">
219 The <CODE CLASS="literal">
220 fake</code> <CODE CLASS="literal">
221 directory</code> <CODE CLASS="literal">
222 create</code> <CODE CLASS="literal">
223 times</code> option exists to keep PC <EM CLASS="emphasis">
224 make</em> programs sane. VFAT and NTFS filesystems record the creation date of a specific directory while Unix does not. Without this option, Samba takes the earliest recorded date it has for the directory (often the last-modified date of a file) and returns it to the client. If this is not sufficient, set the following option under a share definition:</p><PRE CLASS="programlisting">
225 [data]
226         fake directory create times = yes</pre><P CLASS="para">
227 If set, Samba will adjust the directory create time it reports to the hardcoded value January 1st, 1980. This is primarily used to convince the Visual C++ <EM CLASS="emphasis">
228 nmake</em> program that any object files in its build directories are indeed younger than the creation date of the directory itself and need to be recompiled.</p></div></div></div></div></blockquote>
229 <div>
230 <center>
231 <hr noshade size=1><TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0">
232 <TR>
233 <TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172">
234 <A CLASS="sect1" HREF="ch07_03.html" TITLE="7.3 Name Resolution with Samba">
235 <IMG SRC="gifs/txtpreva.gif" ALT="Previous: 7.3 Name Resolution with Samba" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171">
236 <A CLASS="book" HREF="index.html" TITLE="">
237 <IMG SRC="gifs/txthome.gif" ALT="" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172">
238 <A CLASS="sect1" HREF="ch08_02.html" TITLE="8.2 Magic Scripts">
239 <IMG SRC="gifs/txtnexta.gif" ALT="Next: 8.2 Magic Scripts" BORDER="0"></a></td></tr><TR>
240 <TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172">7.3 Name Resolution with Samba</td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171">
241 <A CLASS="index" HREF="inx.html" TITLE="Book Index">
242 <IMG SRC="gifs/index.gif" ALT="Book Index" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172">
243 8.2 Magic Scripts</td></tr></table><hr noshade size=1></center>
244 </div>
245
246 <!-- End of sample chapter -->
247 <CENTER>
248 <FONT SIZE="1" FACE="Verdana, Arial, Helvetica">
249 <A HREF="http://www.oreilly.com/">
250 <B>O'Reilly Home</B></A> <B> | </B>
251 <A HREF="http://www.oreilly.com/sales/bookstores">
252 <B>O'Reilly Bookstores</B></A> <B> | </B>
253 <A HREF="http://www.oreilly.com/order_new/">
254 <B>How to Order</B></A> <B> | </B>
255 <A HREF="http://www.oreilly.com/oreilly/contact.html">
256 <B>O'Reilly Contacts<BR></B></A>
257 <A HREF="http://www.oreilly.com/international/">
258 <B>International</B></A> <B> | </B>
259 <A HREF="http://www.oreilly.com/oreilly/about.html">
260 <B>About O'Reilly</B></A> <B> | </B>
261 <A HREF="http://www.oreilly.com/affiliates.html">
262 <B>Affiliated Companies</B></A><p>
263 <EM>&copy; 1999, O'Reilly &amp; Associates, Inc.</EM>
264 </FONT>
265 </CENTER>
266 </BODY>
267 </html>