~ubuntu-branches/ubuntu/maverick/dbus/maverick-security

« back to all changes in this revision

Viewing changes to bus/dbus-daemon.1.in

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-27 13:06:32 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: james.westby@ubuntu.com-20100927130632-bqs145trvchd2lmf
Tags: 1.4.0-0ubuntu1
* New upstream release
 - Fixes https://bugs.freedesktop.org/show_bug.cgi?id=17754 Race condition in protected_change_timeout
 - Requested by various upstream KDE developers http://lists.kde.org/?t=128514970000004&r=1&w=2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.\" 
 
1
.\"
2
2
.\" dbus-daemon manual page.
3
3
.\" Copyright (C) 2003,2008 Red Hat, Inc.
4
4
.\"
12
12
[\-\-print-address[=DESCRIPTOR]] [\-\-print-pid[=DESCRIPTOR]] [\-\-fork]
13
13
 
14
14
.SH DESCRIPTION
15
 
 
16
15
\fIdbus-daemon\fP is the D-Bus message bus daemon. See
17
16
http://www.freedesktop.org/software/dbus/ for more information about
18
17
the big picture. D-Bus is first a library that provides one-to-one
20
19
application that uses this library to implement a message bus
21
20
daemon. Multiple programs connect to the message bus daemon and can
22
21
exchange messages with one another.
23
 
 
24
22
.PP
25
 
There are two standard message bus instances: the systemwide message bus 
26
 
(installed on many systems as the "messagebus" init service) and the 
 
23
There are two standard message bus instances: the systemwide message bus
 
24
(installed on many systems as the "messagebus" init service) and the
27
25
per-user-login-session message bus (started each time a user logs in).
28
 
\fIdbus-daemon\fP is used for both of these instances, but with 
 
26
\fIdbus-daemon\fP is used for both of these instances, but with
29
27
a different configuration file.
30
 
 
31
28
.PP
32
29
The \-\-session option is equivalent to
33
30
"\-\-config-file=@EXPANDED_SYSCONFDIR@/dbus-1/session.conf" and the \-\-system
34
31
option is equivalent to
35
 
"\-\-config-file=@EXPANDED_SYSCONFDIR@/dbus-1/system.conf". By creating 
 
32
"\-\-config-file=@EXPANDED_SYSCONFDIR@/dbus-1/system.conf". By creating
36
33
additional configuration files and using the \-\-config-file option,
37
34
additional special-purpose message bus daemons could be created.
38
 
 
39
 
.PP
40
 
The systemwide daemon is normally launched by an init script, 
41
 
standardly called simply "messagebus". 
42
 
 
43
 
.PP
44
 
The systemwide daemon is largely used for broadcasting system events, 
 
35
.PP
 
36
The systemwide daemon is normally launched by an init script,
 
37
standardly called simply "messagebus".
 
38
.PP
 
39
The systemwide daemon is largely used for broadcasting system events,
45
40
such as changes to the printer queue, or adding/removing devices.
46
 
 
47
41
.PP
48
 
The per-session daemon is used for various interprocess communication 
49
 
