source: trunk/dports/gnome/gdm/files/patch-use-g_credentials_get_unix_pid.diff @ 117867

Last change on this file since 117867 was 117867, checked in by devans@…, 6 years ago

gdm: use upstream patch rather than our own in daemon/gdm-session.c, move our patches from configure to configure.ac, update m4/intltool.m4 and autoreconf to fix intltool configuration, increment revision.

File size: 3.4 KB
  • configure.ac

    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
    ---
    diff --git a/configure.ac b/configure.ac
    index bffc88b..0008c62 100644
    dnl --------------------------------------------------------------------------- 
    6363dnl - Dependencies
    6464dnl ---------------------------------------------------------------------------
    6565
    66 GLIB_REQUIRED_VERSION=2.35.0
     66GLIB_REQUIRED_VERSION=2.36.0
    6767GTK_REQUIRED_VERSION=2.91.1
    6868LIBCANBERRA_GTK_REQUIRED_VERSION=0.4
    6969ACCOUNTS_SERVICE_REQUIRED_VERSION=0.6.12
  • daemon/gdm-session.c

    diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
    index d74bed6..b2d931d 100644
    allow_worker_function (GDBusAuthObserver *observer, 
    970970        return FALSE;
    971971}
    972972
    973 static GPid
    974 credentials_get_unix_pid (GCredentials *credentials)
    975 {
    976         GPid pid = 0;
    977         gpointer native_credentials = NULL;
    978 
    979 #ifdef __linux__
    980         native_credentials = g_credentials_get_native (credentials, G_CREDENTIALS_TYPE_LINUX_UCRED);
    981         pid = (GPid) ((struct ucred *) native_credentials)->pid;
    982 #elif defined (__FreeBSD__)
    983         native_credentials = g_credentials_get_native (credentials, G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED);
    984         pid = (GPid) ((struct cmsgcred *) native_credentials)->cmcred_pid;
    985 #elif defined (__OpenBSD__)
    986         native_credentials = g_credentials_get_native (credentials, G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED);
    987         pid = (GPid) ((struct sockpeercred *) native_credentials)->pid;
    988 #else
    989 #error "platform not supported, need mechanism to detect pid of connected process"
    990 #endif
    991 
    992         return pid;
    993 }
    994 
    995973static gboolean
    996974register_worker (GdmDBusWorkerManager  *worker_manager_interface,
    997975                 GDBusMethodInvocation *invocation,
    register_worker (GdmDBusWorkerManager *worker_manager_interface, 
    1021999                                    connection_node);
    10221000
    10231001        credentials = g_dbus_connection_get_peer_credentials (connection);
    1024         pid = credentials_get_unix_pid (credentials);
     1002        pid = g_credentials_get_unix_pid (credentials, NULL);
    10251003
    10261004        conversation = find_conversation_by_pid (self, (GPid) pid);
    10271005
    on_outside_connection_closed (GDBusConnection *connection, 
    14791457                            connection);
    14801458
    14811459        credentials = g_dbus_connection_get_peer_credentials (connection);
    1482         pid_of_client = credentials_get_unix_pid (credentials);
     1460        pid_of_client = g_credentials_get_unix_pid (credentials, NULL);
    14831461
    14841462        g_signal_emit (G_OBJECT (self),
    14851463                       signals [CLIENT_DISCONNECTED],
    handle_connection_from_outside (GDBusServer *server, 
    15311509        }
    15321510
    15331511        credentials = g_dbus_connection_get_peer_credentials (connection);
    1534         pid_of_client = credentials_get_unix_pid (credentials);
     1512        pid_of_client = g_credentials_get_unix_pid (credentials, NULL);
    15351513
    15361514        g_signal_emit (G_OBJECT (self),
    15371515                       signals [CLIENT_CONNECTED],
Note: See TracBrowser for help on using the repository browser.