From owner-svn-ports-branches@freebsd.org Thu Jun 6 22:07:18 2019 Return-Path: Delivered-To: svn-ports-branches@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D61615C1A79; Thu, 6 Jun 2019 22:07:18 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B45A8A247; Thu, 6 Jun 2019 22:07:18 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E50E822A87; Thu, 6 Jun 2019 22:07:17 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56M7HcB056492; Thu, 6 Jun 2019 22:07:17 GMT (envelope-from madpilot@FreeBSD.org) Received: (from madpilot@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56M7Hb0056490; Thu, 6 Jun 2019 22:07:17 GMT (envelope-from madpilot@FreeBSD.org) Message-Id: <201906062207.x56M7Hb0056490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: madpilot set sender to madpilot@FreeBSD.org using -f From: Guido Falsi Date: Thu, 6 Jun 2019 22:07:17 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r503607 - in branches/2019Q2/x11/xfce4-screensaver: . files X-SVN-Group: ports-branches X-SVN-Commit-Author: madpilot X-SVN-Commit-Paths: in branches/2019Q2/x11/xfce4-screensaver: . files X-SVN-Commit-Revision: 503607 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B45A8A247 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-ports-branches@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the branches of the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 22:07:18 -0000 Author: madpilot Date: Thu Jun 6 22:07:17 2019 New Revision: 503607 URL: https://svnweb.freebsd.org/changeset/ports/503607 Log: MFH: r503583 Import upstreamed patch to fix the Inhibit lock functionality. Also add some required dependencies. PR: 238348 Submitted by: Olivier Duchateau Approved by: ports-secteam (joneum) Added: branches/2019Q2/x11/xfce4-screensaver/files/patch-src_gs-listener-dbus.c - copied unchanged from r503583, head/x11/xfce4-screensaver/files/patch-src_gs-listener-dbus.c Modified: branches/2019Q2/x11/xfce4-screensaver/Makefile Directory Properties: branches/2019Q2/ (props changed) Modified: branches/2019Q2/x11/xfce4-screensaver/Makefile ============================================================================== --- branches/2019Q2/x11/xfce4-screensaver/Makefile Thu Jun 6 21:42:23 2019 (r503606) +++ branches/2019Q2/x11/xfce4-screensaver/Makefile Thu Jun 6 22:07:17 2019 (r503607) @@ -2,6 +2,7 @@ PORTNAME= xfce4-screensaver PORTVERSION= 0.1.4 +PORTREVISION= 1 CATEGORIES= x11 xfce MASTER_SITES= XFCE/src/apps/${PORTNAME}/${PORTVERSION:R} DIST_SUBDIR= xfce4 @@ -18,9 +19,10 @@ LIB_DEPENDS= libdbus-1.so:devel/dbus \ libdbus-glib-1.so:devel/dbus-glib \ libnotify.so:devel/libnotify \ libstartup-notification-1.so:x11/startup-notification \ - libxklavier.so:x11/libxklavier + libxklavier.so:x11/libxklavier \ + libconsolekit.so:sysutils/consolekit2 -USES= gettext-tools gmake gnome pkgconfig tar:bzip2 xfce:gtk3 +USES= gettext-tools gl gmake gnome pkgconfig tar:bzip2 xfce:gtk3 USE_GL= gl USE_GNOME= cairo gdkpixbuf2 glib20 gtk30 intltool USE_XFCE= garcon libexo libutil Copied: branches/2019Q2/x11/xfce4-screensaver/files/patch-src_gs-listener-dbus.c (from r503583, head/x11/xfce4-screensaver/files/patch-src_gs-listener-dbus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2019Q2/x11/xfce4-screensaver/files/patch-src_gs-listener-dbus.c Thu Jun 6 22:07:17 2019 (r503607, copy of r503583, head/x11/xfce4-screensaver/files/patch-src_gs-listener-dbus.c) @@ -0,0 +1,161 @@ +--- src/gs-listener-dbus.c.orig 2019-03-15 02:23:32 UTC ++++ src/gs-listener-dbus.c +@@ -74,10 +74,6 @@ static DBusHandlerResult gs_listener_message_handler + #define CK_MANAGER_INTERFACE "org.freedesktop.ConsoleKit.Manager" + #define CK_SESSION_INTERFACE "org.freedesktop.ConsoleKit.Session" + +-#define SESSION_NAME "org.gnome.SessionManager" +-#define SESSION_PATH "/org/gnome/SessionManager" +-#define SESSION_INTERFACE "org.gnome.SessionManager" +- + #define TYPE_MISMATCH_ERROR GS_LISTENER_INTERFACE ".TypeMismatch" + + struct GSListenerPrivate { +@@ -108,7 +104,7 @@ typedef struct { + char *reason; + char *connection; + guint32 cookie; +- guint32 foreign_cookie; ++ gint32 fd; + GTimeVal since; + } GSListenerRefEntry; + +@@ -604,34 +600,44 @@ listener_ref_entry_check (GSListener *listener, + static void + add_session_inhibit (GSListener *listener, + GSListenerRefEntry *entry) { +- DBusMessage *message; +- DBusMessage *reply; +- DBusMessageIter iter; +- DBusMessageIter reply_iter; ++ DBusMessage *message, *reply; ++ DBusMessageIter iter, reply_iter; + DBusError error; +- guint xid; +- guint flags; ++ const gchar *mode = "block"; ++ /* it is a colon-separated list of lock types */ ++ const gchar *what = "idle"; + + g_return_if_fail (listener != NULL); + + dbus_error_init (&error); + +- message = dbus_message_new_method_call (SESSION_NAME, +- SESSION_PATH, +- SESSION_INTERFACE, ++#if defined(WITH_SYSTEMD) ++ message = dbus_message_new_method_call (SYSTEMD_LOGIND_SERVICE, ++ SYSTEMD_LOGIND_PATH, ++ SYSTEMD_LOGIND_INTERFACE, + "Inhibit"); ++#elif defined(WITH_CONSOLE_KIT) ++ message = dbus_message_new_method_call (CK_NAME, ++ CK_MANAGER_PATH, ++ CK_MANAGER_INTERFACE, ++ "Inhibit"); ++#endif + if (message == NULL) { + gs_debug ("Couldn't allocate the dbus message"); + return; + } + + dbus_message_iter_init_append (message, &iter); +- xid = 0; +- flags = 8; +- dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &entry->application); +- dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &xid); +- dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &entry->reason); +- dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &flags); ++ /* what parameter */ ++ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &what); ++ /* who parameter */ ++ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, ++ &entry->application); ++ /* why parameter */ ++ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, ++ &entry->reason); ++ /* mode parameter */ ++ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &mode); + + /* FIXME: use async? */ + reply = dbus_connection_send_with_reply_and_block (listener->priv->connection, +@@ -647,54 +653,23 @@ add_session_inhibit (GSListener *listener, + } + + dbus_message_iter_init (reply, &reply_iter); +- dbus_message_iter_get_basic (&reply_iter, &entry->foreign_cookie); ++ if (DBUS_TYPE_UNIX_FD == dbus_message_iter_get_arg_type(&reply_iter)) ++ dbus_message_iter_get_basic (&reply_iter, &entry->fd); + + dbus_message_unref (reply); + } + + static void +-remove_session_inhibit (GSListener *listener, +- GSListenerRefEntry *entry) { +- DBusMessage *message; +- DBusMessage *reply; +- DBusMessageIter iter; +- DBusError error; +- +- g_return_if_fail (listener != NULL); +- +- if (entry->foreign_cookie == 0) { ++remove_session_inhibit (GSListenerRefEntry *entry) { ++ if (entry->fd < 0) { + gs_debug ("Can't remove inhibitor from session: Session cookie not set"); + return; + } + +- dbus_error_init (&error); +- +- message = dbus_message_new_method_call (SESSION_NAME, +- SESSION_PATH, +- SESSION_INTERFACE, +- "Uninhibit"); +- if (message == NULL) { +- gs_debug ("Couldn't allocate the dbus message"); ++ if (close(entry->fd) < 0) { ++ gs_debug ("Can't close file descriptor"); + return; + } +- +- dbus_message_iter_init_append (message, &iter); +- dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &entry->foreign_cookie); +- +- /* FIXME: use async? */ +- reply = dbus_connection_send_with_reply_and_block (listener->priv->connection, +- message, +- -1, +- &error); +- dbus_message_unref (message); +- +- if (dbus_error_is_set (&error)) { +- gs_debug ("%s raised:\n %s\n\n", error.name, error.message); +- dbus_error_free (&error); +- return; +- } +- +- dbus_message_unref (reply); + } + + static void +@@ -745,7 +720,7 @@ listener_remove_ref_entry (GSListener *listener, + + if (entry_type == REF_ENTRY_TYPE_INHIBIT) { + /* remove inhibit from xfce session */ +- remove_session_inhibit (listener, entry); ++ remove_session_inhibit (entry); + } + + removed = g_hash_table_remove (hash, &cookie); +@@ -977,7 +952,7 @@ listener_ref_entry_remove_for_connection (GSListener + + if (entry->entry_type == REF_ENTRY_TYPE_INHIBIT) { + /* remove inhibit from xfce session */ +- remove_session_inhibit (listener, entry); ++ remove_session_inhibit (entry); + } + + g_hash_table_iter_remove (&iter);