patches/xscreensaver-13-trusted.diff
author alanc
Thu, 27 May 2010 07:20:44 +0000
changeset 18044 c733815d6bee
parent 18039 93dd6ed68b16
child 18045 dbf849ca434c
permissions -rw-r--r--
* patches/xscreensaver-06-gtk-lock.diff, * patches/xscreensaver-09-xinput.diff, * patches/xscreensaver-13-trusted.diff, * patches/xscreensaver-14-pam_audit.diff: Remove some unneeded changes (like includes of Xt headers) and fix some warnings.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     1
/*
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     2
 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     3
 *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     4
 * Permission is hereby granted, free of charge, to any person obtaining a
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     5
 * copy of this software and associated documentation files (the "Software"),
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     6
 * to deal in the Software without restriction, including without limitation
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     7
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     8
 * and/or sell copies of the Software, and to permit persons to whom the
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
     9
 * Software is furnished to do so, subject to the following conditions:
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    10
 *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    11
 * The above copyright notice and this permission notice (including the next
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    12
 * paragraph) shall be included in all copies or substantial portions of the
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    13
 * Software.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    14
 *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    18
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    19
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    20
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    21
 * DEALINGS IN THE SOFTWARE.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    22
 */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    23
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    24
Support needed for Solaris Trusted Extensions / Trusted GNOME.
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    25
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    26
diff --git xscreensaver-5.11/driver/Makefile.in xscreensaver-5.11/driver/Makefile.in
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    27
--- xscreensaver-5.11/driver/Makefile.in
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    28
+++ xscreensaver-5.11/driver/Makefile.in
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    29
@@ -105,6 +105,10 @@ GTK_OBJS	= demo-Gtk.o demo-Gtk-conf.o @GTK_EXTRA_OBJS@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    30
 GTK_LOCK_SRCS	= lock-Gtk.c remote.c
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    31
 GTK_LOCK_OBJS	= lock-Gtk.o remote.o
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    32
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    33
+TRUSTED_LIBS	= -lglib-2.0 -lsecdb
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    34
+TRUSTED_SRCS	= trusted-utils.c
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    35
+TRUSTED_OBJS	= trusted-utils.o
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    36
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    37
 PWENT_SRCS	= passwd-pwent.c
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    38
 PWENT_OBJS	= passwd-pwent.o
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    39
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    40
@@ -794,8 +798,9 @@ XScreenSaver_Xm_ad.h: XScreenSaver-Xm.ad
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    41
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    42
 # The executables linked in this directory.
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    43
 #
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    44
-xscreensaver: $(SAVER_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    45
-	$(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(SAVER_LIBS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    46
+xscreensaver: $(SAVER_OBJS) $(TRUSTED_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    47
+	$(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(TRUSTED_OBJS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    48
+	$(TRUSTED_LIBS) $(SAVER_LIBS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    49
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    50
 xscreensaver-command: $(CMD_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    51
 	$(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    52
@@ -814,8 +819,9 @@ xscreensaver-demo: @PREFERRED_DEMO_PROGRAM@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    53
 xscreensaver-lock: @PREFERRED_LOCK_PROGRAM@
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    54
 	$(INSTALL_PROGRAM) @PREFERRED_LOCK_PROGRAM@ $@
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    55
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    56
-xscreensaver-lock-Gtk: $(GTK_LOCK_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    57
+xscreensaver-lock-Gtk: $(GTK_LOCK_OBJS) $(TRUSTED_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    58
 	$(CC) $(LDFLAGS) -o $@ $(GTK_LOCK_OBJS) $(LIBS) $(X_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    59
+	$(TRUSTED_OBJS) $(TRUSTED_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    60
 	$(GTK_LIBS) $(XML_LIBS) $(X_PRE_LIBS) -lXt -lX11 \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    61
 	$(XDPMS_LIBS) -lXext \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    62
 	$(X_EXTRA_LIBS)
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    63
@@ -825,9 +831,9 @@ xscreensaver-demo-Xm: $(DEMO_OBJS) $(MOTIF_OBJS)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    64
 	$(MOTIF_LIBS) $(INTL_LIBS) $(X_PRE_LIBS) -lXt -lX11 \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    65
 	$(XDPMS_LIBS) $(XINERAMA_LIBS) -lXext $(X_EXTRA_LIBS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    66
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    67
-xscreensaver-demo-Gtk: $(DEMO_OBJS) $(GTK_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    68
-	$(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(GTK_OBJS) $(LIBS) $(X_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    69
-	$(GTK_LIBS) $(XPM_LIBS) $(XML_LIBS) $(INTL_LIBS) $(X_PRE_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    70
+xscreensaver-demo-Gtk: $(DEMO_OBJS) $(GTK_OBJS) $(TRUSTED_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    71
+	$(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(GTK_OBJS) $(TRUSTED_OBJS) $(LIBS) $(X_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    72
+	$(GTK_LIBS) $(XPM_LIBS) $(XML_LIBS) $(INTL_LIBS) $(TRUSTED_LIBS) $(X_PRE_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    73
 	-lXt -lX11 $(XDPMS_LIBS) $(XINERAMA_LIBS) -lXext $(X_EXTRA_LIBS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    74
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    75
 demo-Gtk.o: XScreenSaver_ad.h
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    76
@@ -836,7 +842,7 @@ xscreensaver.o: XScreenSaver_ad.h
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    77
 xscreensaver-getimage.o: XScreenSaver_ad.h
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    78
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    79
 xscreensaver-getimage: $(GETIMG_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    80
-	$(CC) $(LDFLAGS) -o $@ $(GETIMG_OBJS) $(GETIMG_LIBS) -lm
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    81
+	$(CC) $(LDFLAGS) -o $@ $(GETIMG_OBJS) $(TRUSTED_OBJS) $(GETIMG_LIBS) $(TRUSTED_LIBS) -lm
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    82
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    83
 pdf2jpeg: $(PDF2JPEG_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    84
 	$(OBJCC) $(LDFLAGS) -o $@ $(PDF2JPEG_OBJS) $(PDF2JPEG_LIBS) -lm
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    85
diff --git xscreensaver-5.11/driver/demo-Gtk.c xscreensaver-5.11/driver/demo-Gtk.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    86
--- xscreensaver-5.11/driver/demo-Gtk.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    87
+++ xscreensaver-5.11/driver/demo-Gtk.c
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    88
@@ -136,6 +136,14 @@
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    89
 #include <string.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    90
 #include <ctype.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    91
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    92
+#include <user_attr.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    93
+
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
    94
+#include "trusted-utils.h"
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    95
+void XTSOLgetWorkstationOwner(Display *, uid_t *);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    96
+static gboolean tsol_hack_initialized = False;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    97
+static gboolean tsol_multi_label_session = False;
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
    98
+extern Display *global_dpy;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    99
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   100
 #ifdef HAVE_GTK2
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   101
 enum {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   102
   COL_ENABLED,
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   103
@@ -916,6 +924,9 @@ doc_menu_cb (GtkMenuItem *menuitem, gpointer user_data)
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   104
     " 'export SHELL=\"/dev/null\"; "
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   105
     " /usr/bin/man xscreensaver || /usr/bin/read foo' &";
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   106
 
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   107
+  if ( tsol_multi_label_session )
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   108
+    return; /* See CR 6845488 */
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   109
+
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   110
   if (system (sun_help_command) < 0)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   111
     fprintf (stderr, "%s: fork error\n", blurb());
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   112
 
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   113
@@ -2889,9 +2900,69 @@ populate_prefs_page (state *s)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   114
     SENSITIZE ("pwd_spinbutton", p->pwd_p);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   115
     SENSITIZE ("pwd_mlabel",     p->pwd_p);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   116
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   117
+    tsol_multi_label_session = tsol_is_multi_label_session ();
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   118
+    if (! tsol_hack_initialized && tsol_multi_label_session)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   119
+      {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   120
+        GtkWidget *doc_menu = name_to_widget (s, "doc_menu");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   121
+        GtkWidget *restart_menu = name_to_widget (s, "restart");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   122
+        GtkWidget *kill_menu = name_to_widget (s, "kill_menu");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   123
+        GtkWidget *lock_spinbutton = name_to_widget (s, "lock_spinbutton");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   124
+        GtkWidget *lock_container = name_to_widget (s, "blanking_table");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   125
+        GtkWidget *lock_button_eventbox = name_to_widget (s, "lock_button_eventbox");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   126
+        Widget *newlabel = g_object_new (GTK_TYPE_LABEL, "label",
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   127
+                                         _("_Lock Screen After"),
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   128
+                                         "use-underline", TRUE,
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   129
+                                         "mnemonic-widget", lock_spinbutton,
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   130
+                                         NULL);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   131
+        GValue *gv = g_new0 (GValue, 1);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   132
+        GtkAdjustment *adj;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   133
+        userattr_t *uent;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   134
+        int idletime;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   135
+        char *value = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   136
+        uid_t WorkstationOwner;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   137
+        Display *dpy = GDK_DISPLAY ();
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   138
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   139
+        gtk_widget_hide (doc_menu);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   140
+        gtk_widget_set_sensitive (restart_menu, FALSE);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   141
+        gtk_widget_set_sensitive (kill_menu, FALSE);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   142
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   143
+        adj = gtk_spin_button_get_adjustment ((GtkSpinButton  *)lock_spinbutton);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   144
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   145
+        XTSOLgetWorkstationOwner (dpy, &WorkstationOwner);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   146
+        uent = getuseruid (WorkstationOwner);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   147
+        value = getusrattrval (uent, USERATTR_IDLETIME_KW);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   148
+        if (value != NULL && *value != '\0')
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   149
+          idletime = atoi (value);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   150
+        adj->upper = (gdouble)idletime;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   151
+        if (adj->value > adj->upper)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   152
+          adj->value = adj->upper;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   153
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   154
+        gtk_spin_button_set_adjustment ((GtkSpinButton *)lock_spinbutton, adj);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   155
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   156
+        gtk_container_add (GTK_CONTAINER (lock_container), GTK_WIDGET (newlabel));
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   157
+        g_value_init (gv, G_TYPE_INT);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   158
+        g_value_set_int (gv, 2);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   159
+        gtk_container_child_set_property (GTK_CONTAINER (lock_container), GTK_WIDGET (newlabel), "top_attach", gv);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   160
+        g_value_set_int (gv, 1);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   161
+        gtk_container_child_set_property (GTK_CONTAINER (lock_container), GTK_WIDGET (newlabel), "left_attach", gv);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   162
+        gtk_widget_show (GTK_WIDGET (newlabel));
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   163
+        gtk_widget_hide (GTK_WIDGET (lock_button_eventbox));
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   164
+        g_object_set (lock_button_eventbox, "active", TRUE, NULL);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   165
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   166
+        SENSITIZE ("lock_button",     1);
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   167
+      }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   168
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   169
+    if (tsol_multi_label_session)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   170
+      {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   171
+        SENSITIZE ("lock_spinbutton", 1);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   172
+        SENSITIZE ("lock_mlabel",     1);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   173
+      }
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   174
+    else
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   175
+      {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   176
     SENSITIZE ("lock_button",     can_lock_p);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   177
     SENSITIZE ("lock_spinbutton", can_lock_p && p->lock_p);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   178
     SENSITIZE ("lock_mlabel",     can_lock_p && p->lock_p);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   179
+      }
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   180
 
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   181
     /* DPMS
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   182
      */
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   183
@@ -2921,6 +2992,7 @@ populate_prefs_page (state *s)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   184
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   185
 # undef SENSITIZE
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   186
   }
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   187
+  tsol_hack_initialized = True;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   188
 }
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   189
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   190
 
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   191
@@ -3006,6 +3078,9 @@ sensitize_menu_items (state *s, Bool force_p)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   192
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   193
   for (i = 0; i < countof(names); i++)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   194
     {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   195
+      if (tsol_is_multi_label_session() && 2==i)
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   196
+        continue;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   197
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   198
       GtkWidget *w = name_to_widget (s, names[i]);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   199
       gtk_widget_set_sensitive (GTK_WIDGET(w), running_p);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   200
     }
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   201
@@ -4984,7 +5059,7 @@ main (int argc, char **argv)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   202
                                      applicationShellWidgetClass,
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   203
                                      dpy, 0, 0);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   204
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   205
-  dpy = XtDisplay (toplevel_shell);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   206
+  global_dpy = dpy = XtDisplay (toplevel_shell);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   207
   db = XtDatabase (dpy);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   208
   XtGetApplicationNameAndClass (dpy, &progname, &progclass);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   209
   XSetErrorHandler (demo_ehandler);
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   210
diff --git xscreensaver-5.11/driver/lock-Gtk.c xscreensaver-5.11/driver/lock-Gtk.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   211
--- xscreensaver-5.11/driver/lock-Gtk.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   212
+++ xscreensaver-5.11/driver/lock-Gtk.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   213
@@ -71,6 +71,7 @@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   214
 #include <atk/atkobject.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   215
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   216
 #include "remote.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   217
+#include "trusted-utils.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   218
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   219
 /* AT-enabled */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   220
 void write_null(int n);
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   221
@@ -174,7 +175,10 @@ load_unlock_logo_image(void)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   222
   const char *logofile;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   223
   struct stat statbuf;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   224
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   225
-  logofile = DEFAULT_ICONDIR "/unlock-logo.png";
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   226
+  if (tsol_is_multi_label_session())
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   227
+    logofile = DEFAULT_ICONDIR "/trusted-logo.png";
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   228
+  else
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   229
+    logofile = DEFAULT_ICONDIR "/unlock-logo.png";
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   230
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   231
   if (stat(logofile, &statbuf) != 0) {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   232
       logofile = DEFAULT_ICONDIR "/logo-180.gif"; /* fallback */
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   233
diff --git xscreensaver-5.11/driver/prefs.c xscreensaver-5.11/driver/prefs.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   234
--- xscreensaver-5.11/driver/prefs.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   235
+++ xscreensaver-5.11/driver/prefs.c
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   236
@@ -37,6 +37,8 @@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   237
 # include "vms-pwd.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   238
 #endif /* VMS */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   239
 
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   240
+#include "trusted-utils.h"
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   241
+#include <user_attr.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   242
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   243
 /* This file doesn't need the Xt headers, so stub these types out... */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   244
 #undef XtPointer
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   245
@@ -67,6 +69,9 @@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   246
 #include "prefs.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   247
 #include "resources.h"
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   248
 
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   249
+#include "trusted-utils.h"
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   250
+Display *global_dpy;
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   251
+
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   252
 /* don't use realpath() on fedora system */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   253
 #ifdef _FORTIFY_SOURCE
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   254
 #undef HAVE_REALPATH
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   255
@@ -1051,7 +1056,10 @@ load_init_file (Display *dpy, saver_preferences *p)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   256
   p->xsync_p	    = get_boolean_resource (dpy, "synchronous", "Synchronous");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   257
   p->verbose_p	    = get_boolean_resource (dpy, "verbose", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   258
   p->timestamp_p    = get_boolean_resource (dpy, "timestamp", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   259
-  p->lock_p	    = get_boolean_resource (dpy, "lock", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   260
+  if (tsol_is_multi_label_session())
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   261
+    p->lock_p       = True; /* always lock in a Multi Label Session */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   262
+  else
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   263
+    p->lock_p       = get_boolean_resource (dpy, "lock", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   264
   p->fade_p	    = get_boolean_resource (dpy, "fade", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   265
   p->unfade_p	    = get_boolean_resource (dpy, "unfade", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   266
   p->fade_seconds   = 1000 * get_seconds_resource (dpy, "fadeSeconds", "Time");
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   267
@@ -1075,6 +1083,27 @@ load_init_file (Display *dpy, saver_preferences *p)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   268
   p->lock_timeout    = 1000 * get_minutes_resource (dpy, "lockTimeout", "Time");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   269
   p->cycle           = 1000 * get_minutes_resource (dpy, "cycle", "Time");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   270
   p->passwd_timeout  = 1000 * get_seconds_resource (dpy, "passwdTimeout", "Time");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   271
+  if (tsol_is_multi_label_session())
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   272
+    {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   273
+      userattr_t *uent;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   274
+      int idletime;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   275
+      char *value = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   276
+      uid_t WorkstationOwner;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   277
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   278
+      XTSOLgetWorkstationOwner (global_dpy, &WorkstationOwner);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   279
+      uent = getuseruid (WorkstationOwner);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   280
+      value = getusrattrval (uent, USERATTR_IDLETIME_KW);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   281
+      if (value != NULL && *value != '\0')
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   282
+        idletime = atoi(value) * 1000;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   283
+      if (p->passwd_timeout > idletime)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   284
+        p->passwd_timeout = idletime;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   285
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   286
+      value = getusrattrval (uent, USERATTR_IDLECMD_KW);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   287
+      if (value && strcmp(value, USERATTR_IDLECMD_LOGOUT_KW) == 0)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   288
+        p->lock_cmd = LOGOUT_CMD;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   289
+      else
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   290
+        p->lock_cmd = LOCK_CMD;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   291
+    }
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   292
   /* *bugid 5077981 pwd timeout */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   293
   p->pwd_p	    = get_boolean_resource (dpy, "passwdTimeoutEnabled", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   294
   p->pointer_timeout = 1000 * get_seconds_resource (dpy, "pointerPollTime", "Time");
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   295
diff --git xscreensaver-5.11/driver/subprocs.c xscreensaver-5.11/driver/subprocs.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   296
--- xscreensaver-5.11/driver/subprocs.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   297
+++ xscreensaver-5.11/driver/subprocs.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   298
@@ -70,6 +70,7 @@ extern int kill (pid_t, int);		/* signal() is in sys/signal.h... */
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   299
 #include "exec.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   300
 #include "yarandom.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   301
 #include "visual.h"    /* for id_to_visual() */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   302
+#include "trusted-utils.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   303
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   304
 extern saver_info *global_si_kludge;	/* I hate C so much... */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   305
 
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   306
@@ -1076,6 +1077,13 @@ spawn_screenhack (saver_screen_info *ssi)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   307
                                              strlen (HACK_PATH));
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   308
       sprintf(complete_hack_command, HACK_PATH"/%s", hack->command);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   309
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   310
+      if (tsol_is_multi_label_session())
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   311
+        if (p->lock_cmd == LOGOUT_CMD)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   312
+          {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   313
+            free (complete_hack_command);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   314
+            exec_command (p->shell, "/usr/bin/pkill gnome-session", 0);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   315
+            exit(1);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   316
+          }
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   317
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   318
       forked = fork_and_exec (ssi, complete_hack_command);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   319
       free (complete_hack_command);
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   320
diff --git xscreensaver-5.11/driver/trusted-utils.c xscreensaver-5.11/driver/trusted-utils.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   321
new file mode 100644
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   322
--- /dev/null
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   323
+++ xscreensaver-5.11/driver/trusted-utils.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   324
@@ -0,0 +1,171 @@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   325
+/*
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   326
+ * Trusted xscreensaver
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   327
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   328
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   329
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   330
+ * Permission is hereby granted, free of charge, to any person obtaining a
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   331
+ * copy of this software and associated documentation files (the "Software"),
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   332
+ * to deal in the Software without restriction, including without limitation
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   333
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   334
+ * and/or sell copies of the Software, and to permit persons to whom the
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   335
+ * Software is furnished to do so, subject to the following conditions:
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   336
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   337
+ * The above copyright notice and this permission notice (including the next
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   338
+ * paragraph) shall be included in all copies or substantial portions of the
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   339
+ * Software.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   340
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   341
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   342
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   343
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   344
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   345
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   346
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   347
+ * DEALINGS IN THE SOFTWARE.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   348
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   349
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   350
+ * Based on work by Erwann Chenede, Ghee Teo
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   351
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   352
+ * Used to check if we are in a multilabel session and to load
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   353
+ * additional functionality within the multilabel session.
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   354
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   355
+#include <dlfcn.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   356
+#include <link.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   357
+#include <stdlib.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   358
+#include <user_attr.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   359
+#include <sys/types.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   360
+#include <unistd.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   361
+#include <strings.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   362
+#include <stdio.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   363
+#include "trusted-utils.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   364
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   365
+/*
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   366
+ * Checks for Multi label session
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   367
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   368
+gboolean
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   369
+tsol_is_multi_label_session (void)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   370
+{
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   371
+  static char *session = NULL;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   372
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   373
+  if (!session)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   374
+    session = (char *)getenv("TRUSTED_SESSION");
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   375
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   376
+  if (!session)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   377
+    return FALSE;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   378
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   379
+  return TRUE;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   380
+}
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   381
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   382
+/*
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   383
+ * dynamicly load the libxtsol library
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   384
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   385
+static
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   386
+void * dlopen_xtsol (void)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   387
+{
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   388
+  void  *handle = NULL;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   389
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   390
+  if ((handle = dlopen ("/usr/lib/libXtsol.so.1", RTLD_LAZY)) != NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   391
+    return handle;
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   392
+  if ((handle = dlopen ("/usr/openwin/lib/libXtsol.so.1", RTLD_LAZY)) != NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   393
+    return handle;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   394
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   395
+  return handle;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   396
+}
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   397
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   398
+/*
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   399
+ * dynamicly load the libDtTsol library
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   400
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   401
+static
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   402
+void * dlopen_gnometsol (void)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   403
+{
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   404
+  void  *handle = NULL;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   405
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   406
+  if ((handle = dlopen ("/usr/lib/libgnometsol.so.1", RTLD_LAZY)) != NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   407
+    return handle;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   408
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   409
+  return handle;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   410
+}
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   411
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   412
+xtsol_XTSOLgetWorkstationOwner      libxtsol_XTSOLgetWorkstationOwner = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   413
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   414
+void
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   415
+XTSOLgetWorkstationOwner(Display *dpy, uid_t *WorkstationOwner)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   416
+{
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   417
+  static gpointer xtsol_handle = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   418
+  static gboolean _xtsol_initialized = FALSE;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   419
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   420
+  if ( ! _xtsol_initialized )
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   421
+    {
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   422
+      _xtsol_initialized = TRUE;
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   423
+      xtsol_handle = dlopen_xtsol ();
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   424
+      if (xtsol_handle != NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   425
+	libxtsol_XTSOLgetWorkstationOwner
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   426
+	  = (xtsol_XTSOLgetWorkstationOwner) dlsym(xtsol_handle,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   427
+						   "XTSOLgetWorkstationOwner");
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   428
+    }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   429
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   430
+  if (libxtsol_XTSOLgetWorkstationOwner == NULL)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   431
+    *WorkstationOwner = getuid();
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   432
+  else
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   433
+    libxtsol_XTSOLgetWorkstationOwner(dpy, WorkstationOwner);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   434
+}
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   435
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   436
+xtsol_XTSOLMakeTPWindow      libxtsol_XTSOLMakeTPWindow = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   437
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   438
+void
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   439
+XTSOLMakeTPWindow(Display *dpy, Window w)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   440
+{
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   441
+  static gpointer xtsol_handle = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   442
+  static gboolean _xtsol_initialized = FALSE;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   443
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   444
+  if ( ! _xtsol_initialized )
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   445
+    {
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   446
+      _xtsol_initialized = TRUE;
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   447
+      xtsol_handle = dlopen_xtsol ();
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   448
+      if (xtsol_handle != NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   449
+	libxtsol_XTSOLMakeTPWindow
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   450
+	  = (xtsol_XTSOLMakeTPWindow) dlsym(xtsol_handle,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   451
+					    "XTSOLMakeTPWindow");
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   452
+    }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   453
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   454
+  if (libxtsol_XTSOLMakeTPWindow)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   455
+    {
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   456
+      libxtsol_XTSOLMakeTPWindow(dpy, w);
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   457
+    }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   458
+}
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   459
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   460
+gnome_tsol_get_usrattr_val		libgnome_tsol_get_usrattr_val = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   461
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   462
+/*
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   463
+ * Returns a value from uattr for the given key.
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   464
+ * If there is no value in user_attr, then it returns the
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   465
+ * system wide default from policy.conf or labelencodings
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   466
+ * as appropriate.
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   467
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   468
+char *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   469
+getusrattrval(userattr_t *uattr, char *keywd)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   470
+{
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   471
+  static gpointer gnometsol_handle = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   472
+  static gboolean _gnometsol_initialized = FALSE;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   473
+  char *value;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   474
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   475
+  if ( ! _gnometsol_initialized )
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   476
+    {
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   477
+      _gnometsol_initialized = TRUE;
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   478
+      gnometsol_handle = dlopen_gnometsol ();
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   479
+      if (gnometsol_handle != NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   480
+	libgnome_tsol_get_usrattr_val
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   481
+	  = (gnome_tsol_get_usrattr_val) dlsym(gnometsol_handle,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   482
+					       "gnome_tsol_get_usrattr_val");
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   483
+    }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   484
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   485
+  if (libgnome_tsol_get_usrattr_val == NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   486
+    {
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   487
+      if (strcmp(keywd, USERATTR_IDLETIME_KW) == 0)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   488
+	value = strdup("15");
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   489
+      else if (strcmp(keywd, USERATTR_IDLECMD_KW) == 0)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   490
+	value = strdup(USERATTR_IDLECMD_LOCK_KW);
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   491
+    } else
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   492
+      value = libgnome_tsol_get_usrattr_val(uattr, keywd);
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   493
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   494
+  return ( value );
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   495
+}
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   496
diff --git xscreensaver-5.11/driver/trusted-utils.h xscreensaver-5.11/driver/trusted-utils.h
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   497
new file mode 100644
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   498
--- /dev/null
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   499
+++ xscreensaver-5.11/driver/trusted-utils.h
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   500
@@ -0,0 +1,54 @@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   501
+/*
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   502
+ * Trusted xscreensaver
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   503
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   504
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   505
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   506
+ * Permission is hereby granted, free of charge, to any person obtaining a
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   507
+ * copy of this software and associated documentation files (the "Software"),
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   508
+ * to deal in the Software without restriction, including without limitation
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   509
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   510
+ * and/or sell copies of the Software, and to permit persons to whom the
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   511
+ * Software is furnished to do so, subject to the following conditions:
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   512
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   513
+ * The above copyright notice and this permission notice (including the next
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   514
+ * paragraph) shall be included in all copies or substantial portions of the
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   515
+ * Software.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   516
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   517
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   518
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   519
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   520
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   521
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   522
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   523
+ * DEALINGS IN THE SOFTWARE.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   524
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   525
+ * Based on work by Erwann Chenede, Ghee Teo
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   526
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   527
+ * Definitions for the trusted functions.
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   528
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   529
+#ifndef TRUSTED_XSCREENSAVER_H
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   530
+#define TRUSTED_XSCREENSAVER_H
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   531
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   532
+#ifdef HAVE_XTSOL
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   533
+#include <X11/extensions/Xtsol.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   534
+#endif /* HAVE_XTSOL */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   535
+#include <user_attr.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   536
+#include <glib.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   537
+#include <X11/Xlib.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   538
+#include <sys/types.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   539
+#include <unistd.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   540
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   541
+extern gboolean tsol_is_multi_label_session (void);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   542
+extern char *getusrattrval(userattr_t *, char *);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   543
+extern void XTSOLgetWorkstationOwner(Display *, uid_t *);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   544
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   545
+typedef void (*xtsol_XTSOLgetWorkstationOwner) (Display *, uid_t *);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   546
+extern void XTSOLMakeTPWindow(Display *, Window);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   547
+typedef void (*xtsol_XTSOLMakeTPWindow) (Display *, Window);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   548
+typedef char *(*gnome_tsol_get_usrattr_val) (userattr_t *, char *);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   549
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   550
+enum {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   551
+	LOCK_CMD = 0,
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   552
+	LOGOUT_CMD
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   553
+};
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   554
+#endif /* TRUSTED_XSCREENSAVER_H */
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   555
diff --git xscreensaver-5.11/driver/types.h xscreensaver-5.11/driver/types.h
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   556
--- xscreensaver-5.11/driver/types.h
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   557
+++ xscreensaver-5.11/driver/types.h
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   558
@@ -105,6 +105,8 @@ struct saver_preferences {
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   559
   Time initial_delay;		/* how long to sleep after launch */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   560
   Time splash_duration;		/* how long the splash screen stays up */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   561
   Time timeout;			/* how much idle time before activation */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   562
+  int lock_cmd;                 /* tsol only  - whether to lock or logout */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   563
+
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   564
   Time lock_timeout;		/* how long after activation locking starts */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   565
   Time cycle;			/* how long each hack should run */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   566
   Time passwd_timeout;		/* how much time before pw dialog goes down */
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   567
diff --git xscreensaver-5.11/driver/xscreensaver-getimage.c xscreensaver-5.11/driver/xscreensaver-getimage.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   568
--- xscreensaver-5.11/driver/xscreensaver-getimage.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   569
+++ xscreensaver-5.11/driver/xscreensaver-getimage.c
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   570
@@ -83,6 +83,7 @@ static char *defaults[] = {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   571
  0
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   572
 };
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   573
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   574
+extern Display *global_dpy;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   575
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   576
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   577
 char *progname = 0;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   578
@@ -1797,7 +1798,7 @@ main (int argc, char **argv)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   579
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   580
   toplevel = XtAppInitialize (&app, progclass, 0, 0, &argc, argv,
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   581
                               defaults, 0, 0);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   582
-  dpy = XtDisplay (toplevel);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   583
+  global_dpy = dpy = XtDisplay (toplevel);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   584
   screen = XtScreen (toplevel);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   585
   db = XtDatabase (dpy);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   586
   XtGetApplicationNameAndClass (dpy, &s, &progclass);
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   587
diff --git xscreensaver-5.11/driver/xscreensaver.c xscreensaver-5.11/driver/xscreensaver.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   588
--- xscreensaver-5.11/driver/xscreensaver.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   589
+++ xscreensaver-5.11/driver/xscreensaver.c
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   590
@@ -142,6 +142,7 @@
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   591
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   592
 #include <stdio.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   593
 #include <ctype.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   594
+#include <zone.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   595
 #include <X11/Xlib.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   596
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   597
 #include <locale.h>
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   598
@@ -224,6 +225,9 @@
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   599
 #include "usleep.h"
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   600
 #include "auth.h"
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   601
 
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   602
+#include "trusted-utils.h"
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   603
+extern Display *global_dpy;
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   604
+
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   605
 saver_info *global_si_kludge = 0;	/* I hate C so much... */
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   606
 
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   607
 /* Globals */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   608
@@ -1447,6 +1451,9 @@ main (int argc, char **argv)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   609
   struct passwd *spasswd;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   610
   int i;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   611
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   612
+  if (tsol_is_multi_label_session () && (getzoneid () != 0))
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   613
+    exit (1);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   614
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   615
 #ifdef ENABLE_NLS
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   616
   if (!setlocale (LC_ALL, ""))
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   617
     fprintf (stderr, "locale not supported by C library\n");
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   618
@@ -1489,6 +1496,7 @@ main (int argc, char **argv)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   619
 # endif /* !NO_LOCKING */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   620
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   621
   shell = connect_to_server (si, &argc, argv);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   622
+  global_dpy = XtDisplay(shell);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   623
   process_command_line (si, &argc, argv);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   624
   stderr_log_file (si);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   625
   print_banner (si);