among desktop applications (however, it is not tied to X or the GUI 
 
42
The per-session daemon is used for various interprocess communication
 
43
among desktop applications (however, it is not tied to X or the GUI
50
44
in any way).
51
 
 
52
45
.PP
53
46
SIGHUP will cause the D-Bus daemon to PARTIALLY reload its
54
47
configuration file and to flush its user/group information caches. Some
63
56
Use the given configuration file.
64
57
.TP
65
58
.I "--fork"
66
 
Force the message bus to fork and become a daemon, even if 
 
59
Force the message bus to fork and become a daemon, even if
67
60
the configuration file does not specify that it should.
68
61
In most contexts the configuration file already gets this
69
62
right, though.
 
63
.I "--nofork"
 
64
Force the message bus not to fork and become a daemon, even if
 
65
the configuration file specifies that it should.
70
66
.TP
71
67
.I "--print-address[=DESCRIPTOR]"
72
 
Print the address of the message bus to standard output, or 
73
 
to the given file descriptor. This is used by programs that 
 
68
Print the address of the message bus to standard output, or
 
69
to the given file descriptor. This is used by programs that
74
70
launch the message bus.
75
71
.TP
76
72
.I "--print-pid[=DESCRIPTOR]"
77
 
Print the process ID of the message bus to standard output, or 
78
 
to the given file descriptor. This is used by programs that 
 
73
Print the process ID of the message bus to standard output, or
 
74
to the given file descriptor. This is used by programs that
79
75
launch the message bus.
80
76
.TP
81
77
.I "--session"
87
83
.TP
88
84
.I "--version"
89
85
Print the version of the daemon.
 
86
.TP
 
87
.I "--introspect"
 
88
Print the introspection information for all D-Bus internal interfaces.
 
89
.TP
 
90
.I "--address[=ADDRESS]"
 
91
Set the address to listen on. This option overrides the address
 
92
configured in the configuration file.
 
93
.TP
 
94
.I "--systemd-activation"
 
95
Enable systemd-style service activation. Only useful in conjunction
 
96
with the systemd system and session manager on Linux.
90
97
 
91
98
.SH CONFIGURATION FILE
92
99
 
93
100
A message bus daemon has a configuration file that specializes it
94
 
for a particular application. For example, one configuration 
95
 
file might set up the message bus to be a systemwide message bus, 
 
101
for a particular application. For example, one configuration
 
102
file might set up the message bus to be a systemwide message bus,
96
103
while another might set it up to be a per-user-login-session bus.
97
 
 
98
104
.PP
99
105
The configuration file also establishes resource limits, security
100
106
parameters, and so forth.
101
 
 
102
107
.PP
103
108
The configuration file is not part of any interoperability
104
109
specification and its backward compatibility is not guaranteed; this
105
110
document is documentation, not specification.
106
 
 
107
111
.PP
108
112
The standard systemwide and per-session message bus setups are
109
113
configured in the files "@EXPANDED_SYSCONFDIR@/dbus-1/system.conf" and
127
131
 
128
132
.TP
129
133
.I "<busconfig>"
130
 
 
 
134
 
131
135
.PP
132
136
Root element.
133
137
 
159
163
 
160
164
.TP
161
165
.I "<include>"
162
 
 
163
 
.PP  
 
166
 
 
167
.PP
164
168
Include a file <include>filename.conf</include> at this point.  If the
165
169
filename is relative, it is located relative to the configuration file
166
170
doing the including.
167
171
 
168
172
.PP
169
173
<include> has an optional attribute "ignore_missing=(yes|no)"
170
 
which defaults to "no" if not provided. This attribute 
171
 
controls whether it's a fatal error for the included file 
 
174
which defaults to "no" if not provided. This attribute
 
175
controls whether it's a fatal error for the included file
172
176
to be absent.
173
177
 
174
178
.TP
201
205
.PP
202
206
The user is changed after the bus has completed initialization.  So
203
207
sockets etc. will be created before changing user, but no data will be
204
 
read from clients before changing user. This means that sockets 
205
 
and PID files can be created in a location that requires root 
 
208
read from clients before changing user. This means that sockets
 
209
and PID files can be created in a location that requires root
206
210
privileges for writing.
207
211
 
208
212
.TP
209
213
.I "<fork>"
210
 
    
 
214
 
211
215
.PP
212
 
If present, the bus daemon becomes a real daemon (forks 
213
 
into the background, etc.). This is generally used 
 
216
If present, the bus daemon becomes a real daemon (forks
 
217
into the background, etc.). This is generally used
214
218
rather than the \-\-fork command line option.
215
219
 
216
220
.TP
217
221
.I "<keep_umask>"
218
 
    
 
222
 
219
223
.PP
220
224
If present, the bus daemon keeps its original umask when forking.
221
225
This may be useful to avoid affecting the behavior of child processes.
224
228
.I "<listen>"
225
229
 
226
230
.PP
227
 
Add an address that the bus should listen on. The 
228
 
address is in the standard D-Bus format that contains 
 
231
Add an address that the bus should listen on. The
 
232
address is in the standard D-Bus format that contains
229
233
a transport name plus possible parameters/options.
230
234
 
231
235
.PP
235
239
Example: <listen>tcp:host=localhost,port=1234</listen>
236
240
 
237
241
.PP
238
 
If there are multiple <listen> elements, then the bus listens 
239
 
on multiple addresses. The bus will pass its address to 
240
 
started services or other interested parties with 
241
 
the last address given in <listen> first. That is, 
 
242
If there are multiple <listen> elements, then the bus listens
 
243
on multiple addresses. The bus will pass its address to
 
244
started services or other interested parties with
 
245
the last address given in <listen> first. That is,
242
246
apps will try to connect to the last <listen> address first.
243
247
 
244
248
.PP
280
284
exist, then all known mechanisms are allowed.  If there are multiple
281
285
<auth> elements, all the listed mechanisms are allowed.  The order in
282
286
which mechanisms are listed is not meaningful.
283
 
    
 
287
 
284
288
.PP
285
289
Example: <auth>EXTERNAL</auth>
286
290
 
292
296
 
293
297
.PP
294
298
Adds a directory to scan for .service files. Directories are
295
 
scanned starting with the last to appear in the config file 
296
 
(the first .service file found that provides a particular 
 
299
scanned starting with the last to appear in the config file
 
300
(the first .service file found that provides a particular
297
301
service will be used).
298
302
 
299
303
.PP
300
304
Service files tell the bus how to automatically start a program.
301
 
They are primarily used with the per-user-session bus, 
 
305
They are primarily used with the per-user-session bus,
302
306
not the systemwide bus.
303
307
 
304
308
.TP
365
369
.nf
366
370
      "max_incoming_bytes"         : total size in bytes of messages
367
371
                                     incoming from a single connection
 
372
      "max_incoming_unix_fds"      : total number of unix fds of messages
 
373
                                     incoming from a single connection
368
374
      "max_outgoing_bytes"         : total size in bytes of messages
369
375
                                     queued up for a single connection
 
376
      "max_outgoing_unix_fds"      : total number of unix fds of messages
 
377
                                     queued up for a single connection
370
378
      "max_message_size"           : max size of a single message in
371
379
                                     bytes
372
 
      "service_start_timeout"      : milliseconds (thousandths) until 
 
380
      "max_message_unix_fds"       : max unix fds of a single message
 
381
      "service_start_timeout"      : milliseconds (thousandths) until
373
382
                                     a started service has to connect
374
383
      "auth_timeout"               : milliseconds (thousandths) a
375
384
                                     connection is given to
376
385
                                     authenticate
377
 
      "max_completed_connections"  : max number of authenticated connections  
 
386
      "max_completed_connections"  : max number of authenticated connections
378
387
      "max_incomplete_connections" : max number of unauthenticated
379
388
                                     connections
380
389
      "max_connections_per_user"   : max number of completed connections from
381
390
                                     the same user
382
391
      "max_pending_service_starts" : max number of service launches in
383
392
                                     progress at the same time
384
 
      "max_names_per_connection"   : max number of names a single 
 
393
      "max_names_per_connection"   : max number of names a single
385
394
                                     connection can own
386
 
      "max_match_rules_per_connection": max number of match rules for a single 
 
395
      "max_match_rules_per_connection": max number of match rules for a single
387
396
                                        connection
388
 
      "max_replies_per_connection" : max number of pending method 
 
397
      "max_replies_per_connection" : max number of pending method
389
398
                                     replies per connection
390
399
                                     (number of calls-in-progress)
391
 
      "reply_timeout"              : milliseconds (thousandths) 
392
 
                                     until a method call times out   
 
400
      "reply_timeout"              : milliseconds (thousandths)
 
401
                                     until a method call times out
393
402
.fi
394
403
 
395
404
.PP
403
412
up all connections on the systemwide bus.
404
413
 
405
414
.PP
406
 
Limits are normally only of interest on the systemwide bus, not the user session 
 
415
Limits are normally only of interest on the systemwide bus, not the user session
407
416
buses.
408
417
 
409
418
.TP
413
422
The <policy> element defines a security policy to be applied to a particular
414
423
set of connections to the bus. A policy is made up of
415
424
<allow> and <deny> elements. Policies are normally used with the systemwide bus;
416
 
they are analogous to a firewall in that they allow expected traffic 
 
425
they are analogous to a firewall in that they allow expected traffic
417
426
and prevent unexpected traffic.
418
427
 
419
428
.PP
420
 
Currently, the system bus has a default-deny policy for sending method calls 
 
429
Currently, the system bus has a default-deny policy for sending method calls
421
430
and owning bus names.  Everything else, in particular reply messages, receive
422
431
checks, and signals has a default allow policy.
423
432
 
430
439
 
431
440
.PP
432
441
The <policy> element has one of four attributes:
433
 
daemon.1.in
434
442
.nf
435
443
  context="(default|mandatory)"
436
444
  at_console="(true|false)"
452
460
.fi
453
461
 
454
462
.PP
455
 
Policies applied later will override those applied earlier, 
456
 
when the policies overlap. Multiple policies with the same 
457
 
user/group/context are applied in the order they appear 
 
463
Policies applied later will override those applied earlier,
 
464
when the policies overlap. Multiple policies with the same
 
465
user/group/context are applied in the order they appear
458
466
in the config file.
459
467
 
460
468
.TP
470
478
The possible attributes of these elements are:
471
479
.nf
472
480
   send_interface="interface_name"
473
 
   send_member="method_or_signal_name" 
474
 
   send_error="error_name" 
475
 
   send_destination="name" 
476
 
   send_type="method_call" | "method_return" | "signal" | "error" 
 
481
   send_member="method_or_signal_name"
 
482
   send_error="error_name"
 
483
   send_destination="name"
 
484
   send_type="method_call" | "method_return" | "signal" | "error"
477
485
   send_path="/path/name"
478
486
 
479
487
   receive_interface="interface_name"
480
 
   receive_member="method_or_signal_name" 
481
 
   receive_error="error_name" 
482
 
   receive_sender="name" 
 
488
   receive_member="method_or_signal_name"
 
489
   receive_error="error_name"
 
490
   receive_sender="name"
483
491
   receive_type="method_call" | "method_return" | "signal" | "error"
484
492
   receive_path="/path/name"
485
493
 
496
504
.PP
497
505
Examples:
498
506
.nf
499
 
   <deny send_interface="org.freedesktop.System" send_member="Reboot"/> 
500
 
   <deny receive_interface="org.freedesktop.System" receive_member="Reboot"/>
501
 
   <deny own="org.freedesktop.System"/>
 
507
   <deny send_destination="org.freedesktop.Service" send_interface="org.freedesktop.System" send_member="Reboot"/>
502
508
   <deny send_destination="org.freedesktop.System"/>
503
509
   <deny receive_sender="org.freedesktop.System"/>
504
510
   <deny user="john"/>
509
515
The <deny> element's attributes determine whether the deny "matches" a
510
516
particular action. If it matches, the action is denied (unless later
511
517
rules in the config file allow it).
512
 
 
513
518
.PP
514
519
send_destination and receive_sender rules mean that messages may not be
515
520
sent to or received from the *owner* of the given name, not that
516
521
they may not be sent *to that name*. That is, if a connection
517
522
owns services A, B, C, and sending to A is denied, sending to B or C
518
523
will not work either.
519
 
 
520
524
.PP
521
525
The other send_* and receive_* attributes are purely textual/by-value
522
526
matches against the given field in the message header.
523
 
 
524
527
.PP
525
528
"Eavesdropping" occurs when an application receives a message that
526
529
was explicitly addressed to a name the application does not own, or
527
530
is a reply to such a message. Eavesdropping thus only applies to
528
531
messages that are addressed to services and replies to such messages
529
532
(i.e. it does not apply to signals).
530
 
 
531
533
.PP
532
 
For <allow>, eavesdrop="true" indicates that the rule matches even 
533
 
when eavesdropping. eavesdrop="false" is the default and means that 
 
534
For <allow>, eavesdrop="true" indicates that the rule matches even
 
535
when eavesdropping. eavesdrop="false" is the default and means that
534
536
the rule only allows messages to go to their specified recipient.
535
 
For <deny>, eavesdrop="true" indicates that the rule matches 
 
537
For <deny>, eavesdrop="true" indicates that the rule matches
536
538
only when eavesdropping. eavesdrop="false" is the default for <deny>
537
 
also, but here it means that the rule applies always, even when 
 
539
also, but here it means that the rule applies always, even when
538
540
not eavesdropping. The eavesdrop attribute can only be combined with
539
541
send and receive rules (with send_* and receive_* attributes).
540
 
 
541
 
 
542
542
.PP
543
543
The [send|receive]_requested_reply attribute works similarly to the eavesdrop
544
544
attribute. It controls whether the <deny> or <allow> matches a reply
559
559
always, regardless of pending reply state.
560
560
 
561
561
.PP
562
 
user and group denials mean that the given user or group may 
 
562
user and group denials mean that the given user or group may
563
563
not connect to the message bus.
564
564
 
565
565
.PP
587
587
received" are evaluated separately.
588
588
 
589
589
.PP
590
 
Be careful with send_interface/receive_interface, because the 
 
590
Be careful with send_interface/receive_interface, because the
591
591
interface field in messages is optional.  In particular, do NOT
592
592
specify <deny send_interface="org.foo.Bar"/>!  This will cause
593
593
no-interface messages to be blocked for all services, which is
608
608
An <associate> element appears below an <selinux> element and
609
609
creates a mapping. Right now only one kind of association is possible:
610
610
.nf
611
 
   <associate own="org.freedesktop.Foobar" context="foo_t"/> 
 
611
   <associate own="org.freedesktop.Foobar" context="foo_t"/>
612
612
.fi
613
613
 
614
614
.PP
615
615
This means that if a connection asks to own the name
616
616
"org.freedesktop.Foobar" then the source context will be the context
617
 
of the connection and the target context will be "foo_t" - see the 
 
617
of the connection and the target context will be "foo_t" - see the
618
618
short discussion of SELinux below.
619
619
 
620
620
.PP
625
625
There's currently no way to set a default for owning any name, if
626
626
we add this syntax it will look like:
627
627
.nf
628
 
   <associate own="*" context="foo_t"/> 
 
628
   <associate own="*" context="foo_t"/>
629
629
.fi
630
630
If you find a reason this is useful, let the developers know.
631
631
Right now the default will be the security context of the bus itself.
677
677
as target, object class "dbus" and requested permission "send_msg".
678
678
 
679
679
.PP
680
 
If a security context is not available for a connection 
681
 
(impossible when using UNIX domain sockets), then the target 
 
680
If a security context is not available for a connection
 
681
(impossible when using UNIX domain sockets), then the target
682
682
context used is the context of the bus daemon itself.
683
 
There is currently no way to change this default, because we're 
684
 
assuming that only UNIX domain sockets will be used to 
685
 
connect to the systemwide bus. If this changes, we'll 
 
683
There is currently no way to change this default, because we're
 
684
assuming that only UNIX domain sockets will be used to
 
685
connect to the systemwide bus. If this changes, we'll
686
686
probably add a way to set the default connection context.
687
687
 
688
688
.PP
689
 
Second, any time a connection asks to own a name, 
690
 
the bus daemon will check permissions with the security 
 
689
Second, any time a connection asks to own a name,
 
690
the bus daemon will check permissions with the security
691
691
context of the connection as source, the security context specified
692
 
for the name in the config file as target, object 
 
692
for the name in the config file as target, object
693
693
class "dbus" and requested permission "acquire_svc".
694
694
 
695
695
.PP
696
 
The security context for a bus name is specified with the 
 
696
The security context for a bus name is specified with the
697
697
<associate> element described earlier in this document.
698
 
If a name has no security context associated in the 
699
 
configuration file, the security context of the bus daemon 
 
698
If a name has no security context associated in the
 
699
configuration file, the security context of the bus daemon
700
700
itself will be used.
701
701
 
702
702
.SH DEBUGGING
704
704
.PP
705
705
If you're trying to figure out where your messages are going or why
706
706
you aren't getting messages, there are several things you can try.
707
 
 
708
707
.PP
709
708
Remember that the system bus is heavily locked down and if you
710
709
haven't installed a security policy file to allow your message
711
710
through, it won't work. For the session bus, this is not a concern.
712
 
 
713
711
.PP
714
712
The simplest way to figure out what's happening on the bus is to run
715
713
the \fIdbus-monitor\fP program, which comes with the D-Bus
716
714
package. You can also send test messages with \fIdbus-send\fP. These
717
715
programs have their own man pages.
718
 
 
719
716
.PP
720
717
If you want to know what the daemon itself is doing, you might consider
721
 
running a separate copy of the daemon to test against. This will allow you 
722
 
to put the daemon under a debugger, or run it with verbose output, without 
 
718
running a separate copy of the daemon to test against. This will allow you
 
719
to put the daemon under a debugger, or run it with verbose output, without
723
720
messing up your real session and system daemons.
724
 
 
725
721
.PP
726
 
To run a separate test copy of the daemon, for example you might open a terminal 
727
 
and type: 
 
722
To run a separate test copy of the daemon, for example you might open a terminal
 
723
and type:
728
724
.nf
729
725
  DBUS_VERBOSE=1 dbus-daemon --session --print-address
730
726
.fi
731
 
 
732
727
.PP
733
728
The test daemon address will be printed when the daemon starts. You will need
734
 
to copy-and-paste this address and use it as the value of the 
 
729
to copy-and-paste this address and use it as the value of the
735
730
DBUS_SESSION_BUS_ADDRESS environment variable when you launch the applications
736
 
you want to test. This will cause those applications to connect to your 
 
731
you want to test. This will cause those applications to connect to your
737
732
test bus instead of the DBUS_SESSION_BUS_ADDRESS of your real session bus.
738
 
 
739
733
.PP
740
734
DBUS_VERBOSE=1 will have NO EFFECT unless your copy of D-Bus
741
735
was compiled with verbose mode enabled. This is not recommended in
742
736
production builds due to performance impact. You may need to rebuild
743
737
D-Bus if your copy was not built with debugging in mind. (DBUS_VERBOSE
744
 
also affects the D-Bus library and thus applications using D-Bus; it may 
 
738
also affects the D-Bus library and thus applications using D-Bus; it may
745
739
be useful to see verbose output on both the client side and from the daemon.)
746
 
 
747
740
.PP
748
741
If you want to get fancy, you can create a custom bus
749
742
configuration for your test bus (see the session.conf and system.conf
751
744
would allow you to specify a different directory for .service files,
752
745
for example.
753
746
 
754
 
 
755
747
.SH AUTHOR
756
748
See http://www.freedesktop.org/software/dbus/doc/AUTHORS
757
749