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 687921 - tries to use OpenBSD credentials on FreeBSD
tries to use OpenBSD credentials on FreeBSD
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
: 711765 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-11-08 12:16 UTC by Simon McVittie
Modified: 2013-11-11 17:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
don;' try to use OpenBSD credentials on FreeBSD (1.17 KB, patch)
2013-11-10 09:39 UTC, Antoine Jacoutot
none Details | Review
Use g_credentials_get_unix_pid() instead of home baked function (3.52 KB, patch)
2013-11-10 23:29 UTC, Laurent Bigonville
accepted-commit_now Details | Review

Description Simon McVittie 2012-11-08 12:16:36 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.
Comment 1 Simon McVittie 2012-11-08 14:16:35 UTC
This is Debian #692739: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=692739
Comment 2 Ray Strode [halfline] 2012-11-08 15:58:05 UTC
Thanks, I definitely didn't test that code. Feel free to commit any tested patch you come up with.
Comment 3 Simon McVittie 2013-01-22 12:50:17 UTC
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.
Comment 4 Antoine Jacoutot 2013-11-10 09:39:03 UTC
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?
Comment 5 Gustau Pérez i Querol 2013-11-10 14:06:03 UTC
*** Bug 711765 has been marked as a duplicate of this bug. ***
Comment 6 Laurent Bigonville 2013-11-10 23:29:08 UTC
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
Comment 7 Simon McVittie 2013-11-11 12:53:23 UTC
I'm not a gdm maintainer, but both those patches look good to me, assuming they work.

Has someone tested those on (k)FreeBSD?
Comment 8 Antoine Jacoutot 2013-11-11 14:22:42 UTC
(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 9 Ray Strode [halfline] 2013-11-11 16:35:15 UTC
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)
Comment 10 Laurent Bigonville 2013-11-11 17:18:18 UTC
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