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