1<HTML> 2<HEAD> 3<TITLE> 4[Chapter 5] 5.2 Filesystem Differences</title><META NAME="DC.title" CONTENT=""><META NAME="DC.creator" CONTENT=""><META NAME="DC.publisher" CONTENT="O'Reilly & Associates, Inc."><META NAME="DC.date" CONTENT="1999-11-05T21:32:56Z"><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" 10alt="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"> 16Robert 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="ch05_01.html" TITLE="5.1 Browsing"> 35<IMG SRC="gifs/txtpreva.gif" ALT="Previous: 5.1 Browsing" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 36<B> 37<FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1"> 38<A CLASS="chapter" REL="up" HREF="ch05_01.html" TITLE="5. Browsing and Advanced Disk Shares "> 39Chapter 5<br> 40Browsing and Advanced Disk Shares </a></font></b></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 41<A CLASS="sect1" HREF="ch05_03.html" TITLE="5.3 File Permissions and Attributes on MS-DOS and Unix"> 42<IMG SRC="gifs/txtnexta.gif" ALT="Next: 5.3 File Permissions and Attributes on MS-DOS and Unix" BORDER="0"></a></td></tr></table> <hr noshade size=1></center> 43</div> 44<blockquote> 45<div> 46<H2 CLASS="sect1"> 47<A CLASS="title" NAME="ch05-34221"> 485.2 Filesystem Differences</a></h2><P CLASS="para">One of the biggest issues for which Samba has to correct is the difference between Unix and non-Unix filesystems. This includes items such as handling symbolic links, hidden files, and dot files. In addition, file permissions can also be a headache if not accounted for properly. This section describes how to use Samba to make up for some of those annoying differences, and even how to add some new functionality of its own.</p><DIV CLASS="sect2"> 49<H3 CLASS="sect2"> 50<A CLASS="title" NAME="ch05-pgfId-963262"> 515.2.1 Hiding and Vetoing Files</a></h3><P CLASS="para">There are some cases when we need to ensure that a user cannot see or access a file at all. Other times, we don't want to keep a user from accessing a file - we just want to hide it when they view the contents of the directory. On Windows systems, an attribute of files allows them to be hidden from a folder listing. With Unix, the traditional way of hiding files in a directory is to precede them with a dot (.). This prevents items such as configuration files or defaults from being seen when performing an ordinary <CODE CLASS="literal"> 52ls</code> command. Keeping a user from accessing a file at all, however, involves working with permissions on files and or directories.</p><P CLASS="para"> 53The first option we should discuss is the boolean <CODE CLASS="literal"> 54hide</code> <CODE CLASS="literal"> 55dot</code> <CODE CLASS="literal"> 56files</code>. This option does exactly what it says. When set to <CODE CLASS="literal"> 57yes</code>, the option treats files beginning with a period (.) as hidden. If set to <CODE CLASS="literal"> 58no</code>, those files are always shown. The important thing to remember is that the files are only hidden. If the user has chosen to show all hidden files while browsing (e.g., using the Folder Options menu item under the View menu in Windows 98), they will still be able to see the files, as shown in <A CLASS="xref" HREF="ch05_02.html#ch05-77260"> 59Figure 5.2</a>. </p><H4 CLASS="figure"> 60<A CLASS="title" NAME="ch05-77260"> 61Figure 5.2: Hidden files in the [data] share</a></h4><IMG CLASS="graphic" SRC="figs/sam.0502.gif" ALT="Figure 5.2"><P CLASS="para"> 62Instead of simply hiding files beginning with a dot, you can also specify a string pattern to Samba for files to hide, using the <CODE CLASS="literal"> 63hide</code> <CODE CLASS="literal"> 64files</code> option. For example, let's assume that we specified the following in our example <CODE CLASS="literal"> 65[data]</code> share:</p><PRE CLASS="programlisting"> 66[data] 67 path = /home/samba/data 68 browseable = yes 69 guest ok = yes 70 writeable = yes 71 case sensitive = no 72 hide files = /*.java/*README*/</pre><P CLASS="para"> 73Each entry for this option must begin, end, or be separated from another with a slash (/) character, even if there is only one pattern listed. This convention allows spaces to appear in filenames. In this example, the share directory would appear as shown in <A CLASS="xref" HREF="ch05_02.html#ch05-19743"> 74Figure 5.3</a>. Again, note that we have set the Windows 98 option to view hidden files for the window. </p><H4 CLASS="figure"> 75<A CLASS="title" NAME="ch05-19743"> 76Figure 5.3: Hiding files based on filename patterns</a></h4><IMG CLASS="graphic" SRC="figs/sam.0503.gif" ALT="Figure 5.3"><P CLASS="para">If we want to prevent users from seeing files at all, we can instead use the <CODE CLASS="literal"> 77veto</code> <CODE CLASS="literal"> 78files</code> option. This option, which takes the same syntax as the <CODE CLASS="literal"> 79hide</code> <CODE CLASS="literal"> 80files</code> option, specifies a list of files that should never be seen by the user. For example, let's change the <CODE CLASS="literal"> 81[data]</code> share to the following:</p><PRE CLASS="programlisting"> 82[data] 83 path = /home/samba/data 84 browseable = yes 85 guest ok = yes 86 writeable = yes 87 case sensitive = no 88 veto files = /*.java/*README*/</pre><P CLASS="para"> 89The syntax of this option is identical to the <CODE CLASS="literal"> 90hide</code> <CODE CLASS="literal"> 91files</code> configuration option: each entry must begin, end, or be separated from another with a slash (<CODE CLASS="literal">/</code>) character, even if there is only one pattern listed. By doing so, the files <CODE CLASS="literal"> 92hello.java</code> and <CODE CLASS="literal"> 93README</code> will simply disappear from the directory, and the user will not be able to access them through SMB. </p><P CLASS="para"> 94There is one other question that we need to address. What happens if the user tries to delete a directory that contains vetoed files? This is where the <CODE CLASS="literal"> 95delete</code> <CODE CLASS="literal"> 96veto</code> <CODE CLASS="literal"> 97files</code> option comes in. If this boolean option is set to <CODE CLASS="literal"> 98yes</code>, the user is allowed to delete both the regular files and the vetoed files in the directory, and the directory itself will be removed. If the option is set to <CODE CLASS="literal"> 99no</code>, the user will not be able to delete the vetoed files, and consequently the directory will not be deleted either. From the user's perspective, the directory will appear to be empty, but cannot be removed.</p><P CLASS="para"> 100The <CODE CLASS="literal"> 101dont</code> <CODE CLASS="literal"> 102descend</code> directive specifies a list of directories whose contents Samba should not allow to be visible. Note that we say <EM CLASS="emphasis"> 103contents</em>, not the directory itself. Users will be able to enter a directory marked as such, but they are prohibited from descending the directory tree any farther - they will always see an empty folder. For example, let's use this option with a more basic form of the share that we defined earlier in the chapter:</p><PRE CLASS="programlisting"> 104[data] 105 path = /home/samba/data 106 browseable = yes 107 guest ok = yes 108 writeable = yes 109 case sensitive = no 110 dont descend = config defaults</pre><P CLASS="para"> 111In addition, let's assume that the <I CLASS="filename"> 112/home/samba/data</i> directory has the following contents:</p><PRE CLASS="programlisting"> 113drwxr-xr-x 6 tom users 1024 Jun 13 09:24 . 114drwxr-xr-x 8 root root 1024 Jun 10 17:53 .. 115-rw-r--r-- 2 tom users 1024 Jun 9 11:43 README 116drwxr-xr-x 3 tom users 1024 Jun 13 09:28 config 117drwxr-xr-x 3 tom users 1024 Jun 13 09:28 defaults 118drwxr-xr-x 3 tom users 1024 Jun 13 09:28 market</pre><P CLASS="para"> 119If the user then connects to the share, he or she would see the directories shown in <A CLASS="xref" HREF="ch05_02.html#ch05-62659"> 120Figure 5.4</a>. However, the contents of the <I CLASS="filename"> 121/config</i> and <I CLASS="filename"> 122/defaults</i> directories would appear empty to the user, even if other folders or files existed in them. In addition, users cannot write any data to the folder (which prevents them from creating a file or folder with the same name as one that is already there but invisible). If a user attempts to do so, he or she will receive an "Access Denied" message. <CODE CLASS="literal"> 123dont</code> <CODE CLASS="literal"> 124descend</code> is an administrative option, not a security option, and is not a substitute for good file permissions. </p><H4 CLASS="figure"> 125<A CLASS="title" NAME="ch05-62659"> 126Figure 5.4: Contents of the [data] share with dont descend </a></h4><IMG CLASS="graphic" SRC="figs/sam.0504.gif" ALT="Figure 5.4"></div><DIV CLASS="sect2"> 127<H3 CLASS="sect2"> 128<A CLASS="title" NAME="ch05-pgfId-963441"> 1295.2.2 Links</a></h3><P CLASS="para">DOS and NT filesystems don't have symbolic links; Windows 95/98/NT systems approximate this with "shortcuts" instead. Therefore, when a client tries to open a symbolic link on a Samba server share, Samba attempts to follow the link to find the real file and let the client open it, as if he or she were on a Unix machine. If you don't want to allow this, set the <CODE CLASS="literal"> 130follow</code> <CODE CLASS="literal"> 131symlinks</code> option:</p><PRE CLASS="programlisting"> 132[data] 133 path = /home/samba/data 134 browseable = yes 135 guest ok = yes 136 writeable = yes 137 case sensitive = no 138 follow symlinks = no</pre><P CLASS="para"> 139You can test this by creating a directory on the Unix server inside the share as the user that you are logging in with. Enter the following commands:</p><PRE CLASS="programlisting"> 140% <CODE CLASS="userinput"><B>mkdir hello; cd hello</b></code> 141% <CODE CLASS="userinput"><B>cat "This is a test" >hello.txt</b></code> 142% <CODE CLASS="userinput"><B>ln -s hello.txt "Link to hello"</b></code></pre><P CLASS="para"> 143This results in the two files shown in the window in <A CLASS="xref" HREF="ch05_02.html#ch05-36377"> 144Figure 5.5</a>. Normally, if you click on either one, you will receive a file which has the text "This is a test" inside of it. However, with the <CODE CLASS="literal"> 145follow</code> <CODE CLASS="literal"> 146symlinks</code> option set to <CODE CLASS="literal"> 147no</code>, you should receive an error similar to the dialog in <A CLASS="xref" HREF="ch05_02.html#ch05-36377"> 148Figure 5.5</a> if you click on "Link to hello." </p><H4 CLASS="figure"> 149<A CLASS="title" NAME="ch05-36377"> 150Figure 5.5: An error dialog trying to follow symbolic links when forbidden by Samba</a></h4><IMG CLASS="graphic" SRC="figs/sam.0505.gif" ALT="Figure 5.5"><P CLASS="para"> 151Finally, let's discuss the <CODE CLASS="literal"> 152wide</code> <CODE CLASS="literal"> 153links</code> option. This option, if set to <CODE CLASS="literal"> 154yes</code>, allows the client user to follow symbolic links that point outside the shared directory tree, including files or directories at the other end of the link. For example, let's assume that we modified the <CODE CLASS="literal"> 155[data]</code> share as follows:</p><PRE CLASS="programlisting"> 156[data] 157 path = /home/samba/data 158 browseable = yes 159 guest ok = yes 160 writeable = yes 161 case sensitive = no 162 follow symlinks = yes 163 wide links = yes</pre><P CLASS="para"> 164As long as the <CODE CLASS="literal"> 165follow</code> <CODE CLASS="literal"> 166symlinks</code> option is enabled, this will cause Samba to follow all symbolic links outside the current share tree. If we create a file outside the share (for example, in someone's home directory) and then create a link to it in the share as follows:</p><PRE CLASS="programlisting"> 167ln -s ~tom/datafile ./datafile</pre><P CLASS="para"> 168then you will be able to open the file in Tom's directory as per the target file's permissions.</p></div><DIV CLASS="sect2"> 169<H3 CLASS="sect2"> 170<A CLASS="title" NAME="ch05-pgfId-963127"> 1715.2.3 Filesystem Options</a></h3><P CLASS="para"> 172<A CLASS="xref" HREF="ch05_02.html#ch05-48353">Table 5.4</a> shows a breakdown of the options we discussed earlier. We recommend the defaults for most, except those listed in the following descriptions. </p><br> 173<TABLE CLASS="table" BORDER="1" CELLPADDING="3"> 174<CAPTION CLASS="table"> 175<A CLASS="title" NAME="ch05-48353"> 176Table 5.4: Filesystem Configuration Options </a></caption><THEAD CLASS="thead"> 177<TR CLASS="row" VALIGN="TOP"> 178<TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 179<P CLASS="para"> 180Option</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 181<P CLASS="para"> 182Parameters</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 183<P CLASS="para"> 184Function</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 185<P CLASS="para"> 186Default</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 187<P CLASS="para"> 188Scope</p></th></tr></thead><TBODY CLASS="tbody"> 189<TR CLASS="row" VALIGN="TOP"> 190<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 191<P CLASS="para"> 192<CODE CLASS="literal"> 193unix realname</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 194<P CLASS="para"> 195boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 196<P CLASS="para"> 197Provides Unix user's full name to client.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 198<P CLASS="para"> 199<CODE CLASS="literal"> 200no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 201<P CLASS="para"> 202Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 203<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 204<P CLASS="para"> 205<CODE CLASS="literal"> 206dont descend</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 207<P CLASS="para"> 208string (list of directories)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 209<P CLASS="para"> 210Indicates a list of directories whose contents Samba should make invisible to clients.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 211<P CLASS="para"> 212None</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 213<P CLASS="para"> 214Share</p></td></tr><TR CLASS="row" VALIGN="TOP"> 215<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 216<P CLASS="para"> 217<CODE CLASS="literal"> 218follow symlinks</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 219<P CLASS="para"> 220boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 221<P CLASS="para"> 222If set to <CODE CLASS="literal"> 223no</code>, Samba will not honor symbolic links.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 224<P CLASS="para"> 225<CODE CLASS="literal"> 226yes</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 227<P CLASS="para"> 228Share</p></td></tr><TR CLASS="row" VALIGN="TOP"> 229<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 230<P CLASS="para"> 231<CODE CLASS="literal"> 232getwd cache</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 233<P CLASS="para"> 234boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 235<P CLASS="para"> 236If set to <CODE CLASS="literal"> 237yes</code>, Samba will use a cache for <CODE CLASS="literal"> 238getwd()</code> calls.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 239<P CLASS="para"> 240<CODE CLASS="literal"> 241yes</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 242<P CLASS="para"> 243Global</p></td></tr><TR CLASS="row" VALIGN="TOP"> 244<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 245<P CLASS="para"> 246<CODE CLASS="literal"> 247wide links</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 248<P CLASS="para"> 249boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 250<P CLASS="para"> 251If set to <CODE CLASS="literal"> 252yes</code>, Samba will follow symbolic links outside the share.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 253<P CLASS="para"> 254<CODE CLASS="literal"> 255yes</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 256<P CLASS="para"> 257Share</p></td></tr><TR CLASS="row" VALIGN="TOP"> 258<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 259<P CLASS="para"> 260<CODE CLASS="literal"> 261hide dot files</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 262<P CLASS="para"> 263boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 264<P CLASS="para"> 265If set to <CODE CLASS="literal"> 266yes</code>, treats Unix hidden files as hidden files in Windows.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 267<P CLASS="para"> 268<CODE CLASS="literal"> 269yes</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 270<P CLASS="para"> 271Share</p></td></tr><TR CLASS="row" VALIGN="TOP"> 272<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 273<P CLASS="para"> 274<CODE CLASS="literal"> 275hide files</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 276<P CLASS="para"> 277string (list of files)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 278<P CLASS="para"> 279List of file patterns to treat as hidden.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 280<P CLASS="para"> 281None</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 282<P CLASS="para"> 283Share</p></td></tr><TR CLASS="row" VALIGN="TOP"> 284<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 285<P CLASS="para"> 286<CODE CLASS="literal"> 287veto files</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 288<P CLASS="para"> 289string (list of files)</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 290<P CLASS="para"> 291List of file patterns to never show.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 292<P CLASS="para"> 293None</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 294<P CLASS="para"> 295Share</p></td></tr><TR CLASS="row" VALIGN="TOP"> 296<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 297<P CLASS="para"> 298<CODE CLASS="literal"> 299delete veto files</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 300<P CLASS="para"> 301boolean</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 302<P CLASS="para"> 303If set to <CODE CLASS="literal"> 304yes</code>, will delete files matched by <CODE CLASS="literal"> 305veto files</code> when the directory they reside in is deleted.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 306<P CLASS="para"> 307<CODE CLASS="literal"> 308no</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 309<P CLASS="para"> 310Share</p></td></tr></tbody></table><DIV CLASS="sect3"> 311<H4 CLASS="sect3"> 312<A CLASS="title" NAME="ch05-pgfId-958657"> 3135.2.3.1 unix realname</a></h4><P CLASS="para"> 314Some programs require a full username in order to operate. For example, a Windows email program often needs to associate a username with a given real name. If your system password file contains the real names of users in the GCOS field, the <CODE CLASS="literal"> 315unix</code> <CODE CLASS="literal"> 316realname</code> option instructs Samba to provide this information to clients. Without it, the name of the user will simply be his or her login ID. For example, if your Unix password file contains the following line:</p><PRE CLASS="programlisting"> 317rcollins:/KaBfco47Rer5:500:500:Robert Collins: 318/home/rcollins:/bin/ksh</pre><P CLASS="para"> 319And the option in the configuration file is:</p><PRE CLASS="programlisting"> 320[global] 321 unix realname = yes</pre><P CLASS="para"> 322then the name Robert Collins will be provided to any client that requests the real name of user <CODE CLASS="literal"> 323rcollins</code>. You typically don't need to bother with this option.</p></div><DIV CLASS="sect3"> 324<H4 CLASS="sect3"> 325<A CLASS="title" NAME="ch05-pgfId-958929"> 3265.2.3.2 dont descend</a></h4><P CLASS="para"> 327The <CODE CLASS="literal"> 328dont</code> <CODE CLASS="literal"> 329descend</code> option can be used to specify various directories that should appear empty to the client. Note that the directory itself will still appear. However, Samba will not show any of the contents of the directory to the client user. This is not a good option to use as a security feature (a user could probably find a way around it); it really is meant only as a convenience to keep client users from browsing into directories that might have sensitive files. See our example earlier in this section.</p></div><DIV CLASS="sect3"> 330<H4 CLASS="sect3"> 331<A CLASS="title" NAME="ch05-pgfId-958663"> 3325.2.3.3 follow symlinks</a></h4><P CLASS="para">This option, which is discussed in greater detail earlier, controls whether Samba will follow a symbolic link in the Unix operating system to the target, or if it should return an error to the client user. If the option is set to <CODE CLASS="literal"> 333yes</code>, the target of the link will be interpreted as the file.</p></div><DIV CLASS="sect3"> 334<H4 CLASS="sect3"> 335<A CLASS="title" NAME="ch05-pgfId-963512"> 3365.2.3.4 getwd cache</a></h4><P CLASS="para"> 337This global option specifies whether Samba should use a local cache for the Unix <CODE CLASS="literal"> 338getwd()</code> (get current working directory) system call. You can override the default value of <CODE CLASS="literal"> 339yes</code> as follows:</p><PRE CLASS="programlisting"> 340[global] 341 getwd cache = no</pre><P CLASS="para"> 342Setting this option to <CODE CLASS="literal"> 343yes</code> can significantly increase the time it takes to resolve the working directory, especially if the <CODE CLASS="literal"> 344wide</code> <CODE CLASS="literal"> 345links</code> option is set to <CODE CLASS="literal"> 346no</code>. You should normally not need to alter this option.</p></div><DIV CLASS="sect3"> 347<H4 CLASS="sect3"> 348<A CLASS="title" NAME="ch05-pgfId-960186"> 3495.2.3.5 wide links</a></h4><P CLASS="para"> 350This option specifies whether the client user can follow symbolic links that point outside the shared directory tree. This includes any files or directories at the other end of the link, as long as the permissions are correct for the user. The default value for this option is <CODE CLASS="literal"> 351yes</code>. Note that this option will not be honored if the <CODE CLASS="literal"> 352follow</code> <CODE CLASS="literal"> 353symlinks</code> options is set to <CODE CLASS="literal"> 354no</code>. Setting this option to <CODE CLASS="literal"> 355no</code> slows <EM CLASS="emphasis"> 356smbd</em> considerably.</p></div><DIV CLASS="sect3"> 357<H4 CLASS="sect3"> 358<A CLASS="title" NAME="ch05-pgfId-958655"> 3595.2.3.6 hide files</a></h4><P CLASS="para">The <CODE CLASS="literal"> 360hide</code> <CODE CLASS="literal"> 361files</code> option provides one or more directory or filename patterns to Samba. Any file matching this pattern will be treated as a hidden file from the perspective of the client. Note that this simply means that the DOS hidden attribute is set, which may or may not mean that the user can actually see it while browsing.</p><P CLASS="para"> 362Each entry in the list must begin, end, or be separated from another entry with a slash (<CODE CLASS="literal">/</code>) character, even if there is only one pattern listed. This allows spaces to appear in the list. Asterisks can be used as a wildcard to represent zero or more characters. Questions marks can be used to represent exactly one character. For example:</p><PRE CLASS="programlisting"> 363hide files = /.jav*/README.???/</pre></div><DIV CLASS="sect3"> 364<H4 CLASS="sect3"> 365<A CLASS="title" NAME="ch05-pgfId-963549"> 3665.2.3.7 hide dot files</a></h4><P CLASS="para"> 367The <CODE CLASS="literal"> 368hide</code> <CODE CLASS="literal"> 369dot</code> <CODE CLASS="literal"> 370files</code> option hides any files on the server that begin with a dot (.) character, in order to mimic the functionality behind several shell commands that are present on Unix systems. Like <CODE CLASS="literal"> 371hide</code> <CODE CLASS="literal"> 372files</code>, those files that begin with a dot have the DOS hidden attribute set, which doesn't necessarily guarantee that a client cannot view them. The default value for this option is <CODE CLASS="literal"> 373yes</code>. </p></div><DIV CLASS="sect3"> 374<H4 CLASS="sect3"> 375<A CLASS="title" NAME="ch05-pgfId-963556"> 3765.2.3.8 veto files</a></h4><P CLASS="para"> 377More stringent than the hidden files state is the state provided by the <CODE CLASS="literal"> 378veto</code> <CODE CLASS="literal"> 379files</code> configuration option. Samba won't even admit these files exist. You cannot list or open them from the client. In reality, this isn't a trustworthy security option. It is actually a mechanism to keep PC programs from deleting special files, such as ones used to store the resource fork of a Macintosh file on a Unix filesystem. If both Windows and Macs are sharing the same files, this can prevent ill-advised power users from removing files the Mac users need.</p><P CLASS="para"> 380The syntax of this option is identical to that of the <CODE CLASS="literal"> 381hide</code> <CODE CLASS="literal"> 382files</code> configuration option: each entry must begin, end, or be separated from another with a slash (/) character, even if only one pattern is listed. Asterisks can be used as a wildcard to represent zero or more characters. Questions marks can be used to represent exactly one character. For example:</p><PRE CLASS="programlisting"> 383veto files = /*config/*default?/</pre><P CLASS="para"> 384This option is primarily administrative - not a substitute for good file permissions.</p></div><DIV CLASS="sect3"> 385<H4 CLASS="sect3"> 386<A CLASS="title" NAME="ch05-pgfId-958851"> 3875.2.3.9 delete veto files</a></h4><P CLASS="para">This option tells Samba to delete vetoed files when a user attempts to delete the directory in which they reside. The default value is <CODE CLASS="literal"> 388no</code>. This means if a user tries to delete a directory that contains a vetoed file, the file (and the directory) will not be deleted. Instead, the directory will remain and appear to be empty from the perspective of the user. If set to <CODE CLASS="literal"> 389yes</code>, the directory and the vetoed files will be deleted.</p></div></div></div></blockquote> 390<div> 391<center> 392<hr noshade size=1><TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 393<TR> 394<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 395<A CLASS="sect1" HREF="ch05_01.html" TITLE="5.1 Browsing"> 396<IMG SRC="gifs/txtpreva.gif" ALT="Previous: 5.1 Browsing" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 397<A CLASS="book" HREF="index.html" TITLE=""> 398<IMG SRC="gifs/txthome.gif" ALT="" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 399<A CLASS="sect1" HREF="ch05_03.html" TITLE="5.3 File Permissions and Attributes on MS-DOS and Unix"> 400<IMG SRC="gifs/txtnexta.gif" ALT="Next: 5.3 File Permissions and Attributes on MS-DOS and Unix" BORDER="0"></a></td></tr><TR> 401<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 4025.1 Browsing</td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 403<A CLASS="index" HREF="inx.html" TITLE="Book Index"> 404<IMG SRC="gifs/index.gif" ALT="Book Index" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 4055.3 File Permissions and Attributes on MS-DOS and Unix</td></tr></table><hr noshade size=1></center> 406</div> 407 408<!-- End of sample chapter --> 409<CENTER> 410<FONT SIZE="1" FACE="Verdana, Arial, Helvetica"> 411<A HREF="http://www.oreilly.com/"> 412<B>O'Reilly Home</B></A> <B> | </B> 413<A HREF="http://www.oreilly.com/sales/bookstores"> 414<B>O'Reilly Bookstores</B></A> <B> | </B> 415<A HREF="http://www.oreilly.com/order_new/"> 416<B>How to Order</B></A> <B> | </B> 417<A HREF="http://www.oreilly.com/oreilly/contact.html"> 418<B>O'Reilly Contacts<BR></B></A> 419<A HREF="http://www.oreilly.com/international/"> 420<B>International</B></A> <B> | </B> 421<A HREF="http://www.oreilly.com/oreilly/about.html"> 422<B>About O'Reilly</B></A> <B> | </B> 423<A HREF="http://www.oreilly.com/affiliates.html"> 424<B>Affiliated Companies</B></A><p> 425<EM>© 1999, O'Reilly & Associates, Inc.</EM> 426</FONT> 427</CENTER> 428</BODY> 429</html> 430