forked from OpenMandrivaAssociation/xscreensaver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxscreensaver-4.23-root.patch
More file actions
30 lines (27 loc) · 1.14 KB
/
xscreensaver-4.23-root.patch
File metadata and controls
30 lines (27 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- xscreensaver-4.23/driver/demo-Gtk.c.root 2005-10-22 07:36:52.000000000 +0200
+++ xscreensaver-4.23/driver/demo-Gtk.c 2005-11-21 11:12:25.000000000 +0100
@@ -890,8 +890,13 @@
flush_dialog_changes_and_save (s);
xscreensaver_command (GDK_DISPLAY(), XA_EXIT, 0, False, NULL);
sleep (1);
+ if (getuid() == 0) {
+ if (system ("TEMPXAUTHORITY=`su - nobody -c \"/bin/mktemp /tmp/xscreensaver.XXXXXX\"` && xauth extract $TEMPXAUTHORITY $DISPLAY && XAUTHORITY=$TEMPXAUTHORITY xscreensaver -nosplash && rm -f $TEMPXAUTHORITY &") < 0)
+ fprintf (stderr, "%s: fork error\n", blurb());
+ } else {
if (system ("xscreensaver -nosplash &") < 0)
fprintf (stderr, "%s: fork error\n", blurb());
+ }
await_xscreensaver (s);
}
@@ -4745,7 +4750,12 @@
if (init_results == 1)
{
- system ("xscreensaver -nosplash &");
+ if (getuid() == 0) {
+ system ("TEMPXAUTHORITY=`su - nobody -c \"/bin/mktemp /tmp/xscreensaver.XXXXXX\"` && xauth extract $TEMPXAUTHORITY $DISPLAY && XAUTHORITY=$TEMPXAUTHORITY xscreensaver -nosplash && rm -f $TEMPXAUTHORITY &");
+ }
+ else {
+ system ("xscreensaver -nosplash &");
+ }
return 0;
}