Re: 'Machine ID' underspecified?

Filipe Laíns <lains-fd97jBR+K/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Organization Archlinux
Message-ID <[email protected]>
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-fd97jBR+K/[email protected]> 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

_______________________________________________
dbus mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dbus
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE0jW0leqs33gyftiw+JPGdIFqqV0FAl/NHcoACgkQ+JPGdIFq
qV0Mqw//WN0BGUQn4CccuKxRGR8YkcBunoEDi6LtH7w5XhenodAxO87U2MHjDW3C
j6FM8boR6UAJkKVE8+1D63C2lFSWnpn8wuxZMHnPZXGh/XJHna0KV0uIh0QC5ndm
GQg+NuQpOzrKc5ocgo6FDnwSFC8CP4A3iwT3Uq+8moF4VY2nrukPy4zsTOCUPzZ8
qhwmCfr3FwegeDu40tCwJQTK3opnX8E+VKpnAFsOVDPs/lRaCu+aQvQeUYzFt7c2
P6xdv1pIDl8a1V8+iKAgFZzzJ/YWbuAlm7R9eqbrQwyt7yc5GLWg8Xqeg+4FvdPv
jvXBfPrTAJODKzTNxon6uADXQOdeLz9bdT7oklj5wolUOxorVxx+Dzc5RIO8YgvI
eiqRpTQlO7varF9wk+hk6O6idWb9LpohZRRg5ala8vLPj7W0al3hJTkTSZk3Fd2a
VcbsTxbytPCgDIiSLSEwpbQcNaLDAflhM3thtxMEvccgX2LroVsG9zw0stI7CZeq
Jjhg0MHjtYgwyrhGYYVg1Q7NoywyNlJnaC6QoL89Z2fWW5foW+akhnArs7ENJAJM
z/up1HfAiFWAGC8XZf2l2Dt4d3gRdws3HlGEvQL05kEXyUQs7UrDpzz+NauaOO0X
jdNYX+IB+M5r1SW8r0Ko1IX2AU+UAvFTiZCcMAyZK2aXahXhtow=
=T2cX
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.