After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696109 - [review] dcbw/duid-fixes: fix crash when machine-id isn't present
[review] dcbw/duid-fixes: fix crash when machine-id isn't present
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-03-18 21:52 UTC by Dan Williams
Modified: 2013-03-20 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't warn if we don't have an IPv6 config when starting DHCPv6 (1.09 KB, patch)
2013-03-18 21:53 UTC, Dan Williams
none Details | Review
Look harder for machine-id and fall back to generated one if missing (3.64 KB, patch)
2013-03-18 21:54 UTC, Dan Williams
none Details | Review

Description Dan Williams 2013-03-18 21:52:41 UTC
Turns out machine-id doesn't have to be in /etc, if you're not running systemd or you're running an older distro, it might be in /var/lib/dbus.  Look for the machine-id in both locations, and if there really, really isn't a machine-id, just make something up from /dev/urandom.
Comment 1 Dan Williams 2013-03-18 21:53:32 UTC
Created attachment 239208 [details] [review]
Don't warn if we don't have an IPv6 config when starting DHCPv6
Comment 2 Dan Williams 2013-03-18 21:54:31 UTC
Created attachment 239209 [details] [review]
Look harder for machine-id and fall back to generated one if missing
Comment 3 Colin Walters 2013-03-19 00:05:47 UTC
Review of attachment 239209 [details] [review]:

Note there is dbus_get_local_machine_id() for libdbus users; an equivalent is currently private in GLib but could be made public.
Comment 4 Jiri Klimes 2013-03-19 07:44:25 UTC
Review of attachment 239208 [details] [review]:

Looks good.
Comment 5 Jiri Klimes 2013-03-19 07:49:44 UTC
Review of attachment 239209 [details] [review]:

Looks good.
Comment 6 Pavel Simerda 2013-03-19 09:01:23 UTC
Review of attachment 239209 [details] [review]:

Looks reasonable for fixing the actual problem.

As a sidenote, I would expect the machine id to come from hardware (which is unfortunately not the case) and then be used unhashed for DUID. I don't think we want to do anything about the hardware part right now and would rather wait for a service that provices us with something like that. But I'm curious why is machine-id considered so sensitive.
Comment 7 Dan Winship 2013-03-19 12:24:59 UTC
(In reply to comment #3)
> Note there is dbus_get_local_machine_id() for libdbus users; an equivalent is
> currently private in GLib but could be made public.

g_get_machine_id() seems like a logical addition to gutils
Comment 8 Dan Williams 2013-03-20 16:26:48 UTC
(In reply to comment #7)
> (In reply to comment #3)
> > Note there is dbus_get_local_machine_id() for libdbus users; an equivalent is
> > currently private in GLib but could be made public.
> 
> g_get_machine_id() seems like a logical addition to gutils

Yeah, we'd switch to that if it was available.
Comment 9 Dan Williams 2013-03-20 16:28:35 UTC
pushed, thanks all