Specifications
CHAPTER 4. DESIGN AND ARCHITECTURE 23
AllowOverride and Order are options for the directive Directory with their corresponding
values.
<Directory "/usr/local/htdocs">
AllowOverride All
Order deny, allow
</Directory>
Samba uses a configuration file format which was derived from the .ini files used by
Microsoft Windows 3.1. This format is divided into sections. Each section has one or more
options with a corresponding value. The following example shows the sections [global] and
[share1]. Two options (workgroup and netbios name) are defined for the section [global],
for section share1, only one option (path) is supplied.
[global]
workgroup = WORKGROUPNAME
netbios name = NETBIOSNAME
[share1]
path = /home
The parsing of the configuration file can be shifted by using an external library, such as
the XML C parser Libxml2 (libxml2). Libxml2 implements a decent number of standards like
XML, XPath, HTML4 and others. A complete list can be obtained on the project home page
located at http://www.xmlsoft.org/. Furthermore, Libxml2 is available for many platforms.
A notional example for a configuration file format using XML would be:
<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration>
<!-- node with numeric value -->
<num_node>1</num_node>
<!-- node with string value -->
<alpha_node>string</alpha_node>
<!-- complex node with attribute and children nodes -->
<complex_node attribute=attribute_value>
<node1>yes</node1>
<node2>10</node2>
</complex_node>
</configuration>
The second approach to configure the Input Abstraction Layer daemon are command line
options. It is common to use the command line parser getopt(3) to implement the com-
mand line interface. Since the options defined in the configuration file interleave with options
passed by the command line, it is necessary to specify which source for the daemon options
is more significant. Command line options are convenient for setting specific daemon options
temporarily—e.g. to test a feature or to change the debug level. Based on this fact, it is
sensible to determine the sequence for the evaluation of options: