18778N/A/*
18790N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
18778N/A *
18778N/A * Permission is hereby granted, free of charge, to any person obtaining a
18790N/A * copy of this software and associated documentation files (the "Software"),
18790N/A * to deal in the Software without restriction, including without limitation
18790N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
18790N/A * and/or sell copies of the Software, and to permit persons to whom the
18790N/A * Software is furnished to do so, subject to the following conditions:
18778N/A *
18790N/A * The above copyright notice and this permission notice (including the next
18790N/A * paragraph) shall be included in all copies or substantial portions of the
18790N/A * Software.
18778N/A *
18790N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18790N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18790N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18790N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18790N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18790N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18790N/A * DEALINGS IN THE SOFTWARE.
18778N/A */
18778N/A
18778N/AVarious fixes to deal with where we install things on Solaris:
18778N/A
18778N/A- Only run hacks from the hacks dir, not $PATH
18778N/A
18778N/A- Find helper programs even though they are not in $PATH
18778N/A
18778N/A- Show author names when reading RSS feeds from sites like blogs.sun.com
18778N/A
18778N/A- Show Solaris package names in demo app when hacks are not installed
18778N/A
19033N/A- Use gnome-help to display man pages nicely, without requiring internet
19033N/A access (which some customers at secure sites won't have configured),
19033N/A instead of opening a web browser to view the man page at jwz.org or
19033N/A opening a gnome-terminal to run the man command.
19033N/A
19033N/ABackport notes: this change relies on the gnome-help version delivered in
19033N/ANevada that supports "man:xscreensaver" style URL's to display man pages.
19033N/AWhen backporting to older releases you will probably want to uncomment the
19033N/Alines shown for GNOME 2.4/2.6.
19033N/A
19033N/AAlso, you'll need to fix the package names shown when the hacks are not
19033N/Ainstalled to be the older SUNWxscreensaver-*, and to not use the a href
19033N/Amarkup links added in newer gtk versions, nor link to IPS .p5i files to
19033N/Ainstall the packages.
19033N/A---
19033N/A driver/Makefile.in | 9 ++++--
19033N/A driver/XScreenSaver.ad.in | 14 +++++++---
19033N/A driver/demo-Gtk.c | 4 +-
19033N/A driver/subprocs.c | 54 +++++++++++++++++++++++++++++++++++++-
19033N/A driver/xscreensaver-demo.glade2 | 8 +++--
19033N/A driver/xscreensaver-text | 6 +++-
19033N/A driver/xscreensaver.man | 5 +--
19033N/A hacks/glx/Makefile.in | 4 +-
19033N/A 8 files changed, 84 insertions(+), 20 deletions(-)
19033N/A
19033N/Adiff --git xscreensaver-5.12/driver/Makefile.in xscreensaver-5.12/driver/Makefile.in
19033N/A--- xscreensaver-5.12/driver/Makefile.in
19033N/A+++ xscreensaver-5.12/driver/Makefile.in
18778N/A@@ -27,7 +27,7 @@ INTLTOOL_MERGE = @INTLTOOL_MERGE@
18778N/A GTK_DATADIR = @GTK_DATADIR@
18778N/A GTK_APPDIR = $(GTK_DATADIR)/applications
18778N/A GTK_ICONDIR = $(GTK_DATADIR)/pixmaps
18778N/A-GTK_GLADEDIR = $(GTK_DATADIR)/xscreensaver/glade
18778N/A+GTK_GLADEDIR = $(prefix)/lib/xscreensaver/config
18778N/A HACK_CONF_DIR = @HACK_CONF_DIR@
18778N/A
18778N/A CC = @CC@
18778N/A@@ -36,8 +36,11 @@ CFLAGS = @CFLAGS@
18778N/A LDFLAGS = @LDFLAGS@
18778N/A DEFS = @DEFS@
18778N/A INTL_DEFS = -DLOCALEDIR=\"$(localedir)\"
18778N/A-SUBP_DEFS = $(DEFS) -DDEFAULT_PATH_PREFIX='"@HACKDIR@"'
18778N/A-GTK_DEFS = $(DEFS) -DDEFAULT_ICONDIR='"$(GTK_GLADEDIR)"'
18778N/A+SUBP_DEFS = $(DEFS) -DHACK_PATH='"@HACKDIR@"' \
18778N/A+ -DDEFAULT_PATH_PREFIX='"@HACKDIR@:$(libexecdir)"' \
18778N/A+ -DHELPER_PATH='"$(libexecdir)"'
18778N/A+GTK_DEFS = $(DEFS) -DDEFAULT_ICONDIR='"$(GTK_GLADEDIR)"' \
18778N/A+ -DBINDIR='"$(bindir)"'
18778N/A CONF_DEFS = -DHACK_CONFIGURATION_PATH='"$(HACK_CONF_DIR)"'
18778N/A
18778N/A LIBS = @LIBS@
19033N/Adiff --git xscreensaver-5.12/driver/XScreenSaver.ad.in xscreensaver-5.12/driver/XScreenSaver.ad.in
19033N/A--- xscreensaver-5.12/driver/XScreenSaver.ad.in
19033N/A+++ xscreensaver-5.12/driver/XScreenSaver.ad.in
19033N/A@@ -87,18 +87,24 @@ GetViewPortIsFullOfLies: False
19033N/A
19033N/A ! This is the URL loaded by the "Help" button on the splash screen,
19033N/A ! and by the "Documentation" menu item in xscreensaver-demo.
19033N/A-*helpURL: http://www.jwz.org/xscreensaver/man.html
19033N/A+*helpURL: man:xscreensaver
19033N/A
19033N/A ! loadURL -- how the "Help" buttons load the helpURL (/bin/sh syntax.)
19033N/A ! manualCommand -- how the "Documentation" buttons display man pages.
19033N/A !
19033N/A ! And there are so very many options to choose from!
19033N/A !
19033N/A+! Modern GNOME:
19033N/A+!
19033N/A+*loadURL: gnome-help '%s'
19033N/A+*manualCommand: gnome-help 'man:%s'
19033N/A+!
19033N/A ! Gnome 2.4, 2.6: (yelp can't display man pages, as of 2.6.3)
19033N/A !
19033N/A-@GNOME24@*loadURL: @WITH_BROWSER@ '%s'
19033N/A-@GNOME24@*manualCommand: gnome-terminal --title '%s manual' \
19033N/A-@GNOME24@ --command '/bin/sh -c "man %s; read foo"'
19033N/A+!*loadURL: gnome-terminal --title 'xscreensaver manual' \
19033N/A+! --command '/bin/ksh -c "man xscreensaver; read foo"'
19033N/A+!*manualCommand: gnome-terminal --title '%s manual' \
19033N/A+! --command '/bin/ksh -c "man %s; read foo"'
19033N/A !
19033N/A ! Gnome 2.2:
19033N/A !
19033N/Adiff --git xscreensaver-5.12/driver/demo-Gtk.c xscreensaver-5.12/driver/demo-Gtk.c
19033N/A--- xscreensaver-5.12/driver/demo-Gtk.c
19033N/A+++ xscreensaver-5.12/driver/demo-Gtk.c
19033N/A@@ -990,7 +990,7 @@ restart_menu_cb (GtkWidget *widget, gpointer user_data)
18778N/A flush_dialog_changes_and_save (s);
18778N/A xscreensaver_command (GDK_DISPLAY(), XA_EXIT, 0, False, NULL);
18778N/A sleep (1);
18778N/A- if (system ("xscreensaver -nosplash &") < 0)
18778N/A+ if (system (BINDIR "/xscreensaver -nosplash &") < 0)
18778N/A fprintf (stderr, "%s: fork error\n", blurb());
18778N/A
18778N/A await_xscreensaver (s);
19033N/A@@ -4933,7 +4933,7 @@ main (int argc, char **argv)
18778N/A
18778N/A if (init_results == 1)
18778N/A {
18778N/A- system ("xscreensaver -nosplash &");
18778N/A+ system (BINDIR "/xscreensaver -nosplash &");
18778N/A return 0;
18778N/A }
18778N/A
19033N/Adiff --git xscreensaver-5.12/driver/subprocs.c xscreensaver-5.12/driver/subprocs.c
19033N/A--- xscreensaver-5.12/driver/subprocs.c
19033N/A+++ xscreensaver-5.12/driver/subprocs.c
18778N/A@@ -14,6 +14,7 @@
18778N/A # include "config.h"
18778N/A #endif
18778N/A
18778N/A+#include <sys/stat.h>
18778N/A #include <ctype.h>
18778N/A #include <stdio.h>
18778N/A #include <string.h>
18778N/A@@ -791,6 +792,8 @@ print_path_error (const char *program)
18778N/A free (cmd);
18778N/A perror (buf);
18778N/A
18778N/A+/* mali - security issue do not want to display user's path */
18778N/A+#ifdef EXPOSE_USER_PATH
18778N/A if (errno == ENOENT &&
18778N/A (token = getenv("PATH")))
18778N/A {
18778N/A@@ -821,6 +824,7 @@ print_path_error (const char *program)
18778N/A }
18778N/A fprintf (stderr, "\n");
18778N/A }
18778N/A+#endif
18778N/A }
18778N/A
18778N/A
19033N/A@@ -877,12 +881,42 @@ fork_and_exec (saver_screen_info *ssi, const char *command)
18778N/A return forked;
18778N/A }
18778N/A
18778N/A+static Bool
18778N/A+check_if_hacks_dir_exists(Bool verbose_p)
18778N/A+{
18778N/A+ const char hackdir[] = HACK_PATH;
18778N/A+
18778N/A+ int status;
18778N/A+ struct stat st;
18778N/A+
18778N/A+ status = stat (hackdir, &st);
18778N/A+
18778N/A+ if (status == 0 && S_ISDIR(st.st_mode))
18778N/A+ {
18778N/A+ return True;
18778N/A+ }
18778N/A+ else
18778N/A+ {
18778N/A+ if (verbose_p)
18778N/A+ {
18778N/A+ fprintf(stderr,
18778N/A+ "%s: Warning: dir: %s missing. Will not run hacks\n",
18778N/A+ blurb(), hackdir);
18778N/A+ }
18778N/A+ return False;
18778N/A+ }
18778N/A+}
18778N/A
18778N/A void
18778N/A spawn_screenhack (saver_screen_info *ssi)
18778N/A {
18778N/A saver_info *si = ssi->global;
18778N/A saver_preferences *p = &si->prefs;
18778N/A+ char* complete_hack_command;
18778N/A+
18778N/A+ if (si->prefs.verbose_p)
18778N/A+ fprintf(stderr, "--> spawn_screenhack()\n");
18778N/A+
18778N/A XFlush (si->dpy);
18778N/A
18778N/A if (!monitor_powered_on_p (si))
19033N/A@@ -962,6 +996,12 @@ spawn_screenhack (saver_screen_info *ssi)
18778N/A ;
18778N/A }
18778N/A
18778N/A+ if ((new_hack >= 0) &&
18778N/A+ (check_if_hacks_dir_exists(p->verbose_p) == False))
18778N/A+ {
18778N/A+ new_hack = -1;
18778N/A+ }
18778N/A+
18778N/A if (new_hack < 0) /* don't run a hack */
18778N/A {
18778N/A ssi->current_hack = -1;
19033N/A@@ -1009,7 +1049,17 @@ spawn_screenhack (saver_screen_info *ssi)
18778N/A if (si->selection_mode < 0)
18778N/A si->selection_mode = 0;
18778N/A
18778N/A- forked = fork_and_exec (ssi, hack->command);
18778N/A+ /* We need complete path to hack command else any executable
18778N/A+ * with the same name in the path gets executed.
18778N/A+ */
18778N/A+ complete_hack_command = malloc (10 + strlen(hack->command) +
18778N/A+ strlen (HACK_PATH));
18778N/A+ sprintf(complete_hack_command, HACK_PATH"/%s", hack->command);
18778N/A+
18778N/A+
18778N/A+ forked = fork_and_exec (ssi, complete_hack_command);
18778N/A+ free (complete_hack_command);
18778N/A+
18778N/A switch ((int) forked)
18778N/A {
18778N/A case -1: /* fork failed */
19033N/A@@ -1186,7 +1236,7 @@ get_best_gl_visual (saver_info *si, Screen *screen)
18778N/A char *av[10];
18778N/A int ac = 0;
18778N/A
18778N/A- av[ac++] = "xscreensaver-gl-helper";
18778N/A+ av[ac++] = HELPER_PATH "/xscreensaver-gl-helper";
18778N/A av[ac] = 0;
18778N/A
18778N/A if (pipe (fds))
19033N/Adiff --git xscreensaver-5.12/driver/xscreensaver-demo.glade2 xscreensaver-5.12/driver/xscreensaver-demo.glade2
19033N/A--- xscreensaver-5.12/driver/xscreensaver-demo.glade2
19033N/A+++ xscreensaver-5.12/driver/xscreensaver-demo.glade2
19033N/A@@ -927,10 +927,12 @@ Installed</property>
18778N/A <property name="visible">True</property>
18778N/A <property name="label" translatable="yes">Very few (or no) screen savers appear to be available.
18778N/A
18778N/A-This probably means that the &quot;xscreensaver-extras&quot; and
18778N/A-&quot;xscreensaver-gl-extras&quot; packages are not installed.</property>
19033N/A+This probably means that the “&lt;a href="file:/usr/lib/xscreensaver/config/xscreensaver-hacks.p5i"&gt;desktop/xscreensaver/hacks&lt;/a&gt;,”
19033N/A+“&lt;a href="file:/usr/lib/xscreensaver/config/xscreensaver-hacks-gl.p5i"&gt;desktop/xscreensaver/hacks/hacks-gl&lt;/a&gt;,” and
19033N/A+“&lt;a href="file:/usr/lib/xscreensaver/config/rss-glx.p5i"&gt;desktop/xscreensaver/hacks/rss-glx&lt;/a&gt;” packages
18778N/A+are not installed.</property>
18778N/A <property name="use_underline">False</property>
19033N/A- <property name="use_markup">False</property>
19033N/A+ <property name="use_markup">True</property>
18778N/A <property name="justify">GTK_JUSTIFY_CENTER</property>
19033N/A <property name="wrap">False</property>
19033N/A <property name="selectable">False</property>
19033N/Adiff --git xscreensaver-5.12/driver/xscreensaver-text xscreensaver-5.12/driver/xscreensaver-text
19033N/A--- xscreensaver-5.12/driver/xscreensaver-text
19033N/A+++ xscreensaver-5.12/driver/xscreensaver-text
18778N/A@@ -695,12 +695,15 @@ sub reformat_rss($) {
18778N/A $i++;
18778N/A
18778N/A my ($title, $body1, $body2, $body3);
18778N/A+ my $author;
18778N/A
18778N/A $title = $3 if (m@<((TITLE) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
18778N/A $body1 = $3 if (m@<((DESCRIPTION) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
18778N/A $body2 = $3 if (m@<((CONTENT) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
18778N/A $body3 = $3 if (m@<((SUMMARY) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
18778N/A
18778N/A+ $author = $3 if (m@<((DC:CREATOR) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
18778N/A+
18778N/A # If there are both <description> and <content> or <content:encoded>,
18778N/A # use whichever one contains more text.
18778N/A #
18778N/A@@ -724,10 +727,11 @@ sub reformat_rss($) {
18778N/A
18778N/A $title = rss_field_to_html ($title || '');
18778N/A $body1 = rss_field_to_html ($body1 || '');
18778N/A+ $author = rss_field_to_html ($author || '');
18778N/A
18778N/A $title = '' if ($body1 eq $title); # Identical in Twitter's atom feed.
18778N/A
18778N/A- reformat_html ("$title<P>$body1", 1);
18778N/A+ reformat_html ("$title<BR>$author<P>$body1", 1);
18778N/A print "\n";
18778N/A }
18778N/A }
19033N/Adiff --git xscreensaver-5.12/driver/xscreensaver.man xscreensaver-5.12/driver/xscreensaver.man
19033N/A--- xscreensaver-5.12/driver/xscreensaver.man
19033N/A+++ xscreensaver-5.12/driver/xscreensaver.man
18778N/A@@ -97,9 +97,8 @@ xscreensaver-command -restart
18778N/A If you want to set the system-wide defaults, then make your edits to
18778N/A the xscreensaver app-defaults file, which should have been installed
18778N/A when xscreensaver itself was installed. The app-defaults file will
18778N/A-usually be named /usr/lib/X11/app-defaults/XScreenSaver, but different
18778N/A-systems might keep it in a different place (for example,
18778N/A-/usr/openwin/lib/app-defaults/XScreenSaver on Solaris.)
18778N/A+usually be named /usr/share/X11/app-defaults/XScreenSaver, but different
18778N/A+systems might keep it in a different place.
18778N/A
18778N/A When settings are changed in the Preferences dialog box (see above)
18778N/A the current settings will be written to the \fI.xscreensaver\fP file.
19033N/Adiff --git xscreensaver-5.12/hacks/glx/Makefile.in xscreensaver-5.12/hacks/glx/Makefile.in
19033N/A--- xscreensaver-5.12/hacks/glx/Makefile.in
19033N/A+++ xscreensaver-5.12/hacks/glx/Makefile.in
18778N/A@@ -270,7 +270,7 @@ install-program:: $(EXES)
18778N/A # the xscreensaver-gl-helper program, in $bindir
18778N/A install-program:: $(EXES)
18778N/A @exes="@GL_UTIL_EXES@" ; \
18778N/A- idir="$(install_prefix)$(bindir)" ; \
18778N/A+ idir="$(install_prefix)$(libexecdir)" ; \
18778N/A if [ "$$exes" != "" ]; then \
18778N/A if [ ! -d $$idir ]; then \
18778N/A $(INSTALL_DIRS) $$idir ; \
18778N/A@@ -339,7 +339,7 @@ uninstall-program::
18778N/A # the xscreensaver-gl-helper program, in $bindir
18778N/A uninstall-program::
18778N/A @exes="$(GL_UTIL_EXES)" ; \
18778N/A- idir="$(install_prefix)$(bindir)" ; \
18778N/A+ idir="$(install_prefix)$(libexecdir)" ; \
18778N/A for program in $$exes; do \
18778N/A echo rm -f $$idir/$$program ; \
18778N/A rm -f $$idir/$$program ; \
19033N/A