author | rohinis |
Tue, 29 Nov 2011 17:32:55 +0000 | |
branch | s11express-2010-11 |
changeset 22234 | c23e64da3e06 |
parent 20008 | adfb891193bd |
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, |
|
20008 | 104 |
@@ -2904,6 +2912,73 @@ populate_prefs_page (state *s) |
105 |
SENSITIZE ("fade_spinbutton", (fading_possible && |
|
106 |
(p->fade_p || p->unfade_p))); |
|
18027 | 107 |
|
108 |
+ tsol_multi_label_session = tsol_is_multi_label_session (); |
|
20008 | 109 |
+ if (tsol_multi_label_session) |
18027 | 110 |
+ { |
20008 | 111 |
+ static int idletime = 0; |
112 |
+ if (!tsol_hack_initialized) |
|
113 |
+ { |
|
114 |
+ GtkWidget *doc_menu = name_to_widget(s,"doc_menu"); |
|
115 |
+ GtkWidget *restart_menu = name_to_widget(s,"restart"); |
|
116 |
+ GtkWidget *kill_menu = name_to_widget(s, "kill_menu"); |
|
117 |
+ GtkWidget *lock_spinbutton = name_to_widget(s, "lock_spinbutton"); |
|
118 |
+ GtkWidget *timeout_spinbutton = name_to_widget(s, "timeout_spinbutton"); |
|
119 |
+ GtkWidget *lock_container = name_to_widget(s, "blanking_table"); |
|
120 |
+ GtkWidget *lock_button_eventbox = name_to_widget(s, "lock_button_eventbox"); |
|
121 |
+ Widget *newlabel = g_object_new(GTK_TYPE_LABEL, "label", |
|
122 |
+ _("_Lock Screen After"), |
|
123 |
+ "use-underline", TRUE, |
|
124 |
+ "mnemonic-widget", lock_spinbutton, |
|
125 |
+ NULL); |
|
126 |
+ GValue *gv = g_new0(GValue, 1); |
|
127 |
+ GtkAdjustment *adj; |
|
128 |
+ userattr_t *uent; |
|
18027 | 129 |
+ |
20008 | 130 |
+ char *value = NULL; |
131 |
+ uid_t WorkstationOwner; |
|
132 |
+ Display *dpy = GDK_DISPLAY(); |
|
18027 | 133 |
+ |
20008 | 134 |
+ gtk_widget_hide(doc_menu); |
135 |
+ gtk_widget_set_sensitive(restart_menu, FALSE); |
|
136 |
+ gtk_widget_set_sensitive (kill_menu, FALSE); |
|
18027 | 137 |
+ |
20008 | 138 |
+ XTSOLgetWorkstationOwner(dpy, &WorkstationOwner); |
139 |
+ uent = getuseruid(WorkstationOwner); |
|
140 |
+ value = getusrattrval(uent, USERATTR_IDLETIME_KW); |
|
141 |
+ if (value != NULL) |
|
142 |
+ { |
|
143 |
+ idletime = atoi(value); |
|
144 |
+ if (idletime) |
|
145 |
+ { |
|
146 |
+ adj = gtk_spin_button_get_adjustment((GtkSpinButton *)timeout_spinbutton); |
|
147 |
+ adj->upper = (gdouble)idletime; |
|
148 |
+ if (adj->value > adj->upper) |
|
149 |
+ adj->value = adj->upper; |
|
150 |
+ gtk_spin_button_set_adjustment((GtkSpinButton *)timeout_spinbutton, adj); |
|
151 |
+ } |
|
152 |
+ } |
|
18027 | 153 |
+ |
20008 | 154 |
+ gtk_container_add(GTK_CONTAINER(lock_container), GTK_WIDGET(newlabel)); |
155 |
+ g_value_init(gv, G_TYPE_INT); |
|
156 |
+ g_value_set_int(gv, 2); |
|
157 |
+ gtk_container_child_set_property(GTK_CONTAINER(lock_container), GTK_WIDGET(newlabel), "top_attach", gv); |
|
158 |
+ g_value_set_int(gv, 1); |
|
159 |
+ gtk_container_child_set_property(GTK_CONTAINER(lock_container), GTK_WIDGET(newlabel), "left_attach", gv); |
|
160 |
+ gtk_widget_show(GTK_WIDGET(newlabel)); |
|
161 |
+ gtk_widget_hide(GTK_WIDGET(lock_button_eventbox)); |
|
162 |
+ g_object_set(lock_button_eventbox, "active", TRUE, NULL); |
|
18027 | 163 |
+ |
20008 | 164 |
+ tsol_hack_initialized = True; |
165 |
+ } |
|
166 |
+ |
|
167 |
+ if (idletime) |
|
168 |
+ { |
|
169 |
+ SENSITIZE ("lock_spinbutton", 0); |
|
170 |
+ SENSITIZE ("lock_mlabel", 0); |
|
171 |
+ SENSITIZE ("lock_button", 0); |
|
172 |
+ } |
|
18039 | 173 |
+ } |
18027 | 174 |
+ |
175 |
# undef SENSITIZE |
|
176 |
} |
|
177 |
} |
|
20008 | 178 |
@@ -2991,6 +3066,9 @@ sensitize_menu_items (state *s, Bool force_p) |
18027 | 179 |
|
180 |
for (i = 0; i < countof(names); i++) |
|
181 |
{ |
|
182 |
+ if (tsol_is_multi_label_session() && 2==i) |
|
18039 | 183 |
+ continue; |
18027 | 184 |
+ |
185 |
GtkWidget *w = name_to_widget (s, names[i]); |
|
186 |
gtk_widget_set_sensitive (GTK_WIDGET(w), running_p); |
|
187 |
} |
|
20008 | 188 |
@@ -4957,7 +5035,7 @@ main (int argc, char **argv) |
18027 | 189 |
applicationShellWidgetClass, |
190 |
dpy, 0, 0); |
|
191 |
||
192 |
- dpy = XtDisplay (toplevel_shell); |
|
193 |
+ global_dpy = dpy = XtDisplay (toplevel_shell); |
|
194 |
db = XtDatabase (dpy); |
|
195 |
XtGetApplicationNameAndClass (dpy, &progname, &progclass); |
|
196 |
XSetErrorHandler (demo_ehandler); |
|
18039 | 197 |
diff --git xscreensaver-5.11/driver/lock-Gtk.c xscreensaver-5.11/driver/lock-Gtk.c |
198 |
--- xscreensaver-5.11/driver/lock-Gtk.c |
|
199 |
+++ xscreensaver-5.11/driver/lock-Gtk.c |
|
200 |
@@ -71,6 +71,7 @@ |
|
18027 | 201 |
#include <atk/atkobject.h> |
202 |
||
203 |
#include "remote.h" |
|
204 |
+#include "trusted-utils.h" |
|
205 |
||
18124 | 206 |
#if GTK_CHECK_VERSION(2,14,0) |
207 |
# define GET_WINDOW(w) gtk_widget_get_window (w) |
|
208 |
@@ -154,7 +155,10 @@ load_unlock_logo_image (void) |
|
18027 | 209 |
const char *logofile; |
210 |
struct stat statbuf; |
|
211 |
||
212 |
- logofile = DEFAULT_ICONDIR "/unlock-logo.png"; |
|
213 |
+ if (tsol_is_multi_label_session()) |
|
214 |
+ logofile = DEFAULT_ICONDIR "/trusted-logo.png"; |
|
215 |
+ else |
|
216 |
+ logofile = DEFAULT_ICONDIR "/unlock-logo.png"; |
|
217 |
||
18045 | 218 |
if (stat (logofile, &statbuf) != 0) |
219 |
{ |
|
18039 | 220 |
diff --git xscreensaver-5.11/driver/prefs.c xscreensaver-5.11/driver/prefs.c |
221 |
--- xscreensaver-5.11/driver/prefs.c |
|
222 |
+++ xscreensaver-5.11/driver/prefs.c |
|
18044 | 223 |
@@ -37,6 +37,8 @@ |
18027 | 224 |
# include "vms-pwd.h" |
225 |
#endif /* VMS */ |
|
226 |
||
18044 | 227 |
+#include "trusted-utils.h" |
18027 | 228 |
+#include <user_attr.h> |
229 |
||
230 |
/* This file doesn't need the Xt headers, so stub these types out... */ |
|
231 |
#undef XtPointer |
|
18044 | 232 |
@@ -67,6 +69,9 @@ |
18027 | 233 |
#include "prefs.h" |
234 |
#include "resources.h" |
|
18044 | 235 |
|
18027 | 236 |
+#include "trusted-utils.h" |
18044 | 237 |
+Display *global_dpy; |
238 |
+ |
|
18027 | 239 |
/* don't use realpath() on fedora system */ |
240 |
#ifdef _FORTIFY_SOURCE |
|
18044 | 241 |
#undef HAVE_REALPATH |
18124 | 242 |
@@ -1046,7 +1051,10 @@ load_init_file (Display *dpy, saver_preferences *p) |
18027 | 243 |
p->xsync_p = get_boolean_resource (dpy, "synchronous", "Synchronous"); |
244 |
p->verbose_p = get_boolean_resource (dpy, "verbose", "Boolean"); |
|
245 |
p->timestamp_p = get_boolean_resource (dpy, "timestamp", "Boolean"); |
|
246 |
- p->lock_p = get_boolean_resource (dpy, "lock", "Boolean"); |
|
247 |
+ if (tsol_is_multi_label_session()) |
|
248 |
+ p->lock_p = True; /* always lock in a Multi Label Session */ |
|
249 |
+ else |
|
250 |
+ p->lock_p = get_boolean_resource (dpy, "lock", "Boolean"); |
|
251 |
p->fade_p = get_boolean_resource (dpy, "fade", "Boolean"); |
|
252 |
p->unfade_p = get_boolean_resource (dpy, "unfade", "Boolean"); |
|
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 | 255 |
p->lock_timeout = 1000 * get_minutes_resource (dpy, "lockTimeout", "Time"); |
256 |
p->cycle = 1000 * get_minutes_resource (dpy, "cycle", "Time"); |
|
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 | 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 | 266 |
+ if (tsol_is_multi_label_session()) |
267 |
+ { |
|
268 |
+ userattr_t *uent; |
|
269 |
+ int idletime; |
|
270 |
+ char *value = NULL; |
|
271 |
+ uid_t WorkstationOwner; |
|
272 |
+ |
|
273 |
+ XTSOLgetWorkstationOwner (global_dpy, &WorkstationOwner); |
|
274 |
+ uent = getuseruid (WorkstationOwner); |
|
275 |
+ value = getusrattrval (uent, USERATTR_IDLETIME_KW); |
|
20008 | 276 |
+ if (value != NULL) |
277 |
+ { |
|
278 |
+ idletime = atoi(value) * 60 * 1000; |
|
279 |
+ if (idletime) |
|
280 |
+ { |
|
281 |
+ p->lock_timeout = 0; |
|
282 |
+ if (p->timeout > idletime) |
|
283 |
+ p->timeout = idletime; |
|
284 |
+ } |
|
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 | 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 | 290 |
+ |
291 |
+ value = getusrattrval (uent, USERATTR_IDLECMD_KW); |
|
18163 | 292 |
+ if (value && strcasecmp (value, USERATTR_IDLECMD_LOGOUT_KW) == 0) |
18027 | 293 |
+ p->lock_cmd = LOGOUT_CMD; |
294 |
+ else |
|
295 |
+ p->lock_cmd = LOCK_CMD; |
|
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 | 301 |
diff --git xscreensaver-5.11/driver/subprocs.c xscreensaver-5.11/driver/subprocs.c |
302 |
--- xscreensaver-5.11/driver/subprocs.c |
|
303 |
+++ xscreensaver-5.11/driver/subprocs.c |
|
304 |
@@ -70,6 +70,7 @@ extern int kill (pid_t, int); /* signal() is in sys/signal.h... */ |
|
18027 | 305 |
#include "exec.h" |
306 |
#include "yarandom.h" |
|
307 |
#include "visual.h" /* for id_to_visual() */ |
|
308 |
+#include "trusted-utils.h" |
|
309 |
||
310 |
extern saver_info *global_si_kludge; /* I hate C so much... */ |
|
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 | 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 | 329 |
+ pid_t forked = fork_and_exec (ssi, "/usr/bin/gnome-session-save\t--force-logout"); |
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 | 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 | 343 |
diff --git xscreensaver-5.11/driver/trusted-utils.c xscreensaver-5.11/driver/trusted-utils.c |
344 |
new file mode 100644 |
|
345 |
--- /dev/null |
|
346 |
+++ xscreensaver-5.11/driver/trusted-utils.c |
|
347 |
@@ -0,0 +1,171 @@ |
|
18027 | 348 |
+/* |
349 |
+ * Trusted xscreensaver |
|
350 |
+ * |
|
18039 | 351 |
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. |
18027 | 352 |
+ * |
353 |
+ * Permission is hereby granted, free of charge, to any person obtaining a |
|
18039 | 354 |
+ * copy of this software and associated documentation files (the "Software"), |
355 |
+ * to deal in the Software without restriction, including without limitation |
|
356 |
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
|
357 |
+ * and/or sell copies of the Software, and to permit persons to whom the |
|
358 |
+ * Software is furnished to do so, subject to the following conditions: |
|
18027 | 359 |
+ * |
18039 | 360 |
+ * The above copyright notice and this permission notice (including the next |
361 |
+ * paragraph) shall be included in all copies or substantial portions of the |
|
362 |
+ * Software. |
|
18027 | 363 |
+ * |
18039 | 364 |
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
365 |
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
366 |
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
367 |
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
368 |
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
369 |
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
370 |
+ * DEALINGS IN THE SOFTWARE. |
|
18027 | 371 |
+ * |
372 |
+ * |
|
373 |
+ * Based on work by Erwann Chenede, Ghee Teo |
|
374 |
+ * |
|
375 |
+ * Used to check if we are in a multilabel session and to load |
|
376 |
+ * additional functionality within the multilabel session. |
|
377 |
+ */ |
|
378 |
+#include <dlfcn.h> |
|
379 |
+#include <link.h> |
|
380 |
+#include <stdlib.h> |
|
381 |
+#include <user_attr.h> |
|
382 |
+#include <sys/types.h> |
|
383 |
+#include <unistd.h> |
|
384 |
+#include <strings.h> |
|
385 |
+#include <stdio.h> |
|
386 |
+#include "trusted-utils.h" |
|
387 |
+ |
|
388 |
+/* |
|
389 |
+ * Checks for Multi label session |
|
390 |
+ */ |
|
391 |
+gboolean |
|
392 |
+tsol_is_multi_label_session (void) |
|
393 |
+{ |
|
18039 | 394 |
+ static char *session = NULL; |
18027 | 395 |
+ |
18039 | 396 |
+ if (!session) |
397 |
+ session = (char *)getenv("TRUSTED_SESSION"); |
|
18027 | 398 |
+ |
18039 | 399 |
+ if (!session) |
400 |
+ return FALSE; |
|
18027 | 401 |
+ |
18039 | 402 |
+ return TRUE; |
18027 | 403 |
+} |
404 |
+ |
|
405 |
+/* |
|
406 |
+ * dynamicly load the libxtsol library |
|
407 |
+ */ |
|
408 |
+static |
|
409 |
+void * dlopen_xtsol (void) |
|
410 |
+{ |
|
18039 | 411 |
+ void *handle = NULL; |
18027 | 412 |
+ |
18039 | 413 |
+ if ((handle = dlopen ("/usr/lib/libXtsol.so.1", RTLD_LAZY)) != NULL) |
414 |
+ return handle; |
|
415 |
+ if ((handle = dlopen ("/usr/openwin/lib/libXtsol.so.1", RTLD_LAZY)) != NULL) |
|
416 |
+ return handle; |
|
18027 | 417 |
+ |
18039 | 418 |
+ return handle; |
18027 | 419 |
+} |
420 |
+ |
|
421 |
+/* |
|
422 |
+ * dynamicly load the libDtTsol library |
|
423 |
+ */ |
|
424 |
+static |
|
425 |
+void * dlopen_gnometsol (void) |
|
426 |
+{ |
|
18039 | 427 |
+ void *handle = NULL; |
18027 | 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 | 430 |
+ return handle; |
18027 | 431 |
+ |
18039 | 432 |
+ return handle; |
18027 | 433 |
+} |
434 |
+ |
|
435 |
+xtsol_XTSOLgetWorkstationOwner libxtsol_XTSOLgetWorkstationOwner = NULL; |
|
436 |
+ |
|
437 |
+void |
|
438 |
+XTSOLgetWorkstationOwner(Display *dpy, uid_t *WorkstationOwner) |
|
439 |
+{ |
|
440 |
+ static gpointer xtsol_handle = NULL; |
|
441 |
+ static gboolean _xtsol_initialized = FALSE; |
|
442 |
+ |
|
18039 | 443 |
+ if ( ! _xtsol_initialized ) |
444 |
+ { |
|
445 |
+ _xtsol_initialized = TRUE; |
|
446 |
+ xtsol_handle = dlopen_xtsol (); |
|
447 |
+ if (xtsol_handle != NULL) |
|
448 |
+ libxtsol_XTSOLgetWorkstationOwner |
|
449 |
+ = (xtsol_XTSOLgetWorkstationOwner) dlsym(xtsol_handle, |
|
450 |
+ "XTSOLgetWorkstationOwner"); |
|
451 |
+ } |
|
18027 | 452 |
+ |
18039 | 453 |
+ if (libxtsol_XTSOLgetWorkstationOwner == NULL) |
18027 | 454 |
+ *WorkstationOwner = getuid(); |
18039 | 455 |
+ else |
18027 | 456 |
+ libxtsol_XTSOLgetWorkstationOwner(dpy, WorkstationOwner); |
457 |
+} |
|
458 |
+ |
|
459 |
+xtsol_XTSOLMakeTPWindow libxtsol_XTSOLMakeTPWindow = NULL; |
|
460 |
+ |
|
461 |
+void |
|
462 |
+XTSOLMakeTPWindow(Display *dpy, Window w) |
|
463 |
+{ |
|
464 |
+ static gpointer xtsol_handle = NULL; |
|
465 |
+ static gboolean _xtsol_initialized = FALSE; |
|
466 |
+ |
|
18039 | 467 |
+ if ( ! _xtsol_initialized ) |
468 |
+ { |
|
469 |
+ _xtsol_initialized = TRUE; |
|
470 |
+ xtsol_handle = dlopen_xtsol (); |
|
471 |
+ if (xtsol_handle != NULL) |
|
472 |
+ libxtsol_XTSOLMakeTPWindow |
|
473 |
+ = (xtsol_XTSOLMakeTPWindow) dlsym(xtsol_handle, |
|
474 |
+ "XTSOLMakeTPWindow"); |
|
475 |
+ } |
|
18027 | 476 |
+ |
18039 | 477 |
+ if (libxtsol_XTSOLMakeTPWindow) |
478 |
+ { |
|
479 |
+ libxtsol_XTSOLMakeTPWindow(dpy, w); |
|
480 |
+ } |
|
18027 | 481 |
+} |
482 |
+ |
|
483 |
+gnome_tsol_get_usrattr_val libgnome_tsol_get_usrattr_val = NULL; |
|
484 |
+ |
|
485 |
+/* |
|
486 |
+ * Returns a value from uattr for the given key. |
|
487 |
+ * If there is no value in user_attr, then it returns the |
|
488 |
+ * system wide default from policy.conf or labelencodings |
|
489 |
+ * as appropriate. |
|
490 |
+ */ |
|
491 |
+char * |
|
492 |
+getusrattrval(userattr_t *uattr, char *keywd) |
|
493 |
+{ |
|
494 |
+ static gpointer gnometsol_handle = NULL; |
|
495 |
+ static gboolean _gnometsol_initialized = FALSE; |
|
496 |
+ char *value; |
|
497 |
+ |
|
18039 | 498 |
+ if ( ! _gnometsol_initialized ) |
499 |
+ { |
|
500 |
+ _gnometsol_initialized = TRUE; |
|
501 |
+ gnometsol_handle = dlopen_gnometsol (); |
|
502 |
+ if (gnometsol_handle != NULL) |
|
503 |
+ libgnome_tsol_get_usrattr_val |
|
504 |
+ = (gnome_tsol_get_usrattr_val) dlsym(gnometsol_handle, |
|
505 |
+ "gnome_tsol_get_usrattr_val"); |
|
506 |
+ } |
|
18027 | 507 |
+ |
18039 | 508 |
+ if (libgnome_tsol_get_usrattr_val == NULL) |
509 |
+ { |
|
510 |
+ if (strcmp(keywd, USERATTR_IDLETIME_KW) == 0) |
|
511 |
+ value = strdup("15"); |
|
512 |
+ else if (strcmp(keywd, USERATTR_IDLECMD_KW) == 0) |
|
513 |
+ value = strdup(USERATTR_IDLECMD_LOCK_KW); |
|
514 |
+ } else |
|
515 |
+ value = libgnome_tsol_get_usrattr_val(uattr, keywd); |
|
18027 | 516 |
+ |
517 |
+ return ( value ); |
|
518 |
+} |
|
18039 | 519 |
diff --git xscreensaver-5.11/driver/trusted-utils.h xscreensaver-5.11/driver/trusted-utils.h |
520 |
new file mode 100644 |
|
521 |
--- /dev/null |
|
522 |
+++ xscreensaver-5.11/driver/trusted-utils.h |
|
523 |
@@ -0,0 +1,54 @@ |
|
18027 | 524 |
+/* |
525 |
+ * Trusted xscreensaver |
|
526 |
+ * |
|
18039 | 527 |
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. |
18027 | 528 |
+ * |
529 |
+ * Permission is hereby granted, free of charge, to any person obtaining a |
|
18039 | 530 |
+ * copy of this software and associated documentation files (the "Software"), |
531 |
+ * to deal in the Software without restriction, including without limitation |
|
532 |
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
|
533 |
+ * and/or sell copies of the Software, and to permit persons to whom the |
|
534 |
+ * Software is furnished to do so, subject to the following conditions: |
|
18027 | 535 |
+ * |
18039 | 536 |
+ * The above copyright notice and this permission notice (including the next |
537 |
+ * paragraph) shall be included in all copies or substantial portions of the |
|
538 |
+ * Software. |
|
18027 | 539 |
+ * |
18039 | 540 |
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
541 |
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
542 |
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
543 |
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
544 |
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
545 |
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
546 |
+ * DEALINGS IN THE SOFTWARE. |
|
18027 | 547 |
+ * |
548 |
+ * Based on work by Erwann Chenede, Ghee Teo |
|
549 |
+ * |
|
550 |
+ * Definitions for the trusted functions. |
|
551 |
+ */ |
|
552 |
+#ifndef TRUSTED_XSCREENSAVER_H |
|
553 |
+#define TRUSTED_XSCREENSAVER_H |
|
554 |
+ |
|
555 |
+#ifdef HAVE_XTSOL |
|
556 |
+#include <X11/extensions/Xtsol.h> |
|
557 |
+#endif /* HAVE_XTSOL */ |
|
558 |
+#include <user_attr.h> |
|
559 |
+#include <glib.h> |
|
560 |
+#include <X11/Xlib.h> |
|
561 |
+#include <sys/types.h> |
|
562 |
+#include <unistd.h> |
|
563 |
+ |
|
564 |
+extern gboolean tsol_is_multi_label_session (void); |
|
565 |
+extern char *getusrattrval(userattr_t *, char *); |
|
566 |
+extern void XTSOLgetWorkstationOwner(Display *, uid_t *); |
|
567 |
+ |
|
568 |
+typedef void (*xtsol_XTSOLgetWorkstationOwner) (Display *, uid_t *); |
|
569 |
+extern void XTSOLMakeTPWindow(Display *, Window); |
|
570 |
+typedef void (*xtsol_XTSOLMakeTPWindow) (Display *, Window); |
|
571 |
+typedef char *(*gnome_tsol_get_usrattr_val) (userattr_t *, char *); |
|
572 |
+ |
|
573 |
+enum { |
|
574 |
+ LOCK_CMD = 0, |
|
575 |
+ LOGOUT_CMD |
|
576 |
+}; |
|
577 |
+#endif /* TRUSTED_XSCREENSAVER_H */ |
|
18044 | 578 |
diff --git xscreensaver-5.11/driver/types.h xscreensaver-5.11/driver/types.h |
579 |
--- xscreensaver-5.11/driver/types.h |
|
580 |
+++ xscreensaver-5.11/driver/types.h |
|
581 |
@@ -105,6 +105,8 @@ struct saver_preferences { |
|
582 |
Time initial_delay; /* how long to sleep after launch */ |
|
583 |
Time splash_duration; /* how long the splash screen stays up */ |
|
584 |
Time timeout; /* how much idle time before activation */ |
|
585 |
+ int lock_cmd; /* tsol only - whether to lock or logout */ |
|
586 |
+ |
|
587 |
Time lock_timeout; /* how long after activation locking starts */ |
|
588 |
Time cycle; /* how long each hack should run */ |
|
589 |
Time passwd_timeout; /* how much time before pw dialog goes down */ |
|
18039 | 590 |
diff --git xscreensaver-5.11/driver/xscreensaver-getimage.c xscreensaver-5.11/driver/xscreensaver-getimage.c |
591 |
--- xscreensaver-5.11/driver/xscreensaver-getimage.c |
|
592 |
+++ xscreensaver-5.11/driver/xscreensaver-getimage.c |
|
18027 | 593 |
@@ -83,6 +83,7 @@ static char *defaults[] = { |
594 |
0 |
|
595 |
}; |
|
596 |
||
597 |
+extern Display *global_dpy; |
|
598 |
||
599 |
||
600 |
char *progname = 0; |
|
601 |
@@ -1797,7 +1798,7 @@ main (int argc, char **argv) |
|
602 |
||
603 |
toplevel = XtAppInitialize (&app, progclass, 0, 0, &argc, argv, |
|
604 |
defaults, 0, 0); |
|
605 |
- dpy = XtDisplay (toplevel); |
|
606 |
+ global_dpy = dpy = XtDisplay (toplevel); |
|
607 |
screen = XtScreen (toplevel); |
|
608 |
db = XtDatabase (dpy); |
|
609 |
XtGetApplicationNameAndClass (dpy, &s, &progclass); |
|
18039 | 610 |
diff --git xscreensaver-5.11/driver/xscreensaver.c xscreensaver-5.11/driver/xscreensaver.c |
611 |
--- xscreensaver-5.11/driver/xscreensaver.c |
|
612 |
+++ xscreensaver-5.11/driver/xscreensaver.c |
|
18027 | 613 |
@@ -142,6 +142,7 @@ |
614 |
||
615 |
#include <stdio.h> |
|
616 |
#include <ctype.h> |
|
617 |
+#include <zone.h> |
|
618 |
#include <X11/Xlib.h> |
|
619 |
||
620 |
#include <locale.h> |
|
18061 | 621 |
@@ -226,6 +227,9 @@ |
18044 | 622 |
#include "usleep.h" |
623 |
#include "auth.h" |
|
624 |
||
625 |
+#include "trusted-utils.h" |
|
18027 | 626 |
+extern Display *global_dpy; |
18044 | 627 |
+ |
628 |
saver_info *global_si_kludge = 0; /* I hate C so much... */ |
|
18027 | 629 |
|
18044 | 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 | 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 | 642 |
struct passwd *spasswd; |
643 |
int i; |
|
644 |
||
645 |
+ if (tsol_is_multi_label_session () && (getzoneid () != 0)) |
|
646 |
+ exit (1); |
|
647 |
+ |
|
648 |
#ifdef ENABLE_NLS |
|
649 |
if (!setlocale (LC_ALL, "")) |
|
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 | 652 |
# endif /* !NO_LOCKING */ |
653 |
||
654 |
shell = connect_to_server (si, &argc, argv); |
|
655 |
+ global_dpy = XtDisplay(shell); |
|
656 |
process_command_line (si, &argc, argv); |
|
657 |
stderr_log_file (si); |
|
658 |
print_banner (si); |
|
18061 | 659 |