GNOME Bugzilla – Bug 687921
tries to use OpenBSD credentials on FreeBSD
Last modified: 2013-11-11 17:18:18 UTC
gdm interprets GUnixCredentials to get the pid. In an ideal world, it wouldn't have to do that itself (Bug #687920). But until then, there are a couple of problems with the FreeBSD case: #elif defined (__FreeBSD__) native_credentials = g_credentials_get_native (credentials, G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED); pid = (GPid) ((struct cmsgcred *) native_credentials)->cmcred_pid; 1) ideally it should check for defined (__FreeBSD__) || defined (__FreeBSD_kernel__) to support Debian GNU/kFreeBSD the same way as native FreeBSD (see Bug #649302) 2) I don't think G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED is the right type of credential to be using here :-) This suggests that nobody has actually ever tested this code on (k)FreeBSD. I'll ask the kFreeBSD people to try it out.
This is Debian #692739: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=692739
Thanks, I definitely didn't test that code. Feel free to commit any tested patch you come up with.
For the GNOME 3.8 cycle, this can now use g_credentials_get_unix_pid(), which I added to GLib (Bug #687920), on all platforms.
Created attachment 259408 [details] [review] don;' try to use OpenBSD credentials on FreeBSD Hi. This bug is still present in 3.10.X. Here's a git formatted patch. It is pretty trivial so if no one objects within the next 24h, I will push it. Ray, is that OK with you?
*** Bug 711765 has been marked as a duplicate of this bug. ***
Created attachment 259511 [details] [review] Use g_credentials_get_unix_pid() instead of home baked function This function is available in GIO since 2.36 Thanks to Petr Salinger <Petr.Salinger@seznam.cz> for the patch Debian Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=692739
I'm not a gdm maintainer, but both those patches look good to me, assuming they work. Has someone tested those on (k)FreeBSD?
(In reply to comment #7) > I'm not a gdm maintainer, but both those patches look good to me, assuming they > work. Laurent's patch is obviously much better than mine. > Has someone tested those on (k)FreeBSD? I successfully tested this on OpenBSD and there is no doubt it works on FreeBSD as well. Ray, any chance we can push this please?
Comment on attachment 259511 [details] [review] Use g_credentials_get_unix_pid() instead of home baked function (i'll push before next release if no one beats me to it)
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. From 87f181489983bb8d640a6a227caa8cbfc0fff853 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville <bigon@bigon.be> Date: Sun, 10 Nov 2013 23:21:37 +0000 Subject: Use g_credentials_get_unix_pid() instead of home baked function This function is available in GIO since 2.36 Thanks to Petr Salinger <Petr.Salinger@seznam.cz> for the patch Debian Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=692739 https://bugzilla.gnome.org/show_bug.cgi?id=687921