Specifications
CHAPTER 5. IMPLEMENTATION 30
the first purposed hole in the deny policy: it allows all processes to connect to the system
bus. Further, the D-BUS daemon parses additional configuration files located in the directory
/etc/dbus-1/system.d/. System daemons utilizing D-BUS for interprocess communication
store their respective D-BUS configuration in this directory.
A D-BUS service is the basic requirement for interprocess communication using D-BUS.
Arbitrary D-BUS interfaces can be applied to a D-BUS service once it is created. Sending
and receiving messages on a D-BUS interface can be allowed or denied for certain users.
The Input Abstraction Layer creates the service com.novell.Ial and the D-BUS interface
(com.novell.Ial.Event) in order to implement the abstract output interface. The Input
Abstraction Layer’s D-BUS configuration file /etc/dbus-1/system.d/ial.conf contains the
following data:
<policy context="default">
<deny own="com.novell.Ial"/>
<deny send_interface="com.novell.Ial.Event"/>
<allow receive_interface="com.novell.Ial.Event"/>
</policy>
<policy user="root">
<allow own="com.novell.Ial"/>
<allow send_interface="com.novell.Ial.Event"/>
<allow receive_interface="com.novell.Ial.Event"/>
</policy>
First, the policy applies to processes owned by all users but root: these processes are not
allowed to own the service com.novell.Ial and they are not allowed to send to the interface
com.novell.Ial.Event. However, they are allowed to receive messages from the interface.
Secondly, a policy for processes owned by the user root is defined: these processes are allowed
to create the service and they are allowed to send and receive from the event interface.
Starting the D-BUS daemon does not invoke the creation of the service or the interface.
The D-BUS configuration only describes the permissions applied to services and interfaces. In
the case of the Input Abstraction Layer, both the service and the interface are created at the
daemon’s start (Section §5.4).
Programming Interface
The Input Abstraction Layer’s library provides three wrapper functions for the interprocess
communication: ial dbus connect(), event send() and event receive(). The daemon
utilizes ial dbus connect() to establish a connection to the D-BUS system message bus.
The function event send() is used by the Input Abstraction Layer’s modules to send input
events to the abstract output interface. External applications can simplify the receiving of
abstract input events by using the library’s function event receive().
The connection to the D-BUS system message bus is represented as a global variable of the
daemon. Once established, it is used for all further interprocess communication. The function
ial dbus connect() is defined in libial.c. The following source code is an excerpt of this
function: