patches/xscreensaver-13-trusted.diff
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 20008 adfb891193bd
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446
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
 
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18045
diff changeset
    40
@@ -794,9 +798,9 @@ XScreenSaver_Xm_ad.h: XScreenSaver-Xm.ad
18027
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)
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18045
diff changeset
    45
-	$(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(SAVER_LIBS) \
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18045
diff changeset
    46
-	-lgconf-2 -lgobject-2.0
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    47
+xscreensaver: $(SAVER_OBJS) $(TRUSTED_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    48
+	$(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(TRUSTED_OBJS) \
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18045
diff changeset
    49
+	$(TRUSTED_LIBS) $(SAVER_LIBS) -lgconf-2 -lgobject-2.0
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    50
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    51
 xscreensaver-command: $(CMD_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    52
 	$(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18045
diff changeset
    53
@@ -815,8 +819,9 @@ xscreensaver-demo: @PREFERRED_DEMO_PROGRAM@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    54
 xscreensaver-lock: @PREFERRED_LOCK_PROGRAM@
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    55
 	$(INSTALL_PROGRAM) @PREFERRED_LOCK_PROGRAM@ $@
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    56
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    57
-xscreensaver-lock-Gtk: $(GTK_LOCK_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    58
+xscreensaver-lock-Gtk: $(GTK_LOCK_OBJS) $(TRUSTED_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    59
 	$(CC) $(LDFLAGS) -o $@ $(GTK_LOCK_OBJS) $(LIBS) $(X_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    60
+	$(TRUSTED_OBJS) $(TRUSTED_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    61
 	$(GTK_LIBS) $(XML_LIBS) $(X_PRE_LIBS) -lXt -lX11 \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    62
 	$(XDPMS_LIBS) -lXext \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    63
 	$(X_EXTRA_LIBS)
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18045
diff changeset
    64
@@ -826,9 +831,9 @@ xscreensaver-demo-Xm: $(DEMO_OBJS) $(MOTIF_OBJS)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    65
 	$(MOTIF_LIBS) $(INTL_LIBS) $(X_PRE_LIBS) -lXt -lX11 \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    66
 	$(XDPMS_LIBS) $(XINERAMA_LIBS) -lXext $(X_EXTRA_LIBS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    67
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    68
-xscreensaver-demo-Gtk: $(DEMO_OBJS) $(GTK_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    69
-	$(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(GTK_OBJS) $(LIBS) $(X_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    70
-	$(GTK_LIBS) $(XPM_LIBS) $(XML_LIBS) $(INTL_LIBS) $(X_PRE_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    71
+xscreensaver-demo-Gtk: $(DEMO_OBJS) $(GTK_OBJS) $(TRUSTED_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    72
+	$(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(GTK_OBJS) $(TRUSTED_OBJS) $(LIBS) $(X_LIBS) \
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    73
+	$(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
    74
 	-lXt -lX11 $(XDPMS_LIBS) $(XINERAMA_LIBS) -lXext $(X_EXTRA_LIBS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    75
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    76
 demo-Gtk.o: XScreenSaver_ad.h
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18045
diff changeset
    77
@@ -837,7 +842,7 @@ xscreensaver.o: XScreenSaver_ad.h
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    78
 xscreensaver-getimage.o: XScreenSaver_ad.h
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    79
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    80
 xscreensaver-getimage: $(GETIMG_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    81
-	$(CC) $(LDFLAGS) -o $@ $(GETIMG_OBJS) $(GETIMG_LIBS) -lm
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    82
+	$(CC) $(LDFLAGS) -o $@ $(GETIMG_OBJS) $(TRUSTED_OBJS) $(GETIMG_LIBS) $(TRUSTED_LIBS) -lm
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    83
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    84
 pdf2jpeg: $(PDF2JPEG_OBJS)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    85
 	$(OBJCC) $(LDFLAGS) -o $@ $(PDF2JPEG_OBJS) $(PDF2JPEG_LIBS) -lm
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    86
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
    87
--- xscreensaver-5.11/driver/demo-Gtk.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
    88
+++ xscreensaver-5.11/driver/demo-Gtk.c
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    89
@@ -136,6 +136,14 @@
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    90
 #include <string.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    91
 #include <ctype.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    92
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    93
+#include <user_attr.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    94
+
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
    95
+#include "trusted-utils.h"
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    96
+void XTSOLgetWorkstationOwner(Display *, uid_t *);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    97
+static gboolean tsol_hack_initialized = False;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    98
+static gboolean tsol_multi_label_session = False;
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
    99
+extern Display *global_dpy;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   100
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   101
 #ifdef HAVE_GTK2
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   102
 enum {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   103
   COL_ENABLED,
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   104
@@ -2904,6 +2912,73 @@ populate_prefs_page (state *s)
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   105
     SENSITIZE ("fade_spinbutton", (fading_possible &&
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   106
                                    (p->fade_p || p->unfade_p)));
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   107
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   108
+    tsol_multi_label_session = tsol_is_multi_label_session ();
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   109
+    if (tsol_multi_label_session)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   110
+      {
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   111
+        static int idletime = 0;
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   112
+        if (!tsol_hack_initialized)
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   113
+          {
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   114
+            GtkWidget *doc_menu = name_to_widget(s,"doc_menu");
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   115
+            GtkWidget *restart_menu = name_to_widget(s,"restart");
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   116
+            GtkWidget *kill_menu = name_to_widget(s, "kill_menu");
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   117
+            GtkWidget *lock_spinbutton = name_to_widget(s, "lock_spinbutton");
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   118
+            GtkWidget *timeout_spinbutton = name_to_widget(s, "timeout_spinbutton");
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   119
+            GtkWidget *lock_container = name_to_widget(s, "blanking_table");
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   120
+            GtkWidget *lock_button_eventbox = name_to_widget(s, "lock_button_eventbox");
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   121
+            Widget *newlabel = g_object_new(GTK_TYPE_LABEL, "label",
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   122
+                                            _("_Lock Screen After"),
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   123
+                                            "use-underline", TRUE,
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   124
+                                            "mnemonic-widget", lock_spinbutton,
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   125
+                                            NULL);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   126
+            GValue *gv = g_new0(GValue, 1);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   127
+            GtkAdjustment *adj;
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   128
+            userattr_t *uent;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   129
+
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   130
+            char *value = NULL;
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   131
+            uid_t WorkstationOwner;
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   132
+            Display *dpy = GDK_DISPLAY();
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   133
+
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   134
+            gtk_widget_hide(doc_menu);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   135
+            gtk_widget_set_sensitive(restart_menu, FALSE);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   136
+            gtk_widget_set_sensitive (kill_menu, FALSE);
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   137
+
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   138
+            XTSOLgetWorkstationOwner(dpy, &WorkstationOwner);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   139
+            uent = getuseruid(WorkstationOwner);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   140
+            value = getusrattrval(uent, USERATTR_IDLETIME_KW);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   141
+            if (value != NULL)
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   142
+              {
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   143
+                idletime = atoi(value);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   144
+                if (idletime)
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   145
+                  {
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   146
+                    adj = gtk_spin_button_get_adjustment((GtkSpinButton  *)timeout_spinbutton);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   147
+                    adj->upper = (gdouble)idletime;
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   148
+                    if (adj->value > adj->upper)
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   149
+                      adj->value = adj->upper;
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   150
+                    gtk_spin_button_set_adjustment((GtkSpinButton *)timeout_spinbutton, adj);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   151
+                  }
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   152
+              }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   153
+
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   154
+            gtk_container_add(GTK_CONTAINER(lock_container), GTK_WIDGET(newlabel));
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   155
+            g_value_init(gv, G_TYPE_INT);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   156
+            g_value_set_int(gv, 2);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   157
+            gtk_container_child_set_property(GTK_CONTAINER(lock_container), GTK_WIDGET(newlabel), "top_attach", gv);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   158
+            g_value_set_int(gv, 1);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   159
+            gtk_container_child_set_property(GTK_CONTAINER(lock_container), GTK_WIDGET(newlabel), "left_attach", gv);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   160
+            gtk_widget_show(GTK_WIDGET(newlabel));
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   161
+            gtk_widget_hide(GTK_WIDGET(lock_button_eventbox));
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   162
+            g_object_set(lock_button_eventbox, "active", TRUE, NULL);
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   163
+
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   164
+            tsol_hack_initialized = True;
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   165
+          }
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   166
+
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   167
+        if (idletime)
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   168
+          {
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   169
+            SENSITIZE ("lock_spinbutton", 0);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   170
+            SENSITIZE ("lock_mlabel",     0);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   171
+            SENSITIZE ("lock_button",     0);
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   172
+          }
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   173
+      }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   174
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   175
 # undef SENSITIZE
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   176
   }
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   177
 }
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   178
@@ -2991,6 +3066,9 @@ sensitize_menu_items (state *s, Bool force_p)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   179
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   180
   for (i = 0; i < countof(names); i++)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   181
     {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   182
+      if (tsol_is_multi_label_session() && 2==i)
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   183
+        continue;
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
       GtkWidget *w = name_to_widget (s, names[i]);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   186
       gtk_widget_set_sensitive (GTK_WIDGET(w), running_p);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   187
     }
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   188
@@ -4957,7 +5035,7 @@ main (int argc, char **argv)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   189
                                      applicationShellWidgetClass,
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   190
                                      dpy, 0, 0);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   191
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   192
-  dpy = XtDisplay (toplevel_shell);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   193
+  global_dpy = dpy = XtDisplay (toplevel_shell);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   194
   db = XtDatabase (dpy);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   195
   XtGetApplicationNameAndClass (dpy, &progname, &progclass);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   196
   XSetErrorHandler (demo_ehandler);
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   197
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
   198
--- xscreensaver-5.11/driver/lock-Gtk.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   199
+++ xscreensaver-5.11/driver/lock-Gtk.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   200
@@ -71,6 +71,7 @@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   201
 #include <atk/atkobject.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   202
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   203
 #include "remote.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   204
+#include "trusted-utils.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   205
 
18124
ac2b6be91df8 2010-06-15 Alan Coopersmith <[email protected]>
alanc
parents: 18087
diff changeset
   206
 #if GTK_CHECK_VERSION(2,14,0)
ac2b6be91df8 2010-06-15 Alan Coopersmith <[email protected]>
alanc
parents: 18087
diff changeset
   207
 # define GET_WINDOW(w)          gtk_widget_get_window (w)
ac2b6be91df8 2010-06-15 Alan Coopersmith <[email protected]>
alanc
parents: 18087
diff changeset
   208
@@ -154,7 +155,10 @@ load_unlock_logo_image (void)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   209
   const char *logofile;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   210
   struct stat statbuf;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   211
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   212
-  logofile = DEFAULT_ICONDIR "/unlock-logo.png";
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   213
+  if (tsol_is_multi_label_session())
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   214
+    logofile = DEFAULT_ICONDIR "/trusted-logo.png";
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   215
+  else
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   216
+    logofile = DEFAULT_ICONDIR "/unlock-logo.png";
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   217
 
18045
dbf849ca434c 2010-05-27 Brian Cameron <[email protected]>
alanc
parents: 18044
diff changeset
   218
   if (stat (logofile, &statbuf) != 0)
dbf849ca434c 2010-05-27 Brian Cameron <[email protected]>
alanc
parents: 18044
diff changeset
   219
     {
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   220
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
   221
--- xscreensaver-5.11/driver/prefs.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   222
+++ xscreensaver-5.11/driver/prefs.c
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   223
@@ -37,6 +37,8 @@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   224
 # include "vms-pwd.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   225
 #endif /* VMS */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   226
 
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   227
+#include "trusted-utils.h"
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   228
+#include <user_attr.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   229
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   230
 /* 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
   231
 #undef XtPointer
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   232
@@ -67,6 +69,9 @@
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   233
 #include "prefs.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   234
 #include "resources.h"
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   235
 
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   236
+#include "trusted-utils.h"
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   237
+Display *global_dpy;
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   238
+
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   239
 /* don't use realpath() on fedora system */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   240
 #ifdef _FORTIFY_SOURCE
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   241
 #undef HAVE_REALPATH
18124
ac2b6be91df8 2010-06-15 Alan Coopersmith <[email protected]>
alanc
parents: 18087
diff changeset
   242
@@ -1046,7 +1051,10 @@ load_init_file (Display *dpy, saver_preferences *p)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   243
   p->xsync_p	    = get_boolean_resource (dpy, "synchronous", "Synchronous");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   244
   p->verbose_p	    = get_boolean_resource (dpy, "verbose", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   245
   p->timestamp_p    = get_boolean_resource (dpy, "timestamp", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   246
-  p->lock_p	    = get_boolean_resource (dpy, "lock", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   247
+  if (tsol_is_multi_label_session())
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   248
+    p->lock_p       = True; /* always lock in a Multi Label Session */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   249
+  else
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   250
+    p->lock_p       = get_boolean_resource (dpy, "lock", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   251
   p->fade_p	    = get_boolean_resource (dpy, "fade", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   252
   p->unfade_p	    = get_boolean_resource (dpy, "unfade", "Boolean");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   253
   p->fade_seconds   = 1000 * get_seconds_resource (dpy, "fadeSeconds", "Time");
18132
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   254
@@ -1070,6 +1078,7 @@ load_init_file (Display *dpy, saver_preferences *p)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   255
   p->lock_timeout    = 1000 * get_minutes_resource (dpy, "lockTimeout", "Time");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   256
   p->cycle           = 1000 * get_minutes_resource (dpy, "cycle", "Time");
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   257
   p->passwd_timeout  = 1000 * get_seconds_resource (dpy, "passwdTimeout", "Time");
18132
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   258
+
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   259
   /* bugid 5077981 */
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   260
   p->unlock_timeout_p = get_boolean_resource (dpy, "passwdTimeoutEnabled", "Boolean");
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   261
   p->pointer_timeout = 1000 * get_seconds_resource (dpy, "pointerPollTime", "Time");
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   262
@@ -1175,6 +1184,38 @@ load_init_file (Display *dpy, saver_preferences *p)
18132
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   263
     if (s) free (s);
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   264
   }
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   265
 
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   266
+  if (tsol_is_multi_label_session())
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   267
+    {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   268
+      userattr_t *uent;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   269
+      int idletime;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   270
+      char *value = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   271
+      uid_t WorkstationOwner;
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
+      XTSOLgetWorkstationOwner (global_dpy, &WorkstationOwner);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   274
+      uent = getuseruid (WorkstationOwner);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   275
+      value = getusrattrval (uent, USERATTR_IDLETIME_KW);
20008
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   276
+      if (value != NULL)
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   277
+        {
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   278
+          idletime = atoi(value) * 60 * 1000;
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   279
+          if (idletime)
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   280
+            {
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   281
+              p->lock_timeout = 0;
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   282
+              if (p->timeout > idletime)
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   283
+                p->timeout = idletime;
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   284
+            }
adfb891193bd 2010-08-10 Brian Cameron <[email protected]>
yippi
parents: 18163
diff changeset
   285
+         }
18132
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   286
+
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   287
+      /* always lock or logout in a Multi Label Session */
18163
fcf7ecec2d4e 2010-06-22 Alan Coopersmith <[email protected]>
alanc
parents: 18160
diff changeset
   288
+      if (p->mode == DONT_BLANK)
18132
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   289
+        p->mode = BLANK_ONLY;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   290
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   291
+      value = getusrattrval (uent, USERATTR_IDLECMD_KW);
18163
fcf7ecec2d4e 2010-06-22 Alan Coopersmith <[email protected]>
alanc
parents: 18160
diff changeset
   292
+      if (value && strcasecmp (value, USERATTR_IDLECMD_LOGOUT_KW) == 0)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   293
+        p->lock_cmd = LOGOUT_CMD;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   294
+      else
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   295
+        p->lock_cmd = LOCK_CMD;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   296
+    }
18132
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   297
+
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   298
   if (system_default_screenhack_count)  /* note: first_time is also true */
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   299
     {
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   300
       merge_system_screenhacks (dpy, p, system_default_screenhacks,
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   301
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
   302
--- xscreensaver-5.11/driver/subprocs.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   303
+++ xscreensaver-5.11/driver/subprocs.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   304
@@ -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
   305
 #include "exec.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   306
 #include "yarandom.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   307
 #include "visual.h"    /* for id_to_visual() */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   308
+#include "trusted-utils.h"
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
 extern saver_info *global_si_kludge;	/* I hate C so much... */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   311
 
18160
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   312
@@ -932,6 +933,30 @@ check_if_hacks_dir_exists(Bool verbose_p)
18132
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   313
     }
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   314
 }
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   315
 
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   316
+/* Added separate function for logout as we need to find better way to log user
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   317
+   out. See CR6422890. For s10 we will use /usr/bin/gnome-session-save --kill
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   318
+*/
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   319
+void
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   320
+logout(saver_screen_info *ssi)
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   321
+{
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   322
+  saver_info *si = ssi->global;
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   323
+  saver_preferences *p = &si->prefs;
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   324
+  if (p->lock_cmd == LOGOUT_CMD && !(si->emergency_lock_p || si->locked_p))
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   325
+    {
18160
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   326
+      struct stat st;
18163
fcf7ecec2d4e 2010-06-22 Alan Coopersmith <[email protected]>
alanc
parents: 18160
diff changeset
   327
+      if (!stat ("/usr/bin/gnome-session-save", &st))
18132
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   328
+        {
18163
fcf7ecec2d4e 2010-06-22 Alan Coopersmith <[email protected]>
alanc
parents: 18160
diff changeset
   329
+          pid_t forked = fork_and_exec (ssi, "/usr/bin/gnome-session-save\t--force-logout");
fcf7ecec2d4e 2010-06-22 Alan Coopersmith <[email protected]>
alanc
parents: 18160
diff changeset
   330
+          if (forked < 1)
18160
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   331
+            {
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   332
+              char buf [255];
18163
fcf7ecec2d4e 2010-06-22 Alan Coopersmith <[email protected]>
alanc
parents: 18160
diff changeset
   333
+              snprintf (buf, sizeof(buf), "%s: couldn't fork", blurb());
18160
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   334
+              perror (buf);
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   335
+            }
18132
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   336
+        }
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   337
+    }
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   338
+}
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   339
+
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   340
 void
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   341
 spawn_screenhack (saver_screen_info *ssi)
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   342
 {
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   343
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
   344
new file mode 100644
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   345
--- /dev/null
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   346
+++ xscreensaver-5.11/driver/trusted-utils.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   347
@@ -0,0 +1,171 @@
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
+ * Trusted xscreensaver
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   350
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   351
+ * 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
   352
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   353
+ * 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
   354
+ * copy of this software and associated documentation files (the "Software"),
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   355
+ * to deal in the Software without restriction, including without limitation
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   356
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   357
+ * 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
   358
+ * Software is furnished to do so, subject to the following conditions:
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   359
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   360
+ * The above copyright notice and this permission notice (including the next
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   361
+ * 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
   362
+ * Software.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   363
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   364
+ * 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
   365
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   366
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   367
+ * 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
   368
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   369
+ * 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
   370
+ * DEALINGS IN THE SOFTWARE.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   371
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   372
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   373
+ * Based on work by Erwann Chenede, Ghee Teo
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   374
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   375
+ * 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
   376
+ * additional functionality within the multilabel session.
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   377
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   378
+#include <dlfcn.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   379
+#include <link.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   380
+#include <stdlib.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   381
+#include <user_attr.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   382
+#include <sys/types.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   383
+#include <unistd.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   384
+#include <strings.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   385
+#include <stdio.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   386
+#include "trusted-utils.h"
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   387
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   388
+/*
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   389
+ * Checks for Multi label session
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   390
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   391
+gboolean
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   392
+tsol_is_multi_label_session (void)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   393
+{
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   394
+  static char *session = NULL;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   395
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   396
+  if (!session)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   397
+    session = (char *)getenv("TRUSTED_SESSION");
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   398
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   399
+  if (!session)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   400
+    return FALSE;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   401
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   402
+  return TRUE;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   403
+}
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   404
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   405
+/*
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   406
+ * dynamicly load the libxtsol library
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   407
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   408
+static
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   409
+void * dlopen_xtsol (void)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   410
+{
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   411
+  void  *handle = NULL;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   412
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   413
+  if ((handle = dlopen ("/usr/lib/libXtsol.so.1", RTLD_LAZY)) != NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   414
+    return handle;
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   415
+  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
   416
+    return handle;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   417
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   418
+  return handle;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   419
+}
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   420
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   421
+/*
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   422
+ * dynamicly load the libDtTsol library
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   423
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   424
+static
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   425
+void * dlopen_gnometsol (void)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   426
+{
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   427
+  void  *handle = NULL;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   428
+
18132
dc3852ef4fe2 CR 6955133, screensaver IDLECMD in policy.conf does not work with TJDS and ldap users
akumrao
parents: 18124
diff changeset
   429
+  if ((handle = dlopen ("/usr/lib/libgnometsol.so", RTLD_LAZY)) != NULL)
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   430
+    return handle;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   431
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   432
+  return handle;
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   433
+}
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
+xtsol_XTSOLgetWorkstationOwner      libxtsol_XTSOLgetWorkstationOwner = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   436
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   437
+void
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   438
+XTSOLgetWorkstationOwner(Display *dpy, uid_t *WorkstationOwner)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   439
+{
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   440
+  static gpointer xtsol_handle = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   441
+  static gboolean _xtsol_initialized = FALSE;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   442
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   443
+  if ( ! _xtsol_initialized )
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   444
+    {
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   445
+      _xtsol_initialized = TRUE;
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   446
+      xtsol_handle = dlopen_xtsol ();
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   447
+      if (xtsol_handle != NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   448
+	libxtsol_XTSOLgetWorkstationOwner
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   449
+	  = (xtsol_XTSOLgetWorkstationOwner) dlsym(xtsol_handle,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   450
+						   "XTSOLgetWorkstationOwner");
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   451
+    }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   452
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   453
+  if (libxtsol_XTSOLgetWorkstationOwner == NULL)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   454
+    *WorkstationOwner = getuid();
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   455
+  else
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   456
+    libxtsol_XTSOLgetWorkstationOwner(dpy, WorkstationOwner);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   457
+}
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
+xtsol_XTSOLMakeTPWindow      libxtsol_XTSOLMakeTPWindow = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   460
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   461
+void
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   462
+XTSOLMakeTPWindow(Display *dpy, Window w)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   463
+{
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   464
+  static gpointer xtsol_handle = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   465
+  static gboolean _xtsol_initialized = FALSE;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   466
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   467
+  if ( ! _xtsol_initialized )
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   468
+    {
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   469
+      _xtsol_initialized = TRUE;
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   470
+      xtsol_handle = dlopen_xtsol ();
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   471
+      if (xtsol_handle != NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   472
+	libxtsol_XTSOLMakeTPWindow
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   473
+	  = (xtsol_XTSOLMakeTPWindow) dlsym(xtsol_handle,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   474
+					    "XTSOLMakeTPWindow");
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   475
+    }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   476
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   477
+  if (libxtsol_XTSOLMakeTPWindow)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   478
+    {
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   479
+      libxtsol_XTSOLMakeTPWindow(dpy, w);
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   480
+    }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   481
+}
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   482
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   483
+gnome_tsol_get_usrattr_val		libgnome_tsol_get_usrattr_val = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   484
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   485
+/*
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   486
+ * Returns a value from uattr for the given key.
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   487
+ * If there is no value in user_attr, then it returns the
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   488
+ * system wide default from policy.conf or labelencodings
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   489
+ * as appropriate.
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   490
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   491
+char *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   492
+getusrattrval(userattr_t *uattr, char *keywd)
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
+  static gpointer gnometsol_handle = NULL;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   495
+  static gboolean _gnometsol_initialized = FALSE;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   496
+  char *value;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   497
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   498
+  if ( ! _gnometsol_initialized )
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   499
+    {
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   500
+      _gnometsol_initialized = TRUE;
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   501
+      gnometsol_handle = dlopen_gnometsol ();
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   502
+      if (gnometsol_handle != NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   503
+	libgnome_tsol_get_usrattr_val
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   504
+	  = (gnome_tsol_get_usrattr_val) dlsym(gnometsol_handle,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   505
+					       "gnome_tsol_get_usrattr_val");
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   506
+    }
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   507
+
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   508
+  if (libgnome_tsol_get_usrattr_val == NULL)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   509
+    {
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   510
+      if (strcmp(keywd, USERATTR_IDLETIME_KW) == 0)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   511
+	value = strdup("15");
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   512
+      else if (strcmp(keywd, USERATTR_IDLECMD_KW) == 0)
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   513
+	value = strdup(USERATTR_IDLECMD_LOCK_KW);
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   514
+    } else
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   515
+      value = libgnome_tsol_get_usrattr_val(uattr, keywd);
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   516
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   517
+  return ( value );
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   518
+}
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   519
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
   520
new file mode 100644
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   521
--- /dev/null
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   522
+++ xscreensaver-5.11/driver/trusted-utils.h
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   523
@@ -0,0 +1,54 @@
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
+ * Trusted xscreensaver
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   526
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   527
+ * 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
   528
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   529
+ * 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
   530
+ * copy of this software and associated documentation files (the "Software"),
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   531
+ * to deal in the Software without restriction, including without limitation
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   532
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   533
+ * 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
   534
+ * Software is furnished to do so, subject to the following conditions:
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   535
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   536
+ * The above copyright notice and this permission notice (including the next
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   537
+ * 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
   538
+ * Software.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   539
+ *
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   540
+ * 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
   541
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   542
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   543
+ * 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
   544
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   545
+ * 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
   546
+ * DEALINGS IN THE SOFTWARE.
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   547
+ *
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   548
+ * Based on work by Erwann Chenede, Ghee Teo
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
+ * Definitions for the trusted functions.
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   551
+ */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   552
+#ifndef TRUSTED_XSCREENSAVER_H
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   553
+#define TRUSTED_XSCREENSAVER_H
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   554
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   555
+#ifdef HAVE_XTSOL
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   556
+#include <X11/extensions/Xtsol.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   557
+#endif /* HAVE_XTSOL */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   558
+#include <user_attr.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   559
+#include <glib.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   560
+#include <X11/Xlib.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   561
+#include <sys/types.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   562
+#include <unistd.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   563
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   564
+extern gboolean tsol_is_multi_label_session (void);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   565
+extern char *getusrattrval(userattr_t *, char *);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   566
+extern void XTSOLgetWorkstationOwner(Display *, uid_t *);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   567
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   568
+typedef void (*xtsol_XTSOLgetWorkstationOwner) (Display *, uid_t *);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   569
+extern void XTSOLMakeTPWindow(Display *, Window);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   570
+typedef void (*xtsol_XTSOLMakeTPWindow) (Display *, Window);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   571
+typedef char *(*gnome_tsol_get_usrattr_val) (userattr_t *, char *);
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
+enum {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   574
+	LOCK_CMD = 0,
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   575
+	LOGOUT_CMD
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
+#endif /* TRUSTED_XSCREENSAVER_H */
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   578
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
   579
--- xscreensaver-5.11/driver/types.h
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   580
+++ xscreensaver-5.11/driver/types.h
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   581
@@ -105,6 +105,8 @@ struct saver_preferences {
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   582
   Time initial_delay;		/* how long to sleep after launch */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   583
   Time splash_duration;		/* how long the splash screen stays up */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   584
   Time timeout;			/* how much idle time before activation */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   585
+  int lock_cmd;                 /* tsol only  - whether to lock or logout */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   586
+
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   587
   Time lock_timeout;		/* how long after activation locking starts */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   588
   Time cycle;			/* how long each hack should run */
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   589
   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
   590
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
   591
--- xscreensaver-5.11/driver/xscreensaver-getimage.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   592
+++ xscreensaver-5.11/driver/xscreensaver-getimage.c
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   593
@@ -83,6 +83,7 @@ static char *defaults[] = {
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   594
  0
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   595
 };
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
+extern Display *global_dpy;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   598
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   599
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   600
 char *progname = 0;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   601
@@ -1797,7 +1798,7 @@ main (int argc, char **argv)
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   602
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   603
   toplevel = XtAppInitialize (&app, progclass, 0, 0, &argc, argv,
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   604
                               defaults, 0, 0);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   605
-  dpy = XtDisplay (toplevel);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   606
+  global_dpy = dpy = XtDisplay (toplevel);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   607
   screen = XtScreen (toplevel);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   608
   db = XtDatabase (dpy);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   609
   XtGetApplicationNameAndClass (dpy, &s, &progclass);
18039
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   610
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
   611
--- xscreensaver-5.11/driver/xscreensaver.c
93dd6ed68b16 2010-05-26 Alan Coopersmith <[email protected]>
alanc
parents: 18027
diff changeset
   612
+++ xscreensaver-5.11/driver/xscreensaver.c
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   613
@@ -142,6 +142,7 @@
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
 #include <stdio.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   616
 #include <ctype.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   617
+#include <zone.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   618
 #include <X11/Xlib.h>
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   619
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   620
 #include <locale.h>
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18045
diff changeset
   621
@@ -226,6 +227,9 @@
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   622
 #include "usleep.h"
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   623
 #include "auth.h"
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   624
 
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   625
+#include "trusted-utils.h"
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   626
+extern Display *global_dpy;
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   627
+
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   628
 saver_info *global_si_kludge = 0;	/* I hate C so much... */
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   629
 
18044
c733815d6bee * patches/xscreensaver-06-gtk-lock.diff,
alanc
parents: 18039
diff changeset
   630
 /* Globals */
18160
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   631
@@ -1180,6 +1184,9 @@ main_loop (saver_info *si)
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   632
 
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   633
       maybe_reload_init_file (si);
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   634
 
18163
fcf7ecec2d4e 2010-06-22 Alan Coopersmith <[email protected]>
alanc
parents: 18160
diff changeset
   635
+      if (tsol_is_multi_label_session())
18160
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   636
+        logout(&si->screens[0]);
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   637
+
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   638
       if (p->mode == DONT_BLANK)
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   639
         {
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   640
           if (p->verbose_p)
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   641
@@ -1456,6 +1463,9 @@ main (int argc, char **argv)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   642
   struct passwd *spasswd;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   643
   int i;
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   644
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   645
+  if (tsol_is_multi_label_session () && (getzoneid () != 0))
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   646
+    exit (1);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   647
+
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   648
 #ifdef ENABLE_NLS
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   649
   if (!setlocale (LC_ALL, ""))
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   650
     fprintf (stderr, "locale not supported by C library\n");
18160
102afe8c57f8 Updated xscreensaver-13-trusted.diff and xscreensaver-07-allow-root.diff to allow root login in screensaver
akumrao
parents: 18138
diff changeset
   651
@@ -1500,6 +1510,7 @@ main (int argc, char **argv)
18027
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   652
 # endif /* !NO_LOCKING */
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   653
 
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   654
   shell = connect_to_server (si, &argc, argv);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   655
+  global_dpy = XtDisplay(shell);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   656
   process_command_line (si, &argc, argv);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   657
   stderr_log_file (si);
aecb9b8c6ef2 2010-05-25 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   658
   print_banner (si);
18061
1ad14cf3c086 2010-06-01 Alan Coopersmith <[email protected]>
alanc
parents: 18045
diff changeset
   659