简体   繁体   中英

Linux DBus communication

In Linux D-Bus:

  1. What prevents a process A from directly talking to a process B ? Why does a method call message have to go through the bus daemon process ?

  2. Why does <policy> section in the daemon's config file have an option to allow / deny owning a bus name ?

  3. If a process can use matching rules to potentially monitor any message passing through the bus daemon process, can two communicating processes express any restriction in any way such that no other process can observe their traffic ?

  4. Why is it said in documentation that a given bus name will always refer the same application ? - Will this be true after machine reboots ?

For 1: My current understanding is that for processes A and B to talk to each other, both must register a bus name with the bus daemon. So is the only thing preventing A from talking to B is that it may know B's bus name and not be able to locate it on the machine ?

1 - nothing. It's just much simpler to use bus ( both services and clients are tcp clients, not servers, easier to configure, manage names etc etc)

2 - to make sure that service behind the name is one you trust. Otherwise malicious code might request name and pretend to be that service.

3 - IMO yes ( though not exactly sure )

4 - name <-> connection. One process can own multiple names. Automatic names are not re-assigned to new connections ( if you reconnect it's always new name ) After reboot you can see same names again, but between reboots you can assume no same name assigned to two different connections over time ( = race conditions )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM