Options in the Samba configuration files fall into one of two categories: global options or share options. Each category dictates where an option can appear in the configuration file.
In addition, configuration options can take three kinds of values. They are as follows :
6.3.1 Configuration File OptionsYou can instruct Samba to include or replace configuration options as it is processing them. The options to do this are summarized in Table 6-3. Table 6-3. Configuration file options
6.3.1.1 config fileThe global config file option specifies a replacement configuration file that will be loaded when the option is encountered. If the target file exists, the remainder of the current configuration file, as well as the options encountered so far, will be discarded, and Samba will configure itself entirely with the options in the new file. Variables can be used with the config file option, which is useful in the event that you want to use a special configuration file based on the NetBIOS machine name or user of the client that is connecting. For example, the following line instructs Samba to use a configuration file specified by the NetBIOS name of the client connecting, if such a file exists. If it does, options specified in the original configuration file are ignored: [global] config file = /usr/local/samba/lib/smb.conf.%m If the configuration file specified does not exist, the option is ignored, and Samba will continue to configure itself based on the current file. This allows a default configuration file to serve most clients , while providing for exceptions with customized configuration files. 6.3.1.2 includeThis option, discussed in greater detail earlier, copies the target file into the current configuration file at the point specified, as shown in Figure 6-1. This option also can be used with variables. You can use this option as follows: [global] include = /usr/local/samba/lib/smb.conf.%m If the configuration file specified does not exist, the option is ignored. Options in the include file override any option specified previously, but not options that are specified later. In Figure 6-1, all three options will override their previous values. Figure 6-1. The include option in a Samba configuration fileThe include option does not work with the variables %u (user), %P (current share's root directory), or %S (current share's name) because they are not set at the time the include parameter is processed . 6.3.1.3 copyThe copy configuration option allows you to clone the configuration options of the share name that you specify in the current share. The target share must appear earlier in the configuration file than the share that is performing the copy. For example: [template] writable = yes browsable = yes valid users = andy, dave, jay [data] path = /usr/local/samba copy = template Note that any options in the share that invoked the copy directive will override those in the cloned share; it does not matter whether they appear before or after the copy directive. |