Bug 18013

Summary: dbus autolaunch fails on OS X 10.5 because of '/' characters in $DISPLAY
Product: dbus Reporter: dpj
Component: coreAssignee: D-Bus Maintainers <dbus>
Status: RESOLVED MOVED QA Contact: D-Bus Maintainers <dbus>
Severity: normal    
Priority: low CC: chengwei.yang.cn, msniko14
Version: 1.5Keywords: patch
Hardware: All   
OS: All   
Whiteboard: review?
i915 platform: i915 features:
Attachments: Patches dbus-launch-x11.c to replace '/' characters with '_' in the session filename.

Description dpj 2008-10-11 04:16:59 UTC
Created attachment 19585 [details] [review]
Patches dbus-launch-x11.c to replace '/' characters with '_' in the session filename.

dbus autolaunch fails on OS X 10.5 Leopard because the DISPLAY environment variable contains '/' forward slash characters. 

dbus-launch fails when it tries to write the session file, the name of which contains '/' characters, so the fopen() call fails as it tries to create directories.

I've made a patch for dbus-launch-x11.c which changes all '/' characters to '_' characters.
Comment 1 Mike McQuaid 2010-12-30 03:22:19 UTC
Is this still necessary now we have launchd patches included?
Comment 2 Jonas Bähr 2010-12-30 05:07:30 UTC
No application should relay on $DISPLAY, as it's not portable. Although it's possible that some applications ported to OS-X use X11 for the GUI, they shouldn't use it to start dbus. In fact, no client should do this directly but rather use the dbus client lib which does handle this the correct way (that is launchd on OS-X).

Anyways, this patch doesn't seem to harm but it fixes deprecated stuff. Unless of course if other X11 systems may also have a slash in their $DISPLAY env var, but in this case this is not an OS-X bug.
Comment 3 Simon McVittie 2014-09-11 09:39:19 UTC
If use of X11 to coordinate dbus-daemon startup under OS X is undesired, I would recommend that anyone building dbus on OS X (Fink, MacPorts, etc.) should not enable the optional X11 support.
Comment 4 GitLab Migration User 2018-10-12 21:04:41 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/8.

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.