Bug 29618 - Add DBUS_MACHINE_UUID_FILE enviroment variable
Summary: Add DBUS_MACHINE_UUID_FILE enviroment variable
Status: RESOLVED MOVED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.5
Hardware: All All
: low enhancement
Assignee: D-Bus Maintainers
QA Contact: D-Bus Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-17 10:12 UTC by Louis-Francis Ratté-Boulianne
Modified: 2018-10-12 21:07 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Add DBUS_MACHINE_UUID_FILE enviroment variable (589 bytes, application/octet-stream)
2010-08-17 10:12 UTC, Louis-Francis Ratté-Boulianne
Details
Add DBUS_MACHINE_UUID_FILE enviroment variable or use gethostuuid() if available (3.39 KB, patch)
2010-08-19 11:06 UTC, Louis-Francis Ratté-Boulianne
Details | Splinter Review
Add DBUS_MACHINE_UUID_FILE enviroment variable or use gethostuuid() if available (2.27 KB, patch)
2010-08-19 11:08 UTC, Louis-Francis Ratté-Boulianne
Details | Splinter Review

Description Louis-Francis Ratté-Boulianne 2010-08-17 10:12:59 UTC
Created attachment 37923 [details]
Add DBUS_MACHINE_UUID_FILE enviroment variable

Right now, you can't package dbus into another application bundle (on OSX) because the dbus-daemon is still looking for the machine uuid file at the path set at compile time.

I'm attaching a patch that allows to set that path at runtime using an environment variable.
Comment 1 Havoc Pennington 2010-08-18 15:10:00 UTC
an even better fix might use some nicer mac-specific mechanism instead of the file; I bet mac already has some kind of machine uuid thing?

though this fix seems fine. the patch should use _dbus_getenv() instead of getenv(), is the only nitpick I see.
Comment 2 Louis-Francis Ratté-Boulianne 2010-08-19 11:05:11 UTC
Before OSX 10.6, there was no (easy) way to get machine UUID (called hardware UUID in OSX world). I added it as an option if function gethostuuid() is found. If not, we still try to use the environment variable or the default file name.

I fixed getenv().
Comment 3 Louis-Francis Ratté-Boulianne 2010-08-19 11:06:22 UTC
Created attachment 37989 [details] [review]
Add DBUS_MACHINE_UUID_FILE enviroment variable or use gethostuuid() if available
Comment 4 Louis-Francis Ratté-Boulianne 2010-08-19 11:08:53 UTC
Created attachment 37990 [details] [review]
 Add DBUS_MACHINE_UUID_FILE enviroment variable or use gethostuuid() if available
Comment 5 Simon McVittie 2011-01-07 07:54:46 UTC
(In reply to comment #1)
> an even better fix might use some nicer mac-specific mechanism instead of the
> file; I bet mac already has some kind of machine uuid thing?

Bug #23679 is the equivalent of this for Linux, which it seems Thiago doesn't like.
Comment 6 Simon McVittie 2011-11-03 09:42:24 UTC
Bug #42531 (Android support) has a related patch.
Comment 7 Simon McVittie 2011-11-09 07:29:25 UTC
(In reply to comment #0)
> Created attachment 37923 [details]
> Add DBUS_MACHINE_UUID_FILE enviroment variable

As noted on Bug #42531, I think this is not necessarily safe: if you run a privileged (setuid, etc.) process, and specify a filename that it can read but you can't, then this can disclose the contents of that file.

Having the machine UUID itself (as hex) as an environment variable value seems safer, from the "what's the worst that can happen?" point of view: the worst you can do to a privileged process is to trick it into thinking it's not on the same machine as the dbus-daemon.
Comment 8 GitLab Migration User 2018-10-12 21:07:10 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/30.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.