Re: 'Machine ID' underspecified?

Zeeshan Ali <[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <CAAa3hFPY35Fc3qiDZ6V3uGYopO+NS9Re4JJ=Z8_=S=v4Mbqkbg@mail.gmail.com>
Hi,

On Sun, 6 Dec 2020 at 19:07, Filipe Laíns <[email protected]> wrote:
>
> On Sun, 2020-12-06 at 16:31 +0100, Zeeshan Ali wrote:
> > Hello,
> >
> > On Sun, 6 Dec 2020 at 15:57, Filipe Laíns <[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.

Right, I see your point. FWIW the spec does admit that it's not always
possible to implement persistence of UUID across reboots:

"This UUID must be the same for all processes on a single system at
least until that system next reboots. It should be the same across
reboots if possible, but this is not always possible to implement and
is not guaranteed."

-- 
Regards,

Zeeshan Ali
_______________________________________________
dbus mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dbus
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.