--- a/components/desktop/xscreensaver/patches/0005-gtk-lock.patch Mon Jun 13 23:38:24 2016 -0700
+++ b/components/desktop/xscreensaver/patches/0005-gtk-lock.patch Mon Jun 13 19:10:07 2016 -0700
@@ -1,4 +1,4 @@
-From 7420325ce7eb36c5441094463f1f7ebe6623d222 Mon Sep 17 00:00:00 2001
+From 8c50007e132d474a772ac456786342c0fe7fe189 Mon Sep 17 00:00:00 2001
From: Alan Coopersmith <[email protected]>
Date: Sat, 2 Jan 2016 20:36:57 -0800
Subject: [PATCH] gtk-lock
@@ -74,13 +74,13 @@
22706313 xscreensaver calls to pam_setcred with the wrong flag
---
config.h.in | 3 +
- configure.in | 27 +-
+ configure.in | 22 +-
driver/Makefile.in | 59 ++-
driver/auth.h | 4 +
driver/demo-Gtk.c | 18 +
driver/dialog-data.h | 131 ++++++
- driver/lock-Gtk.c | 968 +++++++++++++++++++++++++++++++++++++++++++
- driver/lock.c | 1085 ++++++++++++++++++++++++++++++++++++++++++++-----
+ driver/lock-Gtk.c | 738 +++++++++++++++++++++++++++++++++
+ driver/lock.c | 1083 ++++++++++++++++++++++++++++++++++++++++++++-----
driver/passwd-pam.c | 228 +++++++++--
driver/passwd.c | 1 +
driver/setuid.c | 5 +-
@@ -90,7 +90,7 @@
driver/windows.c | 21 +-
driver/xscreensaver.c | 130 +++++-
driver/xscreensaver.h | 6 +
- 17 files changed, 2687 insertions(+), 162 deletions(-)
+ 17 files changed, 2451 insertions(+), 161 deletions(-)
create mode 100644 driver/dialog-data.h
create mode 100644 driver/lock-Gtk.c
@@ -109,7 +109,7 @@
#undef HAVE_XSHM_EXTENSION
diff --git a/configure.in b/configure.in
-index 4c4dee5..873299e 100644
+index 4c4dee5..eb753a3 100644
--- a/configure.in
+++ b/configure.in
@@ -2666,6 +2666,7 @@ if test "$with_gtk" = yes; then
@@ -120,22 +120,17 @@
have_gtk="$ok"
if test "$have_gtk" = no; then
-@@ -2681,6 +2682,14 @@ if test "$with_gtk" = yes; then
+@@ -2681,6 +2682,9 @@ if test "$with_gtk" = yes; then
fi
if test "$have_gtk" = yes; then
+#--- Begin SUNW addition
-+ PKG_CHECK_MODULES([LOGINHELPER], [libloginhelper-1.0 >= 1.0],
-+ [pkgs="$pkgs libloginhelper-1.0"
-+ AC_DEFINE([HAVE_LOGINHELPER],[],
-+ [Define this to use libloginhelper (atk 1.x only)])],
-+ [true])
+ AC_DEFINE(HAVE_XSCREENSAVER_LOCK,[],[Define this to build the external lock dialog])
+#--- End SUNW addition
AC_CACHE_CHECK([for Gtk includes], ac_cv_gtk_config_cflags,
[ac_cv_gtk_config_cflags=`$pkg_config --cflags $pkgs`])
AC_CACHE_CHECK([for Gtk libs], ac_cv_gtk_config_libs,
-@@ -3933,6 +3942,16 @@ if test "$have_gtk" = yes; then
+@@ -3933,6 +3937,16 @@ if test "$have_gtk" = yes; then
ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
fi
@@ -152,7 +147,7 @@
if test "$have_kerberos" = yes; then
PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
-@@ -4077,6 +4096,11 @@ AC_SUBST(INCLUDES)
+@@ -4077,6 +4091,11 @@ AC_SUBST(INCLUDES)
AC_SUBST(PREFERRED_DEMO_PROGRAM)
AC_SUBST(ALL_DEMO_PROGRAMS)
@@ -164,7 +159,7 @@
AC_SUBST(SAVER_LIBS)
AC_SUBST(MOTIF_LIBS)
AC_SUBST(GTK_LIBS)
-@@ -4598,7 +4622,8 @@ HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
+@@ -4598,7 +4617,8 @@ HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
# Sanity check the hackdir
@@ -546,10 +541,10 @@
+#endif /* __DIALOG_DATA_H__ */
diff --git a/driver/lock-Gtk.c b/driver/lock-Gtk.c
new file mode 100644
-index 0000000..13e0213
+index 0000000..93ef574
--- /dev/null
+++ b/driver/lock-Gtk.c
-@@ -0,0 +1,968 @@
+@@ -0,0 +1,738 @@
+/* lock-Gtk.c -- a GTK+ password dialog for xscreensaver
+ * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski <[email protected]>
+ *
@@ -565,7 +560,7 @@
+/* GTK+ locking code written by Jacob Berkman <[email protected]> for
+ * Sun Microsystems.
+ *
-+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
@@ -618,10 +613,6 @@
+#include <X11/Xmu/WinUtil.h>
+
+#include <gconf/gconf-client.h>
-+#ifdef HAVE_LOGINHELPER
-+#include <libbonobo.h>
-+#include <login-helper/Accessibility_LoginHelper.h>
-+#endif
+#include <atk/atkobject.h>
+
+#include "remote.h"
@@ -1193,13 +1184,6 @@
+ const char *locale = NULL;
+
+ gboolean at_enable = FALSE; /* accessibility mode enabled ? */
-+#ifdef HAVE_LOGINHELPER
-+ Bonobo_ServerInfoList *server_list = NULL;
-+ CORBA_Environment ev;
-+ Accessibility_LoginHelper helper;
-+ Accessibility_LoginHelper *helper_list = NULL;
-+ CORBA_boolean safe;
-+#endif
+ gboolean center_position = TRUE; /* center dialog on screen? */
+
+#ifdef ENABLE_NLS
@@ -1264,35 +1248,12 @@
+ if (!modulesptr || modulesptr [0] == '\0')
+ putenv ("GTK_MODULES=gail:atk-bridge");
+
-+#ifdef HAVE_LOGINHELPER
-+ CORBA_exception_init (&ev);
-+ if (!bonobo_init (&argc, argv))
-+ {
-+ g_error ("Can't initialize Bonobo");
-+ }
-+
-+ /* bonobo-activation query lists existing instances */
-+ server_list = bonobo_activation_query (
-+ "(repo_ids.has('IDL:Accessibility/LoginHelper:1.0')) AND _active",
-+ NULL, &ev);
-+
-+ if (BONOBO_EX (&ev))
-+ {
-+ bonobo_debug_shutdown ();
-+ g_error ("LoginHelper query failed : %s",
-+ bonobo_exception_get_text (&ev));
-+ /* not reached (below) because g_error exits */
-+ CORBA_exception_free (&ev);
-+ }
-+
+ /*
+ * 6182506: unlock dialog can be obscured by the magnifier window
+ * if it's always centered, so don't force that if any accessibility
+ * helpers are present
+ */
-+ if (server_list && server_list->_length)
-+ center_position = FALSE;
-+#endif
++ center_position = FALSE;
+ } /* accessibility enabled */
+
+ pwd = make_dialog (center_position);
@@ -1307,180 +1268,6 @@
+ gdk_window_add_filter (GET_WINDOW (pwd->dialog), dialog_filter_func, pwd);
+ write_windowid ("dialog_win", GDK_WINDOW_XID (GET_WINDOW (pwd->dialog)));
+
-+#ifdef HAVE_LOGINHELPER
-+ if (server_list && server_list->_length)
-+ {
-+ /* debug only
-+ g_message ("%d LoginHelpers are running.",
-+ server_list ? server_list->_length : 0);
-+ */
-+
-+ helper_list = g_new0 (Accessibility_LoginHelper, server_list->_length);
-+
-+ /* for each instance... */
-+ for (i = 0; i < server_list->_length; i++)
-+ {
-+ Bonobo_Unknown server;
-+ Bonobo_ServerInfo info = server_list->_buffer[i];
-+
-+ server = bonobo_activation_activate_from_id (
-+ info.iid, Bonobo_ACTIVATION_FLAG_EXISTING_ONLY, NULL, &ev);
-+
-+ if (BONOBO_EX (&ev))
-+ {
-+ g_warning ("Error activating server %d: %s", i,
-+ bonobo_exception_get_text (&ev));
-+ CORBA_exception_free (&ev);
-+ continue;
-+ }
-+ else if (server == CORBA_OBJECT_NIL)
-+ {
-+ g_warning ("Activated server %d is NIL!", i);
-+ continue;
-+ }
-+
-+ bonobo_activate ();
-+
-+ helper = Bonobo_Unknown_queryInterface
-+ (server, "IDL:Accessibility/LoginHelper:1.0", &ev);
-+
-+ if (BONOBO_EX (&ev))
-+ {
-+ g_warning ("Error performing interface query: %s",
-+ bonobo_exception_get_text (&ev));
-+ CORBA_exception_free (&ev);
-+ continue;
-+ }
-+ else if (helper == CORBA_OBJECT_NIL)
-+ {
-+ g_warning ("Activated an object which advertised LoginHelper but does not implement it!");
-+ continue;
-+ }
-+
-+ helper_list[i] = helper;
-+ bonobo_object_release_unref (server, &ev);
-+
-+ if (helper && !BONOBO_EX (&ev))
-+ {
-+ /* ask the helper to go into safe mode */
-+ safe = Accessibility_LoginHelper_setSafe (helper, TRUE, &ev);
-+ if (BONOBO_EX (&ev))
-+ {
-+ g_warning ("setSafe(TRUE) failed: %s",
-+ bonobo_exception_get_text (&ev));
-+ CORBA_exception_free (&ev);
-+ }
-+
-+ /* get the raise window list (if the program went into safe mode) */
-+ if (safe)
-+ {
-+ int j;
-+ gboolean needs_windows_raised = FALSE;
-+ Accessibility_LoginHelper_DeviceReqList *list;
-+
-+ g_debug ("safe");
-+
-+ /* does this helper need to have windows raised? */
-+ list = Accessibility_LoginHelper_getDeviceReqs (helper, &ev);
-+
-+ if (BONOBO_EX (&ev))
-+ {
-+ g_warning ("Bonobo exception getting Device Requirements: %s",
-+ bonobo_exception_get_text (&ev));
-+ CORBA_exception_free (&ev);
-+ }
-+ else
-+ {
-+ g_debug ("LoginHelper device requirements: ");
-+ if (list->_length == 0)
-+ g_debug (" - None.");
-+
-+ for (j = 0; j < list->_length; j++)
-+ {
-+ switch (list->_buffer[j])
-+ {
-+ case Accessibility_LoginHelper_GUI_EVENTS:
-+ g_debug (" - Needs access to the GUI event subsystem (e.g. Xserver)");
-+ break;
-+ case Accessibility_LoginHelper_CORE_KEYBOARD:
-+ g_debug (" - Needs access to core keyboard device");
-+ write_to_parent("ungrab_keyboard", "true", FALSE);
-+ break;
-+ case Accessibility_LoginHelper_CORE_POINTER:
-+ g_debug (" - Needs access to core pointer device");
-+ write_to_parent("ungrab_pointer", "true", FALSE);
-+ break;
-+ case Accessibility_LoginHelper_EXT_INPUT:
-+ g_debug (" - Reads XInput extended input devices");
-+ break;
-+ case Accessibility_LoginHelper_POST_WINDOWS:
-+ g_debug (" - Posts windows");
-+ needs_windows_raised = TRUE;
-+ break;
-+ case Accessibility_LoginHelper_AUDIO_OUT:
-+ g_debug (" - Writes to audio device");
-+ break;
-+ case Accessibility_LoginHelper_AUDIO_IN:
-+ g_debug (" - Reads from audio device");
-+ break;
-+ case Accessibility_LoginHelper_LOCALHOST:
-+ g_debug (" - Needs LOCALHOST network connection");
-+ break;
-+ case Accessibility_LoginHelper_SERIAL_OUT:
-+ g_debug (" - Needs to write to one or more serial ports");
-+ break;
-+ default:
-+ break;
-+ }
-+ }
-+ CORBA_free (list);
-+ }
-+
-+ if (needs_windows_raised)
-+ {
-+ Accessibility_LoginHelper_WindowList *windows
-+ = Accessibility_LoginHelper_getRaiseWindows
-+ (helper, &ev);
-+
-+ if (BONOBO_EX (&ev))
-+ {
-+ g_warning ("getRaiseWindows failed: %s",
-+ bonobo_exception_get_text (&ev));
-+ CORBA_exception_free (&ev);
-+ }
-+
-+ g_debug ("%d windows need raising", windows->_length);
-+ for (j = 0; j < windows->_length; j++)
-+ {
-+ Window wid = windows->_buffer[j].winID;
-+ g_debug ("Window ID = 0x%lx", wid);
-+ if (wid)
-+ write_windowid ("raise_win", wid);
-+ }
-+ }
-+ }
-+ else
-+ {
-+ g_warning ("LoginHelper %d did not go into safe mode", i);
-+ }
-+ }
-+ else
-+ {
-+ if (BONOBO_EX (&ev))
-+ {
-+ g_warning ("Error activating %s: %s",
-+ info.iid, bonobo_exception_get_text (&ev));
-+ CORBA_exception_free (&ev);
-+ }
-+ else
-+ {
-+ g_warning ("no active instance of %s found", info.iid);
-+ }
-+ }
-+ }
-+ } /* accessibility helpers active */
-+#endif
-+
+ /* Flush dialog window ids & any messages about login helpers to parent */
+ write_to_parent(NULL, NULL, TRUE);
+
@@ -1493,33 +1280,11 @@
+
+ gtk_main ();
+
-+#ifdef LOGIN_HELPER
-+ /* Reset accessibility helpers back to non-safe mode now that we're done */
-+ if (server_list)
-+ {
-+ for (i = 0; i < server_list->_length; i++)
-+ {
-+ helper = helper_list[i];
-+ /* really no need to check the return value this time */
-+ Accessibility_LoginHelper_setSafe (helper, FALSE, &ev);
-+ if (BONOBO_EX (&ev))
-+ {
-+ g_warning ("setSafe(FALSE) failed: %s",
-+ bonobo_exception_get_text (&ev));
-+ CORBA_exception_free (&ev);
-+ }
-+ CORBA_Object_release (helper, &ev);
-+ }
-+ CORBA_free (server_list);
-+ bonobo_debug_shutdown ();
-+ }
-+#endif
-+
+ return 0;
+}
+#endif /* HAVE_GTK2 */
diff --git a/driver/lock.c b/driver/lock.c
-index 7c92be6..becf85b 100644
+index 7c92be6..a4114e2 100644
--- a/driver/lock.c
+++ b/driver/lock.c
@@ -21,8 +21,13 @@
@@ -2674,13 +2439,11 @@
static void
handle_passwd_key (saver_info *si, XKeyEvent *event)
-@@ -1739,7 +2474,8 @@ handle_passwd_key (saver_info *si, XKeyEvent *event)
- passwd_dialog_data *pw = si->pw_data;
+@@ -1740,6 +2475,7 @@ handle_passwd_key (saver_info *si, XKeyEvent *event)
unsigned char decoded [MAX_BYTES_PER_CHAR * 10]; /* leave some slack */
KeySym keysym = 0;
--
+
+#ifndef HAVE_XSCREENSAVER_LOCK
-+
/* XLookupString may return more than one character via XRebindKeysym;
and on some systems it returns multi-byte UTF-8 characters (contrary
to its documentation, which says it returns only Latin1.)
@@ -4058,5 +3821,5 @@
subprocs diagnostics
======================================================================= */
--
-2.6.1
+2.7.4