retitle 631968 gnome-terminal: fails to start on kFreeBSD
clone 631968 -1 -2
retitle -1 gnome-terminal: should recommend dbus-x11
severity -1 important
retitle -2 gnome-terminal: no error message when unable to join D-Bus session
severity -2 important
thanks
On Mon, 22 Oct 2012 at 10:13:35 +0100, Simon McVittie wrote:
On 05/07/12 01:05, Simon McVittie wrote:
You don't need all of GNOME, but you do need a D-Bus session.
... which will automatically be started (either from Xsession.d or on-demand)
if you have dbus-x11. Since gnome-terminal needs a D-Bus session, it ought
to have at least a Recommends: on dbus-x11 - this is clone -1 of this bug.
In a previous mail, I wrote:
[having no error message] is an unhelpful implementation, though - it
should complain to stderr with g_printerr() before dying, or fall back
to non-single-instance.
This is clone -2.
I wonder whether this is to do with GDBus not supporting credentials-passing
for authentication on kFreeBSD. It does support credentials-passing on
FreeBSD, and it's the same kernel, so the same code ought to work; please
try the attached patch for src:glib2.0? If successful, this can be tagged
'patch' and reassigned to libglib2.0-0.
This is the original bug 631968. Sorry, I didn't attach the patch as I'd
intended: here it is.
S
From 7c02d526880e9a684a6b2f0c72f1b5779c1ae481 Mon Sep 17 00:00:00 2001
From: Simon McVittie s...@debian.org
Date: Sun, 21 Oct 2012 23:38:31 +0100
Subject: [PATCH] Use the FreeBSD credentials-passing code on Debian
GNU/kFreeBSD
The __FreeBSD__ macro means we have both a FreeBSD kernel and FreeBSD
libc, which isn't the case on GNU/kFreeBSD (GNU libc and userland on
the FreeBSD kernel), so it predefines a different macro. The kernel
is what actually matters for credentials-passing, though.
---
gio/gcredentials.c| 18 +-
gio/gunixcredentialsmessage.c | 12 ++--
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/gio/gcredentials.c b/gio/gcredentials.c
index 3a98333..2827c45 100644
--- a/gio/gcredentials.c
+++ b/gio/gcredentials.c
@@ -22,7 +22,7 @@
#include config.h
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include sys/types.h
#include sys/socket.h
#include string.h
@@ -88,7 +88,7 @@ struct _GCredentials
#ifdef __linux__
struct ucred native;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
struct cmsgcred native;
#elif defined(__OpenBSD__)
struct sockpeercred native;
@@ -140,7 +140,7 @@ g_credentials_init (GCredentials *credentials)
credentials-native.pid = getpid ();
credentials-native.uid = geteuid ();
credentials-native.gid = getegid ();
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
memset (credentials-native, 0, sizeof (struct cmsgcred));
credentials-native.cmcred_pid = getpid ();
credentials-native.cmcred_euid = geteuid ();
@@ -202,7 +202,7 @@ g_credentials_to_string (GCredentials *credentials)
g_string_append_printf (ret, gid=% G_GINT64_FORMAT ,, (gint64) credentials-native.gid);
if (ret-str[ret-len - 1] == ',')
ret-str[ret-len - 1] = '\0';
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
g_string_append (ret, freebsd-cmsgcred:);
if (credentials-native.cmcred_pid != -1)
g_string_append_printf (ret, pid=% G_GINT64_FORMAT ,, (gint64) credentials-native.cmcred_pid);
@@ -260,7 +260,7 @@ g_credentials_is_same_user (GCredentials *credentials,
#ifdef __linux__
if (credentials-native.uid == other_credentials-native.uid)
ret = TRUE;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
if (credentials-native.cmcred_euid == other_credentials-native.cmcred_euid)
ret = TRUE;
#elif defined(__OpenBSD__)
@@ -316,7 +316,7 @@ g_credentials_get_native (GCredentials *credentials,
{
ret = credentials-native;
}
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
if (native_type != G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED)
{
g_warning (g_credentials_get_native: Trying to get credentials of type %d but only
@@ -377,7 +377,7 @@ g_credentials_set_native (GCredentials *credentials,
{
memcpy (credentials-native, native, sizeof (struct ucred));
}
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
if (native_type != G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED)
{
g_warning (g_credentials_set_native: Trying to set credentials of type %d
@@ -435,7 +435,7 @@ g_credentials_get_unix_user (GCredentials*credentials,
#ifdef __linux__
ret = credentials-native.uid;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
ret = credentials-native.cmcred_euid;
#elif defined(__OpenBSD__)
ret = credentials-native.uid;
@@ -482,7 +482,7 @@