'Machine ID' underspecified?

Filipe Laíns lains at archlinux.org
Sun Dec 6 18:07:11 UTC 2020


On Sun, 2020-12-06 at 16:31 +0100, Zeeshan Ali wrote:
> Hello,
> 
> On Sun, 6 Dec 2020 at 15:57, Filipe Laíns <lains at archlinux.org> wrote:
> > 
> > On Sun, 2020-12-06 at 13:03 +1300, Lawrence D'Oliveiro wrote:
> > > On Sat, 05 Dec 2020 15:34:31 +0000, Thomas Kluyver wrote:
> > > 
> > > > The standard org.freedesktop.DBus.Peer interface
> > > > (
> > > > https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-peer
> > > > ) defines a GetMachineId method. The spec says that this returns a
> > > > UUID which "must be the same for all processes on a single system at
> > > > least until that system next reboots."
> > > > 
> > > > ...
> > > > 
> > > > I looked into the code for the reference implementation. On Unix, it
> > > > gets the ID from a compile-time configurable file
> > > > (/var/lib/dbus/machine-id on my system) with a hardcoded fallback to
> > > > /etc/machine-id:
> > > 
> > > Seems like libdbus is going further than the spec requires, by defining
> > > a value that persists across reboots. That doesn’t seem to be necessary
> > > for the example use cases described in the spec.
> > 
> > Right, but the problem is that the spec forces this UUID to be the same for
> > all
> > processes but does not defines how that processes should get that ID.
> > So, how should a client exposing an interface get the correct UUID to send
> > if
> > there is no standard way to do it? In my implementation I could just mimic
> > what
> > libdbus does, but that could effectively change anytime, and might not be
> > what
> > other implementations do.
> 
> But is that really an issue? Is there a use case of peers connecting
> to more than 1 broker? As long as the ID is fixed for the same machine
> for the same broker, should there be any problems?
> 
> > 
> > Cheers,
> > Filipe Laíns

The problem isn't the ID given by the broker, but by the ID given by the
processes exposing interfaces. These processes can be running on a different
machine than the broker, so they can't ask the broker for the machine ID, for
eg.

See https://github.com/FFY00/dbus-objects/commit/2c5f19ad3ef26c8bae163985a56e4dc8a35482cb#r44622287

The spec must define a way for the machine prefix to be fetched/calculated,
otherwise it is an implementation detail and this spec feature does not hold any
value at all.

For my implementation, I just won't implement this method.

Cheers,
Filipe Laíns
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20201206/00571ef6/attachment.sig>


More information about the dbus mailing list