4869280 Update xscreensaver to 5.0
authorAlan Coopersmith <Alan.Coopersmith@Sun.COM>
Thu, 10 Aug 2006 09:55:02 -0700
changeset 47 d59efbadf28b
parent 46 bd40e98dea27
child 48 a6bb916436b7
4869280 Update xscreensaver to 5.0
open-src/app/xscreensaver/GNOME-desktop.patch
open-src/app/xscreensaver/IPv6.patch
open-src/app/xscreensaver/Makefile
open-src/app/xscreensaver/Sun-colors.patch
open-src/app/xscreensaver/Sun.app-defaults.patch
open-src/app/xscreensaver/accessibility.patch
open-src/app/xscreensaver/allow-root.patch
open-src/app/xscreensaver/apple2.patch
open-src/app/xscreensaver/barcode-hack.patch
open-src/app/xscreensaver/blurb.patch
open-src/app/xscreensaver/bug-6450019.patch
open-src/app/xscreensaver/debug-msgs.patch
open-src/app/xscreensaver/dont-bug-jwz.patch
open-src/app/xscreensaver/dpms.patch
open-src/app/xscreensaver/gl-error-capture.patch
open-src/app/xscreensaver/glsnake.patch
open-src/app/xscreensaver/gtk-lock.patch
open-src/app/xscreensaver/i18n.patch
open-src/app/xscreensaver/misc.patch
open-src/app/xscreensaver/pam_audit.patch
open-src/app/xscreensaver/passwdTimeout-pref.patch
open-src/app/xscreensaver/s_isdir.patch
open-src/app/xscreensaver/scf-smartcard.patch
open-src/app/xscreensaver/solaris-paths.patch
open-src/app/xscreensaver/solaris-suncc-fixes.patch
open-src/app/xscreensaver/starfish.patch
open-src/app/xscreensaver/sun-src/driver/scf-smartcard.c
open-src/app/xscreensaver/sun-src/driver/scf-smartcard.h
open-src/app/xscreensaver/sun-src/driver/xscreensaver-demo.glade2p
open-src/app/xscreensaver/tooltips.patch
open-src/app/xscreensaver/topblock.patch
open-src/app/xscreensaver/trusted.patch
open-src/app/xscreensaver/xinput.patch
open-src/common/Makefile.inc
open-src/common/suntouch-manpages.pl
packages/SUNWxscreensaver-hacks-gl/copyright.add
packages/SUNWxscreensaver-hacks-gl/depend.i386
packages/SUNWxscreensaver-hacks-gl/depend.sparc
packages/SUNWxscreensaver-hacks-gl/pkginfo.tmpl
packages/SUNWxscreensaver-hacks-gl/prototype_com
packages/SUNWxscreensaver-hacks-gl/prototype_i386
packages/SUNWxscreensaver-hacks-gl/prototype_sparc
packages/SUNWxscreensaver-hacks/copyright.add
packages/SUNWxscreensaver-hacks/depend
packages/SUNWxscreensaver-hacks/pkginfo.tmpl
packages/SUNWxscreensaver-hacks/prototype
packages/SUNWxwsvr/copyright.add
packages/SUNWxwsvr/depend
packages/SUNWxwsvr/pkginfo.tmpl
packages/SUNWxwsvr/prototype
--- a/open-src/app/xscreensaver/GNOME-desktop.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/GNOME-desktop.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -32,17 +32,16 @@
 Localized name & tooltips (Sun bug 5103358)
 
 diff -urp -x '*~' driver/screensaver-properties.desktop.in driver/screensaver-properties.desktop.in
---- driver/screensaver-properties.desktop.in	2002-05-28 17:42:12.000000000 -0700
-+++ driver/screensaver-properties.desktop.in	2006-05-10 08:48:12.224912000 -0700
-@@ -1,9 +1,36 @@
+--- driver/screensaver-properties.desktop.in	2003-12-15 03:16:12.000000000 -0800
++++ driver/screensaver-properties.desktop.in	2006-08-08 15:24:22.756630000 -0700
+@@ -1,8 +1,35 @@
  [Desktop Entry]
- Exec=xscreensaver-demo --crapplet
- TryExec=xscreensaver-demo
+ Exec=xscreensaver-demo
 -Icon=xscreensaver.xpm
 +Icon=gnome-ccscreensaver.png
- Terminal=0
+ Terminal=false
 -_Name=Screensaver
--_Comment=Configure the settings of the screensaver.
+-_Comment=Change screensaver properties
 +Name=Screensaver
 +Name[cs]=Spořič obrazovky
 +Name[de]=Bildschirmschoner
@@ -73,5 +72,5 @@
 +Comment[zh_HK]=配置螢幕保護程式設定。
 +Comment[zh_TW]=配置螢幕保護程式設定。
  Type=Application
--Categories=Applications;Settings;
+-Categories=Application;Settings;Appearance;AdvancedSettings;
 +Categories=GNOME;Settings;Appearance;
--- a/open-src/app/xscreensaver/IPv6.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/IPv6.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -31,12 +31,12 @@
 4802743 - xscreensaver mangles IPv6 numeric addresses in $DISPLAY
 
 diff -urp -x '*~' driver/subprocs.c driver/subprocs.c
---- driver/subprocs.c	2006-05-10 08:49:17.229068000 -0700
-+++ driver/subprocs.c	2006-05-10 08:49:23.643545000 -0700
-@@ -994,14 +994,17 @@ hack_subproc_environment (saver_screen_i
-   saver_info *si = ssi->global;
+--- driver/subprocs.c	2006-08-08 17:26:57.491298000 -0700
++++ driver/subprocs.c	2006-08-08 17:27:03.422319000 -0700
+@@ -1211,14 +1211,17 @@ hack_subproc_environment (saver_screen_i
    const char *odpy = DisplayString (si->dpy);
-   char *ndpy = (char *) malloc(strlen(odpy) + 20);
+   char *ndpy = (char *) malloc (strlen(odpy) + 20);
+   char *nssw = (char *) malloc (40);
 -  char *s;
 +  char *s, *c;
  
--- a/open-src/app/xscreensaver/Makefile	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/Makefile	Thu Aug 10 09:55:02 2006 -0700
@@ -30,7 +30,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile	1.65	06/07/27
+# @(#)Makefile	1.66	06/08/09
 #
 
 PWD:sh=pwd
@@ -38,42 +38,40 @@
 BUILD_TYPES=32
 
 # Version number (used in path names)
-XSCREENSAVER_VERS=4.05
+XSCREENSAVER_VERS=5.00
 
 # Source tarball
 SOURCE_TARBALL_NAME=xscreensaver-$(XSCREENSAVER_VERS).tar.gz
 
-# Download site for source - master site no longer carries 4.05 so we use
-# a mirror site until we upgrade to a newer version
-#SOURCE_URL=http://www.jwz.org/xscreensaver/$(SOURCE_TARBALL_NAME)
-SOURCE_URL=http://slackware.osuosl.org/unsupported/source/gnome-1.4.1/xscreensaver/$(SOURCE_TARBALL_NAME)
+# Download site for source
+SOURCE_URL=http://www.jwz.org/xscreensaver/$(SOURCE_TARBALL_NAME)
 SOURCE_UNCOMPRESS=gzcat
 
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES = \
-	solaris-suncc-fixes.patch \
-	s_isdir.patch \
 	Sun.app-defaults.patch \
 	GNOME-desktop.patch \
 	solaris-paths.patch \
 	dont-bug-jwz.patch \
 	gtk-lock.patch \
 	allow-root.patch \
-	scf-smartcard.patch \
 	passwdTimeout-pref.patch \
 	xinput.patch \
 	i18n.patch \
 	debug-msgs.patch \
-	tooltips.patch \
 	dpms.patch \
 	IPv6.patch \
 	gl-error-capture.patch \
-	blurb.patch \
 	accessibility.patch \
-	misc.patch \
 	trusted.patch \
-        pam_audit.patch \
-        bug-6450019.patch
+	pam_audit.patch \
+	bug-6450019.patch \
+	Sun-colors.patch \
+	barcode-hack.patch \
+	starfish.patch \
+	glsnake.patch \
+	apple2.patch \
+	topblock.patch
 
 # Directory created by unpacking source
 SOURCE_DIR=$(BUILD_DIR)/xscreensaver-$(XSCREENSAVER_VERS)
@@ -102,14 +100,25 @@
 OPENGL_DIR:sh=arch | sed 's/^\(.*\)$/\$\(OPENGL_DIR_\1\)/'
 
 # Command line options to GNU autoconf configure script
-XS_CFG=--prefix=/usr/openwin/ --enable-maintainer-mode --enable-gtk-doc --with-shadow --with-dpms --enable-locking --disable-screengrab --enable-dpms --with-gtk2=/usr --with-gl=$(OPENGL_DIR) --with-pixbuf=/usr  --with-pam=/usr --without-motif --with-jpeg=/usr/sfw --mandir='$${prefix}/share/man' --libexecdir='$${prefix}/lib/xscreensaver/bin' --datadir='$${prefix}/share' --with-hackdir=lib/xscreensaver/hacks --with-configdir=lib/xscreensaver/config/control-center-2.0 --with-gnome --with-scf-smartcard
+XS_CFG= --prefix=/usr/X11 --enable-maintainer-mode \
+ --with-gnome --enable-gtk-doc --with-gtk2=/usr --with-pixbuf=/usr \
+ --enable-locking --with-pam=/usr --without-shadow --without-kerberos \
+ --with-dpms --enable-dpms --disable-screengrab \
+ --with-gl=$(OPENGL_DIR)  --without-motif --with-jpeg=/usr \
+ --mandir='$${prefix}/share/man' --datadir='$${prefix}/share' \
+ --libexecdir='$${prefix}/lib/xscreensaver/bin' \
+ --with-hackdir='$${prefix}/lib/xscreensaver/hacks' \
+ --with-configdir=/usr/X11/lib/xscreensaver/config/control-center-2.0 \
+ --with-image-directory=/usr/share/pixmaps/backgrounds \
+ --with-text-file=/etc/motd \
+ --with-x-app-defaults=/usr/X11/lib/X11/app-defaults
 
 # BINARY built in tree
 XS_BIN=$(SOURCE_DIR)/xscreensaver
 
 # Messages for translation
 XS_POT=$(SOURCE_DIR)/po/xscreensaver.pot
-POT_DEST=$(PROTODIR)/usr/openwin/share/locale/C/LC_MESSAGES
+POT_DEST=$(PROTODIR)/usr/X11/share/locale/C/LC_MESSAGES
 
 # Man pages
 XS_MAN=$(SOURCE_DIR)/driver/xscreensaver.man.orig
@@ -119,9 +128,7 @@
 
 # Additional optimization flags, to make the hacks show off the hardware
 # better and we can get away with optimizations not allowed in the core X code
-#
-# Temporarily removed -fsimple=2 to avoid bug 6453103 in Studio 11 compilers
-XS_CFLAGS=$(CFLAGS) -nofstore -xprefetch $(XS_ARCH_FLAGS) -xstrconst
+XS_CFLAGS=$(CFLAGS) -fsimple=2 -nofstore -xprefetch $(XS_ARCH_FLAGS) -xstrconst
 XS_ARCH_FLAGS:sh=arch | sed 's/^\(.*\)$/\$\(XS_\1_ARCH_FLAGS\)/'
 XS_sun4_ARCH_FLAGS=-xtarget=ultra2
 
@@ -159,15 +166,23 @@
 
 # Add Sun attributes section to man pages
 $(XS_MAN):
-	for f in $(SOURCE_DIR)/driver/*.man ; do \
-	  if [ ! -f $$f.orig ] ; then \
-	    mv $$f $$f.orig ; \
-	  fi ; \
-	  cat	$(TOP)/common/table-prepend \
-		$$f.orig \
-		$(TOP)/common/sunman-stability \
-	    | sed 's/__package__/SUNWxscreensaver/g' > $$f ; \
-	done
+	/usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
+	    -a '{Availability, SUNWxscreensaver} {Interface Stability, Volatile}' \
+		-p /usr/X11/bin \
+		$(SOURCE_DIR)/driver/xscreensaver.man \
+		$(SOURCE_DIR)/driver/xscreensaver-command.man \
+		$(SOURCE_DIR)/driver/xscreensaver-demo.man
+	/usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
+	    -a '{Availability, SUNWxscreensaver} {Interface Stability, Private}' \
+		-p /usr/X11/lib/xscreensaver/bin \
+		$(SOURCE_DIR)/driver/xscreensaver-get*.man \
+		$(SOURCE_DIR)/driver/xscreensaver-text.man
+	/usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
+	    -a '{Availability, SUNWxscreensaver-hacks} {Interface Stability, Private}' \
+		-p /usr/X11/lib/xscreensaver/hacks/ $(SOURCE_DIR)/hacks/*.man
+	/usr/perl5/bin/perl $(TOP)/common/suntouch-manpages.pl \
+	    -a '{Availability, SUNWxscreensaver-hacks-gl} {Interface Stability, Private}' \
+		-p /usr/X11/lib/xscreensaver/hacks/ $(SOURCE_DIR)/hacks/glx/*.man
 
 install_gen: $(XS_BIN) $(XS_MAN) $(XS_POT)
 	chmod +w $(SOURCE_DIR)/hacks/vidwhacker \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/app/xscreensaver/Sun-colors.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -0,0 +1,205 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
+
+Use Sun branding colors in various hacks to better match color schemes of JDS
+desktop.
+
+diff -urp -x '*~' driver/XScreenSaver.ad.in driver/XScreenSaver.ad.in
+--- driver/XScreenSaver.ad.in	2006-08-08 17:27:33.957438000 -0700
++++ driver/XScreenSaver.ad.in	2006-08-08 17:27:40.097943000 -0700
+@@ -293,7 +293,7 @@ GetViewPortIsFullOfLies: False
+                                 bubbles -root				    \n\
+ 				pong -root				    \n\
+ 				wormhole -root				    \n\
+-				fuzzyflakes -root			    \n\
++				fuzzyflakes -root -color A3B8CB		    \n\
+ 				anemotaxis -root			    \n\
+ 				memscroller -root			    \n\
+ 				substrate -root				    \n\
+diff -urp -x '*~' hacks/glx/antinspect.c hacks/glx/antinspect.c
+--- hacks/glx/antinspect.c	2006-02-25 12:13:26.000000000 -0800
++++ hacks/glx/antinspect.c	2006-08-08 17:27:40.098471000 -0700
+@@ -94,13 +94,13 @@ static const float position1[] = {-1.0, 
+ static const float lmodel_ambient[] = {0.5, 0.5, 0.5, 1.0};
+ static const float lmodel_twoside[] = {GL_TRUE};
+ 
+-static const float MaterialRed[] =     {0.6, 0.0, 0.0, 1.0};
+-static const float MaterialOrange[] =  {1.0, 0.69, 0.00, 1.0};
+-static const float MaterialGray[] =    {0.2, 0.2, 0.2, 1.0};
++static const float MaterialRed[] =     {0.90, 0.43, 0.0, 1.0};
++static const float MaterialOrange[] =  {1.0, 0.78, 0.15, 1.0};
++static const float MaterialGray[] =    {0.2, 0.21, 0.22, 1.0};
+ static const float MaterialBlack[] =   {0.1, 0.1, 0.1, 0.4};
+ static const float MaterialShadow[] =   {0.3, 0.3, 0.3, 0.3};
+-static const float MaterialGray5[] =   {0.5, 0.5, 0.5, 0.3};
+-static const float MaterialGray6[] =   {0.6, 0.6, 0.6, 1.0};
++static const float MaterialGray5[] =   {0.5, 0.51, 0.53, 0.3};
++static const float MaterialGray6[] =   {0.6, 0.61, 0.63, 1.0};
+ 
+ static antinspectstruct *antinspect = (antinspectstruct *) NULL;
+ 
+diff -urp -x '*~' hacks/glx/antmaze.c hacks/glx/antmaze.c
+--- hacks/glx/antmaze.c	2006-03-14 19:55:05.000000000 -0800
++++ hacks/glx/antmaze.c	2006-08-08 17:27:40.099297000 -0700
+@@ -148,13 +148,13 @@ typedef struct {
+ static antmazestruct *antmaze = (antmazestruct *) NULL;
+ 
+ 
+-static const GLfloat MaterialRed[] = {0.6, 0.0, 0.0, 1.0};
++static const GLfloat MaterialRed[] = {0.75, 0.40, 0.0, 1.0};
+ /*static const GLfloat MaterialMagenta[] = {0.6, 0.2, 0.5, 1.0};*/
+ static const GLfloat MaterialGray8[] = {0.8, 0.8, 0.8, 1.0};
+-static const GLfloat MaterialGray35[] = {0.30, 0.30, 0.30, 1.0};
+-static const GLfloat MaterialGray4[] = {0.40, 0.40, 0.40, 1.0};
+-static const GLfloat MaterialOrange[] = {1.0, 0.69, 0.00, 1.0};
+-static const GLfloat MaterialGreen[] = {0.1, 0.4, 0.2, 1.0};
++static const GLfloat MaterialGray35[] = {0.30, 0.31, 0.33, 1.0};
++static const GLfloat MaterialGray4[] = {0.4375, 0.4450, 0.4650, 1.0};
++static const GLfloat MaterialOrange[] = {0.90, 0.43, 0.00, 1.0};
++static const GLfloat MaterialGreen[] = {0.695, 0.734, 0.0, 1.0};
+ 
+ /* lighting variables */
+ static const GLfloat front_shininess[] = {60.0};
+diff -urp -x '*~' hacks/glx/flipflop.c hacks/glx/flipflop.c
+--- hacks/glx/flipflop.c	2006-02-25 12:13:27.000000000 -0800
++++ hacks/glx/flipflop.c	2006-08-08 17:27:40.744299000 -0700
+@@ -337,6 +337,10 @@ draw_sheet(void)
+   glEnd();
+ }
+ 
++static const float sun_colors [ 3 ][ 3 ] = {
++ { 0.3255, 0.5098, 0.6314 }, { 0.9059, 0.4353, 0.0 }, { 1.0, 0.7804, 0.1490 }
++};
++
+ static void
+ randsheet_initialize( randsheet *rs )
+ {
+@@ -354,9 +358,9 @@ randsheet_initialize( randsheet *rs )
+ 		  rs->xpos[ index ] = i;
+ 		  rs->ypos[ index ] = j;
+ 		  /* have the square colors start out as a pattern */
+-		  rs->color[ index ][ 0 ] = ((i+j)%3 == 0)||((i+j+1)%3 == 0);
+-		  rs->color[ index ][ 1 ] = ((i+j+1)%3 == 0);
+-		  rs->color[ index ][ 2 ] = ((i+j+2)%3 == 0);
++		  rs->color[ index ][ 0 ] = sun_colors[(i+j)%3][0];
++		  rs->color[ index ][ 1 ] = sun_colors[(i+j)%3][1];
++		  rs->color[ index ][ 2 ] = sun_colors[(i+j)%3][2];
+ 		 ++index;
+ 		}
+ 		/* leave everything else empty*/
+diff -urp -x '*~' hacks/glx/gears.c hacks/glx/gears.c
+--- hacks/glx/gears.c	2006-03-12 03:15:36.000000000 -0800
++++ hacks/glx/gears.c	2006-08-08 17:27:40.099886000 -0700
+@@ -640,10 +640,10 @@ pinit(ModeInfo * mi)
+ {
+ 	gearsstruct *gp = &gears[MI_SCREEN(mi)];
+ 	static const GLfloat pos[4]   = {5.0, 5.0, 10.0, 1.0};
+-	static const GLfloat red[4]   = {0.8, 0.1, 0.0, 1.0};
+-	static const GLfloat green[4] = {0.0, 0.8, 0.2, 1.0};
+-	static const GLfloat blue[4]  = {0.2, 0.2, 1.0, 1.0};
+-	static const GLfloat gray[4]  = {0.5, 0.5, 0.5, 1.0};
++	static const GLfloat red[4]   = {0.9023, 0.4336, 0.0, 1.0};
++	static const GLfloat green[4] = {0.6953, 0.7344, 0.0, 1.0};
++	static const GLfloat blue[4]  = {0.3242, 0.5078, 0.6289, 1.0};
++	static const GLfloat gray[4]  = {0.4375, 0.4450, 0.4650, 1.0};
+ 	static const GLfloat white[4] = {1.0, 1.0, 1.0, 1.0};
+ 	int         wire = MI_IS_WIREFRAME(mi);
+ 	int         mono = MI_IS_MONO(mi);
+diff -urp -x '*~' hacks/glx/sproingies.c hacks/glx/sproingies.c
+--- hacks/glx/sproingies.c	2006-02-25 12:13:28.000000000 -0800
++++ hacks/glx/sproingies.c	2006-08-08 17:27:40.100400000 -0700
+@@ -94,9 +94,9 @@ build_TopsSides(int wireframe)
+ 
+ 	/* Surface: Tops */
+ 	glNewList(dl_num, GL_COMPILE);
+-	mat_color[0] = 0.392157;
+-	mat_color[1] = 0.784314;
+-	mat_color[2] = 0.941176;
++	mat_color[0] = 0.325490;
++	mat_color[1] = 0.509804;
++	mat_color[2] = 0.631373;
+ 	if (wireframe)
+ 		glColor3fv(mat_color);
+ 	else {
+@@ -110,9 +110,9 @@ build_TopsSides(int wireframe)
+ 		glColor3fv(mat_color);
+ 	else {
+       /* jwz: in wireframe mode, color tops and sides the same. */
+-      mat_color[0] = 0.156863;
+-      mat_color[1] = 0.156863;
+-      mat_color[2] = 0.392157;
++		mat_color[0] = 0.207843;
++		mat_color[1] = 0.333333;
++		mat_color[2] = 0.419607;
+ 		glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_color);
+ 	}
+ 	glEndList();
+diff -urp -x '*~' utils/colors.c utils/colors.c
+--- utils/colors.c	2006-02-04 05:39:41.000000000 -0800
++++ utils/colors.c	2006-08-08 17:27:40.100974000 -0700
+@@ -598,6 +598,13 @@ make_uniform_colormap (Display *dpy, Vis
+   *ncolorsP = ncolors;
+ }
+ 
++/* Use Sun branding colors first in random colormaps */
++#define NUM_SUN_COLORS 12
++static const XColor sun_colors[NUM_SUN_COLORS] = {
++    { 83, 130, 161}, {231, 111,  0}, {178, 188,   0}, {255, 199,  38},
++    { 53,  85, 107}, {192, 102,  0}, {127, 120,   0}, {198, 146,   0},
++    {163, 184, 203}, {237, 155, 79}, {197, 213, 169}, {248, 213, 131}
++};
+ 
+ void
+ make_random_colormap (Display *dpy, Visual *visual, Colormap cmap,
+@@ -610,6 +617,7 @@ make_random_colormap (Display *dpy, Visu
+   Bool wanted_writable = (allocate_p && writable_pP && *writable_pP);
+   int ncolors = *ncolorsP;
+   int i;
++  int sun_color_offset = random() % NUM_SUN_COLORS;
+   Screen *screen = (dpy ? DefaultScreenOfDisplay(dpy) : 0); /* #### WRONG! */
+ 
+   if (*ncolorsP <= 0) return;
+@@ -631,9 +639,16 @@ make_random_colormap (Display *dpy, Visu
+ 	}
+       else
+ 	{
++	  if (i < NUM_SUN_COLORS) {
++	      int n = (i + sun_color_offset) % NUM_SUN_COLORS;
++	      colors[i].red = sun_colors[n].red;
++	      colors[i].green = sun_colors[n].green;
++	      colors[i].blue = sun_colors[n].blue;
++	  } else {
+ 	  colors[i].red   = random() % 0xFFFF;
+ 	  colors[i].green = random() % 0xFFFF;
+ 	  colors[i].blue  = random() % 0xFFFF;
++	  }
+ 	}
+     }
+ 
--- a/open-src/app/xscreensaver/Sun.app-defaults.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/Sun.app-defaults.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -34,18 +34,22 @@
    -    disable using screen grabs in hacks to avoid security leaks
    -    set default mode to screen blank
    -    disable bsod by default to avoid confusion in shops with real NT boxes
+   -    enable & disable various hacks by default for aesthetic reasons
 4871833 DPMS settings should be consistent between CDE and Gnome
 6368607 increase unlock dialog box timeout to 2 minutes
 
 
 diff -urp -x '*~' driver/XScreenSaver.ad.in driver/XScreenSaver.ad.in
---- driver/XScreenSaver.ad.in	2002-06-11 02:09:05.000000000 -0700
-+++ driver/XScreenSaver.ad.in	2006-05-10 08:48:06.305863000 -0700
-@@ -28,21 +28,21 @@
+--- driver/XScreenSaver.ad.in	2006-05-23 16:01:34.000000000 -0700
++++ driver/XScreenSaver.ad.in	2006-08-08 15:24:18.298277000 -0700
+@@ -28,39 +28,40 @@
  
  ! /* (xrdb prevention kludge: whole file)
  
+-*mode:			random
 -*timeout:		0:10:00
++! We want the default mode to be just blank the screen
++*mode:			blank
 +*timeout:		0:15:00
  *cycle:			0:10:00
 -*lockTimeout:		0:00:00
@@ -63,17 +67,16 @@
 +*dpmsOff:		0:30:00
 +*grabDesktopImages:	False
  *grabVideoFrames:	False
- *chooseRandomImages:	False
- *imageDirectory:	
+ *chooseRandomImages:	@DEFAULT_IMAGES_P@
+ *imageDirectory:	@DEFAULT_IMAGE_DIRECTORY@
 -*nice:			10
 +*nice:			19
  *memoryLimit:		0
 -*lock:			False
 +*lock:			True
- *lockVTs:		True
  *verbose:		False
  *timestamp:		True
-@@ -50,11 +50,11 @@
+ *fade:			True
  *unfade:		False
  *fadeSeconds:		0:00:03
  *fadeTicks:		20
@@ -81,27 +84,227 @@
 +*splash:		False
  *splashDuration:	0:00:05
  *visualID:		default
+ *captureStderr: 	True
+ *ignoreUninstalledPrograms: False
  
--*captureStderr: 	True
-+*captureStderr: 	False
+-*textMode:		file
++*textMode:		date
+ *textLiteral:		XScreenSaver
+ *textFile:		@DEFAULT_TEXT_FILE@
+-*textProgram:		fortune
+-*textURL:		http://www.livejournal.com/stats/latest-rss.bml
++*textProgram:		date
++*textURL:		http://blogs.sun.com/roller/rss
+ 
  *overlayTextForeground:	#FFFF00
  *overlayTextBackground:	#000000
- *overlayStderr:		True
-@@ -102,6 +102,8 @@
+@@ -149,9 +150,9 @@ GetViewPortIsFullOfLies: False
+ ! screen savers interactively.
  !
- *installColormap:	True
- 
-+! We want the default mode to be just blank the screen
-+*mode: blank
- 
- ! Any program which can draw on the root window will work as a screensaver.
- ! The following resource enumerates them.
-@@ -227,7 +229,7 @@
+ *programs:								      \
+-		 "Qix (solid)" 	qix -root -solid -segments 100		    \n\
+-	   "Qix (transparent)" 	qix -root -count 4 -solid -transparent	    \n\
+-		"Qix (linear)" 	qix -root -count 5 -solid -transparent	      \
++-		 "Qix (solid)" 	qix -root -solid -segments 100		    \n\
++-	   "Qix (transparent)" 	qix -root -count 4 -solid -transparent	    \n\
++-		"Qix (linear)" 	qix -root -count 5 -solid -transparent	      \
+ 				  -linear -segments 250 -size 100	    \n\
+ 									      \
+ 	  "Attraction (balls)" 	attraction -root -mode balls		    \n\
+@@ -164,11 +165,11 @@ GetViewPortIsFullOfLies: False
+ 									      \
+ 				pyro -root				    \n\
+ 				rocks -root				    \n\
+-				helix -root				    \n\
+-				pedal -root				    \n\
+-				rorschach -root				    \n\
++-				helix -root				    \n\
++-				pedal -root				    \n\
++-				rorschach -root				    \n\
+ 				hopalong -root				    \n\
+-				greynetic -root				    \n\
++-				greynetic -root				    \n\
+ 				imsmap -root				    \n\
+ 				slidescreen -root			    \n\
+ 				decayscreen -root			    \n\
+@@ -179,49 +180,49 @@ GetViewPortIsFullOfLies: False
+ 				spotlight -root				    \n\
+ 	      "Ripples (stir)"	ripples -root -oily -light 2 -stir	    \n\
+ 	   "Ripples (desktop)"	ripples -root -water -light 6		    \n\
+-				hypercube -root				    \n\
++-				hypercube -root				    \n\
+ -				hyperball -root				    \n\
+ 				halo -root				    \n\
+ 				maze -root				    \n\
+ 				noseguy -root				    \n\
+-				flame -root				    \n\
++-				flame -root				    \n\
+ -				lmorph -root				    \n\
+ 				deco -root				    \n\
+-				moire -root				    \n\
+-				moire2 -root				    \n\
++-				moire -root				    \n\
++-				moire2 -root				    \n\
+ 				lightning -root				    \n\
+ 				strange -root				    \n\
+ -				spiral -root				    \n\
+-				laser -root				    \n\
++-				laser -root				    \n\
+ 	       			grav -root				    \n\
+ 				drift -root				    \n\
+ 				ifs -root				    \n\
+-				julia -root				    \n\
++-				julia -root				    \n\
+ 				penrose -root				    \n\
+ -				sierpinski -root			    \n\
+ 				braid -root				    \n\
+ 				galaxy -root				    \n\
+ 				bouboule -root				    \n\
+ 				swirl -root				    \n\
+-				flag -root				    \n\
+-				sphere -root				    \n\
+-				forest -root				    \n\
++-				flag -root				    \n\
++-				sphere -root				    \n\
++-				forest -root				    \n\
+ -				lisa -root				    \n\
+ -				lissie -root				    \n\
+ 				goop -root				    \n\
+ 				starfish -root				    \n\
+-				munch -root				    \n\
++-				munch -root				    \n\
+ 				mismunch -root				    \n\
+ 				fadeplot -root				    \n\
+-				coral -root				    \n\
++-				coral -root				    \n\
+ 				mountain -root				    \n\
+ 				triangle -root				    \n\
+ -				worm -root				    \n\
+ -				rotor -root				    \n\
+--				demon -root				    \n\
++				demon -root				    \n\
+ -				loop -root				    \n\
+ -				vines -root				    \n\
+-				kaleidescope -root			    \n\
++-				kaleidescope -root			    \n\
+ 				xjack -root				    \n\
+ 				xlyap -root				    \n\
+ 				cynosure -root				    \n\
+@@ -229,7 +230,7 @@ GetViewPortIsFullOfLies: False
  				epicycle -root				    \n\
  				interference -root			    \n\
- 				truchet -root -randomize		    \n\
+ 				truchet -root				    \n\
 -				bsod -root				    \n\
 +-				bsod -root				    \n\
  				crystal -root				    \n\
  				discrete -root				    \n\
  				kumppa -root				    \n\
+@@ -239,9 +240,9 @@ GetViewPortIsFullOfLies: False
+ 				t3d -root				    \n\
+ 				penetrate -root				    \n\
+ 				deluxe -root				    \n\
+-				compass -root				    \n\
++-				compass -root				    \n\
+ 				squiral -root				    \n\
+-				xflame -root				    \n\
++				xflame -root -bitmap /usr/share/pixmaps/gnome-logo-large.png \n\
+ 				wander -root				    \n\
+ 	      "Wander (spots)" 	wander -root -advance 0 -size 10 -circles     \
+ 				  -length 10000 -reset 100000		    \n\
+@@ -259,18 +260,18 @@ GetViewPortIsFullOfLies: False
+ 				bumps -root				    \n\
+ 				xanalogtv -root				    \n\
+ 				xspirograph -root			    \n\
+-				nerverot -root				    \n\
++-				nerverot -root				    \n\
+ 				xrayswarm -root				    \n\
+ -	       "Zoom (Fatbits)"	zoom -root				    \n\
+ 	       "Zoom (Lenses)"	zoom -root -lenses			    \n\
+ 				rotzoomer -root				    \n\
+ 				whirlwindwarp -root			    \n\
+  	            		whirlygig -root				    \n\
+- 	            		speedmine -root				    \n\
+- 	            "SpeedWorm"	speedmine -root -worm			    \n\
++- 	            		speedmine -root				    \n\
++- 	            "SpeedWorm"	speedmine -root -worm			    \n\
+  	                	vermiculate -root			    \n\
+  	                	twang -root				    \n\
+- 	                	apollonian -root			    \n\
++- 	                	apollonian -root			    \n\
+  	                	euler2d -root				    \n\
+ 	     "Euler2d (dense)"	euler2d -root -count 4000 -eulertail 400      \
+ 				  -ncolors 230				    \n\
+@@ -287,11 +288,9 @@ GetViewPortIsFullOfLies: False
+  	                	piecewise -root				    \n\
+  	                	cloudlife -root				    \n\
+ 		   		fontglide -root				    \n\
+-				apple2 -root				    \n\
+                                 bubbles -root				    \n\
+ 				pong -root				    \n\
+ 				wormhole -root				    \n\
+-				pacman -root				    \n\
+ 				fuzzyflakes -root			    \n\
+ 				anemotaxis -root			    \n\
+ 				memscroller -root			    \n\
+@@ -352,7 +351,6 @@ GetViewPortIsFullOfLies: False
+ @GL_KLUDGE@ GL:			endgame -root				    \n\
+ -	   GL:			glblur -root				    \n\
+ @GL_KLUDGE@ GL:			atunnel -root				    \n\
+-@GL_KLUDGE@ GL:			flyingtoasters -root			    \n\
+ @GL_KLUDGE@ GL:			bouncingcow -root			    \n\
+ @GL_KLUDGE@ GL:			jigglypuff -root			    \n\
+ @GL_KLUDGE@ GL:			klein -root				    \n\
+@@ -363,23 +361,23 @@ GetViewPortIsFullOfLies: False
+ @GL_KLUDGE@ GL:			blocktube -root				    \n\
+ @GL_KLUDGE@ GL:			flipflop -root				    \n\
+ @GL_KLUDGE@ GL:			antspotlight -root			    \n\
+--	   GL:			glslideshow -root			    \n\
++@GL_KLUDGE@ GL:			glslideshow -root			    \n\
+ @GL_KLUDGE@ GL:			polytopes -root				    \n\
+ @GL_KLUDGE@ GL:			gleidescope -root			    \n\
+-- 	   GL:			mirrorblob -root			    \n\
+-@GL_KLUDGE@ GL:	    "MirrorBlob (color only)"				      \
++@GL_KLUDGE@ GL:			mirrorblob -root			    \n\
++-	   GL:	    "MirrorBlob (color only)"				      \
+                                 mirrorblob -root -colour -no-texture	    \n\
+ @GL_KLUDGE@ GL:			blinkbox -root				    \n\
+ @GL_KLUDGE@ GL:			noof -root				    \n\
+ @GL_KLUDGE@ GL:			polyhedra -root				    \n\
+--	   GL:                  antinspect -root                            \n\
+-@GL_KLUDGE@ GL:			providence -root			    \n\
++@GL_KLUDGE@ GL:			antinspect -root                            \n\
++-	   GL:			providence -root			    \n\
+ @GL_KLUDGE@ GL:	"Pinion (large gears)"	pinion -root			    \n\
+ @GL_KLUDGE@ GL:	"Pinion (small gears)"	pinion -root -size 0.2 -scroll 0.3  \n\
+ @GL_KLUDGE@ GL:			boing -root -lighting -smooth		    \n\
+--	   GL:                  carousel -root                              \n\
++@GL_KLUDGE@ GL:			carousel -root                              \n\
+ @GL_KLUDGE@ GL:			fliptext -root				    \n\
+--	   GL:                  antmaze -root                               \n\
++@GL_KLUDGE@ GL:			antmaze -root                               \n\
+ @GL_KLUDGE@ GL:			tangram -root				    \n\
+ @GL_KLUDGE@ GL:			crackberg -root				    \n\
+ @GL_KLUDGE@ GL:			glhanoi -root				    \n\
+@@ -452,12 +450,12 @@ XScreenSaver.bourneShell:		/bin/sh
+ *Dialog.shadowThickness:	2
+ 
+ *passwd.heading.label:		XScreenSaver %s
+-*passwd.body.label:		Please enter your password.
++*passwd.body.label:		This display is locked.
+ *passwd.login.label:		New Login
+ *passwd.user.label:		Username:
+ *passwd.passwd.label:		Password:
+ *passwd.thermometer.width:	8
+-*passwd.asterisks:              True
++*passwd.asterisks:              False
+ *passwd.uname:                  True
+ 
+ *splash.heading.label:		XScreenSaver %s
+@@ -512,7 +510,6 @@ XScreenSaver.bourneShell:		/bin/sh
+ *hacks.electricsheep.name:  ElectricSheep
+ *hacks.sphereEversion.name: SphereEversion
+ *hacks.fluidballs.name:     FluidBalls
+-*hacks.flyingtoasters.name: FlyingToasters
+ *hacks.bouncingcow.name:    BouncingCow
+ *hacks.jigglypuff.name:     JigglyPuff
+ *hacks.hypertorus.name:     HyperTorus
--- a/open-src/app/xscreensaver/accessibility.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/accessibility.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -50,18 +50,18 @@
 	http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6176524
 
 diff -urp -x '*~' driver/demo-Gtk.c driver/demo-Gtk.c
---- driver/demo-Gtk.c	2006-05-10 08:49:37.280822000 -0700
-+++ driver/demo-Gtk.c	2006-05-10 08:49:43.010409000 -0700
-@@ -84,6 +84,8 @@
- #include <glade/glade-xml.h>
- #endif /* HAVE_GTK2 */
+--- driver/demo-Gtk.c	2006-08-09 14:27:11.803220000 -0700
++++ driver/demo-Gtk.c	2006-08-09 14:27:18.141511000 -0700
+@@ -98,6 +98,8 @@
+ # define G_MODULE_EXPORT /**/
+ #endif /* !HAVE_GTK2 */
  
 +#include <gconf/gconf-client.h>
 +
  #if defined(DEFAULT_ICONDIR) && !defined(GLADE_DIR)
  # define GLADE_DIR DEFAULT_ICONDIR
  #endif
-@@ -3826,6 +3828,10 @@ create_xscreensaver_settings_dialog (voi
+@@ -4578,6 +4580,10 @@ create_xscreensaver_settings_dialog (voi
  
  #endif /* HAVE_GTK2 */
  
@@ -72,8 +72,8 @@
  int
  main (int argc, char **argv)
  {
-@@ -3840,6 +3846,12 @@ main (int argc, char **argv)
-   char window_title[255];
+@@ -4593,6 +4599,12 @@ main (int argc, char **argv)
+   char *geom = 0;
    Bool crapplet_p = False;
    char *str;
 +/*
@@ -85,9 +85,9 @@
  
  #ifdef ENABLE_NLS
    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
-@@ -4067,6 +4079,15 @@ main (int argc, char **argv)
-   p->db = db;
-   load_init_file (p);
+@@ -4876,6 +4888,15 @@ main (int argc, char **argv)
+ 
+   load_init_file (dpy, p);
    initialize_sort_map (s);
 +  /* Bug 147639:Gok cant automatically UI grab screensaver preferences
 +  */
@@ -102,11 +102,11 @@
    /* Now that Xt has been initialized, and the resources have been read,
       we can set our `progname' variable to something more in line with
 diff -urp -x '*~' driver/lock.c driver/lock.c
---- driver/lock.c	2006-05-10 08:49:37.437773000 -0700
-+++ driver/lock.c	2006-05-10 08:49:43.058171000 -0700
-@@ -25,6 +25,7 @@
- 
+--- driver/lock.c	2006-08-09 14:27:11.540710000 -0700
++++ driver/lock.c	2006-08-09 14:27:18.181823000 -0700
+@@ -21,6 +21,7 @@
  #include <X11/Intrinsic.h>
+ #include <X11/cursorfont.h>
  #include <X11/Xos.h>		/* for time() */
 +#include <X11/Xatom.h>
  #include <time.h>
@@ -115,21 +115,19 @@
 @@ -77,6 +78,10 @@ vms_passwd_valid_p(char *pw, Bool verbos
  
  #endif /* VMS */
-  
-+/* 5059445(p3) screen kb and reader support */
-+extern
-+int grab_mouse (saver_info *si, Window window, Cursor cursor, int screen_no);
-+extern int grab_kbd (saver_info *si, Window window,  int screen_no);
- extern void await_dying_children (saver_info *si);
- void hack_uid (saver_info *si);
  
-@@ -181,8 +186,106 @@ void update_passwd_window (saver_info *s
- 				  float ratio);
- void destroy_passwd_window (saver_info *si);
- static void undo_vp_motion (saver_info *si);
++/* 5059445(p3) screen kb and reader support */
++extern int grab_mouse (saver_info *si, Window window, Cursor cursor, int screen_no);
++extern int grab_kbd (saver_info *si, Window window,  int screen_no);
++
+ extern int kill_job (saver_info *si, pid_t pid, int signal);
+ extern struct screenhack_job *make_job (pid_t pid, int screen, const char *cmd);
+ void hack_uid (saver_info *si);
+@@ -99,6 +104,105 @@ static void handle_passwd_button (saver_
+ extern Atom XA_UNLOCK_RATIO;
+ 
+ 
 +/* GOK bug */
- 
- extern Atom XA_UNLOCK_RATIO;
 +Window at_win[4] = {0,0,0,0};	/* wIds for XRestackWindows() */
 +				/* dialog, GOK, or MAG or screenSaver */
 +
@@ -227,10 +225,11 @@
 + else 
 +	return 0;
 +}
++
+ static int  ignore_all_errors_ehandler (Display *dpy, XErrorEvent *error);
  
- #if defined (HAVE_XF86VMODE) || defined (HAVE_XSCREENSAVER_LOCK)
- static Bool vp_got_error = False;
-@@ -258,6 +361,7 @@ handle_passwd_input (XtPointer data, int
+ #ifdef HAVE_XSCREENSAVER_LOCK
+@@ -164,6 +268,7 @@ handle_passwd_input (XtPointer data, int
    saver_preferences *p = &si->prefs;
    char buffer[1024];
    char *s;
@@ -238,7 +237,7 @@
  
    if (si->prefs.verbose_p)
      fprintf (stderr, "passwd input handler() fd=%d\n",*fd);
-@@ -300,9 +404,100 @@ handle_passwd_input (XtPointer data, int
+@@ -206,9 +311,100 @@ handle_passwd_input (XtPointer data, int
    else /* Get the window id of lock dialog from Child ***/
      {
        Window window = strtoul (s, NULL, 0);
@@ -341,17 +340,15 @@
        si->pw_data->got_windowid = True;
        si->passwd_dialog = window;
        /**g_passwd_dialog_created = True;**/ /*set global flag to check in timers.c*/
-@@ -469,7 +664,9 @@ make_window (saver_info *si, enum window
- 	  si->external_passwd = True;
- 	  return;
- 	}
-+    }
+@@ -363,6 +559,7 @@ make_window (saver_info *si, enum window
+       return;
+     }
    si->external_passwd = False;
 +  si->at_external_passwd = False;
    /* FIXME: don't abort() */
    /*abort ();*/
- #endif /* HAVE_XSCREENSAVER_LOCK */
-@@ -1129,6 +1326,13 @@ destroy_passwd_window (saver_info *si)
+ #endif /* HAVE_XSCREENSAVER_LOCK */ 
+@@ -1123,6 +1320,13 @@ destroy_passwd_window (saver_info *si)
    Colormap cmap;
    Pixel black, white;
    XEvent event;
@@ -365,18 +362,18 @@
  
    if (si->prefs.verbose_p)
      fprintf (stderr, "destroy_passwd_window\n");
-@@ -1186,6 +1390,7 @@ destroy_passwd_window (saver_info *si)
-       unblock_sigchld ();
+@@ -1171,6 +1375,7 @@ destroy_passwd_window (saver_info *si)
+ 	}
        
        si->external_passwd = False;
 +      si->at_external_passwd = False;
-     }
+      }     
    else
  #endif /* HAVE_XSCREENSAVER_LOCK */
-@@ -1324,6 +1529,19 @@ destroy_passwd_window (saver_info *si)
-      free (pw);
-      si->pw_data = 0;
-    ************/
+@@ -1292,6 +1497,19 @@ destroy_passwd_window (saver_info *si)
+   free (pw);
+   si->pw_data = 0;
+   ************/
 +
 + for (j= 1; j < 3 ; j++)
 + {
@@ -393,7 +390,7 @@
  }
  
  
-@@ -1574,6 +1792,10 @@ passwd_animate_timer (XtPointer closure,
+@@ -1540,6 +1758,10 @@ passwd_animate_timer (XtPointer closure,
        event.xclient.data.l[1] = 0;
        event.xclient.data.l[2] = 0;
  
@@ -404,21 +401,18 @@
        XSync (si->dpy, False);
        old_handler = XSetErrorHandler (ignore_all_errors_ehandler);
        
-@@ -1687,8 +1909,13 @@ passwd_event_loop (saver_info *si)
-   saver_preferences *p = &si->prefs;
-   char *msg = 0;
+@@ -1709,6 +1931,10 @@ passwd_event_loop (saver_info *si)
    XEvent event;
+   unsigned int caps_p = 0;
+ 
 +/* bugid 6176524 passwdTimeout and reset timer for each key press */
 +  passwd_dialog_data *pw = si->pw_data;
 +  int ii;
 +
    passwd_animate_timer ((XtPointer) si, 0);
  
-+      
    while (si->pw_data && si->pw_data->state == pw_read)
-     {
-       XtAppNextEvent (si->app, &event);
-@@ -1697,7 +1924,7 @@ passwd_event_loop (saver_info *si)
+@@ -1719,7 +1945,7 @@ passwd_event_loop (saver_info *si)
  	{
  	  if (si->pw_data->got_windowid)
  	    {
@@ -427,7 +421,7 @@
  	      XErrorHandler old_handler;
  	     
                if(p->verbose_p)
-@@ -1713,6 +1940,22 @@ passwd_event_loop (saver_info *si)
+@@ -1735,6 +1961,22 @@ passwd_event_loop (saver_info *si)
                XSync (si->dpy, False);
                XSetErrorHandler (old_handler);
  
@@ -450,7 +444,7 @@
                if (p->verbose_p)
                  {
                    if (status)
-@@ -1758,8 +2001,61 @@ passwd_event_loop (saver_info *si)
+@@ -1775,8 +2017,61 @@ passwd_event_loop (saver_info *si)
  	  si->pw_data->state = pw_read;
         }
  
@@ -514,9 +508,9 @@
  
    switch (si->pw_data->state)
 diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2006-05-10 08:49:37.424123000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:49:43.046876000 -0700
-@@ -808,6 +808,21 @@ initialize_per_screen_info (saver_info *
+--- driver/xscreensaver.c	2006-08-09 14:27:11.897652000 -0700
++++ driver/xscreensaver.c	2006-08-09 14:27:18.183551000 -0700
+@@ -933,6 +933,21 @@ initialize_per_screen_info (saver_info *
  	      get_visual (ssi->screen, "GrayScale", True, False))
  	    found_any_writable_cells = True;
  	}
@@ -538,7 +532,7 @@
      }
  
    si->fading_possible_p = found_any_writable_cells;
-@@ -1026,6 +1041,18 @@ main_loop (saver_info *si)
+@@ -1168,6 +1183,18 @@ main_loop (saver_info *si)
  {
    saver_preferences *p = &si->prefs;
    /* Bool ok_to_unblank; made this a global flag, gets set in timers.c */
@@ -558,9 +552,9 @@
    while (1)
      {
 diff -urp -x '*~' driver/xscreensaver.h driver/xscreensaver.h
---- driver/xscreensaver.h	2006-05-10 08:49:37.266733000 -0700
-+++ driver/xscreensaver.h	2006-05-10 08:49:43.045439000 -0700
-@@ -286,6 +286,8 @@ struct saver_screen_info {
+--- driver/xscreensaver.h	2006-08-09 14:27:11.790468000 -0700
++++ driver/xscreensaver.h	2006-08-09 14:27:18.199788000 -0700
+@@ -302,6 +302,8 @@ struct saver_screen_info {
    GC stderr_gc;
    Window stderr_overlay_window;    /* Used if the server has overlay planes */
    Colormap stderr_cmap;
--- a/open-src/app/xscreensaver/allow-root.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/allow-root.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -38,32 +38,31 @@
 
 
 diff -urp -x '*~' driver/demo-Gtk.c driver/demo-Gtk.c
---- driver/demo-Gtk.c	2006-05-10 08:48:29.898310000 -0700
-+++ driver/demo-Gtk.c	2006-05-10 08:48:35.790594000 -0700
-@@ -533,6 +533,14 @@ run_cmd (state *s, Atom command, int arg
+--- driver/demo-Gtk.c	2006-08-08 17:26:21.212926000 -0700
++++ driver/demo-Gtk.c	2006-08-08 17:26:28.136415000 -0700
+@@ -623,6 +623,14 @@ run_cmd (state *s, Atom command, int arg
    char *err = 0;
    int status;
  
 +  if (getuid() == 0) 
 +   {
 +      char buf [255];
-+      strcpy (buf, _("Cant run hacks if logged in as root!"));
++      strlcpy (buf, ("Can not run hacks if logged in as root!"), sizeof(buf));
 +      warning_dialog (s->toplevel_widget, buf, False, 100);
-+     return; 
++      return; 
 +   }
 +
    flush_dialog_changes_and_save (s);
    status = xscreensaver_command (GDK_DISPLAY(), command, arg, False, &err);
-   if (status < 0)
-@@ -552,6 +560,15 @@ static void
- run_hack (state *s, int list_elt, Bool report_errors_p)
- {
-   int hack_number;
-+
+ 
+@@ -653,6 +661,14 @@ run_hack (state *s, int list_elt, Bool r
+   char *err = 0;
+   int status;
+ 
 +  if (getuid() == 0) 
 +   {
 +      char buf [255];
-+      strcpy (buf, _("Cant run hacks if logged in as root!"));
++      strlcpy (buf, _("Can not run hacks if logged in as root!"), sizeof(buf));
 +      warning_dialog (s->toplevel_widget, buf, False, 100);
 +     return; 
 +   }
@@ -71,32 +70,34 @@
    if (list_elt < 0) return;
    hack_number = s->list_elt_to_hack_number[list_elt];
  
-@@ -4131,11 +4148,21 @@ main (int argc, char **argv)
-     GtkOptionMenu *opt = GTK_OPTION_MENU (name_to_widget (s, "mode_menu"));
+@@ -4948,6 +4964,15 @@ main (int argc, char **argv)
      GtkMenu *menu = GTK_MENU (gtk_option_menu_get_menu (opt));
      GList *kids = gtk_container_children (GTK_CONTAINER (menu));
+     int i;
 +
 +    if (getuid() == 0)
 +     {
 +      /*mali if logged in as root disable menu so user cant activate a hack...*/
-+      gtk_widget_set_sensitive (opt, False);
-+      gtk_widget_set_sensitive (menu, False);
++      gtk_widget_set_sensitive (GTK_WIDGET (opt), False);
++      gtk_widget_set_sensitive (GTK_WIDGET (menu), False);
 +     }
 +    else
 +     {
-     for (; kids; kids = kids->next)
-       gtk_signal_connect (GTK_OBJECT (kids->data), "activate",
-                           GTK_SIGNAL_FUNC (mode_menu_item_cb),
-                           (gpointer) s);
-   }
-+  }
+     for (i = 0; kids; kids = kids->next, i++)
+       {
+         gtk_signal_connect (GTK_OBJECT (kids->data), "activate",
+@@ -4961,6 +4986,7 @@ main (int argc, char **argv)
+             mode_menu_order[i] == RANDOM_HACKS_SAME)
+           gtk_widget_hide (GTK_WIDGET (kids->data));
+       }
++     }
  
- 
-   /* Handle the -prefs command-line argument. */
+     if (s->nscreens <= 1)   /* recompute option-menu size */
+       {
 diff -urp -x '*~' driver/exec.c driver/exec.c
---- driver/exec.c	2002-01-17 00:34:43.000000000 -0800
-+++ driver/exec.c	2006-05-10 08:48:35.753517000 -0700
-@@ -185,6 +185,7 @@ exec_command (const char *shell, const c
+--- driver/exec.c	2006-02-03 23:36:33.000000000 -0800
++++ driver/exec.c	2006-08-08 17:26:28.136858000 -0700
+@@ -187,6 +187,7 @@ exec_command (const char *shell, const c
    hairy_p = !!strpbrk (command, "*?$&!<>[];`'\\\"=");
    /* note: = is in the above because of the sh syntax "FOO=bar cmd". */
  
@@ -104,7 +105,7 @@
    if (getuid() == (uid_t) 0 || geteuid() == (uid_t) 0)
      {
        /* If you're thinking of commenting this out, think again.
-@@ -195,6 +196,7 @@ exec_command (const char *shell, const c
+@@ -197,6 +198,7 @@ exec_command (const char *shell, const c
                 blurb());
        exit (-1);
      }
@@ -113,20 +114,20 @@
    if (hairy_p)
      /* If it contains any shell metacharacters, do it the hard way,
 diff -urp -x '*~' driver/setuid.c driver/setuid.c
---- driver/setuid.c	2006-05-10 08:48:29.941707000 -0700
-+++ driver/setuid.c	2006-05-10 08:48:35.755829000 -0700
-@@ -83,6 +83,10 @@ set_ids_by_number (uid_t uid, gid_t gid,
+--- driver/setuid.c	2006-08-08 17:26:21.309244000 -0700
++++ driver/setuid.c	2006-08-08 17:26:28.137412000 -0700
+@@ -122,6 +122,10 @@ set_ids_by_number (uid_t uid, gid_t gid,
    struct passwd *p = getpwuid (uid);
    struct group  *g = getgrgid (gid);
  
 +  /* if we are logged in as root i.e. uid==0 then dont do anything*/
 +  if (getuid() == 0)
-+   return;
++   return 0;
 +
    if (message_ret)
      *message_ret = 0;
  
-@@ -192,6 +196,9 @@ hack_uid (saver_info *si)
+@@ -279,6 +283,9 @@ hack_uid (saver_info *si)
           of the xscreensaver manual titled "LOCKING AND ROOT LOGINS",
           and "USING XDM".
     */
@@ -136,7 +137,7 @@
    if (getuid() == (uid_t) 0)
      {
        si->locking_disabled_p = True;
-@@ -229,6 +236,7 @@ hack_uid (saver_info *si)
+@@ -316,6 +323,7 @@ hack_uid (saver_info *si)
        if (set_ids_by_number (p->pw_uid, p->pw_gid, &si->uid_message) != 0)
  	saver_exit (si, -1, 0);
      }
@@ -144,7 +145,7 @@
  
  
    /* If there's anything even remotely funny looking about the passwd struct,
-@@ -271,7 +279,10 @@ hack_uid (saver_info *si)
+@@ -358,7 +366,10 @@ hack_uid (saver_info *si)
  		 (p && p->pw_name && *p->pw_name
  		  ? p->pw_name : "<unknown>"));
  	si->nolock_reason = buf;
@@ -156,9 +157,9 @@
        }
    }
 diff -urp -x '*~' driver/subprocs.c driver/subprocs.c
---- driver/subprocs.c	2006-05-10 08:48:29.955074000 -0700
-+++ driver/subprocs.c	2006-05-10 08:48:35.788404000 -0700
-@@ -849,6 +849,9 @@ check_if_hacks_dir_exists(void)
+--- driver/subprocs.c	2006-08-08 17:26:21.310147000 -0700
++++ driver/subprocs.c	2006-08-08 17:26:28.179189000 -0700
+@@ -1066,6 +1066,9 @@ check_if_hacks_dir_exists(void)
  void
  spawn_screenhack (saver_info *si, Bool first_time_p)
  {
@@ -169,9 +170,9 @@
     fprintf(stderr, "--> spawn_screenhack()\n");
  
 diff -urp -x '*~' driver/timers.c driver/timers.c
---- driver/timers.c	2006-05-10 08:48:29.940928000 -0700
-+++ driver/timers.c	2006-05-10 08:48:35.781471000 -0700
-@@ -248,7 +248,8 @@ cycle_timer (XtPointer closure, XtInterv
+--- driver/timers.c	2006-08-08 17:26:21.311523000 -0700
++++ driver/timers.c	2006-08-08 17:26:28.180256000 -0700
+@@ -274,7 +274,8 @@ cycle_timer (XtPointer closure, XtInterv
        maybe_reload_init_file (si);
        kill_screenhack (si);
  
@@ -182,9 +183,9 @@
        else
          {
 diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2006-05-10 08:48:29.979552000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:48:35.764178000 -0700
-@@ -399,6 +399,7 @@ startup_ehandler (String name, String ty
+--- driver/xscreensaver.c	2006-08-08 17:26:21.345515000 -0700
++++ driver/xscreensaver.c	2006-08-08 17:26:28.181466000 -0700
+@@ -402,6 +402,7 @@ startup_ehandler (String name, String ty
  
    describe_uids (si, stderr);
  
@@ -192,7 +193,7 @@
    if (si->orig_uid && !strncmp (si->orig_uid, "root/", 5))
      {
        fprintf (stderr, "\n"
-@@ -412,11 +413,11 @@ startup_ehandler (String name, String ty
+@@ -415,11 +416,11 @@ startup_ehandler (String name, String ty
                 blurb());
      }
    else
@@ -206,7 +207,7 @@
             blurb());
      }
  
-@@ -1034,7 +1035,7 @@ main_loop (saver_info *si)
+@@ -1244,7 +1245,7 @@ main_loop (saver_info *si)
  
        kill_screenhack (si);
  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/app/xscreensaver/apple2.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
+
+You must include <X11/Xlib.h> before <X11/Xutil.h> on systems based on
+X11R6.6 and earlier.   (XFree86 and X11R6.7 and later added the include
+directly to Xutil.h.)
+
+diff -urp -x '*~' hacks/apple2-main.c hacks/apple2-main.c
+--- hacks/apple2-main.c	2006-03-26 21:34:17.000000000 -0800
++++ hacks/apple2-main.c	2006-08-08 15:26:04.882637000 -0700
+@@ -27,6 +27,7 @@
+ #ifndef HAVE_COCOA
+ # define XK_MISCELLANY
+ # include <X11/keysymdef.h>
++# include <X11/Xlib.h>
+ # include <X11/Xutil.h>
+ # include <X11/Intrinsic.h>
+ #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/app/xscreensaver/barcode-hack.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -0,0 +1,347 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
+
+Replace words that may disturb easily-offended users or easily-worried lawyers
+with those that may entertain the easily-amused Sun engineer who had to edit
+the list.
+
+diff -urp -x '*~' hacks/barcode.c hacks/barcode.c
+--- hacks/barcode.c	2006-04-05 23:40:32.000000000 -0700
++++ hacks/barcode.c	2006-08-09 14:27:45.688577000 -0700
+@@ -111,16 +111,24 @@ static const char *words[] = 
+   "bangle",
+   "bankruptcy",
+   "baptism",
++  "barrelmaker",
+   "beer",
+   "bellicosity",
+   "bells",
+   "belly",
++  "Beowawe",
++  "Berkeley",
++  "BFU",
++  "biodiesel",
++  "blastwave",
+   "bliss",
+   "bogosity",
+-  "boobies",
+-  "boobs",
++  "bolthole",
++  "Boole House",
+   "booty",
+   "bread",
++  "brickify",
++  "browncoat",
+   "bubba",
+   "burrito",
+   "California",
+@@ -128,18 +136,25 @@ static const char *words[] = 
+   "cardinality",
+   "caribou",
+   "carnage",
++  "Chicago",
+   "children",
++  "chime",
+   "chocolate",
++  "chupacabra",
++  "cinnabar",
+   "CLONE",
+-  "cock",
+   "constriction",
+   "contrition",
+   "cop",
++  "corona",
+   "corpse",
+   "cowboy",
+   "crabapple",
+   "craziness",
++  "crossbow",
+   "cthulhu",
++  "cuddle",
++  "cuddletech",
+   "Death",
+   "decepticon",
+   "deception",
+@@ -148,20 +163,25 @@ static const char *words[] = 
+   "decoy",
+   "defenestration",
+   "democracy",
++  "dendrite",
+   "dependency",
+   "despair",
+   "desperation",
+   "disease",
+   "disease",
+   "doberman",
++  "dot com",
+   "DOOM",
+-  "dreams",
++  "DREAM",
+   "dreams",
+   "drugs",
++  "Duckwater",
+   "easy",
+   "ebony",
+   "election",
+   "eloquence",
++  "Elko",
++  "Ely",
+   "emergency",
+   "eureka",
+   "excommunication",
+@@ -174,15 +194,21 @@ static const char *words[] = 
+   "flatulence",
+   "fluff",
+   "fnord",
++  "frak",
+   "freedom",
+   "fruit",
+   "fruit",
+   "futility",
++  "galaxy",
++  "genunix",
+   "gerbils",
+-  "GOD",
++  "Gerlach",
+   "goggles",
+   "goobers",
+   "gorilla",
++  "grok",
++  "grub",
++  "Groom Lake",
+   "halibut",
+   "handmaid",
+   "happiness",
+@@ -193,7 +219,9 @@ static const char *words[] = 
+   "heroin",
+   "heroine",
+   "hope",
++  "honeycomb",
+   "hysteria",
++  "Ichthyosaur",
+   "icepick",
+   "identity",
+   "ignorance",
+@@ -206,10 +234,13 @@ static const char *words[] = 
+   "irritant",
+   "jade",
+   "jaundice",
++  "Jet",
+   "Joyce",
++  "Jupiter",
+   "kidney stone",
+   "kitchenette",
+   "kiwi",
++  "Lahontan",
+   "lathe",
+   "lattice",
+   "lawyer",
+@@ -218,22 +249,35 @@ static const char *words[] = 
+   "lobbyist",
+   "love",
+   "lozenge",
++  "Lund",
++  "Mad Hatter",
+   "magazine",
+   "magnesium",
+   "malfunction",
++  "Marrakesh",
++  "Mars",
+   "marmot",
+   "marshmallow",
++  "McGill",
++  "Menlo Park",
++  "mercurial",
+   "merit",
+   "merkin",
+   "mescaline",
+   "milk",
+   "mischief",
+   "mistrust",
++  "Moapa",
+   "money",
+   "monkey",
+   "monkeybutter",
++  "Muskoka",
++  "mustang",
+   "nationalism",
+   "nature",
++  "Nevada",
++  "newt",
++  "Niagara",
+   "neuron",
+   "noise",
+   "nomenclature",
+@@ -242,8 +286,11 @@ static const char *words[] = 
+   "ocelot",
+   "offspring",
+   "overseer",
++  "Pahrump",
+   "pain",
+   "pajamas",
++  "panic",
++  "paravon",
+   "passenger",
+   "passion",
+   "Passover",
+@@ -253,6 +300,8 @@ static const char *words[] = 
+   "petticoat",
+   "pharmacist",
+   "PhD",
++  "pinenut",
++  "Pioche",
+   "pitchfork",
+   "plague",
+   "Poindexter",
+@@ -261,11 +310,10 @@ static const char *words[] = 
+   "presidency",
+   "prison",
+   "prophecy",
+-  "Prozac",
+   "punishment",
+   "punk rock",
+   "punk",
+-  "pussy",
++  "quahog",
+   "quagmire",
+   "quarantine",
+   "quartz",
+@@ -274,13 +322,14 @@ static const char *words[] = 
+   "rage",
+   "readout",
+   "reality",
+-  "rectum",
+   "reject",
+   "rejection",
++  "Reno",
+   "respect",
+   "revolution",
+   "roadrunner",
+   "rule",
++  "sagebrush",
+   "savor",
+   "scab",
+   "scalar",
+@@ -289,16 +338,20 @@ static const char *words[] = 
+   "security",
+   "sediment",
+   "self worth",
++  "shiny",
+   "sickness",
++  "sierra",
+   "silicone",
++  "Sirius",
+   "slack",
+   "slander",
+   "slavery",
+   "sledgehammer",
+-  "smegma",
+   "smelly socks",
++  "soda",
+   "sorrow",
+   "space program",
++  "Sparks",
+   "stamen",
+   "standardization",
+   "stench",
+@@ -308,6 +361,7 @@ static const char *words[] = 
+   "surrender",
+   "surveillance",
+   "synthesis",
++  "tamarack",
+   "television",
+   "tenant",
+   "tendril",
+@@ -316,16 +370,23 @@ static const char *words[] = 
+   "terrorist",
+   "the impossible",
+   "the unknown",
++  "thumper",
++  "tiger",
++  "tonic",
+   "toast",
++  "Tonopah",
+   "topography",
+   "truism",
++  "Tsinghua",
+   "turgid",
++  "uisce",
+   "underbrush",
+   "underling",
+   "unguent",
+   "unusual",
+   "uplink",
+   "urge",
++  "Utah",
+   "valor",
+   "variance",
+   "vaudeville",
+@@ -333,8 +394,7 @@ static const char *words[] = 
+   "vegetarian",
+   "venom",
+   "verifiability",
+-  "viagra",
+-  "vibrator",
++  "vermillion",
+   "victim",
+   "vignette",
+   "villainy",
+@@ -344,25 +404,29 @@ static const char *words[] = 
+   "warehouse",
+   "waste",
+   "waveform",
++  "Wendover",
+   "whiffle ball",
+   "whorl",
+   "windmill",
++  "Winchester",
+   "words",
+   "worm",
+   "worship",
+   "worship",
+-  "Xanax",
++  "Wyoming",
+   "Xerxes",
+   "Xhosa",
+   "xylophone",
+   "yellow",
++  "Yerington",
+   "yesterday",
+   "your nose",
+   "Zanzibar",
+   "zeal",
+   "zebra",
+   "zest",
+-  "zinc"
++  "zinc",
++  "Zulu"
+ };
+ 
+ #define WORD_COUNT (sizeof(words) / sizeof(char *))
--- a/open-src/app/xscreensaver/blurb.patch	Mon Aug 07 13:49:43 2006 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,356 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
- *
- */
-
-Removed unsafe calls to blurb from signal handlers and other places.
-
-diff -urp -x '*~' driver/lock.c driver/lock.c
---- driver/lock.c	2006-05-10 08:49:29.423263000 -0700
-+++ driver/lock.c	2006-05-10 08:49:37.437773000 -0700
-@@ -1841,12 +1841,11 @@ passwd_event_loop (saver_info *si)
-     {
-       if (si->unlock_failures == 1)
- 	fprintf (real_stderr,
--		 "%s: WARNING: 1 failed attempt to unlock the screen.\n",
--		 blurb());
-+		 "WARNING: 1 failed attempt to unlock the screen.\n");
-       else
- 	fprintf (real_stderr,
--		 "%s: WARNING: %d failed attempts to unlock the screen.\n",
--		 blurb(), si->unlock_failures);
-+		 "WARNING: %d failed attempts to unlock the screen.\n",
-+		 si->unlock_failures);
- 
-       si->unlock_failures = 0;
-     }
-diff -urp -x '*~' driver/subprocs.c driver/subprocs.c
---- driver/subprocs.c	2006-05-10 08:49:29.616989000 -0700
-+++ driver/subprocs.c	2006-05-10 08:49:37.422733000 -0700
-@@ -104,7 +104,7 @@ limit_subproc_memory (int address_space_
-   if (getrlimit (RLIMIT_AS, &r) != 0)
-     {
-       char buf [512];
--      sprintf (buf, "%s: getrlimit(RLIMIT_AS) failed", blurb());
-+      sprintf (buf, "getrlimit(RLIMIT_AS) failed");
-       perror (buf);
-       return;
-     }
-@@ -114,8 +114,8 @@ limit_subproc_memory (int address_space_
-   if (setrlimit (RLIMIT_AS, &r) != 0)
-     {
-       char buf [512];
--      sprintf (buf, "%s: setrlimit(RLIMIT_AS, {%lu, %lu}) failed",
--               blurb(), r.rlim_cur, r.rlim_max);
-+      sprintf (buf, "setrlimit(RLIMIT_AS, {%lu, %lu}) failed",
-+                r.rlim_cur, r.rlim_max);
-       perror (buf);
-       return;
-     }
-@@ -133,8 +133,8 @@ limit_subproc_memory (int address_space_
-       else
-         sprintf(buf, "%d bytes", i);
- 
--      fprintf (stderr, "%s: limited pid %lu address space to %s.\n",
--               blurb(), (unsigned long) getpid (), buf);
-+      fprintf (stderr, "limited pid %lu address space to %s.\n",
-+                (unsigned long) getpid (), buf);
-     }
- 
- #endif /* HAVE_SETRLIMIT && RLIMIT_AS */
-@@ -169,7 +169,7 @@ void
- show_job_list (void)
- {
-   struct screenhack_job *job;
--  fprintf(stderr, "%s: job list:\n", blurb());
-+  fprintf(stderr, "job list:\n");
-   for (job = jobs; job; job = job->next)
-     fprintf (stderr, "  %5ld: %2d: (%s) %s\n",
- 	     (long) job->pid,
-@@ -342,8 +342,8 @@ kill_job (saver_info *si, pid_t pid, int
-       job->status == job_killed)
-     {
-       if (p->verbose_p)
--	fprintf (stderr, "%s: no child %ld to signal!\n",
--		 blurb(), (long) pid);
-+	fprintf (stderr, " no child %ld to signal!\n",
-+		  (long) pid);
-       goto DONE;
-     }
- 
-@@ -358,8 +358,8 @@ kill_job (saver_info *si, pid_t pid, int
-   }
- 
-   if (p->verbose_p)
--    fprintf (stderr, "%s: %d: %s pid %lu (%s)\n",
--             blurb(), job->screen,
-+    fprintf (stderr, "%d: %s pid %lu (%s)\n",
-+             job->screen,
-              (job->status == job_killed  ? "killing" :
-               job->status == job_stopped ? "suspending" : "resuming"),
-              (unsigned long) job->pid,
-@@ -371,13 +371,13 @@ kill_job (saver_info *si, pid_t pid, int
-     {
-       if (errno == ESRCH)
- 	fprintf (stderr,
--                 "%s: %d: child process %lu (%s) was already dead.\n",
--		 blurb(), job->screen, job->pid, job->name);
-+                 " %d: child process %lu (%s) was already dead.\n",
-+		  job->screen, job->pid, job->name);
-       else
- 	{
- 	  char buf [1024];
--	  sprintf (buf, "%s: %d: couldn't kill child process %lu (%s)",
--		   blurb(), job->screen, job->pid, job->name);
-+	  sprintf (buf, "%d: couldn't kill child process %lu (%s)",
-+		    job->screen, job->pid, job->name);
- 	  perror (buf);
- 	}
-     }
-@@ -401,7 +401,7 @@ sigchld_handler (int sig)
-   saver_info *si = global_si_kludge;	/* I hate C so much... */
- 
-   if (si->prefs.debug_p)
--    fprintf(stderr, "%s: got SIGCHLD%s\n", blurb(),
-+    fprintf(stderr, " got SIGCHLD%s\n", 
- 	    (block_sigchld_handler ? " (blocked)" : ""));
- 
-   if (block_sigchld_handler < 0)
-@@ -433,10 +433,10 @@ await_dying_children (saver_info *si)
-       if (si->prefs.debug_p)
- 	{
- 	  if (kid < 0 && errno)
--	    fprintf (stderr, "%s: waitpid(-1) ==> %ld (%d)\n", blurb(),
-+	    fprintf (stderr, " waitpid(-1) ==> %ld (%d)\n", 
- 		     (long) kid, errno);
- 	  else
--	    fprintf (stderr, "%s: waitpid(-1) ==> %ld\n", blurb(),
-+	    fprintf (stderr, " waitpid(-1) ==> %ld\n", 
- 		     (long) kid);
- 	}
- 
-@@ -475,6 +475,7 @@ describe_dead_child (saver_info *si, pid
- 	 if they happen on their own.
-        */
- 
-+#if UNSAFE_CALLS_REMOVE_THESE
-       if ((!job 
- #ifdef HAVE_XSCREENSAVER_LOCK
- 	   && kid != si->passwd_pid
-@@ -489,12 +490,15 @@ describe_dead_child (saver_info *si, pid
-       else if (p->verbose_p)
- 	fprintf (stderr, "%s: %d: child pid %lu (%s) exited normally.\n",
- 		 blurb(), screen_no, (unsigned long) kid, name);
-+#endif /*UNSAFE_CALLS_REMOVE_THESE**/
- 
-       if (job)
- 	job->status = job_dead;
-     }
-   else if (WIFSIGNALED (wait_status))
-     {
-+
-+#if UNSAFE_CALLS_REMOVE_THESE
-       if (p->verbose_p ||
- 	  (!job
- #ifdef HAVE_XSCREENSAVER_LOCK
-@@ -506,24 +510,29 @@ describe_dead_child (saver_info *si, pid
- 	fprintf (stderr, "%s: %d: child pid %lu (%s) terminated with %s.\n",
- 		 blurb(), screen_no, (unsigned long) kid, name,
- 		 signal_name (WTERMSIG(wait_status)));
-+#endif /*UNSAFE_CALLS_REMOVE_THESE*/
- 
-       if (job)
- 	job->status = job_dead;
-     }
-   else if (WIFSTOPPED (wait_status))
-     {
-+#if UNSAFE_CALLS_REMOVE_THESE
-       if (p->verbose_p)
- 	fprintf (stderr, "%s: child pid %lu (%s) stopped with %s.\n",
- 		 blurb(), (unsigned long) kid, name,
- 		 signal_name (WSTOPSIG (wait_status)));
-+#endif /*UNSAFE_CALLS_REMOVE_THESE*/
- 
-       if (job)
- 	job->status = job_stopped;
-     }
-   else
-     {
-+#if UNSAFE_CALLS_REMOVE_THESE
-       fprintf (stderr, "%s: child pid %lu (%s) died in a mysterious way!",
- 	       blurb(), (unsigned long) kid, name);
-+#endif /*UNSAFE_CALLS_REMOVE_THESE*/
-       if (job)
- 	job->status = job_dead;
-     }
-@@ -574,7 +583,7 @@ init_sigchld (void)
-       if (sigaction(SIGCHLD, &action, &old) < 0)
- 	{
- 	  char buf [255];
--	  sprintf (buf, "%s: couldn't catch SIGCHLD", blurb());
-+	  sprintf (buf, "couldn't catch SIGCHLD");
- 	  perror (buf);
- 	}
-       sigchld_initialized_p = True;
-@@ -585,7 +594,7 @@ init_sigchld (void)
-   if (((long) signal (SIGCHLD, sigchld_handler)) == -1L)
-     {
-       char buf [255];
--      sprintf (buf, "%s: couldn't catch SIGCHLD", blurb());
-+      sprintf (buf, "couldn't catch SIGCHLD");
-       perror (buf);
-     }
- # endif /* !HAVE_SIGACTION */
-@@ -629,7 +638,7 @@ print_path_error (const char *program)
-   char *token = strchr (cmd, ' ');
- 
-   if (token) *token = 0;
--  sprintf (buf, "%s: could not execute \"%.100s\"", blurb(), cmd);
-+  sprintf (buf, "could not execute \"%.100s\"", cmd);
-   free (cmd);
-   perror (buf);
- 
-@@ -768,8 +777,8 @@ spawn_screenhack_1 (saver_screen_info *s
- 	      */
- 	      if (p->verbose_p)
- 		fprintf(stderr,
--		      "%s: %d: no programs enabled, or no suitable visuals.\n",
--			blurb(), ssi->number);
-+		      "%d: no programs enabled, or no suitable visuals.\n",
-+			ssi->number);
- 	      return;
- 	    }
- 	  else
-@@ -785,7 +794,7 @@ spawn_screenhack_1 (saver_screen_info *s
-       switch ((int) (forked = fork ()))
- 	{
- 	case -1:
--	  sprintf (buf, "%s: couldn't fork", blurb());
-+	  sprintf (buf, "couldn't fork");
- 	  perror (buf);
- 	  restore_real_vroot (si);
- 	  saver_exit (si, 1, 0);
-@@ -807,9 +816,9 @@ spawn_screenhack_1 (saver_screen_info *s
- 			hack->command);
- 
-           if (p->verbose_p)
--            fprintf (stderr, "%s: %d: spawning \"%s\" in pid %lu.\n",
--                     blurb(), ssi->number, hack->command,
--                     (unsigned long) getpid ());
-+            fprintf (stderr, "%d: spawning \"%s\" in pid %lu nice=%d.\n",
-+                      ssi->number, complete_hack_command,
-+                     (unsigned long) getpid (), p->nice_inferior);
- 
- 	  exec_command (p->shell, complete_hack_command, p->nice_inferior);
- 
-@@ -877,8 +886,8 @@ spawn_screenhack (saver_info *si, Bool f
-     }
-   else if (si->prefs.verbose_p)
-     fprintf (stderr,
--             "%s: X says monitor has powered down; "
--             "not launching a hack.\n", blurb());
-+             "X says monitor has powered down; "
-+             "not launching a hack.\n");
- 
-   store_saver_status (si);  /* store current hack numbers */
- }
-@@ -1068,7 +1077,7 @@ get_best_gl_visual (saver_screen_info *s
-     {
-     case -1:
-       {
--        sprintf (buf, "%s: couldn't fork", blurb());
-+        sprintf (buf, "couldn't fork");
-         perror (buf);
-         saver_exit (si, 1, 0);
-       }
-@@ -1103,7 +1112,7 @@ get_best_gl_visual (saver_screen_info *s
-           {
-             /* Ignore "no such file or directory" errors, unless verbose.
-                Issue all other exec errors, though. */
--            sprintf (buf, "%s: running %s", blurb(), av[0]);
-+            sprintf (buf, "running %s", av[0]);
-             perror (buf);
-           }
-         exit (1);                               /* exits fork */
-@@ -1141,16 +1150,16 @@ get_best_gl_visual (saver_screen_info *s
-         if (result == 0)
-           {
-             if (si->prefs.verbose_p)
--              fprintf (stderr, "%s: %s did not report a GL visual!\n",
--                       blurb(), av[0]);
-+              fprintf (stderr, "%s did not report a GL visual!\n",
-+                       av[0]);
-             return 0;
-           }
-         else
-           {
-             Visual *v = id_to_visual (ssi->screen, result);
-             if (si->prefs.verbose_p)
--              fprintf (stderr, "%s: %d: %s: GL visual is 0x%X%s.\n",
--                       blurb(), ssi->number,
-+              fprintf (stderr, "%d: %s: GL visual is 0x%X%s.\n",
-+                        ssi->number,
-                        av[0], result,
-                        (v == ssi->default_visual ? " (default)" : ""));
-             return v;
-@@ -1192,7 +1201,7 @@ restart_process (saver_info *si)
-   if (si->prefs.verbose_p)
-     {
-       int i;
--      fprintf (stderr, "%s: re-executing", blurb());
-+      fprintf (stderr, "re-executing");
-       for (i = 0; saved_argv[i]; i++)
- 	fprintf (stderr, " %s", saved_argv[i]);
-       fprintf (stderr, "\n");
-@@ -1205,7 +1214,7 @@ restart_process (saver_info *si)
-   execvp (saved_argv [0], saved_argv);	/* shouldn't return */
-   {
-     char buf [512];
--    sprintf (buf, "%s: could not restart process", blurb());
-+    sprintf (buf, "could not restart process");
-     perror(buf);
-     fflush(stderr);
-     abort();
-diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2006-05-10 08:49:29.603987000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:49:37.424123000 -0700
-@@ -298,6 +298,14 @@ static Bool blurb_timestamp_p = False;  
- const char *
- blurb (void)
- {
-+ /* A alot of functions call blurb and calling blurb from a 
-+    signal handler is not safe. Causes a hang as timestring is not
-+    a safe call to make from a signal handler. 
-+    So, just returning as timestamp in error msgs is not important.
-+  */
-+
-+  return progname;
-+
-   if (!blurb_timestamp_p)
-     return progname;
-   else
--- a/open-src/app/xscreensaver/bug-6450019.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/bug-6450019.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -1,5 +1,35 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
+
 Fix for bug id 6450019. I was checking if the user is root before deciding
-wether to prompt the user for password or simply use the cached password 
+whether to prompt the user for password or simply use the cached password 
 for the root hack. This backfired when user logged in as root in which case
 there is no cached flag and we simply do not prompt user for password, 
 causing unlock dialog to not prompt for password and failing continously.
@@ -8,24 +38,24 @@
 dialog box. This case was missing if password got expired and xscreensaver
 was letting user back in with expired passwd CR 6417168.
 
---- driver/passwd-pam.c	Thu Jul 20 16:51:39 2006
-+++ driver/passwd-pam.c	Fri Jul 21 11:28:28 2006
-@@ -90,7 +90,14 @@
- 
+diff -urp -x '*~' driver/passwd-pam.c driver/passwd-pam.c
+--- driver/passwd-pam.c	2006-08-08 15:25:38.341257000 -0700
++++ driver/passwd-pam.c	2006-08-08 15:25:42.962275000 -0700
+@@ -85,6 +85,13 @@ extern passwd_dialog_data* ptr_mygtkpwd;
  extern saver_info *global_si_kludge;
  extern Bool g_passwd_dialog_created;
+ 
 +/* CR 6450019 Added this flag to track if orig passwd failed and before
 + * trying root passwd. Trick is for orig passwd we prompt user and wait 
 + * in PAM_ECHO_OFF/ON case whereas for root passwd we need to cache it 
 + * and without prompting user send it to PAM to try root.
 + */
 +static Bool not_a_failover_case = False; 
++
+ extern sigset_t block_sigchld (void);
+ extern void unblock_sigchld (void);
  
-+
- /* blargh */
- #undef  Bool
- #undef  True
-@@ -579,6 +586,15 @@
+@@ -585,6 +592,15 @@ pam_passwd_valid_p (void)
            goto DONE;
           }
  	}
@@ -41,19 +71,20 @@
  
        /* Each time we successfully authenticate, refresh credentials,
           for Kerberos/AFS/DCE/etc.  If this fails, just ignore that
-@@ -626,6 +642,11 @@
+@@ -635,6 +651,12 @@ pam_passwd_valid_p (void)
+   if (user) free (user);
    user = strdup ("root");
    c.user = user;
- 
++ 
 +  not_a_failover_case = True; /* Set this so user is not prompted for root
 +                               * passwd instead the cached passwd from above
 +                               * call to pam_authenticate() is used. 
 +                               */
 +
-   status = -1;  	/* Reset status */
    status = pam_set_item (pamh, PAM_USER, c.user);
    if (verbose_p)
-@@ -848,8 +869,9 @@
+     fprintf (stderr, "%s:   pam_set_item(p, PAM_USER, \"%s\") ==> %d (%s)\n",
+@@ -857,8 +879,9 @@ pam_conversation (int nmsgs,
  					msg[replies]->msg);
  
               /* For our hack to see if the user typed in root passwd to unlock. */
--- a/open-src/app/xscreensaver/debug-msgs.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/debug-msgs.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -31,9 +31,9 @@
 Various tidbits found to aid debugging over the years.
 
 diff -urp -x '*~' driver/demo-Gtk.c driver/demo-Gtk.c
---- driver/demo-Gtk.c	2006-05-10 08:48:56.250032000 -0700
-+++ driver/demo-Gtk.c	2006-05-10 08:49:02.885168000 -0700
-@@ -2327,9 +2327,23 @@ populate_prefs_page (state *s)
+--- driver/demo-Gtk.c	2006-08-08 15:25:01.015494000 -0700
++++ driver/demo-Gtk.c	2006-08-08 15:25:07.860347000 -0700
+@@ -2823,9 +2823,23 @@ populate_prefs_page (state *s)
  
  #ifdef HAVE_DPMS_EXTENSION
      {
@@ -58,9 +58,9 @@
  #endif /* HAVE_DPMS_EXTENSION */
  
 diff -urp -x '*~' driver/prefs.c driver/prefs.c
---- driver/prefs.c	2006-05-10 08:48:56.328495000 -0700
-+++ driver/prefs.c	2006-05-10 08:49:02.873669000 -0700
-@@ -458,6 +458,12 @@ init_file_changed_p (saver_preferences *
+--- driver/prefs.c	2006-08-08 15:25:01.023671000 -0700
++++ driver/prefs.c	2006-08-08 15:25:07.942311000 -0700
+@@ -482,6 +482,12 @@ init_file_changed_p (saver_preferences *
    const char *name = init_file_name();
    struct stat st;
  
@@ -73,7 +73,7 @@
    if (!name) return False;
  
    if (stat(name, &st) != 0)
-@@ -466,6 +472,12 @@ init_file_changed_p (saver_preferences *
+@@ -490,6 +496,12 @@ init_file_changed_p (saver_preferences *
    if (p->init_file_date == st.st_mtime)
      return False;
  
@@ -87,9 +87,9 @@
  }
  
 diff -urp -x '*~' driver/timers.c driver/timers.c
---- driver/timers.c	2006-05-10 08:48:56.343046000 -0700
-+++ driver/timers.c	2006-05-10 08:49:02.882875000 -0700
-@@ -152,7 +152,7 @@ notice_events (saver_info *si, Window wi
+--- driver/timers.c	2006-08-08 15:25:01.024861000 -0700
++++ driver/timers.c	2006-08-08 15:25:07.958865000 -0700
+@@ -175,7 +175,7 @@ notice_events (saver_info *si, Window wi
     */
    XSelectInput (si->dpy, window, SubstructureNotifyMask | events);
  
@@ -98,7 +98,7 @@
      {
        /* Only mention one window per tree (hack hack). */
        fprintf (stderr, "%s: %d: selected KeyPress on 0x%lX\n",
-@@ -235,6 +235,9 @@ cycle_timer (XtPointer closure, XtInterv
+@@ -258,6 +258,9 @@ cycle_timer (XtPointer closure, XtInterv
    saver_preferences *p = &si->prefs;
    Time how_long = p->cycle;
  
@@ -108,7 +108,7 @@
    if (si->selection_mode > 0 &&
        screenhack_running_p (si))
      /* If we're in "SELECT n" mode, the cycle timer going off will just
-@@ -254,7 +257,14 @@ cycle_timer (XtPointer closure, XtInterv
+@@ -277,7 +280,14 @@ cycle_timer (XtPointer closure, XtInterv
      }
    else
      {
@@ -123,7 +123,7 @@
        kill_screenhack (si);
  
        /* if we are root then dont run hacks*/
-@@ -274,13 +284,13 @@ cycle_timer (XtPointer closure, XtInterv
+@@ -297,13 +307,13 @@ cycle_timer (XtPointer closure, XtInterv
        si->cycle_id = XtAppAddTimeOut (si->app, how_long, cycle_timer,
                                        (XtPointer) si);
  
@@ -136,10 +136,10 @@
      {
 -      if (p->debug_p)
 +      if (p->verbose_p)
-         fprintf (stderr, "%s: not starting cycle_timer: how_long == %d\n",
-                  blurb(), how_long);
+         fprintf (stderr, "%s: not starting cycle_timer: how_long == %ld\n",
+                  blurb(), (unsigned long) how_long);
      }
-@@ -322,7 +332,7 @@ reset_timers (saver_info *si)
+@@ -345,7 +355,7 @@ reset_timers (saver_info *si)
  
    if (si->timer_id)
      {
@@ -148,9 +148,9 @@
          fprintf (stderr, "%s: killing idle_timer  (%ld, %ld)\n",
                   blurb(), p->timeout, si->timer_id);
        XtRemoveTimeOut (si->timer_id);
-@@ -640,6 +650,9 @@ sleep_until_idle (saver_info *si, Bool u
-     }
- #endif /* HAVE_SCF_SMARTCARD */
+@@ -723,6 +733,9 @@ sleep_until_idle (saver_info *si, Bool u
+                                    si->using_sgi_saver_extension) ||
+ 				   si->using_xinputdev_extension);
  
 +  if (si->prefs.debug_p)
 +   fprintf(stderr,"--> sleep_until_idle()\n");
@@ -158,7 +158,7 @@
    if (until_idle_p)
      {
        if (polling_for_idleness)
-@@ -729,6 +742,9 @@ sleep_until_idle (saver_info *si, Bool u
+@@ -800,17 +813,24 @@ sleep_until_idle (saver_info *si, Bool u
                     an event (again, user activity.)
                   */
  		idle = 1000 * (si->last_activity_time - time ((time_t *) 0));
@@ -167,8 +167,6 @@
 +
  	      }
  
- #ifdef HAVE_SCF_SMARTCARD
-@@ -756,12 +772,16 @@ sleep_until_idle (saver_info *si, Bool u
  	    if (idle >= p->timeout)
                {
                  /* Look, we've been idle long enough.  We're done. */
@@ -185,17 +183,17 @@
                  goto DONE;
                }
              else
-@@ -769,6 +789,9 @@ sleep_until_idle (saver_info *si, Bool u
-                 /* The event went off, but it turns out that the user has not
-                    yet been idle for long enough.  So re-signal the event.
-                    */
+@@ -821,6 +841,9 @@ sleep_until_idle (saver_info *si, Bool u
+                    user has been idle for 2 minutes, then set this timer to
+                    go off in 3 minutes.
+                  */
 +  	        if (si->prefs.verbose_p)
 +   	         fprintf(stderr,"polling_for_idleness (sleep_until_idle)\n");
 +
                  if (polling_for_idleness)
                    schedule_wakeup_event (si, p->timeout - idle, p->debug_p);
                }
-@@ -857,7 +880,7 @@ sleep_until_idle (saver_info *si, Bool u
+@@ -890,7 +913,7 @@ sleep_until_idle (saver_info *si, Bool u
        case ButtonRelease:
        case MotionNotify:
  
@@ -204,7 +202,7 @@
  	  {
              Window root=0, window=0;
              int x=-1, y=-1;
-@@ -877,6 +900,13 @@ sleep_until_idle (saver_info *si, Bool u
+@@ -910,6 +933,13 @@ sleep_until_idle (saver_info *si, Bool u
                  window = event.xkey.window;
                  x = y = -1;
                }
@@ -218,7 +216,7 @@
  	    else if (event.xany.type == ButtonPress)
                {
                  type = "ButtonPress";
-@@ -885,6 +915,14 @@ sleep_until_idle (saver_info *si, Bool u
+@@ -918,6 +948,14 @@ sleep_until_idle (saver_info *si, Bool u
                  x = event.xmotion.x_root;
                  y = event.xmotion.y_root;
                }
@@ -233,7 +231,7 @@
  
              if (type)
                {
-@@ -899,6 +937,14 @@ sleep_until_idle (saver_info *si, Bool u
+@@ -945,6 +983,14 @@ sleep_until_idle (saver_info *si, Bool u
                  else
                    fprintf (stderr, " at %d,%d.\n", x, y);
                }
@@ -248,7 +246,7 @@
  	  }
  
  	/* If any widgets want to handle this event, let them. */
-@@ -920,7 +966,11 @@ sleep_until_idle (saver_info *si, Bool u
+@@ -987,7 +1033,11 @@ sleep_until_idle (saver_info *si, Bool u
  	    else
  	      /* If we're not demoing, then any activity causes deactivation.
  	       */
@@ -260,7 +258,7 @@
  	  }
  	else
  	  reset_timers (si);
-@@ -1345,6 +1395,9 @@ watchdog_timer (XtPointer closure, XtInt
+@@ -1491,6 +1541,9 @@ watchdog_timer (XtPointer closure, XtInt
                               p->dpms_off / 1000,
                               False);
  
@@ -270,7 +268,7 @@
    if (si->screen_blanked_p)
      {
        Bool running_p = screenhack_running_p (si);
-@@ -1358,7 +1411,7 @@ watchdog_timer (XtPointer closure, XtInt
+@@ -1504,7 +1557,7 @@ watchdog_timer (XtPointer closure, XtInt
          }
        else
          {
@@ -279,7 +277,7 @@
              fprintf (stderr, "%s: watchdog timer raising %sscreen.\n",
                       blurb(), (running_p ? "" : "and clearing "));
  
-@@ -1370,7 +1423,8 @@ watchdog_timer (XtPointer closure, XtInt
+@@ -1516,7 +1569,8 @@ watchdog_timer (XtPointer closure, XtInt
  	{
  	  if (si->prefs.verbose_p)
  	    fprintf (stderr,
@@ -289,7 +287,7 @@
  		     "killing running hacks.\n", blurb());
  	  kill_screenhack (si);
  	}
-@@ -1400,7 +1454,7 @@ reset_watchdog_timer (saver_info *si, Bo
+@@ -1546,7 +1600,7 @@ reset_watchdog_timer (saver_info *si, Bo
        si->watchdog_id = XtAppAddTimeOut (si->app, p->watchdog_timeout,
  					 watchdog_timer, (XtPointer) si);
  
@@ -299,9 +297,9 @@
  		 blurb(), p->watchdog_timeout, si->watchdog_id);
      }
 diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2006-05-10 08:48:56.397896000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:49:02.886459000 -0700
-@@ -692,7 +692,7 @@ print_banner (saver_info *si)
+--- driver/xscreensaver.c	2006-08-08 15:25:01.031812000 -0700
++++ driver/xscreensaver.c	2006-08-08 15:25:07.960461000 -0700
+@@ -706,7 +706,7 @@ print_banner (saver_info *si)
  
    if (p->debug_p)
      fprintf (stderr, "\n"
@@ -310,7 +308,7 @@
  	     "\n"
  	     "\tNote that in debug mode, the xscreensaver window will only\n"
  	     "\tcover the left half of the screen.  (The idea is that you\n"
-@@ -1306,7 +1306,12 @@ main (int argc, char **argv)
+@@ -1455,7 +1455,12 @@ main (int argc, char **argv)
    saver_info the_si;
    saver_info *si = &the_si;
    saver_preferences *p = &si->prefs;
--- a/open-src/app/xscreensaver/dont-bug-jwz.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/dont-bug-jwz.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -34,27 +34,22 @@
 fix things that aren't his fault.
 
 diff -urp -x '*~' driver/XScreenSaver.ad.in driver/XScreenSaver.ad.in
---- driver/XScreenSaver.ad.in	2006-05-10 08:48:17.084393000 -0700
-+++ driver/XScreenSaver.ad.in	2006-05-10 08:48:24.193863000 -0700
-@@ -73,11 +73,11 @@
- *prefsCommand: xscreensaver-demo -prefs
+--- driver/XScreenSaver.ad.in	2006-08-08 15:24:27.689831000 -0700
++++ driver/XScreenSaver.ad.in	2006-08-08 15:24:33.346473000 -0700
+@@ -85,7 +85,7 @@ GetViewPortIsFullOfLies: False
  
- ! This is the URL that the "Help" button on the splash screen loads.
+ ! This is the URL loaded by the "Help" button on the splash screen,
+ ! and by the "Documentation" menu item in xscreensaver-demo.
 -*helpURL: http://www.jwz.org/xscreensaver/man.html
 +*helpURL: 
  
- ! This is how the "Help" button loads URLs (/bin/sh syntax.)
- ! The "helpURL" will be substituted for up to two occurrences of "%s".
--*loadURL: netscape -remote 'openURL(%s)' || netscape '%s'
-+*loadURL: 
- 
- ! This is what the "Manual" button in xscreensaver-demo runs (/bin/sh syntax.)
- @GNOMEHELP_N@*manualCommand: xterm +sb -fg black -bg gray75 -T '%s manual' \
+ ! loadURL       -- how the "Help" buttons load the helpURL (/bin/sh syntax.)
+ ! manualCommand -- how the "Documentation" buttons display man pages.
 diff -urp -x '*~' driver/demo-Gtk.c driver/demo-Gtk.c
---- driver/demo-Gtk.c	2006-05-10 08:48:17.094156000 -0700
-+++ driver/demo-Gtk.c	2006-05-10 08:48:24.196159000 -0700
-@@ -716,6 +716,10 @@ about_menu_cb (GtkMenuItem *menuitem, gp
- void
+--- driver/demo-Gtk.c	2006-08-08 15:24:27.699568000 -0700
++++ driver/demo-Gtk.c	2006-08-08 15:24:33.383606000 -0700
+@@ -860,6 +860,10 @@ about_menu_cb (GtkMenuItem *menuitem, gp
+ G_MODULE_EXPORT void
  doc_menu_cb (GtkMenuItem *menuitem, gpointer user_data)
  {
 +
@@ -64,9 +59,9 @@
    state *s = global_state_kludge;  /* I hate C so much... */
    saver_preferences *p = &s->prefs;
    char *help_command;
-@@ -736,6 +740,9 @@ doc_menu_cb (GtkMenuItem *menuitem, gpoi
-   strcat (help_command, " ) &");
-   system (help_command);
+@@ -882,6 +886,9 @@ doc_menu_cb (GtkMenuItem *menuitem, gpoi
+   if (system (help_command) < 0)
+     fprintf (stderr, "%s: fork error\n", blurb());
    free (help_command);
 +#endif /*JWZ_HELP*/
 +
@@ -75,9 +70,9 @@
  
  
 diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2002-04-13 03:27:02.000000000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:48:24.232166000 -0700
-@@ -240,9 +240,9 @@ xscreensaver %s, copyright (c) 1991-2002
+--- driver/xscreensaver.c	2006-05-17 16:35:54.000000000 -0700
++++ driver/xscreensaver.c	2006-08-08 15:24:33.384967000 -0700
+@@ -239,9 +239,9 @@ xscreensaver %s, copyright (c) 1991-2006
          xscreensaver &\n\
          xscreensaver-demo\n\
  \n\
@@ -86,12 +81,12 @@
  \n\
 -       http://www.jwz.org/xscreensaver/\n\
 +       man xscreensaver/\n\
- \n",
- 	  si->version);
+ \n");
+ 
    fflush (stdout);
-@@ -340,9 +340,6 @@ saver_ehandler (Display *dpy, XErrorEven
-    "    file in your bug report.  *DO NOT* mail the core file itself!\n"
-    "    That won't work.\n"
+@@ -343,9 +343,6 @@ saver_ehandler (Display *dpy, XErrorEven
+    "    That won't work.\n");
+           fprintf (real_stderr,
     "\n"
 -   "    http://www.jwz.org/xscreensaver/bugs.html explains how to create\n"
 -   "    the most useful bug reports, and how to examine core files.\n"
@@ -99,7 +94,7 @@
     "    The more information you can provide, the better.  But please\n"
     "    report this bug, regardless!\n"
     "\n");
-@@ -409,11 +406,6 @@ startup_ehandler (String name, String ty
+@@ -412,11 +409,6 @@ startup_ehandler (String name, String ty
             blurb());
      }
  
@@ -111,7 +106,7 @@
    fflush (stderr);
    fflush (stdout);
    exit (1);
-@@ -619,8 +611,7 @@ process_command_line (saver_info *si, in
+@@ -653,8 +645,7 @@ process_command_line (saver_info *si, in
      The `xscreensaver' program is a daemon that runs in the background.\n\
      You control a running xscreensaver process by sending it messages\n\
      with `xscreensaver-demo' or `xscreensaver-command'.\n\
--- a/open-src/app/xscreensaver/dpms.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/dpms.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -28,17 +28,13 @@
  *
  */
 
-Miscellaneous DPMS fixes, including:
-- Allow xset dpms settings to override .xscreensaver.
-- Changed dpms hack of not allowing to run a hack if system did not support 
-  DPMS, for sunray performance issues. Now, we check if hack dir exists and 
-  not use DPMS support before running a hack.
+Allow xset dpms settings to override .xscreensaver.
 
 
 diff -urp -x '*~' driver/timers.c driver/timers.c
---- driver/timers.c	2006-05-10 08:49:10.952391000 -0700
-+++ driver/timers.c	2006-05-10 08:49:17.369181000 -0700
-@@ -1387,13 +1387,17 @@ watchdog_timer (XtPointer closure, XtInt
+--- driver/timers.c	2006-08-08 15:25:07.958865000 -0700
++++ driver/timers.c	2006-08-08 15:25:12.822517000 -0700
+@@ -1533,13 +1533,17 @@ watchdog_timer (XtPointer closure, XtInt
  
    /* If the DPMS settings on the server have changed, change them back to
       what ~/.xscreensaver says they should be. */
@@ -58,9 +54,9 @@
    if (p->verbose_p)
     fprintf (stderr, "--->watchdog_timer()\n");
 diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2006-05-10 08:49:10.960069000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:49:17.373784000 -0700
-@@ -1380,6 +1380,11 @@ while (debug_flag)
+--- driver/xscreensaver.c	2006-08-08 15:25:07.960461000 -0700
++++ driver/xscreensaver.c	2006-08-08 15:25:12.823864000 -0700
+@@ -1529,6 +1529,11 @@ while (debug_flag)
    init_sigchld ();
  
    disable_builtin_screensaver (si, True);
@@ -72,61 +68,3 @@
    sync_server_dpms_settings (si->dpy,
                               (p->dpms_enabled_p  &&
                                p->mode != DONT_BLANK),
-diff -urp -x '*~' driver/xset.c driver/xset.c
---- driver/xset.c	2006-05-10 08:49:10.891006000 -0700
-+++ driver/xset.c	2006-05-10 08:49:17.372412000 -0700
-@@ -491,15 +491,33 @@ monitor_powered_on_p (saver_info *si)
-     result = True;
- 
-   else if (!DPMSCapable(si->dpy))
-+   {
-     /* Server says the monitor doesn't do power management -- so it's on. */
--    result = True;
-+    /* mali- No, for sunrays if dpms is not working we dont want hacks to run */
-+       if (si->prefs.verbose_p)
-+       {
-+         fprintf(stderr, "Monitor is not DPMSCapable!!\n");
-+         fflush(stderr);
-+       }
-+       result = True;
-+    }
- 
-   else
-     {
-+
-       DPMSInfo(si->dpy, &state, &onoff);
-+      if (si->prefs.verbose_p)
-+       {
-+         fprintf(stderr, "DPMSInfo returned onoff=%d and state=%d\n", onoff, state);
-+         fflush(stderr);
-+       }
-+
-       if (!onoff)
-+       {
- 	/* Server says DPMS is disabled -- so the monitor is on. */
--	result = True;
-+        /*mali no if DPMS is diabled then still run hacks **/
-+	 result = True;
-+       }
-       else
- 	switch (state) {
- 	case DPMSModeOn:      result = True;  break;  /* really on */
-@@ -516,14 +534,17 @@ monitor_powered_on_p (saver_info *si)
- void
- monitor_power_on (saver_info *si)
- {
--  if (!monitor_powered_on_p (si))
-+  if (!monitor_powered_on_p (si) && si->prefs.dpms_enabled_p)
-     {
-+return;
-+/***mali causing BadMatch X Error
-       DPMSForceLevel(si->dpy, DPMSModeOn);
-       XSync(si->dpy, False);
-       if (!monitor_powered_on_p (si))
- 	fprintf (stderr,
-        "%s: DPMSForceLevel(dpy, DPMSModeOn) did not power the monitor on?\n",
- 		 blurb());
-+****/
-     }
- }
- 
--- a/open-src/app/xscreensaver/gl-error-capture.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/gl-error-capture.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -33,9 +33,9 @@
 
 
 diff -urp -x '*~' driver/subprocs.c driver/subprocs.c
---- driver/subprocs.c	2006-05-10 08:49:23.643545000 -0700
-+++ driver/subprocs.c	2006-05-10 08:49:29.616989000 -0700
-@@ -1029,6 +1029,10 @@ get_best_gl_visual (saver_screen_info *s
+--- driver/subprocs.c	2006-08-08 17:27:03.422319000 -0700
++++ driver/subprocs.c	2006-08-08 17:27:08.533828000 -0700
+@@ -1255,6 +1255,10 @@ get_best_gl_visual (saver_screen_info *s
    pid_t forked;
    int fds [2];
    int in, out;
@@ -46,7 +46,7 @@
    char buf[1024];
  
    char *av[10];
-@@ -1046,6 +1050,20 @@ get_best_gl_visual (saver_screen_info *s
+@@ -1272,6 +1276,20 @@ get_best_gl_visual (saver_screen_info *s
    in = fds [0];
    out = fds [1];
  
@@ -67,7 +67,7 @@
    switch ((int) (forked = fork ()))
      {
      case -1:
-@@ -1066,6 +1084,17 @@ get_best_gl_visual (saver_screen_info *s
+@@ -1292,6 +1310,17 @@ get_best_gl_visual (saver_screen_info *s
              perror ("could not dup() a new stdout:");
              return 0;
            }
@@ -85,8 +85,8 @@
          hack_subproc_environment (ssi);		/* set $DISPLAY */
  
          execvp (av[0], av);			/* shouldn't return. */
-@@ -1095,6 +1124,14 @@ get_best_gl_visual (saver_screen_info *s
-         fgets (buf, sizeof(buf)-1, f);
+@@ -1322,6 +1351,14 @@ get_best_gl_visual (saver_screen_info *s
+           *buf = 0;
          fclose (f);
  
 +/* Begin: SUN addition: capture stderr as well */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/app/xscreensaver/glsnake.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
+
+Remove models whose name and/or shape are in poor taste.
+
+diff -urp -x '*~' hacks/glx/glsnake.c hacks/glx/glsnake.c
+--- hacks/glx/glsnake.c	2006-05-03 12:39:21.000000000 -0700
++++ hacks/glx/glsnake.c	2006-08-08 15:25:59.692385000 -0700
+@@ -535,11 +535,6 @@ static const struct model_s model[] = {
+ 	PIN, ZERO, RIGHT, RIGHT, ZERO, PIN, PIN, ZERO, PIN, PIN, ZERO,
+ 	RIGHT, ZERO }
+     },
+-    { "k's turd",
+-      { RIGHT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT,
+-	RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN,
+-	RIGHT, LEFT, RIGHT, PIN, ZERO }
+-    },
+     { "lightsabre",
+       { ZERO, ZERO, ZERO, ZERO, ZERO, PIN, PIN, ZERO, ZERO, ZERO, ZERO,
+ 	ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO,
+@@ -560,26 +555,6 @@ static const struct model_s model[] = {
+ 	ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO,
+ 	ZERO, ZERO, ZERO }
+     },
+-    { "kissy box",
+-      { PIN, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO, ZERO,
+-	ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO,
+-	ZERO, PIN, ZERO }
+-    },
+-    { "erect penis",     /* thanks benno */
+-      { PIN, ZERO, PIN, PIN, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, PIN,
+-	PIN, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO,
+-	ZERO, ZERO }
+-    },
+-    { "flaccid penis",
+-      { PIN, ZERO, PIN, PIN, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, PIN,
+-	PIN, ZERO, ZERO, ZERO, RIGHT, PIN, ZERO, ZERO, ZERO, ZERO, ZERO,
+-	ZERO, ZERO }
+-    },
+-    { "vagina",
+-      { RIGHT, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, PIN, ZERO, ZERO,
+-	LEFT, ZERO, ZERO, ZERO, LEFT, ZERO, LEFT, PIN, LEFT, PIN, RIGHT,
+-	PIN, RIGHT, ZERO }
+-    },
+     { "mask",
+       { ZERO, RIGHT, LEFT, PIN, RIGHT, RIGHT, PIN, ZERO, ZERO, PIN,
+ 	ZERO, ZERO, PIN, ZERO, PIN, ZERO, PIN, ZERO, ZERO, PIN, ZERO,
+@@ -684,9 +659,6 @@ static const struct model_s model[] = {
+     { "Bow",
+         { LEFT, LEFT, LEFT, RIGHT, LEFT, RIGHT, RIGHT, RIGHT, LEFT, LEFT, LEFT, RIGHT, LEFT, RIGHT, RIGHT, RIGHT, LEFT, LEFT, LEFT, RIGHT, LEFT, RIGHT, RIGHT , ZERO }
+     },
+-    { "bra",
+-        { RIGHT, RIGHT, LEFT, LEFT, RIGHT, LEFT, RIGHT, RIGHT, LEFT, LEFT, LEFT, RIGHT, RIGHT, RIGHT, LEFT, LEFT, RIGHT, LEFT, RIGHT, RIGHT, LEFT, LEFT, LEFT , ZERO }
+-    },
+     { "bronchosaurus",
+         { ZERO, PIN, ZERO, PIN, PIN, ZERO, PIN, ZERO, ZERO, PIN, ZERO, PIN, PIN, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, PIN , ZERO }
+     },
+@@ -995,9 +967,6 @@ static const struct model_s model[] = {
+     { "Parrot",
+         { ZERO, ZERO, ZERO, ZERO, RIGHT, RIGHT, ZERO, LEFT, PIN, RIGHT, ZERO, RIGHT, ZERO, RIGHT, ZERO, RIGHT, PIN, LEFT, ZERO, RIGHT, LEFT, ZERO, PIN, ZERO }
+     },
+-    { "Penis",
+-        { PIN, PIN, RIGHT, ZERO, PIN, PIN, ZERO, PIN, ZERO, ZERO, RIGHT, PIN, LEFT, ZERO, ZERO, PIN, ZERO, PIN, PIN, ZERO, LEFT, PIN, PIN, ZERO }
+-    },
+     { "PictureComingSoon",
+         { LEFT, LEFT, ZERO, RIGHT, LEFT, PIN, RIGHT, RIGHT, PIN, RIGHT, LEFT, PIN, LEFT, RIGHT, PIN, RIGHT, RIGHT, PIN, RIGHT, LEFT, ZERO, RIGHT, RIGHT, ZERO }
+     },
--- a/open-src/app/xscreensaver/gtk-lock.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/gtk-lock.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -46,49 +46,50 @@
 models than just a single password for authentication.
 
 diff -urp -x '*~' config.h.in config.h.in
---- config.h.in	2002-05-28 17:44:37.000000000 -0700
-+++ config.h.in	2006-05-10 08:48:29.922847000 -0700
-@@ -147,6 +147,10 @@
-  */
+--- config.h.in	2006-05-17 16:36:52.000000000 -0700
++++ config.h.in	2006-08-09 14:26:27.988140000 -0700
+@@ -129,6 +129,9 @@
+ /* Define this if you have Gtk 2.x. */
  #undef HAVE_GTK2
  
-+/*  Define this to build the external lock dialog
-+ */
++/* Define this to build the external lock dialog */
 +#undef HAVE_XSCREENSAVER_LOCK
 +
- /*  Define this if you have Gnome and want to build support for the 
-     xscreensaver control panel in the Gnome Control Center (gnomecc).
-     (This is needed only with Gtk 1.x.)
+ /* Define this if you are running HPUX with so-called ``Secure Passwords'' (if
+    you have /usr/include/hpsecurity.h, you probably have this.) I haven't
+    tested this one, let me know if it works. */
 diff -urp -x '*~' configure.in configure.in
---- configure.in	2006-05-10 08:48:24.125209000 -0700
-+++ configure.in	2006-05-10 08:48:29.922219000 -0700
-@@ -1462,7 +1462,7 @@ if test "$enable_locking" = yes -a "$wit
-   if test "$ac_cv_pam" = yes ; then
-     have_pam=yes
+--- configure.in	2006-05-23 15:07:00.000000000 -0700
++++ configure.in	2006-08-09 14:26:27.990806000 -0700
+@@ -1834,7 +1834,7 @@ if test "$enable_locking" = yes -a "$wit
      AC_DEFINE(HAVE_PAM)
+     AC_DEFINE_UNQUOTED(PAM_SERVICE_NAME,"$pam_service_name")
+     
 -    PASSWD_LIBS="${PASSWD_LIBS} -lpam"
 +    PASSWD_LIBS="${PASSWD_LIBS} -lcmd -lpam"
  
      # libpam typically requires dlopen and dlsym.  On FreeBSD,
      # those are in libc.  On Linux and Solaris, they're in libdl.
-@@ -1943,11 +1943,16 @@ if test "$with_gtk" = yes; then
-     pkg_check_version  gmodule-2.0  2.0.0
-     pkg_check_version   libxml-2.0  2.4.6
-     pkg_check_version libglade-2.0  1.99.0
-+    pkg_check_version    gconf-2.0  2.6.1
-+    pkg_check_version libloginhelper-1.0 1.0
-     have_gtk="$ok"
+@@ -2386,6 +2386,8 @@ if test "$with_gtk" = yes; then
+   pkg_check_version        libglade-2.0  1.99.0
+   pkg_check_version      gdk-pixbuf-2.0  2.0.0
+   pkg_check_version gdk-pixbuf-xlib-2.0  2.0.0
++  pkg_check_version           gconf-2.0  2.6.1
++  pkg_check_version  libloginhelper-1.0  1.0
+   have_gtk="$ok"
  
-     if test "$have_gtk" = yes; then
-       have_gtk2=yes
-       AC_DEFINE(HAVE_GTK2)
+   if test "$have_gtk" = no; then
+@@ -2401,6 +2403,9 @@ if test "$with_gtk" = yes; then
+   fi
+ 
+   if test "$have_gtk" = yes; then
 +#--- Begin SUNW addition
-+      AC_DEFINE(HAVE_XSCREENSAVER_LOCK)
++    AC_DEFINE(HAVE_XSCREENSAVER_LOCK)
 +#--- End SUNW addition
-     else
-       if test -n "$ac_gtk_version_string" ; then
-         gtk2_halfassed="$ac_gtk_version_string"
-@@ -3256,6 +3261,28 @@ if test "$have_gtk" = yes; then
+     AC_CACHE_CHECK([for Gtk includes], ac_cv_gtk_config_cflags,
+                    [ac_cv_gtk_config_cflags=`$pkg_config --cflags $pkgs`])
+     AC_CACHE_CHECK([for Gtk libs], ac_cv_gtk_config_libs,
+@@ -3414,6 +3419,28 @@ if test "$have_gtk" = yes; then
    ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
  fi
  
@@ -96,7 +97,7 @@
 +PREFERRED_LOCK_PROGRAM=
 +ALL_LOCK_PROGRAMS=
 +LOCK_PROGRAM=
-+if test "$have_gtk2" = yes; then
++if test "$have_gtk" = yes; then
 +  PREFERRED_LOCK_PROGRAM=xscreensaver-lock-Gtk
 +  ALL_LOCK_PROGRAMS="$PREFERRED_LOCK_PROGRAM $ALL_LOCK_PROGRAMS"
 +  LOCK_PROGRAM=xscreensaver-lock
@@ -117,7 +118,7 @@
  
  if test "$have_kerberos" = yes; then
    PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
-@@ -3387,6 +3414,11 @@ AC_SUBST(INCLUDES)
+@@ -3556,6 +3583,11 @@ AC_SUBST(INCLUDES)
  
  AC_SUBST(PREFERRED_DEMO_PROGRAM)
  AC_SUBST(ALL_DEMO_PROGRAMS)
@@ -129,7 +130,7 @@
  AC_SUBST(SAVER_LIBS)
  AC_SUBST(MOTIF_LIBS)
  AC_SUBST(GTK_LIBS)
-@@ -3855,7 +3887,8 @@ HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" |
+@@ -4038,7 +4070,8 @@ HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" |
  
  
  # Sanity check the hackdir
@@ -140,33 +141,25 @@
      echo ""
      AC_MSG_ERROR([\"--with-hackdir=${bindir}/${bad_choice}\" won't work.
 diff -urp -x '*~' driver/Makefile.in driver/Makefile.in
---- driver/Makefile.in	2002-06-11 02:09:07.000000000 -0700
-+++ driver/Makefile.in	2006-05-10 08:48:29.938067000 -0700
-@@ -14,6 +14,7 @@ install_prefix	=
- prefix		= @prefix@
- exec_prefix	= @exec_prefix@
- bindir		= @bindir@
-+libexecdir	= @libexecdir@
- mandir		= @mandir@
- man1dir		= $(mandir)/man1
- mansuffix	= 1
-@@ -30,6 +31,7 @@ GNOME_PANELDIR	= @GNOME_PANELDIR@
- GLADE_DATADIR	= @GLADE_DATADIR@
- GNOME_BINDIR	= $(bindir)
+--- driver/Makefile.in	2006-08-09 14:26:22.840872000 -0700
++++ driver/Makefile.in	2006-08-09 14:26:27.991816000 -0700
+@@ -28,6 +28,7 @@ GTK_APPDIR	= $(GTK_DATADIR)/applications
+ GTK_ICONDIR	= $(GTK_DATADIR)/pixmaps
+ GTK_GLADEDIR	= $(prefix)/lib/xscreensaver/config
  HACK_CONF_DIR	= @HACK_CONF_DIR@
 +LOCK_DIR	= $(libexecdir)
  
  CC		= @CC@
- CFLAGS		= @CFLAGS@
-@@ -39,6 +41,7 @@ INTL_DEFS	= -DLOCALEDIR=\"$(localedir)\"
- SUBP_DEFS	= $(DEFS) -DDEFAULT_PATH_PREFIX='"@HACKDIR@"'
- GTK_DEFS	= $(DEFS) -DDEFAULT_ICONDIR='"$(GLADE_DATADIR)"'
+ OBJCC		= @OBJCC@
+@@ -41,6 +42,7 @@ SUBP_DEFS	= $(DEFS) -DHACK_PATH='"@HACKD
+ GTK_DEFS	= $(DEFS) -DDEFAULT_ICONDIR='"$(GTK_GLADEDIR)"' \
+ 			-DBINDIR='"$(bindir)"'
  CONF_DEFS	= -DHACK_CONFIGURATION_PATH='"$(HACK_CONF_DIR)"'
 +LOCK_DEFS	= $(DEFS) -DLOCKDIR=\"$(LOCK_DIR)\"
  
  LIBS		= @LIBS@
  INTL_LIBS	= @INTLLIBS@
-@@ -95,6 +98,8 @@ GTK_SRCS	= demo-Gtk.c demo-Gtk-conf.c \
+@@ -98,6 +100,8 @@ GTK_SRCS	= demo-Gtk.c demo-Gtk-conf.c \
  		  demo-Gtk-widgets.c demo-Gtk-support.c
  GTK_EXTRA_OBJS  = demo-Gtk-widgets.o demo-Gtk-support.o
  GTK_OBJS	= demo-Gtk.o demo-Gtk-conf.o @GTK_EXTRA_OBJS@
@@ -175,27 +168,36 @@
  
  PWENT_SRCS	= passwd-pwent.c
  PWENT_OBJS	= passwd-pwent.o
-@@ -199,8 +204,8 @@ GETIMG_LIBS	= $(LIBS) $(X_LIBS) $(XPM_LI
+@@ -216,8 +220,8 @@ GETIMG_LIBS	= $(LIBS) $(X_LIBS) $(XPM_LI
  		  $(X_PRE_LIBS) -lXt -lX11 $(XMU_LIBS) -lXext $(X_EXTRA_LIBS)
  
  EXES		= xscreensaver xscreensaver-command xscreensaver-demo \
--		  xscreensaver-getimage
+-		  xscreensaver-getimage @EXES_OSX@
 -EXES2		= @ALL_DEMO_PROGRAMS@
-+		  xscreensaver-getimage @LOCK_PROGRAM@
++		  xscreensaver-getimage @EXES_OSX@ @LOCK_PROGRAM@
 +EXES2		= @ALL_DEMO_PROGRAMS@ @ALL_LOCK_PROGRAMS@
- SCRIPTS		= xscreensaver-getimage-file xscreensaver-getimage-video
+ EXES_OSX	= pdf2jpeg
  
- HDRS		= XScreenSaver_ad.h xscreensaver.h prefs.h remote.h \
-@@ -222,7 +227,7 @@ VMSFILES	= compile_axp.com compile_decc.
+ SCRIPTS_1	= xscreensaver-getimage-file xscreensaver-getimage-video \
+@@ -247,7 +251,7 @@ VMSFILES	= compile_axp.com compile_decc.
+ 		  vms-getpwnam.c vms-pwd.h vms-hpwd.c vms-validate.c \
  		  vms_axp.opt vms_axp_12.opt vms_decc.opt vms_decc_12.opt
  
- TARFILES	= $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
--		  $(MOTIF_SRCS) $(GTK_SRCS) $(PWENT_SRCS) \
-+		  $(MOTIF_SRCS) $(GTK_SRCS) $(GTK_LOCK_SRCS) $(PWENT_SRCS) \
+-TARFILES	= $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
++TARFILES	= $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) $(GTK_LOCK_SRCS) \
+ 		  $(MOTIF_SRCS) $(GTK_SRCS) $(PWENT_SRCS) $(PWHELPER_SRCS) \
  		  $(KERBEROS_SRCS) $(PAM_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) \
- 		  $(CMD_SRCS) $(GETIMG_SRCS_1) $(HDRS) $(SCRIPTS) \
- 		  $(TEST_SRCS) $(MEN)
-@@ -245,6 +250,9 @@ install-program: $(EXES)
+ 		  $(CMD_SRCS) $(GETIMG_SRCS_1) $(PDF2JPEG_SRCS) $(HDRS) \
+@@ -260,7 +264,7 @@ all: $(EXES) $(EXES2)
+ tests: $(TEST_EXES)
+ 
+ install:   install-program   install-ad    install-scripts \
+-	   install-gnome     install-man   install-xml install-pam
++	   install-gnome     install-man   install-xml 
+ uninstall: uninstall-program uninstall-ad  \
+ 	   uninstall-gnome   uninstall-man uninstall-xml  
+ 
+@@ -272,6 +276,9 @@ install-program: $(EXES)
  	@if [ ! -d $(install_prefix)$(bindir) ]; then			\
  	  $(INSTALL_DIRS) $(install_prefix)$(bindir) ;			\
  	 fi
@@ -205,10 +207,10 @@
  	@inst="$(INSTALL_PROGRAM)" ;					\
  	if [ @NEED_SETUID@ = yes ]; then				\
  	   me=`PATH="$$PATH:/usr/ucb" whoami` ;				\
-@@ -280,6 +288,12 @@ install-program: $(EXES)
- 	  $(install_prefix)$(bindir)/xscreensaver-getimage ; \
- 	$(INSTALL_PROGRAM) xscreensaver-getimage \
- 	  $(install_prefix)$(bindir)/xscreensaver-getimage
+@@ -300,6 +307,12 @@ install-program: $(EXES)
+ 	  echo $(INSTALL_PROGRAM) $$exe $(install_prefix)$(bindir)/$$exe ; \
+ 	       $(INSTALL_PROGRAM) $$exe $(install_prefix)$(bindir)/$$exe ; \
+ 	 done
 +	@if [ -n "@LOCK_PROGRAM@" ]; then				     \
 +	  echo $(INSTALL_PROGRAM) xscreensaver-lock \
 +	    $(install_prefix)$(LOCK_DIR)/xscreensaver-lock ; \
@@ -218,30 +220,24 @@
  
  install-ad: XScreenSaver.ad
  	@if [ ! -d $(install_prefix)$(AD_DIR) ]; then			      \
-@@ -767,13 +781,18 @@ $(SAVER_UTIL_OBJS):
+@@ -734,7 +747,7 @@ $(SAVER_UTIL_OBJS):
  
  # How we build object files in this directory.
  .c.o:
--	$(CC) -c $(INCLUDES) $(DEFS)  $(CFLAGS) $(X_CFLAGS) $<
+-	$(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
 +	$(CC) -c $(INCLUDES) $(DEFS) $(INTL_DEFS) $(CFLAGS) $(X_CFLAGS) $<
  
- # subprocs takes an extra -D option.
- subprocs.o: subprocs.c
- 	$(CC) -c $(INCLUDES) $(SUBP_DEFS) $(CFLAGS) $(X_CFLAGS) \
- 	  $(srcdir)/subprocs.c
+ .m.o:
+ 	$(OBJCC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
+@@ -755,6 +768,19 @@ demo-Gtk-conf.o: demo-Gtk-conf.c
+ 	$(CC) -c $(INCLUDES) $(CONF_DEFS) $(GTK_DEFS) $(CFLAGS) $(X_CFLAGS) \
+ 	  $(srcdir)/demo-Gtk-conf.c
  
 +# lock takes an extra -D option.
 +lock.o:
 +	$(CC) -c $(INCLUDES) $(LOCK_DEFS) $(CFLAGS) $(X_CFLAGS) \
 +	  $(srcdir)/lock.c
 +
- # demo-Gtk takes extra -D options, and an extra -I option.
- demo-Gtk.o: demo-Gtk.c
- 	$(CC) -c $(INCLUDES) $(SUBP_DEFS) -I$(ICON_SRC) \
-@@ -785,6 +804,14 @@ demo-Gtk-conf.o: demo-Gtk-conf.c
- 	$(CC) -c $(INCLUDES) $(CONF_DEFS) $(GTK_DEFS) $(CFLAGS) $(X_CFLAGS) \
- 	  $(srcdir)/demo-Gtk-conf.c
- 
 +# lock-Gtk takes extra -D and -I options.
 +GTK_LOCK_LOGO_DEFS=-DXPM_LOGO_FILE=\"@XPM_LOGO_FILE@\" \
 +		  -DXPM_LOGO_NAME=@XPM_LOGO_NAME@
@@ -253,9 +249,9 @@
  
  # How we build the default app-defaults file into the program.
  #
-@@ -806,6 +833,15 @@ xscreensaver-demo: @PREFERRED_DEMO_PROGR
- 	cp -p @PREFERRED_DEMO_PROGRAM@@EXEEXT@ $@@EXEEXT@
- #	$(INSTALL_PROGRAM) @PREFERRED_DEMO_PROGRAM@ $@
+@@ -785,6 +811,15 @@ xscreensaver-demo: @PREFERRED_DEMO_PROGR
+ 	       cp -p @PREFERRED_DEMO_PROGRAM@@EXEEXT@ $@@EXEEXT@      ;	\
+ 	fi
  
 +xscreensaver-lock: @PREFERRED_LOCK_PROGRAM@
 +	$(INSTALL_PROGRAM) @PREFERRED_LOCK_PROGRAM@ $@
@@ -269,7 +265,7 @@
  xscreensaver-demo-Xm: $(DEMO_OBJS) $(MOTIF_OBJS)
  	$(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(MOTIF_OBJS) $(LIBS) $(X_LIBS) \
  	$(MOTIF_LIBS) $(INTL_LIBS) $(X_PRE_LIBS) -lXt -lX11 \
-@@ -821,7 +857,7 @@ xscreensaver-getimage: $(GETIMG_OBJS)
+@@ -806,7 +841,7 @@ pdf2jpeg: $(PDF2JPEG_OBJS)
  
  
  TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
@@ -279,48 +275,49 @@
  test-passwd.o: XScreenSaver_ad.h
  
 diff -urp -x '*~' driver/dpms.c driver/dpms.c
---- driver/dpms.c	2001-03-22 10:10:53.000000000 -0800
-+++ driver/dpms.c	2006-05-10 08:48:29.971953000 -0700
-@@ -16,6 +16,7 @@
+--- driver/dpms.c	2005-03-21 18:07:21.000000000 -0800
++++ driver/dpms.c	2006-08-09 14:26:27.992239000 -0700
+@@ -50,6 +50,7 @@
  
  #include <stdio.h>
  #include <X11/Xlib.h>
 +# include <X11/Intrinsic.h>
  
- #ifdef HAVE_DPMS_EXTENSION
+ #ifdef HAVE_DPMS_EXTENSION   /* almost the whole file */
  
 diff -urp -x '*~' driver/lock.c driver/lock.c
---- driver/lock.c	2002-03-05 18:15:03.000000000 -0800
-+++ driver/lock.c	2006-05-10 08:48:29.981598000 -0700
-@@ -21,6 +21,8 @@
+--- driver/lock.c	2006-05-17 16:35:54.000000000 -0700
++++ driver/lock.c	2006-08-09 14:26:27.994490000 -0700
+@@ -23,6 +23,9 @@
  #include <X11/Xos.h>		/* for time() */
  #include <time.h>
  #include <sys/time.h>
 +#include <errno.h>
 +#include <signal.h>
++#include "exec.h"
  #include "xscreensaver.h"
  #include "resources.h"
  
-@@ -68,281 +70,428 @@ vms_passwd_valid_p(char *pw, Bool verbos
- # define passwd_valid_p vms_passwd_valid_p
+@@ -74,110 +77,296 @@ vms_passwd_valid_p(char *pw, Bool verbos
  
  #endif /* VMS */
+ 
++extern int kill_job (saver_info *si, pid_t pid, int signal);
++extern struct screenhack_job *make_job (pid_t pid, int screen, const char *cmd);
++void hack_uid (saver_info *si);
 + 
-+extern void await_dying_children (saver_info *si);
-+void hack_uid (saver_info *si);
- 
 +Bool g_passwd_dialog_created = 0;
  
  #undef MAX
  #define MAX(a,b) ((a)>(b)?(a):(b))
  
- enum passwd_state { pw_read, pw_ok, pw_null, pw_fail, pw_cancel, pw_time };
- 
+-enum passwd_state { pw_read, pw_ok, pw_null, pw_fail, pw_cancel, pw_time };
+-
 -struct passwd_dialog_data {
- 
+-
 -  saver_screen_info *prompt_screen;
 -  int previous_mouse_x, previous_mouse_y;
- 
+-
 -  enum passwd_state state;
 -  char typed_passwd [80];
 -  XtIntervalId timer;
@@ -332,6 +329,9 @@
 -  Dimension height;
 -  Dimension border_width;
 -
+-  Bool show_stars_p; /* "I regret that I have but one asterisk for my country."
+-                        -- Nathan Hale, 1776. */
+-
 -  char *heading_label;
 -  char *body_label;
 -  char *user_label;
@@ -339,12 +339,18 @@
 -  char *date_label;
 -  char *user_string;
 -  char *passwd_string;
+-  char *login_label;
+-  char *uname_label;
+-
+-  Bool show_uname_p;
 -
 -  XFontStruct *heading_font;
 -  XFontStruct *body_font;
 -  XFontStruct *label_font;
 -  XFontStruct *passwd_font;
 -  XFontStruct *date_font;
+-  XFontStruct *button_font;
+-  XFontStruct *uname_font;
 -
 -  Pixel foreground;
 -  Pixel background;
@@ -354,6 +360,8 @@
 -  Pixel thermo_background;
 -  Pixel shadow_top;
 -  Pixel shadow_bottom;
+-  Pixel button_foreground;
+-  Pixel button_background;
 -
 -  Dimension logo_width;
 -  Dimension logo_height;
@@ -364,43 +372,41 @@
 -  Dimension passwd_field_x, passwd_field_y;
 -  Dimension passwd_field_width, passwd_field_height;
 -
+-  Dimension login_button_x, login_button_y;
+-  Dimension login_button_width, login_button_height;
+-
 -  Dimension thermo_field_x, thermo_field_y;
 -  Dimension thermo_field_height;
 -
 -  Pixmap logo_pixmap;
+-  Pixmap logo_clipmask;
 -  int logo_npixels;
 -  unsigned long *logo_pixels;
- 
+-
+-  Cursor passwd_cursor;
+-  Bool login_button_down_p;
+-  Bool login_button_p;
+-  Bool login_button_enabled_p;
+-
 -  Pixmap save_under;
 -};
++/* enum passwd_state & struct passwd_dialog_data moved to xscreensaver.h */
  
-+
-+
-+
-+
-+
 +static void make_window (saver_info *si, enum window_type w_type);
  static void draw_passwd_window (saver_info *si);
 -static void update_passwd_window (saver_info *si, const char *printed_passwd,
-+void update_passwd_window (saver_info *si, const char *printed_passwd,
++       void update_passwd_window (saver_info *si, const char *printed_passwd,
  				  float ratio);
 -static void destroy_passwd_window (saver_info *si);
-+void destroy_passwd_window (saver_info *si);
++       void destroy_passwd_window (saver_info *si);
  static void undo_vp_motion (saver_info *si);
+ static void handle_passwd_button (saver_info *si, XEvent *event);
  
 +extern Atom XA_UNLOCK_RATIO;
  
 -static void
-+#if defined (HAVE_XF86VMODE) || defined (HAVE_XSCREENSAVER_LOCK)
-+static Bool vp_got_error = False;
 +
-+static int
-+ignore_all_errors_ehandler (Display *dpy, XErrorEvent *error)
-+{
-+  vp_got_error = True;
-+  return 0;
-+}
-+#endif /* defined (HAVE_XF86VMODE) || defined (HAVE_XSCREENSAVER_LOCK) */
++static int  ignore_all_errors_ehandler (Display *dpy, XErrorEvent *error);
 +
 +#ifdef HAVE_XSCREENSAVER_LOCK
 +
@@ -589,8 +595,8 @@
 +      abort ();
 +
 +    default:
-+
 +      /* In Parent */
++      make_job(forked, 0, command);
 +      close_and_invalidate (&stdin_pipe[0]);
 +      close_and_invalidate (&stdout_pipe[1]);
 +
@@ -636,19 +642,18 @@
    XSetWindowAttributes attrs;
    unsigned long attrmask = 0;
 -  passwd_dialog_data *pw = (passwd_dialog_data *) calloc (1, sizeof(*pw));
++  passwd_dialog_data *pw = si->pw_data;
    Screen *screen;
    Colormap cmap;
    char *f;
+   saver_screen_info *ssi = &si->screens [mouse_screen (si)];
  
--  pw->prompt_screen = &si->screens [mouse_screen (si)];
-   if (si->prefs.verbose_p)
--    fprintf (stderr, "%s: %d: creating password dialog.\n",
--             blurb(), pw->prompt_screen->number);
-+     fprintf(stderr, "-->make_window()\n");
++  if (si->prefs.verbose_p)
++    fprintf(stderr, "-->make_window()\n");
 +
 +#ifdef HAVE_XSCREENSAVER_LOCK
-+      if (spawn_external_passwd_process (si, si->pw_data))
-+	{ 
++  if (spawn_external_passwd_process (si, si->pw_data))
++    { 
 +/***************
 +          if (si->prefs.verbose_p)
 +	    fprintf(stderr, "spawning external passwd process in make_window()\n");
@@ -659,193 +664,42 @@
 +	    fprintf(stderr, "Failed to blank the screen\n");
 +*******************/
 +
-+	  si->pw_data->ratio = 1.0;
-+	  si->pw_data->w_type = w_type;
-+	  /*si->pw_data = pw;*/
-+	  si->external_passwd = True;
-+	  return;
-+	}
++      si->pw_data->ratio = 1.0;
++      si->pw_data->w_type = w_type;
++      /*si->pw_data = pw;*/
++      si->external_passwd = True;
++      return;
++    }
 +  si->external_passwd = False;
 +  /* FIXME: don't abort() */
 +  /*abort ();*/
-+#endif /* HAVE_XSCREENSAVER_LOCK */
++#endif /* HAVE_XSCREENSAVER_LOCK */ 
 +
-+  if (si->prefs.verbose_p)
-+     fprintf (stderr, "creating message window\n");
- 
--  screen = pw->prompt_screen->screen;
-+  si->pw_data->prompt_screen = &si->screens [mouse_screen (si)];
-+  /*mali pw->prompt_screen = &si->screens[0];   hardwired for now */
-+  if (si->prefs.verbose_p)
-+    fprintf (stderr, "%s: %d: creating message window.\n",
-+             blurb(), si->pw_data->prompt_screen->number);
-+
-+  screen = si->pw_data->prompt_screen->screen;
+   /* Display the button only if the "newLoginCommand" pref is non-null.
+    */
+   pw->login_button_p = (si->prefs.new_login_command &&
+@@ -196,6 +385,8 @@ make_passwd_window (saver_info *si)
+   screen = pw->prompt_screen->screen;
    cmap = DefaultColormapOfScreen (screen);
  
--  pw->ratio = 1.0;
-+  si->pw_data->w_type = w_type;  
-+  si->pw_data->state = pw_read;
-+  si->pw_data->ratio = 1.0;
++  pw->w_type = w_type;  
++  pw->state = pw_read;
+   pw->ratio = 1.0;
  
--  pw->heading_label = get_string_resource ("passwd.heading.label",
-+  si->pw_data->heading_label = get_string_resource ("passwd.heading.label",
- 					   "Dialog.Label.Label");
--  pw->body_label = get_string_resource ("passwd.body.label",
--					"Dialog.Label.Label");
--  pw->user_label = get_string_resource ("passwd.user.label",
--					"Dialog.Label.Label");
--  pw->passwd_label = get_string_resource ("passwd.passwd.label",
--					  "Dialog.Label.Label");
--  pw->date_label = get_string_resource ("dateFormat", "DateFormat");
--
--  if (!pw->heading_label)
--    pw->heading_label = strdup("ERROR: REESOURCES NOT INSTALLED CORRECTLY");
--  if (!pw->body_label)
--    pw->body_label = strdup("ERROR: REESOURCES NOT INSTALLED CORRECTLY");
--  if (!pw->user_label) pw->user_label = strdup("ERROR");
--  if (!pw->passwd_label) pw->passwd_label = strdup("ERROR");
--  if (!pw->date_label) pw->date_label = strdup("ERROR");
-+  si->pw_data->date_label = get_string_resource ("dateFormat", "DateFormat");
-+
-+  if (!si->pw_data->heading_label)
-+    si->pw_data->heading_label = strdup("ERROR: REESOURCES NOT INSTALLED CORRECTLY");
-+  if (!si->pw_data->date_label) si->pw_data->date_label = strdup("ERROR");
- 
-   /* Put the version number in the label. */
-   {
--    char *s = (char *) malloc (strlen(pw->heading_label) + 20);
--    sprintf(s, pw->heading_label, si->version);
--    free (pw->heading_label);
--    pw->heading_label = s;
-+    char *s = (char *) malloc (strlen(si->pw_data->heading_label) + 20);
-+    sprintf(s, si->pw_data->heading_label, si->version);
-+    free (si->pw_data->heading_label);
-+    si->pw_data->heading_label = s;
+   pw->show_stars_p = get_boolean_resource(si->dpy, "passwd.asterisks", 
+@@ -254,9 +445,6 @@ make_passwd_window (saver_info *si)
    }
+ # endif
  
 -  pw->user_string = strdup (p && p->pw_name ? p->pw_name : "???");
 -  pw->passwd_string = strdup("");
 -
-   f = get_string_resource ("passwd.headingFont", "Dialog.Font");
--  pw->heading_font = XLoadQueryFont (si->dpy, (f ? f : "fixed"));
--  if (!pw->heading_font) pw->heading_font = XLoadQueryFont (si->dpy, "fixed");
-+  si->pw_data->heading_font = XLoadQueryFont (si->dpy, (f ? f : "fixed"));
-+  if (!si->pw_data->heading_font) si->pw_data->heading_font = XLoadQueryFont (si->dpy, "fixed");
-   if (f) free (f);
- 
-   f = get_string_resource("passwd.bodyFont", "Dialog.Font");
--  pw->body_font = XLoadQueryFont (si->dpy, (f ? f : "fixed"));
--  if (!pw->body_font) pw->body_font = XLoadQueryFont (si->dpy, "fixed");
--  if (f) free (f);
--
--  f = get_string_resource("passwd.labelFont", "Dialog.Font");
--  pw->label_font = XLoadQueryFont (si->dpy, (f ? f : "fixed"));
--  if (!pw->label_font) pw->label_font = XLoadQueryFont (si->dpy, "fixed");
--  if (f) free (f);
--
--  f = get_string_resource("passwd.passwdFont", "Dialog.Font");
--  pw->passwd_font = XLoadQueryFont (si->dpy, (f ? f : "fixed"));
--  if (!pw->passwd_font) pw->passwd_font = XLoadQueryFont (si->dpy, "fixed");
-+  si->pw_data->body_font = XLoadQueryFont (si->dpy, (f ? f : "fixed"));
-+  if (!si->pw_data->body_font) si->pw_data->body_font = XLoadQueryFont (si->dpy, "fixed");
-   if (f) free (f);
- 
-   f = get_string_resource("passwd.dateFont", "Dialog.Font");
--  pw->date_font = XLoadQueryFont (si->dpy, (f ? f : "fixed"));
--  if (!pw->date_font) pw->date_font = XLoadQueryFont (si->dpy, "fixed");
-+  si->pw_data->date_font = XLoadQueryFont (si->dpy, (f ? f : "fixed"));
-+  if (!si->pw_data->date_font) si->pw_data->date_font = XLoadQueryFont (si->dpy, "fixed");
-   if (f) free (f);
- 
--  pw->foreground = get_pixel_resource ("passwd.foreground",
-+  si->pw_data->foreground = get_pixel_resource ("passwd.foreground",
- 				       "Dialog.Foreground",
- 				       si->dpy, cmap);
--  pw->background = get_pixel_resource ("passwd.background",
-+  si->pw_data->background = get_pixel_resource ("passwd.background",
- 				       "Dialog.Background",
- 				       si->dpy, cmap);
- 
--  if (pw->foreground == pw->background)
-+  if (si->pw_data->foreground == si->pw_data->background)
-     {
-       /* Make sure the error messages show up. */
--      pw->foreground = BlackPixelOfScreen (screen);
--      pw->background = WhitePixelOfScreen (screen);
-+      si->pw_data->foreground = BlackPixelOfScreen (screen);
-+      si->pw_data->background = WhitePixelOfScreen (screen);
-     }
- 
--  pw->passwd_foreground = get_pixel_resource ("passwd.text.foreground",
--					      "Dialog.Text.Foreground",
--					      si->dpy, cmap);
--  pw->passwd_background = get_pixel_resource ("passwd.text.background",
--					      "Dialog.Text.Background",
--					      si->dpy, cmap);
--  pw->thermo_foreground = get_pixel_resource ("passwd.thermometer.foreground",
-+  si->pw_data->thermo_foreground = get_pixel_resource ("passwd.thermometer.foreground",
- 					      "Dialog.Thermometer.Foreground",
- 					      si->dpy, cmap);
--  pw->thermo_background = get_pixel_resource ("passwd.thermometer.background",
-+  si->pw_data->thermo_background = get_pixel_resource ("passwd.thermometer.background",
- 					      "Dialog.Thermometer.Background",
- 					      si->dpy, cmap);
--  pw->shadow_top = get_pixel_resource ("passwd.topShadowColor",
-+  si->pw_data->shadow_top = get_pixel_resource ("passwd.topShadowColor",
- 				       "Dialog.Foreground",
- 				       si->dpy, cmap);
--  pw->shadow_bottom = get_pixel_resource ("passwd.bottomShadowColor",
-+  si->pw_data->shadow_bottom = get_pixel_resource ("passwd.bottomShadowColor",
- 					  "Dialog.Background",
- 					  si->dpy, cmap);
- 
--  pw->logo_width = get_integer_resource ("passwd.logo.width",
-+  si->pw_data->logo_width = get_integer_resource ("passwd.logo.width",
- 					 "Dialog.Logo.Width");
--  pw->logo_height = get_integer_resource ("passwd.logo.height",
-+  si->pw_data->logo_height = get_integer_resource ("passwd.logo.height",
- 					  "Dialog.Logo.Height");
--  pw->thermo_width = get_integer_resource ("passwd.thermometer.width",
-+  si->pw_data->thermo_width = get_integer_resource ("passwd.thermometer.width",
- 					   "Dialog.Thermometer.Width");
--  pw->internal_border = get_integer_resource ("passwd.internalBorderWidth",
-+  si->pw_data->internal_border = get_integer_resource ("passwd.internalBorderWidth",
- 					      "Dialog.InternalBorderWidth");
--  pw->shadow_width = get_integer_resource ("passwd.shadowThickness",
-+  si->pw_data->shadow_width = get_integer_resource ("passwd.shadowThickness",
- 					   "Dialog.ShadowThickness");
- 
--  if (pw->logo_width == 0)  pw->logo_width = 150;
--  if (pw->logo_height == 0) pw->logo_height = 150;
--  if (pw->internal_border == 0) pw->internal_border = 15;
--  if (pw->shadow_width == 0) pw->shadow_width = 4;
--  if (pw->thermo_width == 0) pw->thermo_width = pw->shadow_width;
-+  if (si->pw_data->logo_width == 0)  si->pw_data->logo_width = 150;
-+  if (si->pw_data->logo_height == 0) si->pw_data->logo_height = 150;
-+  if (si->pw_data->internal_border == 0) si->pw_data->internal_border = 15;
-+  if (si->pw_data->shadow_width == 0) si->pw_data->shadow_width = 4;
-+  if (si->pw_data->thermo_width == 0) si->pw_data->thermo_width = si->pw_data->shadow_width;
- 
-   {
-     int direction, ascent, descent;
-     XCharStruct overall;
- 
--    pw->width = 0;
--    pw->height = 0;
-+    si->pw_data->width = 0;
-+    si->pw_data->height = 0;
- 
-     /* Measure the heading_label. */
--    XTextExtents (pw->heading_font,
--		  pw->heading_label, strlen(pw->heading_label),
-+    XTextExtents (si->pw_data->heading_font,
-+		  si->pw_data->heading_label, strlen(si->pw_data->heading_label),
- 		  &direction, &ascent, &descent, &overall);
--    if (overall.width > pw->width) pw->width = overall.width;
--    pw->height += ascent + descent;
-+    if (overall.width > si->pw_data->width) si->pw_data->width = overall.width;
-+    si->pw_data->height += ascent + descent;
+   f = get_string_resource (si->dpy, "passwd.headingFont", "Dialog.Font");
+   pw->heading_font = XLoadQueryFont (si->dpy, (f ? f : "fixed"));
+   if (!pw->heading_font) pw->heading_font = XLoadQueryFont (si->dpy, "fixed");
+@@ -374,84 +562,6 @@ make_passwd_window (saver_info *si)
+ 	pw->height += ascent + descent;
+       }
  
 -    /* Measure the body_label. */
 -    XTextExtents (pw->body_font,
@@ -853,12 +707,10 @@
 -		  &direction, &ascent, &descent, &overall);
 -    if (overall.width > pw->width) pw->width = overall.width;
 -    pw->height += ascent + descent;
-+    si->pw_data->width  += (si->pw_data->internal_border * 2);
-+    si->pw_data->height += (si->pw_data->internal_border * 4);
- 
+-
 -    {
--      Dimension w2 = 0, w3 = 0;
--      Dimension h2 = 0, h3 = 0;
+-      Dimension w2 = 0, w3 = 0, button_w = 0;
+-      Dimension h2 = 0, h3 = 0, button_h = 0;
 -      const char *passwd_string = "MMMMMMMMMMMM";
 -
 -      /* Measure the user_label. */
@@ -896,155 +748,50 @@
 -      w2 = w2 + w3 + (pw->shadow_width * 2);
 -      h2 = MAX (h2, h3);
 -
+-      pw->login_button_width = 0;
+-      pw->login_button_height = 0;
+-
+-      if (pw->login_button_p)
+-        {
+-          pw->login_button_enabled_p = True;
+-
+-          /* Measure the "New Login" button */
+-          XTextExtents (pw->button_font, pw->login_label,
+-                        strlen (pw->login_label),
+-                        &direction, &ascent, &descent, &overall);
+-          button_w = overall.width;
+-          button_h = ascent + descent;
+-
+-          /* Add some horizontal padding inside the buttons. */
+-          button_w += ascent;
+-
+-          button_w += ((ascent + descent) / 2) + (pw->shadow_width * 2);
+-          button_h += ((ascent + descent) / 2) + (pw->shadow_width * 2);
+-
+-          pw->login_button_width = button_w;
+-          pw->login_button_height = button_h;
+-
+-          w2 = MAX (w2, button_w);
+-          h2 += button_h * 1.5;
+-        }
+-
 -      if (w2 > pw->width)  pw->width  = w2;
 -      pw->height += h2;
 -    }
 -
--    pw->width  += (pw->internal_border * 2);
--    pw->height += (pw->internal_border * 4);
--
--    pw->width += pw->thermo_width + (pw->shadow_width * 3);
--
--    if (pw->logo_height > pw->height)
--      pw->height = pw->logo_height;
--    else if (pw->height > pw->logo_height)
--      pw->logo_height = pw->height;
-+    si->pw_data->width += si->pw_data->thermo_width + (si->pw_data->shadow_width * 3);
-+
-+    if (si->pw_data->logo_height > si->pw_data->height)
-+      si->pw_data->height = si->pw_data->logo_height;
-+    else if (si->pw_data->height > si->pw_data->logo_height)
-+      si->pw_data->logo_height = si->pw_data->height;
- 
--    pw->logo_width = pw->logo_height;
-+    si->pw_data->logo_width = si->pw_data->logo_height;
- 
--    pw->width += pw->logo_width;
-+    si->pw_data->width += si->pw_data->logo_width;
-   }
- 
-   attrmask |= CWOverrideRedirect; attrs.override_redirect = True;
-@@ -356,22 +505,22 @@ make_passwd_window (saver_info *si)
-     Window pointer_root, pointer_child;
-     int root_x, root_y, win_x, win_y;
-     unsigned int mask;
--    pw->previous_mouse_x = 0;
--    pw->previous_mouse_y = 0;
--    if (XQueryPointer (si->dpy, RootWindowOfScreen (pw->prompt_screen->screen),
-+    si->pw_data->previous_mouse_x = 0;
-+    si->pw_data->previous_mouse_y = 0;
-+    if (XQueryPointer (si->dpy, RootWindowOfScreen (si->pw_data->prompt_screen->screen),
-                        &pointer_root, &pointer_child,
-                        &root_x, &root_y, &win_x, &win_y, &mask))
-       {
--        pw->previous_mouse_x = root_x;
--        pw->previous_mouse_y = root_y;
-+        si->pw_data->previous_mouse_x = root_x;
-+        si->pw_data->previous_mouse_y = root_y;
-         if (si->prefs.verbose_p)
-           fprintf (stderr, "%s: %d: mouse is at %d,%d.\n",
--                   blurb(), pw->prompt_screen->number,
--                   pw->previous_mouse_x, pw->previous_mouse_y);
-+                   blurb(), si->pw_data->prompt_screen->number,
-+                   si->pw_data->previous_mouse_x, si->pw_data->previous_mouse_y);
-       }
-     else if (si->prefs.verbose_p)
-       fprintf (stderr, "%s: %d: unable to determine mouse position?\n",
--               blurb(), pw->prompt_screen->number);
-+               blurb(), si->pw_data->prompt_screen->number);
-   }
+     pw->width  += (pw->internal_border * 2);
+     pw->height += (pw->internal_border * 4);
  
-   /* Figure out where on the desktop to place the window so that it will
-@@ -379,31 +528,31 @@ make_passwd_window (saver_info *si)
-      well as Xinerama. */
-   {
-     int x, y, w, h;
--    get_screen_viewport (pw->prompt_screen, &x, &y, &w, &h,
--                         pw->previous_mouse_x, pw->previous_mouse_y,
-+    get_screen_viewport (si->pw_data->prompt_screen, &x, &y, &w, &h,
-+                         si->pw_data->previous_mouse_x, si->pw_data->previous_mouse_y,
-                          si->prefs.verbose_p);
-     if (si->prefs.debug_p) w /= 2;
--    pw->x = x + ((w + pw->width) / 2) - pw->width;
--    pw->y = y + ((h + pw->height) / 2) - pw->height;
--    if (pw->x < x) pw->x = x;
--    if (pw->y < y) pw->y = y;
-+    si->pw_data->x = x + ((w + si->pw_data->width) / 2) - si->pw_data->width;
-+    si->pw_data->y = y + ((h + si->pw_data->height) / 2) - si->pw_data->height;
-+    if (si->pw_data->x < x) si->pw_data->x = x;
-+    if (si->pw_data->y < y) si->pw_data->y = y;
-   }
- 
--  pw->border_width = get_integer_resource ("passwd.borderWidth",
-+  si->pw_data->border_width = get_integer_resource ("passwd.borderWidth",
-                                            "Dialog.BorderWidth");
- 
-   si->passwd_dialog =
-     XCreateWindow (si->dpy,
- 		   RootWindowOfScreen(screen),
--		   pw->x, pw->y, pw->width, pw->height, pw->border_width,
-+		   si->pw_data->x, si->pw_data->y, si->pw_data->width, si->pw_data->height, si->pw_data->border_width,
- 		   DefaultDepthOfScreen (screen), InputOutput,
- 		   DefaultVisualOfScreen(screen),
- 		   attrmask, &attrs);
--  XSetWindowBackground (si->dpy, si->passwd_dialog, pw->background);
-+  XSetWindowBackground (si->dpy, si->passwd_dialog, si->pw_data->background);
- 
--  pw->logo_pixmap = xscreensaver_logo (si->dpy, si->passwd_dialog, cmap,
--                                       pw->background, 
--                                       &pw->logo_pixels, &pw->logo_npixels,
-+  si->pw_data->logo_pixmap = xscreensaver_logo (si->dpy, si->passwd_dialog, cmap,
-+                                       si->pw_data->background, 
-+                                       &si->pw_data->logo_pixels, &si->pw_data->logo_npixels,
-                                        0, True);
- 
-   /* Before mapping the window, save the bits that are underneath the
-@@ -414,18 +563,18 @@ make_passwd_window (saver_info *si)
-   {
-     XGCValues gcv;
-     GC gc;
--    pw->save_under = XCreatePixmap (si->dpy,
--                                    pw->prompt_screen->screensaver_window,
--                                    pw->width + (pw->border_width*2) + 1,
--                                    pw->height + (pw->border_width*2) + 1,
--                                    pw->prompt_screen->current_depth);
-+    si->pw_data->save_under = XCreatePixmap (si->dpy,
-+                                    si->pw_data->prompt_screen->screensaver_window,
-+                                    si->pw_data->width + (si->pw_data->border_width*2) + 1,
-+                                    si->pw_data->height + (si->pw_data->border_width*2) + 1,
-+                                    si->pw_data->prompt_screen->current_depth);
-     gcv.function = GXcopy;
--    gc = XCreateGC (si->dpy, pw->save_under, GCFunction, &gcv);
--    XCopyArea (si->dpy, pw->prompt_screen->screensaver_window,
--               pw->save_under, gc,
--               pw->x - pw->border_width, pw->y - pw->border_width,
--               pw->width + (pw->border_width*2) + 1,
--               pw->height + (pw->border_width*2) + 1,
-+    gc = XCreateGC (si->dpy, si->pw_data->save_under, GCFunction, &gcv);
-+    XCopyArea (si->dpy, si->pw_data->prompt_screen->screensaver_window,
-+               si->pw_data->save_under, gc,
-+               si->pw_data->x - si->pw_data->border_width, si->pw_data->y - si->pw_data->border_width,
-+               si->pw_data->width + (si->pw_data->border_width*2) + 1,
-+               si->pw_data->height + (si->pw_data->border_width*2) + 1,
-                0, 0);
-     XFreeGC (si->dpy, gc);
-   }
-@@ -434,11 +583,11 @@ make_passwd_window (saver_info *si)
-   XSync (si->dpy, False);
- 
-   move_mouse_grab (si, si->passwd_dialog,
--                   pw->prompt_screen->cursor,
--                   pw->prompt_screen->number);
-+                   si->pw_data->prompt_screen->cursor,
-+                   si->pw_data->prompt_screen->number);
+@@ -570,7 +680,7 @@ make_passwd_window (saver_info *si)
+                    pw->prompt_screen->number);
    undo_vp_motion (si);
  
 -  si->pw_data = pw;
-+  /*mali si->pw_data_data = si->pw_data;***/
++  /*mali si->pw_data = pw; */
  
    if (cmap)
      XInstallColormap (si->dpy, cmap);
-@@ -458,6 +607,10 @@ draw_passwd_window (saver_info *si)
+@@ -590,6 +700,10 @@ draw_passwd_window (saver_info *si)
    int sw;
    int tb_height;
  
@@ -1053,9 +800,9 @@
 +    fprintf (stderr, "-->draw_passwd_window() case w_dialog!!\n");
 +
    height = (pw->heading_font->ascent + pw->heading_font->descent +
- 	    pw->body_font->ascent + pw->body_font->descent +
- 	    (2 * MAX ((pw->label_font->ascent + pw->label_font->descent),
-@@ -676,7 +829,7 @@ draw_passwd_window (saver_info *si)
+             pw->body_font->ascent + pw->body_font->descent +
+             (2 * MAX ((pw->label_font->ascent + pw->label_font->descent),
+@@ -865,7 +979,7 @@ draw_passwd_window (saver_info *si)
  }
  
  
@@ -1064,7 +811,7 @@
  update_passwd_window (saver_info *si, const char *printed_passwd, float ratio)
  {
    passwd_dialog_data *pw = si->pw_data;
-@@ -686,8 +839,20 @@ update_passwd_window (saver_info *si, co
+@@ -875,8 +989,20 @@ update_passwd_window (saver_info *si, co
    XRectangle rects[1];
  
    pw->ratio = ratio;
@@ -1086,7 +833,7 @@
    gc1 = XCreateGC (si->dpy, si->passwd_dialog, GCForeground|GCFont, &gcv);
    gcv.foreground = pw->passwd_background;
    gc2 = XCreateGC (si->dpy, si->passwd_dialog, GCForeground, &gcv);
-@@ -760,114 +925,186 @@ update_passwd_window (saver_info *si, co
+@@ -988,23 +1114,77 @@ update_passwd_window (saver_info *si, co
  }
  
  
@@ -1116,31 +863,12 @@
    if (pw->timer)
      XtRemoveTimeOut (pw->timer);
  
--  move_mouse_grab (si, RootWindowOfScreen (ssi->screen),
--                   ssi->cursor, ssi->number);
--
--  if (p->verbose_p)
--    fprintf (stderr, "%s: %d: moving mouse back to %d,%d.\n",
--             blurb(), ssi->number,
--             pw->previous_mouse_x, pw->previous_mouse_y);
--
--  XWarpPointer (si->dpy, None, RootWindowOfScreen (ssi->screen),
--                0, 0, 0, 0,
--                pw->previous_mouse_x, pw->previous_mouse_y);
--
--  XSync (si->dpy, False);
--  while (XCheckMaskEvent (si->dpy, PointerMotionMask, &event))
--    if (p->verbose_p)
--      fprintf (stderr, "%s: discarding MotionNotify event.\n", blurb());
 +  /*reset global flag to indicate passwd dialog is no longer there*/
 +  g_passwd_dialog_created = 0;
- 
--  if (si->passwd_dialog)
++
 +#ifdef HAVE_XSCREENSAVER_LOCK
 +  if (si->external_passwd)
-     {
--      XDestroyWindow (si->dpy, si->passwd_dialog);
--      si->passwd_dialog = 0;
++    {
 +      /* kill the child etc. */
 +      
 +      if (si->passwd_dialog)
@@ -1166,227 +894,46 @@
 +      else if (pw->stdout_fd != -1)
 +	close_and_invalidate (&pw->stdout_fd);
 +      
-+      block_sigchld ();
-+      
 +      if (si->passwd_pid)
 +	{
-+	  int status = -1;
-+	  
-+	  status = kill (si->passwd_pid, SIGTERM);
-+	  
-+	  await_dying_children (si);  
-+	  
++	  kill_job (si, si->passwd_pid, SIGTERM);
 +	  si->passwd_pid = 0;
 +	}
 +      
-+      unblock_sigchld ();
-+      
 +      si->external_passwd = False;
-     }
--  
--  if (pw->save_under)
++     }     
 +  else
 +#endif /* HAVE_XSCREENSAVER_LOCK */
-     {
--      XGCValues gcv;
--      GC gc;
--      gcv.function = GXcopy;
--      gc = XCreateGC (si->dpy, ssi->screensaver_window, GCFunction, &gcv);
--      XCopyArea (si->dpy, pw->save_under,
--                 ssi->screensaver_window, gc,
--                 0, 0,
--                 pw->width + (pw->border_width*2) + 1,
--                 pw->height + (pw->border_width*2) + 1,
--                 pw->x - pw->border_width, pw->y - pw->border_width);
--      XFreePixmap (si->dpy, pw->save_under);
--      pw->save_under = 0;
--      XFreeGC (si->dpy, gc);
--    }
--
--  if (pw->heading_label) free (pw->heading_label);
--  if (pw->body_label)    free (pw->body_label);
--  if (pw->user_label)    free (pw->user_label);
--  if (pw->passwd_label)  free (pw->passwd_label);
--  if (pw->date_label)    free (pw->date_label);
--  if (pw->user_string)   free (pw->user_string);
--  if (pw->passwd_string) free (pw->passwd_string);
--
--  if (pw->heading_font) XFreeFont (si->dpy, pw->heading_font);
--  if (pw->body_font)    XFreeFont (si->dpy, pw->body_font);
--  if (pw->label_font)   XFreeFont (si->dpy, pw->label_font);
--  if (pw->passwd_font)  XFreeFont (si->dpy, pw->passwd_font);
--  if (pw->date_font)    XFreeFont (si->dpy, pw->date_font);
--
--  if (pw->foreground != black && pw->foreground != white)
--    XFreeColors (si->dpy, cmap, &pw->foreground, 1, 0L);
--  if (pw->background != black && pw->background != white)
--    XFreeColors (si->dpy, cmap, &pw->background, 1, 0L);
--  if (pw->passwd_foreground != black && pw->passwd_foreground != white)
--    XFreeColors (si->dpy, cmap, &pw->passwd_foreground, 1, 0L);
--  if (pw->passwd_background != black && pw->passwd_background != white)
--    XFreeColors (si->dpy, cmap, &pw->passwd_background, 1, 0L);
--  if (pw->thermo_foreground != black && pw->thermo_foreground != white)
--    XFreeColors (si->dpy, cmap, &pw->thermo_foreground, 1, 0L);
--  if (pw->thermo_background != black && pw->thermo_background != white)
--    XFreeColors (si->dpy, cmap, &pw->thermo_background, 1, 0L);
--  if (pw->shadow_top != black && pw->shadow_top != white)
--    XFreeColors (si->dpy, cmap, &pw->shadow_top, 1, 0L);
--  if (pw->shadow_bottom != black && pw->shadow_bottom != white)
--    XFreeColors (si->dpy, cmap, &pw->shadow_bottom, 1, 0L);
-+      if (p->verbose_p)
-+	fprintf (stderr, "In destroy_passwd else case..i.e. si->external-passwd is False already\n");
- 
--  if (pw->logo_pixmap)
--    XFreePixmap (si->dpy, pw->logo_pixmap);
--  if (pw->logo_pixels)
--    {
--      if (pw->logo_npixels)
--        XFreeColors (si->dpy, cmap, pw->logo_pixels, pw->logo_npixels, 0L);
--      free (pw->logo_pixels);
--      pw->logo_pixels = 0;
--      pw->logo_npixels = 0;
--    }
-+      if (pw->passwd_string == NULL)
-+	pw->passwd_string = 0;
- 
--  if (pw->save_under)
--    XFreePixmap (si->dpy, pw->save_under);
-+      memset (pw->typed_passwd, 0, sizeof(pw->typed_passwd));
-+      memset (pw->passwd_string, 0, strlen(pw->passwd_string));
- 
--  if (cmap)
--    XInstallColormap (si->dpy, cmap);
-+      ssi = pw->prompt_screen;
-+      cmap = DefaultColormapOfScreen (ssi->screen);
-+      black = BlackPixelOfScreen (ssi->screen);
-+      white = WhitePixelOfScreen (ssi->screen);
++{
++  if (p->verbose_p)
++    fprintf (stderr, "In destroy_passwd else case..i.e. si->external-passwd is False already\n");
++
++  memset (pw->typed_passwd, 0, sizeof(pw->typed_passwd));
++  memset (pw->passwd_string, 0, strlen(pw->passwd_string));
 +
-+      move_mouse_grab (si, RootWindowOfScreen (ssi->screen),
-+		       ssi->cursor, ssi->number);
-+      
-+      if (p->verbose_p)
-+	fprintf (stderr, "%s: %d: moving mouse back to %d,%d.\n",
-+		 blurb(), ssi->number,
-+		 pw->previous_mouse_x, pw->previous_mouse_y);
-+      
-+      XWarpPointer (si->dpy, None, RootWindowOfScreen (ssi->screen),
-+		    0, 0, 0, 0,
-+		    pw->previous_mouse_x, pw->previous_mouse_y);
-+      
-+      XSync (si->dpy, False);
-+      while (XCheckMaskEvent (si->dpy, PointerMotionMask, &event))
-+	if (p->verbose_p)
-+	  fprintf (stderr, "%s: discarding MotionNotify event.\n", blurb());
-+      
-+      if (si->passwd_dialog)
-+	{
-+	  XDestroyWindow (si->dpy, si->passwd_dialog);
-+	  si->passwd_dialog = 0;
-+	}
-+      
-+      if (pw->save_under)
-+	{
-+	  XGCValues gcv;
-+	  GC gc;
-+	  gcv.function = GXcopy;
-+	  gc = XCreateGC (si->dpy, ssi->screensaver_window, GCFunction, &gcv);
-+	  XCopyArea (si->dpy, pw->save_under,
-+		     ssi->screensaver_window, gc,
-+		     0, 0,
-+		     pw->width + (pw->border_width*2) + 1,
-+		     pw->height + (pw->border_width*2) + 1,
-+		     pw->x - pw->border_width, pw->y - pw->border_width);
-+	  XFreePixmap (si->dpy, pw->save_under);
-+	  pw->save_under = 0;
-+	  XFreeGC (si->dpy, gc);
-+	}
-+      
-+      if (pw->heading_label) free (pw->heading_label);
-+      if (pw->body_label)    free (pw->body_label);
-+      if (pw->user_label)    free (pw->user_label);
-+      if (pw->passwd_label)  free (pw->passwd_label);
-+      if (pw->date_label)    free (pw->date_label);
-+      if (pw->user_string)   free (pw->user_string);
-+      if (pw->passwd_string) free (pw->passwd_string);
-+      
-+      if (pw->heading_font) XFreeFont (si->dpy, pw->heading_font);
-+      if (pw->body_font)    XFreeFont (si->dpy, pw->body_font);
-+      if (pw->label_font)   XFreeFont (si->dpy, pw->label_font);
-+      if (pw->passwd_font)  XFreeFont (si->dpy, pw->passwd_font);
-+      if (pw->date_font)    XFreeFont (si->dpy, pw->date_font);
-+      
-+      if (pw->foreground != black && pw->foreground != white)
-+	XFreeColors (si->dpy, cmap, &pw->foreground, 1, 0L);
-+      if (pw->background != black && pw->background != white)
-+	XFreeColors (si->dpy, cmap, &pw->background, 1, 0L);
-+
-+      if (pw->passwd_foreground != black && pw->passwd_foreground != white)
-+	XFreeColors (si->dpy, cmap, &pw->passwd_foreground, 1, 0L);
-+      if (pw->passwd_background != black && pw->passwd_background != white)
-+	XFreeColors (si->dpy, cmap, &pw->passwd_background, 1, 0L);
-+      if (pw->thermo_foreground != black && pw->thermo_foreground != white)
-+	XFreeColors (si->dpy, cmap, &pw->thermo_foreground, 1, 0L);
-+      if (pw->thermo_background != black && pw->thermo_background != white)
-+	XFreeColors (si->dpy, cmap, &pw->thermo_background, 1, 0L);
-+      if (pw->shadow_top != black && pw->shadow_top != white)
-+	XFreeColors (si->dpy, cmap, &pw->shadow_top, 1, 0L);
-+      if (pw->shadow_bottom != black && pw->shadow_bottom != white)
-+	XFreeColors (si->dpy, cmap, &pw->shadow_bottom, 1, 0L);
-+      
-+      if (pw->logo_pixmap)
-+	XFreePixmap (si->dpy, pw->logo_pixmap);
-+      if (pw->logo_pixels)
-+	{
-+	  if (pw->logo_npixels)
-+	    XFreeColors (si->dpy, cmap, pw->logo_pixels, pw->logo_npixels, 0L);
-+	  free (pw->logo_pixels);
-+	  pw->logo_pixels = 0;
-+	  pw->logo_npixels = 0;
-+	}
-+  
-+      if (pw->save_under)
-+	XFreePixmap (si->dpy, pw->save_under);
-+  
-+      if (cmap)
-+	XInstallColormap (si->dpy, cmap);
-+    }
++  ssi = pw->prompt_screen;
++  cmap = DefaultColormapOfScreen (ssi->screen);
++  black = BlackPixelOfScreen (ssi->screen);
++  white = WhitePixelOfScreen (ssi->screen);
+   move_mouse_grab (si, RootWindowOfScreen (ssi->screen),
+                    ssi->cursor, ssi->number);
+ 
+@@ -1105,10 +1285,13 @@ destroy_passwd_window (saver_info *si)
  
+   if (cmap)
+     XInstallColormap (si->dpy, cmap);
+-
++}
    memset (pw, 0, sizeof(*pw));
--  free (pw);
--  si->pw_data = 0;
-+  /*** NO mali99 we only create a copy of pw in main and keep it
++/*** NO mali99 we only create a copy of pw in main and keep it
 +     so dont free it.
-+     free (pw);
-+     si->pw_data = 0;
-+   ************/
+   free (pw);
+   si->pw_data = 0;
++  ************/
  }
  
  
-@@ -968,9 +1205,6 @@ linux_lock_vt_switch (saver_info *si, Bo
-  */
- #ifdef HAVE_XF86VMODE
- 
--static int ignore_all_errors_ehandler (Display *dpy, XErrorEvent *error);
--static Bool vp_got_error = False;
--
- static void
- xfree_lock_mode_switch (saver_info *si, Bool lock_p)
- {
-@@ -1010,13 +1244,6 @@ xfree_lock_mode_switch (saver_info *si, 
-     }
- }
- 
--static int
--ignore_all_errors_ehandler (Display *dpy, XErrorEvent *error)
--{
--  vp_got_error = True;
--  return 0;
--}
--
- #endif /* HAVE_XF86VMODE */
- 
- 
-@@ -1085,17 +1312,64 @@ passwd_animate_timer (XtPointer closure,
+@@ -1314,17 +1497,64 @@ passwd_animate_timer (XtPointer closure,
    int tick = 166;
    passwd_dialog_data *pw = si->pw_data;
  
@@ -1453,7 +1000,7 @@
  
    if (pw->state == pw_read)
      pw->timer = XtAppAddTimeOut (si->app, tick, passwd_animate_timer,
-@@ -1147,11 +1421,15 @@ handle_passwd_key (saver_info *si, XKeyE
+@@ -1420,11 +1650,15 @@ handle_passwd_key (saver_info *si, XKeyE
          {
            update_passwd_window (si, "Checking...", pw->ratio);
            XSync (si->dpy, False);
@@ -1470,7 +1017,7 @@
          }
        break;
  
-@@ -1176,7 +1454,7 @@ handle_passwd_key (saver_info *si, XKeyE
+@@ -1467,7 +1701,7 @@ handle_passwd_key (saver_info *si, XKeyE
  }
  
  
@@ -1479,7 +1026,7 @@
  passwd_event_loop (saver_info *si)
  {
    saver_preferences *p = &si->prefs;
-@@ -1187,20 +1465,75 @@ passwd_event_loop (saver_info *si)
+@@ -1480,6 +1714,43 @@ passwd_event_loop (saver_info *si)
    while (si->pw_data && si->pw_data->state == pw_read)
      {
        XtAppNextEvent (si->app, &event);
@@ -1523,7 +1070,10 @@
        if (event.xany.window == si->passwd_dialog && event.xany.type == Expose)
  	draw_passwd_window (si);
        else if (event.xany.type == KeyPress)
- 	handle_passwd_key (si, &event.xkey);
+@@ -1491,16 +1762,34 @@ passwd_event_loop (saver_info *si)
+                 event.xany.type == ButtonRelease) && 
+                si->pw_data->login_button_p)
+ 	handle_passwd_button (si, &event);
 +#endif /* !HAVE_XSCREENSAVER_LOCK */
 +      else if (event.xany.window == si->passwd_dialog && event.xany.type == Expose &&
 +               si->pw_data->passwd_label != NULL)
@@ -1546,7 +1096,7 @@
 -    case pw_ok:   msg = 0; break;
 -    case pw_null: msg = ""; break;
 -    case pw_time: msg = "Timed out!"; break;
--    default:      msg = "Sorry!"; break;
+-    default:      msg = (caps_p ? "CapsLock?" : "Sorry!"); break;
 +    case pw_ok:   msg = strdup("pw_ok"); break;
 +    case pw_null: msg = strdup("pw_null"); break;
 +    case pw_time: msg = strdup("pw_time"); break;
@@ -1559,7 +1109,7 @@
      }
  
    if (si->pw_data->state == pw_fail)
-@@ -1210,7 +1543,12 @@ passwd_event_loop (saver_info *si)
+@@ -1510,7 +1799,12 @@ passwd_event_loop (saver_info *si)
      switch (si->pw_data->state)
        {
        case pw_ok:
@@ -1571,9 +1121,9 @@
 +        break;
 +       }
        case pw_fail:
- 	fprintf (stderr, "%s: password incorrect!\n", blurb()); break;
-       case pw_null:
-@@ -1218,7 +1556,8 @@ passwd_event_loop (saver_info *si)
+ 	fprintf (stderr, "%s: password incorrect!%s\n", blurb(),
+                  (caps_p ? "  (CapsLock)" : ""));
+@@ -1520,7 +1814,8 @@ passwd_event_loop (saver_info *si)
  	fprintf (stderr, "%s: password entry cancelled.\n", blurb()); break;
        case pw_time:
  	fprintf (stderr, "%s: password entry timed out.\n", blurb()); break;
@@ -1583,7 +1133,7 @@
        }
  
  #ifdef HAVE_SYSLOG
-@@ -1266,17 +1605,57 @@ passwd_event_loop (saver_info *si)
+@@ -1568,17 +1863,57 @@ passwd_event_loop (saver_info *si)
  	fprintf (real_stderr,
  		 "%s: WARNING: %d failed attempts to unlock the screen.\n",
  		 blurb(), si->unlock_failures);
@@ -1643,7 +1193,7 @@
  
        /* Swallow all pending KeyPress/KeyRelease events. */
        {
-@@ -1288,7 +1667,7 @@ passwd_event_loop (saver_info *si)
+@@ -1590,7 +1925,7 @@ passwd_event_loop (saver_info *si)
  }
  
  
@@ -1652,7 +1202,7 @@
  handle_typeahead (saver_info *si)
  {
    passwd_dialog_data *pw = si->pw_data;
-@@ -1305,7 +1684,13 @@ handle_typeahead (saver_info *si)
+@@ -1607,7 +1942,13 @@ handle_typeahead (saver_info *si)
  
    memset (si->unlock_typeahead, '*', strlen(si->unlock_typeahead));
    si->unlock_typeahead[i] = 0;
@@ -1666,7 +1216,7 @@
  
    free (si->unlock_typeahead);
    si->unlock_typeahead = 0;
-@@ -1321,12 +1706,14 @@ unlock_p (saver_info *si)
+@@ -1623,12 +1964,14 @@ unlock_p (saver_info *si)
    raise_window (si, True, True, True);
  
    if (p->verbose_p)
@@ -1682,7 +1232,7 @@
  
    compose_status = calloc (1, sizeof (*compose_status));
  
-@@ -1334,7 +1721,8 @@ unlock_p (saver_info *si)
+@@ -1636,6 +1979,7 @@ unlock_p (saver_info *si)
    passwd_event_loop (si);
  
    status = (si->pw_data->state == pw_ok);
@@ -1690,22 +1240,21 @@
    destroy_passwd_window (si);
  
    free (compose_status);
-
---- driver/passwd-kerberos.c	2000-02-27 14:21:41.000000000 -0800
-+++ driver/passwd-kerberos.c	2006-04-10 13:48:06.182897000 -0700
-@@ -143,7 +143,7 @@ key_to_key(char *user, char *instance, c
+diff -urp -x '*~' driver/passwd-kerberos.c driver/passwd-kerberos.c
+--- driver/passwd-kerberos.c	2005-06-21 20:20:11.000000000 -0700
++++ driver/passwd-kerberos.c	2006-08-09 14:26:28.016423000 -0700
+@@ -178,7 +178,7 @@ key_to_key(char *user, char *instance, c
     some sites. So, we do a quick, painful hack with a tmpfile.
   */
  Bool
 -kerberos_passwd_valid_p (const char *typed_passwd, Bool verbose_p)
 +kerberos_passwd_valid_p (const char *typed_passwd, Bool verbose_p, int whichService)
  {
-     C_Block mitkey;
-     Bool success;
-
+ # ifdef HAVE_DARWIN
+     return (klNoErr ==
 diff -urp -x '*~' driver/passwd-pam.c driver/passwd-pam.c
---- driver/passwd-pam.c	2006-05-10 08:48:24.113115000 -0700
-+++ driver/passwd-pam.c	2006-05-10 08:48:29.973056000 -0700
+--- driver/passwd-pam.c	2006-05-16 19:14:58.000000000 -0700
++++ driver/passwd-pam.c	2006-08-09 14:26:28.017901000 -0700
 @@ -39,11 +39,18 @@
  #ifndef NO_LOCKING  /* whole file */
  
@@ -1726,7 +1275,7 @@
  
  
  #include <stdio.h>
-@@ -55,8 +62,26 @@ extern char *blurb(void);
+@@ -57,6 +64,25 @@ extern char *blurb(void);
  
  #include <sys/stat.h>
  
@@ -1743,17 +1292,16 @@
 +extern void destroy_passwd_window (saver_info* si);
 +extern void handle_typeahead (saver_info* si);
 +extern void update_passwd_window (saver_info *si, const char *printed_passwd, float ratio);
- extern void block_sigchld (void);
- extern void unblock_sigchld (void);
 +extern void passwd_event_loop(saver_info* si);
 +extern passwd_dialog_data* ptr_mygtkpwd;
 +
 +extern saver_info *global_si_kludge;
 +extern Bool g_passwd_dialog_created;
++
+ extern sigset_t block_sigchld (void);
+ extern void unblock_sigchld (void);
  
- /* blargh */
- #undef  Bool
-@@ -66,6 +91,9 @@ extern void unblock_sigchld (void);
+@@ -68,6 +94,9 @@ extern void unblock_sigchld (void);
  #define True  1
  #define False 0
  
@@ -1763,7 +1311,7 @@
  #undef countof
  #define countof(x) (sizeof((x))/sizeof(*(x)))
  
-@@ -76,14 +104,14 @@ extern void unblock_sigchld (void);
+@@ -78,18 +107,18 @@ extern void unblock_sigchld (void);
  # define PAM_REFRESH_CRED PAM_CRED_REFRESH
  #endif
  
@@ -1781,22 +1329,29 @@
    Bool verbose_p;
  };
  
-@@ -171,22 +199,34 @@ static void *suns_pam_implementation_blo
+-Bool pam_passwd_valid_p (const char *typed_passwd, Bool verbose_p);
++Bool pam_passwd_valid_p (void);
+ Bool pam_priv_init (int argc, char **argv, Bool verbose_p);
+ 
+ #ifdef HAVE_PAM_FAIL_DELAY
+@@ -175,24 +204,37 @@ static void *suns_pam_implementation_blo
     to root.
   */
  Bool
 -pam_passwd_valid_p (const char *typed_passwd, Bool verbose_p)
-+pam_passwd_valid_p ()
++pam_passwd_valid_p (void)
  {
    const char *service = PAM_SERVICE_NAME;
 +  uid_t euid;
    pam_handle_t *pamh = 0;
--  int status = -1;
+   int status = -1;
 +  int pam_auth_status = 0;  /* Specific for pam_authenticate() status*/
-+  int status,acct_rc,setcred_rc,chauth_rc;
++  int acct_rc,setcred_rc,chauth_rc;
    struct pam_conv pc;
    struct pam_closure c;
    char *user = 0;
+   sigset_t set;
+   struct timespec timeout;
 +  char* tmp_buf;
 +  int  pam_flags = 0;
 +  saver_info *si = global_si_kludge;
@@ -1815,11 +1370,11 @@
  
    c.user = user;
 -  c.typed_passwd = typed_passwd;
-+/**  c.typed_passwd = NULL; **/
++/**  c.typed_passwd = typed_passwd; **/
    c.verbose_p = verbose_p;
  
    pc.conv = &pam_conversation;
-@@ -196,6 +236,20 @@ pam_passwd_valid_p (const char *typed_pa
+@@ -202,6 +244,20 @@ pam_passwd_valid_p (const char *typed_pa
       `closure' argument to pc.conv always comes in as random garbage. */
    suns_pam_implementation_blows = (void *) &c;
  
@@ -1840,7 +1395,7 @@
  
    /* Initialize PAM.
     */
-@@ -204,21 +258,61 @@ pam_passwd_valid_p (const char *typed_pa
+@@ -210,21 +266,61 @@ pam_passwd_valid_p (const char *typed_pa
      fprintf (stderr, "%s: pam_start (\"%s\", \"%s\", ...) ==> %d (%s)\n",
               blurb(), service, c.user,
               status, PAM_STRERROR (pamh, status));
@@ -1904,7 +1459,7 @@
  
    /* Try to authenticate as the current user.
       We must turn off our SIGCHLD handler for the duration of the call to
-@@ -242,31 +336,132 @@ pam_passwd_valid_p (const char *typed_pa
+@@ -248,29 +344,104 @@ pam_passwd_valid_p (const char *typed_pa
  
    PAM_NO_DELAY(pamh);
  
@@ -1914,10 +1469,15 @@
 +****************************/
 +   {
 +
-   block_sigchld();
++  
+   timeout.tv_sec = 0;
+   timeout.tv_nsec = 1;
+   set = block_sigchld();
 -  status = pam_authenticate (pamh, 0);
-+     pam_auth_status = pam_authenticate (pamh, pam_flags);
++  pam_auth_status = pam_authenticate (pamh, 0);
+   sigtimedwait (&set, NULL, &timeout);
    unblock_sigchld();
+ 
 +     /* Send status message to unlock dialog ***/
 +     if (pam_auth_status == PAM_SUCCESS)
 +      {
@@ -1946,66 +1506,84 @@
 +
 +     /* We get here implies regardless of success/failure nuke lock dialog */
 +     /* no..wait till pam_end..to display error msgs...destroy_passwd_window (si);**/
-+   }
- 
++   }  
++
    if (verbose_p)
      fprintf (stderr, "%s:   pam_authenticate (...) ==> %d (%s)\n",
--             blurb(), status, PAM_STRERROR(pamh, status));
+              blurb(), status, PAM_STRERROR(pamh, status));
 -  if (status == PAM_SUCCESS)  /* Win! */
-+             blurb(), pam_auth_status, PAM_STRERROR(pamh, pam_auth_status));
 +  if (pam_auth_status == PAM_SUCCESS)  /* Win! */
      {
-+        /* perform PAM account validation procedures for login user only */
-+	acct_rc   = pam_acct_mgmt(pamh, pam_flags);
+-      int status2;
+-
+-      /* We don't actually care if the account modules fail or succeed,
+-       * but we need to run them anyway because certain pam modules
+-       * depend on side effects of the account modules getting run.
+-       */
+-      status2 = pam_acct_mgmt (pamh, 0);
++      /* perform PAM account validation procedures for login user only */
++      acct_rc   = pam_acct_mgmt(pamh, pam_flags);
++      
++      /******************************************************************
++           ignore other cases for the time being 
++           PAM_USER_UNKNOWN, PAM_AUTH_ERR, PAM_ACCT_EXPIRED
++           (password mgn service module)
++           same as pam_setcred(), focus on auth. service module only
++       *****************************************************************/
+ 
+       if (verbose_p)
+         fprintf (stderr, "%s:   pam_acct_mgmt (...) ==> %d (%s)\n",
+-                 blurb(), status2, PAM_STRERROR(pamh, status2));
++                 blurb(), acct_rc, PAM_STRERROR(pamh, acct_rc));
 +
-+        /******************************************************************
++      /******************************************************************
 +           ignore other cases for the time being 
 +           PAM_USER_UNKNOWN, PAM_AUTH_ERR, PAM_ACCT_EXPIRED
 +           (password mgn service module)
 +           same as pam_setcred(), focus on auth. service module only
-+         *****************************************************************/
-+
-+	if (acct_rc   == PAM_NEW_AUTHTOK_REQD) {
-+		do {
-+			chauth_rc  = pam_chauthtok(pamh, 0);
-+                    } while (chauth_rc == PAM_AUTHTOK_ERR ||
-+                      chauth_rc  == PAM_TRY_AGAIN);
-+      		if (verbose_p)
-+        	  fprintf (stderr, "%s:   pam_chauthtok (...) ==> %d (%s)\n",
-+                 blurb(), chauth_rc, PAM_STRERROR(pamh, chauth_rc));
-+	}
-+        if (verbose_p)
-+        fprintf (stderr, "%s:   pam_acct_mgmt (...) ==> %d (%s)\n",
-+                 blurb(), acct_rc, PAM_STRERROR(pamh, acct_rc));
++       *****************************************************************/
 +
-+     /* Send status message to unlock dialog ***/
-+     if (acct_rc == PAM_SUCCESS)
-+      {
-+        write_to_child (si, "pw_acct_ok");
-+        tmp_buf = (char*)PAM_STRERROR(pamh, acct_rc);
-+        write_to_child (si, tmp_buf);
-+        if (verbose_p)
-+          sleep (1);
-+      }
-+     else
-+      {
-+        write_to_child (si, "pw_acct_fail");
-+        tmp_buf = (char*)PAM_STRERROR(pamh, acct_rc);
-+        write_to_child (si, tmp_buf);
-+        if (verbose_p)
-+          sleep (1);
++      if (acct_rc   == PAM_NEW_AUTHTOK_REQD) {
++	do {
++	  chauth_rc  = pam_chauthtok(pamh, 0);
++	} while (chauth_rc == PAM_AUTHTOK_ERR ||
++		 chauth_rc  == PAM_TRY_AGAIN);
++	if (verbose_p)
++	  fprintf (stderr, "%s:   pam_chauthtok (...) ==> %d (%s)\n",
++		   blurb(), chauth_rc, PAM_STRERROR(pamh, chauth_rc));
 +      }
 +
++      /* Send status message to unlock dialog ***/
++      if (acct_rc == PAM_SUCCESS)
++	{
++	  write_to_child (si, "pw_acct_ok");
++	  tmp_buf = (char*)PAM_STRERROR(pamh, acct_rc);
++	  write_to_child (si, tmp_buf);
++	  if (verbose_p)
++	    sleep (1);
++	}
++      else
++	{
++	  write_to_child (si, "pw_acct_fail");
++	  tmp_buf = (char*)PAM_STRERROR(pamh, acct_rc);
++	  write_to_child (si, tmp_buf);
++	  if (verbose_p)
++	    sleep (1);
++	}
++
+ 
        /* Each time we successfully authenticate, refresh credentials,
           for Kerberos/AFS/DCE/etc.  If this fails, just ignore that
-          failure and blunder along; it shouldn't matter.
+@@ -281,13 +452,36 @@ pam_passwd_valid_p (const char *typed_pa
+          says that the Linux PAM library ignores that one, and only refreshes
+          credentials when using PAM_REINITIALIZE_CRED.
         */
--      int status2 = pam_setcred (pamh, PAM_REFRESH_CRED);
+-      status2 = pam_setcred (pamh, PAM_REINITIALIZE_CRED);
 +      setcred_rc = pam_setcred (pamh, PAM_REFRESH_CRED);
        if (verbose_p)
          fprintf (stderr, "%s:   pam_setcred (...) ==> %d (%s)\n",
 -                 blurb(), status2, PAM_STRERROR(pamh, status2));
-+                 blurb(), setcred_rc , PAM_STRERROR(pamh, setcred_rc));
++                 blurb(), setcred_rc, PAM_STRERROR(pamh, setcred_rc));
 +
 +     /* Send status message to unlock dialog ***/
 +     if (setcred_rc == PAM_SUCCESS)
@@ -2035,45 +1613,35 @@
    /* If that didn't work, set the user to root, and try to authenticate again.
     */
    if (user) free (user);
-   user = strdup ("root");
-   c.user = user;
-+
-+  status = -1;  	/* Reset status */
-   status = pam_set_item (pamh, PAM_USER, c.user);
-   if (verbose_p)
-     fprintf (stderr, "%s:   pam_set_item(p, PAM_USER, \"%s\") ==> %d (%s)\n",
-@@ -274,23 +469,72 @@ pam_passwd_valid_p (const char *typed_pa
-   if (status != PAM_SUCCESS) goto DONE;
+@@ -302,26 +496,72 @@ pam_passwd_valid_p (const char *typed_pa
+   PAM_NO_DELAY(pamh);
  
-   PAM_NO_DELAY(pamh);
+   set = block_sigchld();
 -  status = pam_authenticate (pamh, 0);
-+  pam_auth_status = -1;  	/* Reset status */
-+
-+  block_sigchld();
 +  pam_auth_status = pam_authenticate (pamh, 0);
-+  unblock_sigchld();
+   sigtimedwait(&set, NULL, &timeout);
+   unblock_sigchld();
+ 
++  /* Send status message to unlock dialog ***/
++  if (pam_auth_status == PAM_SUCCESS)
++    {
++      write_to_child (si, "pw_ok");
++      tmp_buf = strdup (_("Letting you in as ROOT!!"));
++      write_to_child (si, tmp_buf);
++      free (tmp_buf);
 +
-+/* Send status message to unlock dialog ***/
-+     if (pam_auth_status == PAM_SUCCESS)
-+      {
-+        write_to_child (si, "pw_ok");
-+        tmp_buf = strdup (_("Letting you in as ROOT!!"));
-+        write_to_child (si, tmp_buf);
-+        free (tmp_buf);
++      if (verbose_p)
++	sleep (1);
++    }
++
++  /* PAM_SUCCESS defined to be 0 in /usr/include/security/pam_appl.h */
++  si->pw_data->state = (pam_auth_status == PAM_SUCCESS ? pw_ok : pw_fail);
++  
    if (verbose_p)
 -    fprintf (stderr, "%s:   pam_authenticate (...) ==> %d (%s)\n",
 -             blurb(), status, PAM_STRERROR(pamh, status));
-+         sleep (1);
-+      }
-+
-+  /* PAM_SUCCESS defined to be 0 in /usr/include/security/pam_appl.h */
-+  si->pw_data->state = (pam_auth_status == PAM_SUCCESS ? pw_ok : pw_fail);
-+
-+  if (verbose_p)
 +    fprintf (stderr, "%s:   pam_authenticate as root user (...) ==> %d (%s)\n",
 +             blurb(), pam_auth_status, PAM_STRERROR(pamh, pam_auth_status));
-+
-+
  
   DONE:
    if (user) free (user);
@@ -2088,43 +1656,43 @@
                   (status2 == PAM_SUCCESS ? "Success" : "Failure"));
      }
 -  return (status == PAM_SUCCESS ? True : False);
-+ 
++  
++
 +  if (seteuid (euid) != 0)
-+   {
-+    if (verbose_p)
-+      perror("Error pam could not revert euid to user running as euid root, locking may not work now\n");
-+}
-+
++    {
++      if (verbose_p)
++	perror("Error pam could not revert euid to user running as euid root, locking may not work now\n");
++    }
++  
 +  if (verbose_p)
 +     fprintf (stderr, "<--end of pam_authenticate() returning ok_to_unblank = %d\n",
-+                            (int) ((pam_auth_status == PAM_SUCCESS) ? True:False));
++	      (int) ((pam_auth_status == PAM_SUCCESS) ? True:False));
 +
 +  /* Now destroy unlock dialog window created in pam_conv func ***/
 +
 +  destroy_passwd_window (si);
-+  usleep (250000); /* if repeatedly tried to unlock dialog with bad passwd, old dialog
-+                    * doesnt get completely unmapped before new one posts, this should
-+                    * help the unmapping to go through before new one is posted */
++  usleep (250000); /* if repeatedly tried to unlock dialog with bad passwd,
++		    * old dialog doesnt get completely unmapped before new
++		    * one posts, this should help the unmapping to go through
++		    * before new one is posted
++		    */
 +  XSync (si->dpy, False);
 +
 +  if (si->pw_data->passwd_string)
-+   {
-+    free (si->pw_data->passwd_string); 
-+    si->pw_data->passwd_string = 0;
-+   }
++    {
++      free (si->pw_data->passwd_string); 
++      si->pw_data->passwd_string = 0;
++    }
 +
-+  if(pam_auth_status == PAM_SUCCESS) 
-+     return (True);
++  if (pam_auth_status == PAM_SUCCESS) 
++    return (True);
 +  else 
-+     return (False);
++    return (False);
  }
  
  
-@@ -308,8 +552,14 @@ pam_priv_init (int argc, char **argv, Bo
-   const char   dir[] = "/etc/pam.d";
-   const char  file[] = "/etc/pam.d/" PAM_SERVICE_NAME;
+@@ -341,6 +581,11 @@ pam_priv_init (int argc, char **argv, Bo
    const char file2[] = "/etc/pam.conf";
-+
    struct stat st;
  
 +  if (! verbose_p)	/* SUN addition: only print warnings in verbose mode */
@@ -2132,10 +1700,10 @@
 +      return True;	/* cause confusion when users see them.		     */
 +    }
 +
- #ifndef S_ISDIR
- # define S_ISDIR(mode)   (((mode) & S_IFMT) == S_IFDIR)
- #endif
-@@ -336,6 +586,9 @@ pam_priv_init (int argc, char **argv, Bo
+ # ifndef S_ISDIR
+ #  define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
+ # endif
+@@ -367,6 +612,9 @@ pam_priv_init (int argc, char **argv, Bo
                  break;
                }
            fclose (f);
@@ -2145,7 +1713,7 @@
            if (!ok)
              {
                fprintf (stderr,
-@@ -343,9 +596,12 @@ pam_priv_init (int argc, char **argv, Bo
+@@ -374,9 +622,12 @@ pam_priv_init (int argc, char **argv, Bo
                    "%s: password authentication via PAM is unlikely to work.\n",
                         blurb(), file2, PAM_SERVICE_NAME, blurb());
              }
@@ -2158,7 +1726,7 @@
    else
      {
        fprintf (stderr,
-@@ -353,6 +609,7 @@ pam_priv_init (int argc, char **argv, Bo
+@@ -384,6 +635,7 @@ pam_priv_init (int argc, char **argv, Bo
                 "%s: password authentication via PAM is unlikely to work.\n",
                 blurb(), file2, file, blurb());
      }
@@ -2166,7 +1734,7 @@
  
    /* Return true anyway, just in case. */
    return True;
-@@ -373,67 +630,144 @@ pam_priv_init (int argc, char **argv, Bo
+@@ -404,67 +656,144 @@ pam_priv_init (int argc, char **argv, Bo
     would never see this string, and the prompted-for password would be
     ignored.
   */
@@ -2339,9 +1907,9 @@
    return PAM_SUCCESS;
  }
 diff -urp -x '*~' driver/passwd.c driver/passwd.c
---- driver/passwd.c	2002-03-05 18:15:47.000000000 -0800
-+++ driver/passwd.c	2006-05-10 08:48:29.955519000 -0700
-@@ -49,15 +49,15 @@ struct auth_methods {
+--- driver/passwd.c	2006-05-16 19:14:58.000000000 -0700
++++ driver/passwd.c	2006-08-09 14:26:28.056099000 -0700
+@@ -49,11 +49,11 @@ struct auth_methods {
  
  #ifdef HAVE_KERBEROS
  extern Bool kerberos_lock_init (int argc, char **argv, Bool verbose_p);
@@ -2353,28 +1921,36 @@
 -extern Bool pam_passwd_valid_p (const char *typed_passwd, Bool verbose_p);
 +extern Bool pam_passwd_valid_p (void);
  #endif
+ #ifdef PASSWD_HELPER_PROGRAM
+ extern Bool ext_priv_init (int argc, char **argv, Bool verbose_p);
+@@ -61,7 +61,7 @@ extern Bool ext_passwd_valid_p (const ch
+ #endif
  extern Bool pwent_lock_init (int argc, char **argv, Bool verbose_p);
  extern Bool pwent_priv_init (int argc, char **argv, Bool verbose_p);
 -extern Bool pwent_passwd_valid_p (const char *typed_passwd, Bool verbose_p);
 +extern Bool pwent_passwd_valid_p (const char *typed_passwd, Bool verbose_p, int whichService);
  
- 
- /* The authorization methods to try, in order.
-@@ -73,9 +73,10 @@ struct auth_methods methods[] = {
+ Bool lock_priv_init (int argc, char **argv, Bool verbose_p);
+ Bool lock_init (int argc, char **argv, Bool verbose_p);
+@@ -80,13 +80,14 @@ struct auth_methods methods[] = {
  # ifdef HAVE_PAM
    { "PAM",              0, pam_priv_init, pam_passwd_valid_p, 
                          False, False },
 -# endif
 +# else    /* If we dont have PAM only then fall back to shadow passwords authentication */
+ # ifdef PASSWD_HELPER_PROGRAM
+   { "external",		0, ext_priv_init, ext_passwd_valid_p,
+   			False, False },
+ #endif
    { "normal",           pwent_lock_init, pwent_priv_init, pwent_passwd_valid_p,
                          False, False }
-+# endif  /* HAVE_PAM */
++# endif
  };
  
  
 diff -urp -x '*~' driver/setuid.c driver/setuid.c
---- driver/setuid.c	2000-11-08 05:13:18.000000000 -0800
-+++ driver/setuid.c	2006-05-10 08:48:29.941707000 -0700
+--- driver/setuid.c	2006-02-08 18:33:29.000000000 -0800
++++ driver/setuid.c	2006-08-09 14:26:28.056755000 -0700
 @@ -15,6 +15,7 @@
  #endif
  
@@ -2383,7 +1959,7 @@
  
  /* This file doesn't need the Xt headers, so stub these types out... */
  #undef XtPointer
-@@ -101,7 +102,10 @@ set_ids_by_number (uid_t uid, gid_t gid,
+@@ -145,7 +146,10 @@ set_ids_by_number (uid_t uid, gid_t gid,
      gid_errno = errno ? errno : -1;
  
    errno = 0;
@@ -2394,10 +1970,10 @@
 + if (seteuid (uid) != 0)
      uid_errno = errno ? errno : -1;
  
-   if (uid_errno == 0 && gid_errno == 0)
+   if (uid_errno == 0 && gid_errno == 0 && sgs_errno == 0)
 diff -urp -x '*~' driver/subprocs.c driver/subprocs.c
---- driver/subprocs.c	2006-05-10 08:48:24.156389000 -0700
-+++ driver/subprocs.c	2006-05-10 08:48:29.955074000 -0700
+--- driver/subprocs.c	2006-08-09 14:26:22.847052000 -0700
++++ driver/subprocs.c	2006-08-09 14:26:28.058300000 -0700
 @@ -20,6 +20,7 @@
  #include <string.h>
  
@@ -2406,43 +1982,43 @@
  
  #ifndef ESRCH
  # include <errno.h>
-@@ -277,7 +278,7 @@ find_job (pid_t pid)
-   return 0;
+@@ -243,7 +244,7 @@ show_job_list (void)
+ 
+ static void clean_job_list (void);
+ 
+-static struct screenhack_job *
++struct screenhack_job *
+ make_job (pid_t pid, int screen, const char *cmd)
+ {
+   struct screenhack_job *job = (struct screenhack_job *) malloc (sizeof(*job));
+@@ -391,7 +392,7 @@ unblock_sigchld (void)
+   block_sigchld_handler--;
  }
  
--static void await_dying_children (saver_info *si);
-+void await_dying_children (saver_info *si);
- #ifndef VMS
- static void describe_dead_child (saver_info *, pid_t, int wait_status);
- #endif
-@@ -413,7 +414,7 @@ sigchld_handler (int sig)
- 
- 
- #ifndef VMS
--static void
-+void
- await_dying_children (saver_info *si)
+-static int
++int
+ kill_job (saver_info *si, pid_t pid, int signal)
  {
-   while (1)
-@@ -468,9 +469,15 @@ describe_dead_child (saver_info *si, pid
+   saver_preferences *p = &si->prefs;
+@@ -574,9 +575,14 @@ describe_dead_child (saver_info *si, pid
  	 mention them) if we've just killed the subprocess.  But mention them
  	 if they happen on their own.
         */
 -      if (!job ||
+-	  (exit_status != 0 &&
+-	   (p->verbose_p || job->status != job_killed)))
 +
 +      if ((!job 
 +#ifdef HAVE_XSCREENSAVER_LOCK
 +	   && kid != si->passwd_pid
 +#endif /* HAVE_XSCREENSAVER_LOCK */
-+		  ) ||
- 	  (exit_status != 0 &&
--	   (p->verbose_p || job->status != job_killed)))
-+	   (p->verbose_p || (job && job->status != job_killed))))
-+
- 	fprintf (stderr,
- 		 "%s: %d: child pid %lu (%s) exited abnormally (code %d).\n",
- 		 blurb(), screen_no, (unsigned long) kid, name, exit_status);
-@@ -484,8 +491,12 @@ describe_dead_child (saver_info *si, pid
++	      ) ||
++	   (exit_status != 0 &&
++	    (p->verbose_p || (job && job->status != job_killed))))
+         {
+           /* Don't call fprintf() from signal handlers, as it might malloc.
+ 	  fprintf (stderr,
+@@ -616,8 +622,12 @@ describe_dead_child (saver_info *si, pid
    else if (WIFSIGNALED (wait_status))
      {
        if (p->verbose_p ||
@@ -2455,9 +2031,9 @@
 +		  ) ||
 +	  (job && job->status != job_killed) ||
  	  WTERMSIG (wait_status) != SIGTERM)
- 	fprintf (stderr, "%s: %d: child pid %lu (%s) terminated with %s.\n",
- 		 blurb(), screen_no, (unsigned long) kid, name,
-@@ -515,12 +526,23 @@ describe_dead_child (saver_info *si, pid
+         {
+           /* Don't call fprintf() from signal handlers, as it might malloc.
+@@ -685,12 +695,23 @@ describe_dead_child (saver_info *si, pid
    /* Clear out the pid so that screenhack_running_p() knows it's dead.
     */
    if (!job || job->status == job_dead)
@@ -2482,9 +2058,9 @@
  
  #else  /* VMS */
 diff -urp -x '*~' driver/timers.c driver/timers.c
---- driver/timers.c	2002-05-10 03:40:32.000000000 -0700
-+++ driver/timers.c	2006-05-10 08:48:29.940928000 -0700
-@@ -49,6 +49,12 @@ static Bool proc_interrupts_activity_p (
+--- driver/timers.c	2005-11-28 02:14:22.000000000 -0800
++++ driver/timers.c	2006-08-09 14:26:28.059781000 -0700
+@@ -60,6 +60,12 @@ static Bool proc_interrupts_activity_p (
  #endif /* HAVE_PROC_INTERRUPTS */
  
  static void check_for_clock_skew (saver_info *si);
@@ -2497,7 +2073,7 @@
  
  
  void
-@@ -229,7 +235,8 @@ cycle_timer (XtPointer closure, XtInterv
+@@ -255,7 +261,8 @@ cycle_timer (XtPointer closure, XtInterv
         crash.  So, restart the thing once an hour. */
      how_long = 1000 * 60 * 60;
  
@@ -2507,7 +2083,7 @@
      {
        if (p->verbose_p)
  	fprintf (stderr, "%s: dialog box up; delaying hack change.\n",
-@@ -277,8 +284,20 @@ activate_lock_timer (XtPointer closure, 
+@@ -303,8 +310,20 @@ activate_lock_timer (XtPointer closure, 
    saver_preferences *p = &si->prefs;
  
    if (p->verbose_p)
@@ -2529,7 +2105,7 @@
  }
  
  
-@@ -684,7 +703,10 @@ sleep_until_idle (saver_info *si, Bool u
+@@ -799,7 +818,10 @@ sleep_until_idle (saver_info *si, Bool u
  
        case ClientMessage:
  	if (handle_clientmessage (si, &event, until_idle_p))
@@ -2540,7 +2116,7 @@
  	break;
  
        case CreateNotify:
-@@ -697,8 +719,47 @@ sleep_until_idle (saver_info *si, Bool u
+@@ -812,8 +834,47 @@ sleep_until_idle (saver_info *si, Bool u
  	  }
  	break;
  
@@ -2589,7 +2165,7 @@
        case ButtonPress:
        case ButtonRelease:
        case MotionNotify:
-@@ -1152,7 +1213,8 @@ watchdog_timer (XtPointer closure, XtInt
+@@ -1380,7 +1441,8 @@ watchdog_timer (XtPointer closure, XtInt
      {
        Bool running_p = screenhack_running_p (si);
  
@@ -2600,8 +2176,8 @@
            if (si->prefs.debug_p)
              fprintf (stderr, "%s: dialog box is up: not raising screen.\n",
 diff -urp -x '*~' driver/windows.c driver/windows.c
---- driver/windows.c	2002-05-28 17:42:12.000000000 -0700
-+++ driver/windows.c	2006-05-10 08:48:29.939107000 -0700
+--- driver/windows.c	2006-05-14 22:13:54.000000000 -0700
++++ driver/windows.c	2006-08-09 14:26:28.061233000 -0700
 @@ -35,6 +35,7 @@
  #include <X11/Xutil.h>		/* for XSetClassHint() */
  #include <X11/Xatom.h>
@@ -2610,7 +2186,7 @@
  #include <signal.h>		/* for the signal names */
  #include <time.h>
  #include <sys/time.h>
-@@ -1230,6 +1231,7 @@ initialize_screensaver_window_1 (saver_s
+@@ -1411,6 +1412,7 @@ initialize_screensaver_window_1 (saver_s
     */
    attrs.event_mask = (KeyPressMask | KeyReleaseMask |
  		      ButtonPressMask | ButtonReleaseMask |
@@ -2618,7 +2194,7 @@
  		      PointerMotionMask);
  
    attrs.backing_store = NotUseful;
-@@ -1397,6 +1399,9 @@ raise_window (saver_info *si,
+@@ -1713,6 +1715,9 @@ raise_window (saver_info *si,
    saver_preferences *p = &si->prefs;
    int i;
  
@@ -2628,7 +2204,7 @@
    if (si->demoing_p)
      inhibit_fade = True;
  
-@@ -1604,6 +1609,9 @@ unblank_screen (saver_info *si)
+@@ -1927,6 +1932,9 @@ unblank_screen (saver_info *si)
    Bool unfade_p = (si->fading_possible_p && p->unfade_p);
    int i;
  
@@ -2639,9 +2215,9 @@
    reset_watchdog_timer (si, False);
  
 diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2006-05-10 08:48:24.232166000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:48:29.979552000 -0700
-@@ -156,8 +156,21 @@
+--- driver/xscreensaver.c	2006-08-09 14:26:22.878497000 -0700
++++ driver/xscreensaver.c	2006-08-09 14:26:28.075976000 -0700
+@@ -177,8 +177,21 @@
  #include "visual.h"
  #include "usleep.h"
  
@@ -2663,7 +2239,7 @@
  char *progname = 0;
  char *progclass = 0;
  XrmDatabase db = 0;
-@@ -168,6 +181,7 @@ static Atom XA_ACTIVATE, XA_DEACTIVATE, 
+@@ -189,6 +202,7 @@ static Atom XA_ACTIVATE, XA_DEACTIVATE, 
  static Atom XA_RESTART, XA_SELECT;
  static Atom XA_THROTTLE, XA_UNTHROTTLE;
  Atom XA_DEMO, XA_PREFS, XA_EXIT, XA_LOCK, XA_BLANK;
@@ -2671,7 +2247,7 @@
  
  
  static XrmOptionDescRec options [] = {
-@@ -555,6 +569,7 @@ connect_to_server (saver_info *si, int *
+@@ -589,6 +603,7 @@ connect_to_server (saver_info *si, int *
    XA_BLANK = XInternAtom (si->dpy, "BLANK", False);
    XA_THROTTLE = XInternAtom (si->dpy, "THROTTLE", False);
    XA_UNTHROTTLE = XInternAtom (si->dpy, "UNTHROTTLE", False);
@@ -2679,7 +2255,7 @@
  
    return toplevel_shell;
  }
-@@ -951,7 +966,7 @@ static void
+@@ -1122,7 +1137,7 @@ static void
  main_loop (saver_info *si)
  {
    saver_preferences *p = &si->prefs;
@@ -2688,7 +2264,7 @@
  
    while (1)
      {
-@@ -982,6 +997,14 @@ main_loop (saver_info *si)
+@@ -1153,6 +1168,14 @@ main_loop (saver_info *si)
              fprintf (stderr, "%s: idle with blanking disabled at %s.\n",
                       blurb(), timestring());
  
@@ -2703,15 +2279,15 @@
            /* Go around the loop and wait for the next bout of idleness,
               or for the init file to change, or for a remote command to
               come in, or something.
-@@ -1005,6 +1028,7 @@ main_loop (saver_info *si)
-           fprintf (stderr,
-                   "%s: unable to grab keyboard or mouse!  Blanking aborted.\n",
-                    blurb());
-+          set_locked_p(si, False);
-           continue;
+@@ -1214,6 +1237,7 @@ main_loop (saver_info *si)
+                        blurb());
+ 
+               schedule_wakeup_event (si, retry, p->debug_p);
++              set_locked_p(si, False);
+               continue;
+             }
          }
- 
-@@ -1049,7 +1073,17 @@ main_loop (saver_info *si)
+@@ -1259,7 +1283,17 @@ main_loop (saver_info *si)
              p->lock_p &&                /* and locking is enabled */
              !si->locking_disabled_p &&  /* and locking is possible */
              lock_timeout == 0)          /* and locking is not timer-deferred */
@@ -2729,7 +2305,7 @@
  
          /* locked_p might be true already because of the above, or because of
             the LOCK ClientMessage.  But if not, and if we're supposed to lock
-@@ -1064,10 +1098,7 @@ main_loop (saver_info *si)
+@@ -1274,10 +1308,7 @@ main_loop (saver_info *si)
        }
  #endif /* !NO_LOCKING */
  
@@ -2740,7 +2316,7 @@
          check_for_leaks ("blanked A");
  	sleep_until_idle (si, False);		/* until not idle */
          check_for_leaks ("blanked B");
-@@ -1077,6 +1108,12 @@ main_loop (saver_info *si)
+@@ -1287,6 +1318,12 @@ main_loop (saver_info *si)
  #ifndef NO_LOCKING
          /* Maybe unlock the screen.
           */
@@ -2753,30 +2329,28 @@
  	if (si->locked_p)
  	  {
  	    saver_screen_info *ssi = si->default_screen;
-@@ -1087,7 +1124,21 @@ main_loop (saver_info *si)
+@@ -1297,7 +1334,20 @@ main_loop (saver_info *si)
  	    suspend_screenhack (si, True);
  	    XUndefineCursor (si->dpy, ssi->screensaver_window);
  
--	    ok_to_unblank = unlock_p (si);
++#ifdef	HAVE_XSCREENSAVER_LOCK    
 +            /*Prevents lock dialog posting on non blanked screen */
 +            if (!si->screen_blanked_p)  /*locked_p is true, so blank now*/
-+              blank_screen (si);
++	      blank_screen (si);
 +            if (si->screen_blanked_p) /* if blanking successful, call PAM*/
-+             {
-+              set_locked_p (si, True);
-+              ok_to_unblank = pam_passwd_valid_p();
-+              if (ok_to_unblank == True)
-+               {
-+                set_locked_p (si, False);
-+                goto DONE;
-+               }
-+              }
-+             else /* blanking failed, probably couldnt grab keyboard/mouse */
-+               set_locked_p (si, False);
++	      {
++		set_locked_p (si, True);
++		ok_to_unblank = pam_passwd_valid_p();
++	      }
++	    else /* blanking failed, probably couldnt grab keyboard/mouse */
++	      set_locked_p (si, False);
++#else
+ 	    ok_to_unblank = unlock_p (si);
++#endif
  
  	    si->dbox_up_p = False;
  	    XDefineCursor (si->dpy, ssi->screensaver_window, ssi->cursor);
-@@ -1111,6 +1162,7 @@ main_loop (saver_info *si)
+@@ -1321,6 +1371,7 @@ main_loop (saver_info *si)
  
  	} while (!ok_to_unblank);
  
@@ -2784,16 +2358,7 @@
  
        if (p->verbose_p)
  	fprintf (stderr, "%s: unblanking screen at %s.\n",
-@@ -1120,8 +1172,6 @@ main_loop (saver_info *si)
-       kill_screenhack (si);
-       unblank_screen (si);
- 
--      set_locked_p (si, False);
--      si->emergency_lock_p = False;
-       si->demoing_p = 0;
-       si->selection_mode = 0;
- 
-@@ -1208,6 +1258,11 @@ main (int argc, char **argv)
+@@ -1377,6 +1428,11 @@ main (int argc, char **argv)
    int i;
  
    memset(si, 0, sizeof(*si));
@@ -2804,8 +2369,8 @@
 +
    global_si_kludge = si;	/* I hate C so much... */
  
- # undef ya_rand_init
-@@ -1215,7 +1270,7 @@ main (int argc, char **argv)
+   fix_fds();
+@@ -1386,7 +1442,7 @@ main (int argc, char **argv)
  
    save_argv (argc, argv);
    set_version_string (si, &argc, argv);
@@ -2814,16 +2379,16 @@
    hack_environment (si);
  
    shell = connect_to_server (si, &argc, argv);
-@@ -1223,6 +1278,8 @@ main (int argc, char **argv)
+@@ -1394,6 +1450,8 @@ main (int argc, char **argv)
    print_banner (si);
  
-   load_init_file (p);  /* must be before initialize_per_screen_info() */
+   load_init_file(si->dpy, p); /* must be before initialize_per_screen_info() */
 +  privileged_initialization (si, &argc, argv);
 +
    blurb_timestamp_p = p->timestamp_p;  /* kludge */
    initialize_per_screen_info (si, shell); /* also sets si->fading_possible_p */
  
-@@ -1263,6 +1320,7 @@ main (int argc, char **argv)
+@@ -1439,6 +1497,7 @@ main (int argc, char **argv)
    handle_signals (si);
  
    make_splash_dialog (si);
@@ -2831,7 +2396,7 @@
  
    main_loop (si);		/* doesn't return */
    return 0;
-@@ -1413,13 +1471,18 @@ handle_clientmessage (saver_info *si, XE
+@@ -1631,13 +1690,18 @@ handle_clientmessage (saver_info *si, XE
    Atom type = 0;
    Window window = event->xclient.window;
  
@@ -2851,7 +2416,7 @@
        return False;
      }
  
-@@ -1667,10 +1730,17 @@ handle_clientmessage (saver_info *si, XE
+@@ -1901,10 +1965,17 @@ handle_clientmessage (saver_info *si, XE
  			    : "locking.");
  	  sprintf (buf, "LOCK ClientMessage received; %s", response);
  	  clientmessage_response (si, window, False, buf, response);
@@ -2870,9 +2435,9 @@
  	    {
  	      XtRemoveTimeOut (si->lock_id);
 diff -urp -x '*~' driver/xscreensaver.h driver/xscreensaver.h
---- driver/xscreensaver.h	2002-03-04 13:16:20.000000000 -0800
-+++ driver/xscreensaver.h	2006-05-10 08:48:29.939723000 -0700
-@@ -115,6 +115,15 @@ struct saver_info {
+--- driver/xscreensaver.h	2006-02-03 23:38:06.000000000 -0800
++++ driver/xscreensaver.h	2006-08-09 14:26:28.077140000 -0700
+@@ -126,6 +126,15 @@ struct saver_info {
  				   privileged user. */
  
    Window passwd_dialog;		/* The password dialog, if its up. */
@@ -2888,7 +2453,7 @@
    passwd_dialog_data *pw_data;	/* Other info necessary to draw it. */
  
    int unlock_failures;		/* Counts failed login attempts while the
-@@ -318,7 +327,7 @@ extern void get_screen_viewport (saver_s
+@@ -348,7 +357,7 @@ extern void get_screen_viewport (saver_s
  extern Bool unlock_p (saver_info *si);
  extern Bool lock_priv_init (int argc, char **argv, Bool verbose_p);
  extern Bool lock_init (int argc, char **argv, Bool verbose_p);
@@ -2897,7 +2462,7 @@
  #endif /* NO_LOCKING */
  
  extern void set_locked_p (saver_info *si, Bool locked_p);
-@@ -326,6 +335,87 @@ extern int move_mouse_grab (saver_info *
+@@ -356,6 +365,109 @@ extern int move_mouse_grab (saver_info *
                              int to_screen_no);
  extern int mouse_screen (saver_info *si);
  
@@ -2907,6 +2472,8 @@
 +
 +enum window_type { w_dialog, w_message };
 +
++enum passwd_state { pw_read, pw_ok, pw_null, pw_fail, pw_cancel, pw_time };
++
 +struct passwd_dialog_data {
 +
 +  saver_screen_info *prompt_screen;
@@ -2926,6 +2493,9 @@
 +  Dimension height;
 +  Dimension border_width;
 +
++  Bool show_stars_p; /* "I regret that I have but one asterisk for my country."
++                        -- Nathan Hale, 1776. */
++
 +  char *heading_label;
 +  char *body_label;
 +  /*
@@ -2939,12 +2509,18 @@
 +  char *date_label;
 +  char *user_string;
 +  char *passwd_string;
++  char *login_label;
++  char *uname_label;
++
++  Bool show_uname_p;
 +
 +  XFontStruct *heading_font;
 +  XFontStruct *body_font;
 +  XFontStruct *label_font;
 +  XFontStruct *passwd_font;
 +  XFontStruct *date_font;
++  XFontStruct *button_font;
++  XFontStruct *uname_font;
 +
 +  Pixel foreground;
 +  Pixel background;
@@ -2954,6 +2530,8 @@
 +  Pixel thermo_background;
 +  Pixel shadow_top;
 +  Pixel shadow_bottom;
++  Pixel button_foreground;
++  Pixel button_background;
 +
 +  Dimension logo_width;
 +  Dimension logo_height;
@@ -2964,13 +2542,22 @@
 +  Dimension passwd_field_x, passwd_field_y;
 +  Dimension passwd_field_width, passwd_field_height;
 +
++  Dimension login_button_x, login_button_y;
++  Dimension login_button_width, login_button_height;
++
 +  Dimension thermo_field_x, thermo_field_y;
 +  Dimension thermo_field_height;
 +
 +  Pixmap logo_pixmap;
++  Pixmap logo_clipmask;
 +  int logo_npixels;
 +  unsigned long *logo_pixels;
 +
++  Cursor passwd_cursor;
++  Bool login_button_down_p;
++  Bool login_button_p;
++  Bool login_button_enabled_p;
++
 +  Pixmap save_under;
 +
 +#ifdef HAVE_XSCREENSAVER_LOCK
@@ -2986,8 +2573,8 @@
  /* =======================================================================
     runtime privileges
 diff -urp -x '*~' driver/xset.c driver/xset.c
---- driver/xset.c	2002-02-25 15:25:49.000000000 -0800
-+++ driver/xset.c	2006-05-10 08:48:29.941372000 -0700
+--- driver/xset.c	2005-03-21 18:04:48.000000000 -0800
++++ driver/xset.c	2006-08-09 14:26:28.077634000 -0700
 @@ -19,6 +19,7 @@
  #include <X11/Xutil.h>
  #include <X11/Xatom.h>
@@ -2996,4 +2583,3 @@
  
  /* This file doesn't need the Xt headers, so stub these types out... */
  #undef XtPointer
-
--- a/open-src/app/xscreensaver/i18n.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/i18n.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -29,35 +29,22 @@
  */
 
 Fixes for bugs that cause problems localizing xscreensaver:
-4806728 Dialognostics should be Diagnostics
 6203951 xscreensaver-lock was not properly l10ned
 
-diff -urp -x '*~' driver/xscreensaver-demo.glade2 driver/xscreensaver-demo.glade2
---- driver/xscreensaver-demo.glade2	2006-05-10 08:48:52.368024000 -0700
-+++ driver/xscreensaver-demo.glade2	2006-05-10 08:48:56.382041000 -0700
-@@ -1094,7 +1094,7 @@ Available</property>
- 			    <widget class="GtkCheckButton" id="verbose_button">
- 			      <property name="visible">True</property>
- 			      <property name="can_focus">True</property>
--			      <property name="label" translatable="yes">_Verbose Dialognostics</property>
-+			      <property name="label" translatable="yes">_Verbose Diagnostics</property>
- 			      <property name="use_underline">True</property>
- 			      <property name="relief">GTK_RELIEF_NORMAL</property>
- 			      <property name="active">False</property>
 diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2006-05-10 08:48:52.422327000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:48:56.397896000 -0700
-@@ -127,6 +127,9 @@
- #include <stdio.h>
+--- driver/xscreensaver.c	2006-08-08 15:24:55.054560000 -0700
++++ driver/xscreensaver.c	2006-08-08 15:25:01.031812000 -0700
+@@ -142,6 +142,9 @@
  #include <ctype.h>
  #include <X11/Xlib.h>
+ 
 +#include <locale.h>
 +#include <libintl.h>
-+#include <X11/Xlibint.h>
++
+ #include <X11/Xlibint.h>
+ 
  #include <X11/Xatom.h>
- #include <X11/Intrinsic.h>
- #include <X11/StringDefs.h>
-@@ -1305,6 +1308,15 @@ main (int argc, char **argv)
+@@ -1454,6 +1457,15 @@ main (int argc, char **argv)
    saver_preferences *p = &si->prefs;
    int i;
  
@@ -72,4 +59,4 @@
 +
    memset(si, 0, sizeof(*si));
  
- #ifdef HAVE_SCF_SMARTCARD
+ /* Initialize and point si to pw_data i.e. the lock dialog struct */
--- a/open-src/app/xscreensaver/misc.patch	Mon Aug 07 13:49:43 2006 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
- *
- */
-
-Changes made before the source was checked into Solaris SCCS/Teamware 
-repositories that I couldn't find comments for nor guess why they were made.
-
-diff -urp -x '*~' driver/demo-Gtk.c driver/demo-Gtk.c
---- driver/demo-Gtk.c	2006-05-10 08:49:43.010409000 -0700
-+++ driver/demo-Gtk.c	2006-05-10 08:49:50.661964000 -0700
-@@ -601,12 +601,13 @@ exit_menu_cb (GtkMenuItem *menuitem, gpo
-   gtk_main_quit ();
- }
- 
--static void
-+static gboolean
- wm_toplevel_close_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
- {
-   state *s = (state *) data;
-   flush_dialog_changes_and_save (s);
-   gtk_main_quit ();
-+  return TRUE;
- }
- 
- 
-@@ -922,7 +923,7 @@ manual_cb (GtkButton *button, gpointer u
- {
-   state *s = global_state_kludge;  /* I hate C so much... */
-   saver_preferences *p = &s->prefs;
--  GtkList *list_widget = GTK_LIST (name_to_widget (s, "list"));
-+  GtkWidget *list_widget = name_to_widget (s, "list");
-   int list_elt = selected_list_element (s);
-   int hack_number;
-   char *name, *name2, *cmd, *str;
-@@ -930,7 +931,7 @@ manual_cb (GtkButton *button, gpointer u
-   hack_number = s->list_elt_to_hack_number[list_elt];
- 
-   flush_dialog_changes_and_save (s);
--  ensure_selected_item_visible (GTK_WIDGET (list_widget));
-+  ensure_selected_item_visible (list_widget);
- 
-   name = strdup (p->screenhacks[hack_number]->command);
-   name2 = name;
-@@ -1974,11 +1975,12 @@ settings_ok_cb (GtkButton *button, gpoin
-   gtk_widget_hide (s->popup_widget);
- }
- 
--static void
-+static gboolean
- wm_popup_close_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
- {
-   state *s = (state *) data;
-   settings_cancel_cb (0, (gpointer) s);
-+  return TRUE;
- }
- 
- 
--- a/open-src/app/xscreensaver/pam_audit.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/pam_audit.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -1,48 +1,60 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
 
 Fixes for bugs:
 5015296, P1, gnome/screensaver - xscreensaver doesn't audit
-6417168, P3, gnome/screensaver - xcreensaver loops while trying to unlock a session for a user whose password was expired
+6417168, P3, gnome/screensaver - xscreensaver loops while trying to unlock a session for a user whose password was expired
 
-diff -ur driver/Makefile.in driver/Makefile.in
---- driver/Makefile.in	Wed Jun  7 18:28:35 2006
-+++ driver/Makefile.in	Wed Jun  7 19:19:46 2006
-@@ -202,7 +202,7 @@
+diff -urp -x '*~' driver/Makefile.in driver/Makefile.in
+--- driver/Makefile.in	2006-08-08 15:25:33.406256000 -0700
++++ driver/Makefile.in	2006-08-08 15:25:38.339890000 -0700
+@@ -215,7 +215,7 @@ PDF2JPEG_LIBS	= -framework Cocoa
  SAVER_LIBS	= $(LIBS) $(X_LIBS) $(XMU_LIBS) @SAVER_LIBS@ \
- 		  $(XDPMS_LIBS) $(GL_LIBS) $(X_PRE_LIBS) \
+ 		  $(XDPMS_LIBS) $(XINERAMA_LIBS) $(GL_LIBS) $(X_PRE_LIBS) \
  		  -lXt -lX11 -lXext -lXi $(X_EXTRA_LIBS) \
 -		  $(PASSWD_LIBS)
 +		  -lbsm $(PASSWD_LIBS)
  
  CMD_LIBS	= $(LIBS) $(X_LIBS) \
  		  $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
-diff -ur driver/demo-Gtk.c driver/demo-Gtk.c
---- driver/demo-Gtk.c	Wed Jun  7 18:28:35 2006
-+++ driver/demo-Gtk.c	Wed Jun  7 19:19:46 2006
-@@ -541,7 +541,7 @@
-   if (getuid() == 0) 
-    {
-       char buf [255];
--      strcpy (buf, _("Cant run hacks if logged in as root!"));
-+      strcpy (buf, _("Can not run hacks if logged in as root!"));
-       warning_dialog (s->toplevel_widget, buf, False, 100);
-      return; 
-    }
-@@ -569,7 +569,7 @@
-   if (getuid() == 0) 
-    {
-       char buf [255];
--      strcpy (buf, _("Cant run hacks if logged in as root!"));
-+      strcpy (buf, _("Can not run hacks if logged in as root!"));
-       warning_dialog (s->toplevel_widget, buf, False, 100);
-      return; 
-    }
-diff -ur driver/passwd-pam.c driver/passwd-pam.c
---- driver/passwd-pam.c	Wed Jun  7 18:28:35 2006
-+++ driver/passwd-pam.c	Wed Jun  7 19:19:46 2006
-@@ -44,12 +44,14 @@
+diff -urp -x '*~' driver/passwd-pam.c driver/passwd-pam.c
+--- driver/passwd-pam.c	2006-08-08 15:25:33.120329000 -0700
++++ driver/passwd-pam.c	2006-08-08 15:25:38.341257000 -0700
+@@ -44,10 +44,12 @@
  #ifdef HAVE_UNISTD_H
  # include <unistd.h>
  #endif
+-
+-# ifdef sun
+-#  include <deflt.h>
+-# endif
 + 
 +#ifdef sun
 +#include <deflt.h>
@@ -50,21 +62,9 @@
 +#include <bsm/adt_event.h>
 +#endif
  
--# ifdef sun
--#  include <deflt.h>
--# endif
  
--
  /*extern char *blurb(void);*/
- 
- 
-@@ -97,12 +99,14 @@
- #define True  1
- #define False 0
- 
--
- Bool we_have_pam;
- 
+@@ -100,6 +102,9 @@ Bool we_have_pam;
  #undef countof
  #define countof(x) (sizeof((x))/sizeof(*(x)))
  
@@ -74,7 +74,7 @@
  /* Some time between Red Hat 4.2 and 7.0, the words were transposed 
     in the various PAM_x_CRED macro names.  Yay!
   */
-@@ -112,8 +116,8 @@
+@@ -109,8 +114,8 @@ Bool we_have_pam;
  
  int pam_conversation (int nmsgs,
                        struct pam_message **msg,
@@ -85,7 +85,7 @@
  
  struct pam_closure {
    const char *user;
-@@ -199,13 +203,154 @@
+@@ -198,6 +203,147 @@ Bool pam_priv_init (int argc, char **arg
   */
  static void *suns_pam_implementation_blows = 0;
  
@@ -93,7 +93,7 @@
 +#include <syslog.h>
 +#include <bsm/adt.h>
 +#include <bsm/adt_event.h>
- 
++
 +static Bool audit_flag_global = True;
 +
 +/*
@@ -230,18 +230,10 @@
 +  pam_resp = NULL;
 +  replies = 0;
 +}
-+
+ 
  /* This can be called at any time, and says whether the typed password
     belongs to either the logged in user (real uid, not effective); or
-    to root.
-  */
- Bool
--pam_passwd_valid_p ()
-+pam_passwd_valid_p (void)
- {
-   const char *service;
-   uid_t euid;
-@@ -266,6 +411,15 @@
+@@ -266,6 +412,15 @@ pam_passwd_valid_p (void)
      fprintf (stderr, "%s: pam_start (\"%s\", \"%s\", ...) ==> %d (%s)\n",
               blurb(), service, c.user,
               status, PAM_STRERROR (pamh, status));
@@ -257,7 +249,7 @@
    if (status != PAM_SUCCESS) 
     {
      we_have_pam = False;
-@@ -296,32 +450,6 @@
+@@ -296,32 +451,6 @@ pam_passwd_valid_p (void)
          }
  #endif
  
@@ -290,7 +282,7 @@
    /* Try to authenticate as the current user.
       We must turn off our SIGCHLD handler for the duration of the call to
       pam_authenticate(), because in some cases, the underlying PAM code
-@@ -344,15 +472,18 @@
+@@ -344,20 +473,22 @@ pam_passwd_valid_p (void)
  
    PAM_NO_DELAY(pamh);
  
@@ -300,12 +292,15 @@
 -****************************/
     {
  
--  block_sigchld();
-+     block_sigchld();
-      pam_auth_status = pam_authenticate (pamh, pam_flags);
--  unblock_sigchld();
-+     unblock_sigchld();
-+
+   
+   timeout.tv_sec = 0;
+   timeout.tv_nsec = 1;
+   set = block_sigchld();
+-  pam_auth_status = pam_authenticate (pamh, 0);
++  pam_auth_status = pam_authenticate (pamh, pam_flags);
+   sigtimedwait (&set, NULL, &timeout);
+   unblock_sigchld();
+ 
 +#ifdef sun
 +        audit_unlock(pam_auth_status);
 +        if (pam_auth_status == PAM_SUCCESS) audit_flag_global = True;
@@ -315,7 +310,7 @@
       /* Send status message to unlock dialog ***/
       if (pam_auth_status == PAM_SUCCESS)
        {
-@@ -375,7 +506,7 @@
+@@ -380,7 +511,7 @@ pam_passwd_valid_p (void)
  
       /* PAM_SUCCESS defined to be 0 in /usr/include/security/pam_appl.h */
       si->pw_data->state = (pam_auth_status == PAM_SUCCESS ? pw_ok : pw_fail);
@@ -324,36 +319,47 @@
          fprintf(stderr,"after calling pam_authenticate status is:%d state is:%d\n",
  			pam_auth_status,si->pw_data->state);
  
-@@ -390,23 +521,8 @@
-     {
-         /* perform PAM account validation procedures for login user only */
- 	acct_rc   = pam_acct_mgmt(pamh, pam_flags);
+@@ -396,34 +527,12 @@ pam_passwd_valid_p (void)
+       /* perform PAM account validation procedures for login user only */
+       acct_rc   = pam_acct_mgmt(pamh, pam_flags);
+       
+-      /******************************************************************
+-           ignore other cases for the time being 
+-           PAM_USER_UNKNOWN, PAM_AUTH_ERR, PAM_ACCT_EXPIRED
+-           (password mgn service module)
+-           same as pam_setcred(), focus on auth. service module only
+-       *****************************************************************/
 +      /*free_pam_response_struct ();**/
  
--        /******************************************************************
+       if (verbose_p)
+         fprintf (stderr, "%s:   pam_acct_mgmt (...) ==> %d (%s)\n",
+                  blurb(), acct_rc, PAM_STRERROR(pamh, acct_rc));
+ 
+-      /******************************************************************
 -           ignore other cases for the time being 
 -           PAM_USER_UNKNOWN, PAM_AUTH_ERR, PAM_ACCT_EXPIRED
 -           (password mgn service module)
 -           same as pam_setcred(), focus on auth. service module only
--         *****************************************************************/
+-       *****************************************************************/
 -
--	if (acct_rc   == PAM_NEW_AUTHTOK_REQD) {
--		do {
--			chauth_rc  = pam_chauthtok(pamh, 0);
--                    } while (chauth_rc == PAM_AUTHTOK_ERR ||
--                      chauth_rc  == PAM_TRY_AGAIN);
--      		if (verbose_p)
--        	  fprintf (stderr, "%s:   pam_chauthtok (...) ==> %d (%s)\n",
--                 blurb(), chauth_rc, PAM_STRERROR(pamh, chauth_rc));
+-      if (acct_rc   == PAM_NEW_AUTHTOK_REQD) {
+-	do {
+-	  chauth_rc  = pam_chauthtok(pamh, 0);
+-	} while (chauth_rc == PAM_AUTHTOK_ERR ||
+-		 chauth_rc  == PAM_TRY_AGAIN);
+-	if (verbose_p)
+-	  fprintf (stderr, "%s:   pam_chauthtok (...) ==> %d (%s)\n",
+-		   blurb(), chauth_rc, PAM_STRERROR(pamh, chauth_rc));
+-      }
+-
+       /* Send status message to unlock dialog ***/
+       if (acct_rc == PAM_SUCCESS)
+ 	{
+@@ -440,8 +549,42 @@ pam_passwd_valid_p (void)
+ 	  write_to_child (si, tmp_buf);
+ 	  if (verbose_p)
+ 	    sleep (1);
 -	}
-         if (verbose_p)
-         fprintf (stderr, "%s:   pam_acct_mgmt (...) ==> %d (%s)\n",
-                  blurb(), acct_rc, PAM_STRERROR(pamh, acct_rc));
-@@ -427,13 +543,49 @@
-         write_to_child (si, tmp_buf);
-         if (verbose_p)
-           sleep (1);
--      }
  
 +   /* Only in failure of pam_acct_mgmt case we call audit */
 +#ifdef sun
@@ -390,17 +396,10 @@
 +          goto DONE;
 +         }
 +	}
-+
+ 
        /* Each time we successfully authenticate, refresh credentials,
           for Kerberos/AFS/DCE/etc.  If this fails, just ignore that
-          failure and blunder along; it shouldn't matter.
-        */
-       setcred_rc = pam_setcred (pamh, PAM_REFRESH_CRED);
-+
-       if (verbose_p)
-         fprintf (stderr, "%s:   pam_setcred (...) ==> %d (%s)\n",
-                  blurb(), setcred_rc , PAM_STRERROR(pamh, setcred_rc));
-@@ -454,6 +606,11 @@
+@@ -473,6 +616,11 @@ pam_passwd_valid_p (void)
          write_to_child (si, tmp_buf);
          if (verbose_p)
            sleep (1);
@@ -412,18 +411,9 @@
        }
  
        goto DONE;
-@@ -490,7 +647,7 @@
-         tmp_buf = strdup (_("Letting you in as ROOT!!"));
-         write_to_child (si, tmp_buf);
-         free (tmp_buf);
--  if (verbose_p)
-+        if (verbose_p)
-          sleep (1);
-       }
+@@ -521,10 +669,11 @@ pam_passwd_valid_p (void)
  
-@@ -506,10 +663,11 @@
   DONE:
-   if (service) free((void *)service);
    if (user) free (user);
 +  if (reply) free (reply);
    if (pamh)
@@ -434,35 +424,15 @@
        if (verbose_p)
          fprintf (stderr, "%s: pam_end (...) ==> %d (%s)\n",
                   blurb(), status2,
-@@ -520,7 +678,7 @@
-    {
-     if (verbose_p)
-       perror("Error pam could not revert euid to user running as euid root, locking may not work now\n");
--}
-+   }
- 
-   if (verbose_p)
-      fprintf (stderr, "<--end of pam_authenticate() returning ok_to_unblank = %d\n",
-@@ -536,8 +694,8 @@
+@@ -554,6 +703,7 @@ pam_passwd_valid_p (void)
  
    if (si->pw_data->passwd_string)
-    {
-+    memset(si->pw_data->passwd_string, 0, strlen(si->pw_data->passwd_string));
-     free (si->pw_data->passwd_string); 
--    si->pw_data->passwd_string = 0;
-    }
- 
-   if(pam_auth_status == PAM_SUCCESS) 
-@@ -572,7 +730,7 @@
- #ifndef S_ISDIR
- # define S_ISDIR(mode)   (((mode) & S_IFMT) == S_IFDIR)
- #endif
--  
-+
-   if (stat (dir, &st) == 0 && S_ISDIR(st.st_mode))
      {
-       if (stat (file, &st) != 0)
-@@ -645,10 +803,10 @@
++      memset(si->pw_data->passwd_string, 0, strlen(si->pw_data->passwd_string));
+       free (si->pw_data->passwd_string); 
+       si->pw_data->passwd_string = 0;
+     }
+@@ -662,10 +812,10 @@ pam_conversation (int nmsgs,
                    struct pam_response **resp,
                    void *closure)
  {
@@ -475,7 +445,7 @@
  
    /* On SunOS 5.6, the `closure' argument always comes in as random garbage. */
    c = (struct pam_closure *) suns_pam_implementation_blows;
-@@ -657,6 +815,7 @@
+@@ -674,6 +824,7 @@ pam_conversation (int nmsgs,
       fprintf(stderr, "-->pam_conv() \n");
  
    reply = (struct pam_response *) calloc (nmsgs, sizeof (*reply));
@@ -483,7 +453,7 @@
    if (!reply) return PAM_CONV_ERR;
  	
    for (replies = 0; replies < nmsgs; replies++)
-@@ -671,7 +830,6 @@
+@@ -688,7 +839,6 @@ pam_conversation (int nmsgs,
             make_passwd_window (si);
           }
  
@@ -491,7 +461,7 @@
        switch (msg[replies]->msg_style)
          {
          case PAM_PROMPT_ECHO_ON:
-@@ -681,8 +839,6 @@
+@@ -698,8 +848,6 @@ pam_conversation (int nmsgs,
              fprintf (stderr, "%s:     PAM ECHO_OFF(\"%s\") ==> password\n",
                       blurb(), msg[replies]->msg);
  
@@ -500,7 +470,7 @@
               write_to_child (si, msg[replies]->msg);
               if (c->verbose_p)
                sleep (1); /* let user see these */
-@@ -691,9 +847,37 @@
+@@ -708,8 +856,36 @@ pam_conversation (int nmsgs,
                  fprintf(stderr, "PAM_ECHO_OFF/ECHO_ON msg[replies]-> %s\n",
  					msg[replies]->msg);
  
@@ -527,7 +497,7 @@
 +
 +             /* Wipe the old password, so we get prompted to enter new password. */
 +             if (si->pw_data->passwd_string) 
-               {
++              {
 +               memset(si->pw_data->passwd_string, 0, strlen(si->pw_data->passwd_string));
 +               free (si->pw_data->passwd_string);
 +               si->pw_data->passwd_string = NULL;
@@ -535,11 +505,10 @@
 +
 +             /***while (!si->pw_data->got_windowid && si->pw_data->state == pw_read)**/
 +             while (si->pw_data->state == pw_read)
-+              {
+               {
                 if (c->verbose_p)
                   fprintf(stderr,"WAiting for window id from lock dialog\n");
-                handle_typeahead (si);
-@@ -702,13 +886,13 @@
+@@ -719,13 +895,13 @@ pam_conversation (int nmsgs,
                   fprintf(stderr,"<---passwd_event_loop() state =%d\n",si->pw_data->state);
                }
  
@@ -556,7 +525,7 @@
                   fprintf(stderr, "in ECHO OFF and got a passwd..:%s\n",
                                         si->pw_data->passwd_string);
                }
-@@ -716,37 +900,37 @@
+@@ -733,46 +909,44 @@ pam_conversation (int nmsgs,
                {
                 /* this shouldnt happen...perhaps sending null passwd to pam is 
  	        * best for now**/
@@ -587,8 +556,8 @@
            if (!g_passwd_dialog_created)
             {
              make_passwd_window (si);
--            /*sleep (1);*/ /*make sure window is created by now **/
-+            usleep (500000); /*make sure window is created by now **/
+             /*sleep (1);*/ /*make sure window is created by now **/
++	    usleep (500000); /*make sure window is created by now **/
             }
 -          tmp_msg = strdup (msg[replies]->msg);
 -          write_to_child (si, tmp_msg);
@@ -596,27 +565,7 @@
 +          write_to_child (si, msg[replies]->msg);
 +          sleep(2);
  
--          fprintf (stderr,"scf_scdata_state = %d\n",
-+          if (c->verbose_p)
-+            fprintf (stderr,"scf_scdata_state = %d\n",
-                               si->scf_si->scdata->state);
-           /* The following need to change to some other variable which gets set 
-            * when the user hits OK button in the dialog displaying the TEXT_INFO or
-@@ -758,13 +942,6 @@
-             XEvent event;
-             XtAppNextEvent (si->app, &event);
-             XtDispatchEvent (&event);
--#if 0
--             /* handle_typeahead (si);**/
--              passwd_event_loop (si);
--          if (c->verbose_p)
--                fprintf (stderr,"scf_scdata_state = %d\n",
--                              si->scf_si->scdata->state);
--#endif /*0*/
-            }
- 
            if (c->verbose_p)
-@@ -771,12 +948,10 @@
              fprintf(stderr, "PAM_ERROR/PAM_TEXT_INFO msg[%d]-> %s\n",
  					replies,msg[replies]->msg);
  
@@ -630,7 +579,7 @@
            break;
  	}
  
-@@ -784,17 +959,14 @@
+@@ -780,16 +954,13 @@ pam_conversation (int nmsgs,
  
           {
             int i;
@@ -647,24 +596,10 @@
 +            if (c->verbose_p)
 +            fprintf (stderr, "%s: PAM unknown  ==> ..default case:\n", blurb());
 +#ifdef  sun
-+            audit_unlock("PAM_CONV_ERR");
++            audit_unlock(PAM_CONV_ERR);
 +#endif  /* sun */
++
++            return PAM_CONV_ERR;
  
-+            return PAM_CONV_ERR;
-+
            } /* end default */
          } /* end switch */
-     } /* end for loop */
-diff -ur driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	Wed Jun  7 18:28:36 2006
-+++ driver/xscreensaver.c	Wed Jun  7 19:19:46 2006
-@@ -1221,6 +1221,9 @@
-               if (ok_to_unblank == True)
-                {
-                 set_locked_p (si, False);
-+                XDefineCursor (si->dpy, ssi->screensaver_window, ssi->cursor);
-+                /* If hack is not resumed it doesnt get killed and leaves zombie processes. */
-+	        suspend_screenhack (si, False);  /* resume */
-                 goto DONE;
-                }
-               }
--- a/open-src/app/xscreensaver/passwdTimeout-pref.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/passwdTimeout-pref.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -34,9 +34,9 @@
 	http://bugzilla.gnome.org/show_bug.cgi?id=147579
 
 diff -urp -x '*~' driver/XScreenSaver.ad.in driver/XScreenSaver.ad.in
---- driver/XScreenSaver.ad.in	2006-05-10 08:48:40.872445000 -0700
-+++ driver/XScreenSaver.ad.in	2006-05-10 08:48:46.868803000 -0700
-@@ -32,6 +32,7 @@
+--- driver/XScreenSaver.ad.in	2006-08-08 15:24:43.355144000 -0700
++++ driver/XScreenSaver.ad.in	2006-08-08 15:24:49.627321000 -0700
+@@ -34,6 +34,7 @@
  *cycle:			0:10:00
  *lockTimeout:		0:30:00
  *passwdTimeout:		0:02:00
@@ -45,9 +45,9 @@
  *dpmsStandby:		0:24:00
  *dpmsSuspend:		0:27:00
 diff -urp -x '*~' driver/demo-Gtk.c driver/demo-Gtk.c
---- driver/demo-Gtk.c	2006-05-10 08:48:40.802432000 -0700
-+++ driver/demo-Gtk.c	2006-05-10 08:48:46.905000000 -0700
-@@ -1313,6 +1313,9 @@ flush_dialog_changes_and_save (state *s)
+--- driver/demo-Gtk.c	2006-08-08 15:24:43.446343000 -0700
++++ driver/demo-Gtk.c	2006-08-08 15:24:49.630059000 -0700
+@@ -1500,6 +1500,9 @@ flush_dialog_changes_and_save (state *s)
  
    MINUTES  (&p2->timeout,         "timeout_spinbutton");
    MINUTES  (&p2->cycle,           "cycle_spinbutton");
@@ -57,7 +57,7 @@
    CHECKBOX (p2->lock_p,           "lock_button");
    MINUTES  (&p2->lock_timeout,    "lock_spinbutton");
  
-@@ -1387,6 +1390,9 @@ flush_dialog_changes_and_save (state *s)
+@@ -1591,6 +1594,9 @@ flush_dialog_changes_and_save (state *s)
    COPY(cycle,          "cycle");
    COPY(lock_p,         "lock_p");
    COPY(lock_timeout,   "lock_timeout");
@@ -67,7 +67,7 @@
  
    COPY(dpms_enabled_p, "dpms_enabled_p");
    COPY(dpms_standby,   "dpms_standby");
-@@ -2246,6 +2252,9 @@ populate_prefs_page (state *s)
+@@ -2706,6 +2712,9 @@ populate_prefs_page (state *s)
    FMT_MINUTES ("timeout_spinbutton",      p->timeout);
    FMT_MINUTES ("cycle_spinbutton",        p->cycle);
    FMT_MINUTES ("lock_spinbutton",         p->lock_timeout);
@@ -77,7 +77,7 @@
    FMT_MINUTES ("dpms_standby_spinbutton", p->dpms_standby);
    FMT_MINUTES ("dpms_suspend_spinbutton", p->dpms_suspend);
    FMT_MINUTES ("dpms_off_spinbutton",     p->dpms_off);
-@@ -2257,6 +2266,10 @@ populate_prefs_page (state *s)
+@@ -2717,6 +2726,10 @@ populate_prefs_page (state *s)
  # define TOGGLE_ACTIVE(NAME,ACTIVEP) \
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (name_to_widget (s,(NAME))),\
                                  (ACTIVEP))
@@ -87,8 +87,8 @@
 +  TOGGLE_ACTIVE ("pwd_button",       p->pwd_p);
  
    TOGGLE_ACTIVE ("lock_button",       p->lock_p);
-   TOGGLE_ACTIVE ("verbose_button",    p->verbose_p);
-@@ -2326,6 +2339,10 @@ populate_prefs_page (state *s)
+ #if 0
+@@ -2822,6 +2835,10 @@ populate_prefs_page (state *s)
  
      /* Blanking and Locking
       */
@@ -96,16 +96,16 @@
 +    SENSITIZE ("pwd_spinbutton", p->pwd_p);
 +    SENSITIZE ("pwd_mlabel",     p->pwd_p);
 +
-     SENSITIZE ("lock_spinbutton", p->lock_p);
-     SENSITIZE ("lock_mlabel",     p->lock_p);
+     SENSITIZE ("lock_button",     can_lock_p);
+     SENSITIZE ("lock_spinbutton", can_lock_p && p->lock_p);
+     SENSITIZE ("lock_mlabel",     can_lock_p && p->lock_p);
+@@ -2990,10 +3007,12 @@ fix_text_entry_sizes (state *s)
+ {
+   GtkWidget *w;
  
-@@ -2433,10 +2450,12 @@ sensitize_demo_widgets (state *s, Bool s
- static void
- fix_text_entry_sizes (state *s)
- {
 +/*bugid 5077981 pwd */
 +
- #ifdef FIXME
+ # if 0   /* appears no longer necessary with Gtk 1.2.10 */
    const char * const spinbuttons[] = {
      "timeout_spinbutton", "cycle_spinbutton", "lock_spinbutton",
 -    "dpms_standby_spinbutton", "dpms_suspend_spinbutton",
@@ -114,9 +114,9 @@
      "-fade_spinbutton" };
    int i;
 diff -urp -x '*~' driver/prefs.c driver/prefs.c
---- driver/prefs.c	2002-03-07 15:41:07.000000000 -0800
-+++ driver/prefs.c	2006-05-10 08:48:46.891011000 -0700
-@@ -230,6 +230,7 @@ get_byte_resource (char *name, char *cla
+--- driver/prefs.c	2006-05-23 15:03:47.000000000 -0700
++++ driver/prefs.c	2006-08-08 15:24:49.631015000 -0700
+@@ -243,6 +243,7 @@ get_byte_resource (Display *dpy, char *n
    return n;
  }
  
@@ -124,244 +124,150 @@
  
  static const char * const prefs[] = {
    "timeout",
-@@ -238,6 +239,7 @@ static const char * const prefs[] = {
-   "lockVTs",
+@@ -251,6 +252,7 @@ static const char * const prefs[] = {
+   "lockVTs",			/* not saved */
    "lockTimeout",
    "passwdTimeout",
 +  "passwdTimeoutEnabled",
    "visualID",
    "installColormap",
    "verbose",
-@@ -753,6 +755,9 @@ write_init_file (saver_preferences *p, c
-       CHECK("timeout")		type = pref_time, t = p->timeout;
-       CHECK("cycle")		type = pref_time, t = p->cycle;
-       CHECK("lock")		type = pref_bool, b = p->lock_p;
+@@ -781,6 +783,9 @@ write_init_file (Display *dpy,
+       CHECK("lockVTs")		continue;  /* don't save, unused */
+       CHECK("lockTimeout")	type = pref_time, t = p->lock_timeout;
+       CHECK("passwdTimeout")	type = pref_time, t = p->passwd_timeout;
 +
 +/* *bugid 5077981 pwd timeout */
 +      CHECK("passwdTimeoutEnabled")		type = pref_bool, b = p->pwd_p;
- # if 0 /* #### not ready yet */
-       CHECK("lockVTs")		type = pref_bool, b = p->lock_vt_p;
- # else
-@@ -989,6 +994,8 @@ load_init_file (saver_preferences *p)
-   p->verbose_p	    = get_boolean_resource ("verbose", "Boolean");
-   p->timestamp_p    = get_boolean_resource ("timestamp", "Boolean");
-   p->lock_p	    = get_boolean_resource ("lock", "Boolean");
+       CHECK("visualID")		type = pref_str,  s =    visual_name;
+       CHECK("installColormap")	type = pref_bool, b = p->install_cmap_p;
+       CHECK("verbose")		type = pref_bool, b = p->verbose_p;
+@@ -1062,6 +1067,8 @@ load_init_file (Display *dpy, saver_pref
+   p->lock_timeout    = 1000 * get_minutes_resource (dpy, "lockTimeout", "Time");
+   p->cycle           = 1000 * get_minutes_resource (dpy, "cycle", "Time");
+   p->passwd_timeout  = 1000 * get_seconds_resource (dpy, "passwdTimeout", "Time");
 +  /* *bugid 5077981 pwd timeout */
-+  p->pwd_p	    = get_boolean_resource ("passwdTimeoutEnabled", "Boolean");
-   p->lock_vt_p	    = get_boolean_resource ("lockVTs", "Boolean");
-   p->fade_p	    = get_boolean_resource ("fade", "Boolean");
-   p->unfade_p	    = get_boolean_resource ("unfade", "Boolean");
++  p->pwd_p	    = get_boolean_resource (dpy, "passwdTimeoutEnabled", "Boolean");
+   p->pointer_timeout = 1000 * get_seconds_resource (dpy, "pointerPollTime", "Time");
+   p->pointer_hysteresis = get_integer_resource (dpy, "pointerHysteresis","Integer");
+   p->notice_events_timeout = 1000*get_seconds_resource(dpy,
 diff -urp -x '*~' driver/prefs.h driver/prefs.h
---- driver/prefs.h	2001-11-19 22:50:35.000000000 -0800
-+++ driver/prefs.h	2006-05-10 08:48:46.902760000 -0700
-@@ -45,6 +45,8 @@ struct saver_preferences {
+--- driver/prefs.h	2006-05-17 16:35:54.000000000 -0700
++++ driver/prefs.h	2006-08-08 15:24:49.631360000 -0700
+@@ -53,6 +53,8 @@ struct saver_preferences {
    Bool xsync_p;			/* whether XSynchronize has been called */
  
    Bool lock_p;			/* whether to lock as well as save */
 +  Bool pwd_p;			/* whether to disable/enable pwd timeout */
 +				/* bugid 5077981 */
-   Bool lock_vt_p;		/* whether to lock VTs too, if possible */
  
    Bool fade_p;			/* whether to fade to black, if possible */
+   Bool unfade_p;		/* whether to fade from black, if possible */
 diff -urp -x '*~' driver/xscreensaver-demo.glade2 driver/xscreensaver-demo.glade2
---- driver/xscreensaver-demo.glade2	2002-05-28 17:42:12.000000000 -0700
-+++ driver/xscreensaver-demo.glade2	2006-05-10 08:48:46.868062000 -0700
-@@ -211,6 +211,34 @@
- 		    </packing>
- 		  </child>
- 
-+                  <child>
-+                    <widget class="GtkEventBox" id="pwd_button_eventbox">
-+                      <property name="visible">True</property>
-+                      <property name="tooltip" translatable="yes">Whether the unlock dialog box should disappear after a timeout.</property>
-+                      <child>
-+                        <widget class="GtkCheckButton" id="pwd_button">
-+                          <property name="visible">True</property>
-+                          <property name="can_focus">True</property>
-+                          <property name="label" translatable="yes">Timeout _Unlock After</property>
-+                          <property name="use_underline">True</property>
-+                          <property name="relief">GTK_RELIEF_NORMAL</property>
-+                          <property name="active">False</property>
-+                          <property name="inconsistent">False</property>
-+                          <property name="draw_indicator">True</property>
-+                          <signal name="toggled" handler="pref_changed_cb"/>
-+                        </widget>
-+                      </child>
-+                    </widget>
-+                    <packing>
-+                      <property name="left_attach">0</property>
-+                      <property name="right_attach">2</property>
-+                      <property name="top_attach">3</property>
-+                      <property name="bottom_attach">4</property>
-+                      <property name="x_options">fill</property>
-+                      <property name="y_options"></property>
-+                    </packing>
-+                  </child>
-+
- 		  <child>
- 		    <widget class="GtkLabel" id="timeout_label">
- 		      <property name="visible">True</property>
-@@ -331,6 +359,29 @@
- 		    </packing>
- 		  </child>
- 
-+                  <child>
-+                    <widget class="GtkLabel" id="pwd_mlabel">
-+                      <property name="visible">True</property>
-+                      <property name="label" translatable="yes">minutes</property>
-+                      <property name="use_underline">False</property>
-+                      <property name="use_markup">False</property>
-+                      <property name="justify">GTK_JUSTIFY_LEFT</property>
-+                      <property name="wrap">False</property>
-+                      <property name="selectable">False</property>
-+                      <property name="xalign">0</property>
-+                      <property name="yalign">0.5</property>
-+                      <property name="xpad">0</property>
-+                      <property name="ypad">0</property>
-+                    </widget>
-+                    <packing>
-+                      <property name="left_attach">3</property>
-+                      <property name="right_attach">4</property>
-+                      <property name="top_attach">3</property>
-+                      <property name="bottom_attach">4</property>
-+                      <property name="y_options"></property>
-+                    </packing>
-+                  </child>
-+ 
- 		  <child>
- 		    <widget class="GtkSpinButton" id="lock_spinbutton">
- 		      <property name="visible">True</property>
-@@ -358,6 +409,33 @@
- 		    </packing>
- 		  </child>
- 
-+                  <child>
-+                    <widget class="GtkSpinButton" id="pwd_spinbutton">
-+                      <property name="visible">True</property>
-+                      <property name="tooltip" translatable="yes">How long the unlock dialog waits for input before disappearing.</property>
-+		      <property name="can_focus">True</property>
-+                      <property name="climb_rate">15</property>
-+                      <property name="digits">0</property>
-+                      <property name="numeric">True</property>
-+                      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-+                      <property name="snap_to_ticks">True</property>
-+                      <property name="wrap">False</property>
-+                      <property name="adjustment">0 0 720 1 15 15</property>
-+                      <signal name="activate" handler="pref_changed_cb"/>
-+                      <signal name="focus_out_event" handler="pref_changed_event_cb"/>
-+                      <signal name="value_changed" handler="pref_changed_cb"/>
-+                    </widget>
-+                    <packing>
-+                      <property name="left_attach">2</property>
-+                      <property name="right_attach">3</property>
-+                      <property name="top_attach">3</property>
-+                      <property name="bottom_attach">4</property>
-+                      <property name="y_padding">10</property>
-+                      <property name="x_options">fill</property>
-+                      <property name="y_options"></property>
-+                    </packing>
-+                  </child>
-+
+--- driver/xscreensaver-demo.glade2	2005-08-09 01:37:05.000000000 -0700
++++ driver/xscreensaver-demo.glade2	2006-08-08 15:24:49.632892000 -0700
+@@ -160,7 +160,7 @@
  		  <child>
- 		    <widget class="GtkSpinButton" id="cycle_spinbutton">
+ 		    <widget class="GtkTable" id="blanking_table">
  		      <property name="visible">True</property>
-
---- driver/demo-Xm-widgets.c	2001-12-19 16:15:43.000000000 -0800
-+++ driver/demo-Xm-widgets.c	2006-04-10 13:48:05.503904000 -0700
-@@ -567,6 +567,8 @@
-   int ac = 0;
-   Widget children[100];
-   Widget timeout_label, cycle_label, fade_seconds_label, fade_ticks_label;
-+  /*bugid 5077981 passwd timeout */
-+  Widget pwd_label,pwd_toggle;
-   Widget lock_label, passwd_label, hr;
-   Widget preferences_form;
- 
-@@ -585,9 +587,13 @@
-   XtSetArg (av [ac], XmNrightAttachment, XmATTACH_FORM); ac++;
-   preferences_form = XmCreateForm (parent, "preferencesForm", av, ac);
-   XtManageChild (preferences_form);
--
-+  /*bugid 147579 */
-   ac = 0;
-+  XtSetArg(av[ac], XmNalignment, XmALIGNMENT_END); ac++;
-+  pwd_label = XmCreateLabelGadget (preferences_form, 
-+			"passwd_Label", av, ac);
- 
-+  ac = 0;
-   XtSetArg(av[ac], XmNalignment, XmALIGNMENT_END); ac++;
-   timeout_label = XmCreateLabelGadget (preferences_form, "timeoutLabel",
-                                        av, ac);
-@@ -638,7 +644,15 @@
-   XtSetArg(av[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-   lock_toggle = XmCreateToggleButtonGadget (preferences_form, "lockToggle",
-                                             av, ac);
-+  
-+/*bugid 5077981 pwd */
-+  ac = 0;
-+  XtSetArg(av[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
-+  pwd_toggle = XmCreateToggleButtonGadget (preferences_form, "pwdToggle",
-+                                            av, ac);
-+
-+
-   ac = 0;
-   hr = XmCreateSeparatorGadget (preferences_form, "separator", av, ac);
+-		      <property name="n_rows">3</property>
++		      <property name="n_rows">4</property>
+ 		      <property name="n_columns">4</property>
+ 		      <property name="homogeneous">False</property>
+ 		      <property name="row_spacing">2</property>
+@@ -326,6 +326,65 @@
+ 		      </child>
  
-   prefs_done = XmCreatePushButtonGadget (preferences_form, "OK", av, ac);
-@@ -846,6 +861,26 @@
-                  XmNrightAttachment, XmATTACH_FORM,
-                  XmNrightOffset, 20,
-                  0);
-+/*bugid 5077981 pwd */
-+  XtVaSetValues (pwd_toggle,
-+                 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
-+                 XmNtopOffset, 0,
-+                 XmNtopWidget, passwd_timeout_text,
-+                 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
-+                 XmNbottomOffset, 0,
-+                 XmNbottomWidget, passwd_timeout_text,
-+                 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
-+                 XmNleftOffset, 0,
-+                 XmNleftWidget, unfade_toggle,
-+                 XmNrightAttachment, XmATTACH_FORM,
-+                 XmNrightOffset, 20,
-+                 0);
+ 		      <child>
++			<widget class="GtkSpinButton" id="pwd_spinbutton">
++			  <property name="visible">True</property>
++			  <property name="tooltip" translatable="yes">How long the unlock dialog waits for input before disappearing.</property>
++			  <property name="can_focus">True</property>
++			  <property name="climb_rate">15</property>
++			  <property name="digits">0</property>
++			  <property name="numeric">True</property>
++			  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
++			  <property name="snap_to_ticks">True</property>
++			  <property name="wrap">False</property>
++			  <property name="adjustment">0 0 720 1 15 15</property>
++			  <signal name="activate" handler="pref_changed_cb"/>
++			  <signal name="focus_out_event" handler="pref_changed_event_cb"/>
++			  <signal name="value_changed" handler="pref_changed_cb"/>
++			</widget>
++			<packing>
++			  <property name="left_attach">2</property>
++			  <property name="right_attach">3</property>
++			  <property name="top_attach">3</property>
++			  <property name="bottom_attach">4</property>
++			  <property name="y_padding">10</property>
++			  <property name="x_options">fill</property>
++			  <property name="y_options"></property>
++			</packing>
++		      </child>
 +
-+  XtVaSetValues (hr,
-+                 XmNtopWidget, passwd_timeout_text,
-+                 XmNbottomAttachment, XmATTACH_FORM,
-+                 XmNbottomOffset, 4,
-+                 XmNleftAttachment, XmATTACH_FORM,
++		      <child>
++			<widget class="GtkEventBox" id="pwd_button_eventbox">
++			  <property name="visible">True</property>
++			  <property name="tooltip" translatable="yes">Whether the unlock dialog box should disappear after a timeout.</property>
++			  <property name="visible_window">True</property>
++			  <property name="above_child">False</property>
++
++			  <child>
++			    <widget class="GtkCheckButton" id="pwd_button">
++			      <property name="visible">True</property>
++			      <property name="can_focus">True</property>
++			      <property name="label" translatable="yes">Timeout _Unlock After</property>
++			      <property name="use_underline">True</property>
++			      <property name="relief">GTK_RELIEF_NORMAL</property>
++			      <property name="focus_on_click">True</property>
++			      <property name="active">False</property>
++			      <property name="inconsistent">False</property>
++			      <property name="draw_indicator">True</property>
++			      <signal name="toggled" handler="pref_changed_cb"/>
++			    </widget>
++			  </child>
++			</widget>
++			<packing>
++			  <property name="left_attach">0</property>
++			  <property name="right_attach">2</property>
++			  <property name="top_attach">3</property>
++			  <property name="bottom_attach">4</property>
++			  <property name="x_options">fill</property>
++			  <property name="y_options">fill</property>
++			</packing>
++		      </child>
++
++		      <child>
+ 			<widget class="GtkLabel" id="cycle_mlabel">
+ 			  <property name="visible">True</property>
+ 			  <property name="label" translatable="yes">minutes</property>
+@@ -372,6 +431,29 @@
+ 		      </child>
  
-   XtVaSetValues (hr,
-                  XmNtopWidget, passwd_timeout_text,
-@@ -886,6 +921,8 @@
-   children[ac++] = fade_toggle;
-   children[ac++] = unfade_toggle;
-   children[ac++] = lock_toggle;
-+  /*bugid 5077981 pwd */
-+  children[ac++] = pwd_toggle;
-   children[ac++] = hr;
- 
-   XtManageChildren(children, ac);
-
---- driver/demo-Xm.c	2002-04-13 03:27:38.000000000 -0700
-+++ driver/demo-Xm.c	2006-04-10 13:48:05.506493000 -0700
-@@ -822,6 +822,7 @@ prefs_ok_cb (Widget button, XtPointer cl
-   CHECKBOX (p2->fade_p,         "fadeToggle");
-   CHECKBOX (p2->unfade_p,       "unfadeToggle");
-   CHECKBOX (p2->lock_p,         "lockToggle");
-+  CHECKBOX (p2->pwd_p,         "pwdToggle");
- 
- # undef SECONDS
- # undef MINUTES
-@@ -843,7 +844,9 @@ prefs_ok_cb (Widget button, XtPointer cl
-   COPY(fade_p);
-   COPY(unfade_p);
-   COPY(lock_p);
-+  COPY(pwd_p);
- # undef COPY
-+/*above bugid 5077981: password enabled */
- 
-   populate_prefs_page (button, pair);
- 
+ 		      <child>
++			<widget class="GtkLabel" id="pwd_mlabel">
++			  <property name="visible">True</property>
++			  <property name="label" translatable="yes">minutes</property>
++			  <property name="use_underline">False</property>
++			  <property name="use_markup">False</property>
++			  <property name="justify">GTK_JUSTIFY_LEFT</property>
++			  <property name="wrap">False</property>
++			  <property name="selectable">False</property>
++			  <property name="xalign">0</property>
++			  <property name="yalign">0.5</property>
++			  <property name="xpad">8</property>
++			  <property name="ypad">0</property>
++			</widget>
++			<packing>
++			  <property name="left_attach">3</property>
++			  <property name="right_attach">4</property>
++			  <property name="top_attach">3</property>
++			  <property name="bottom_attach">4</property>
++			  <property name="y_options"></property>
++			</packing>
++		      </child>
++
++		      <child>
+ 			<widget class="GtkLabel" id="timeout_label">
+ 			  <property name="visible">True</property>
+ 			  <property name="label" translatable="yes">_Blank After</property>
--- a/open-src/app/xscreensaver/s_isdir.patch	Mon Aug 07 13:49:43 2006 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
- *
- */
-
-6348365 - S_IFMT comparison abuse in X
-Submitted to jwz 11/9/2005 - accepted into xscreensaver 4.24
-
-
-diff -urp -x '*~' driver/passwd-pam.c driver/passwd-pam.c
---- driver/passwd-pam.c	2002-03-03 19:57:17.000000000 -0800
-+++ driver/passwd-pam.c	2006-05-10 08:48:01.063112000 -0700
-@@ -310,7 +310,11 @@ pam_priv_init (int argc, char **argv, Bo
-   const char file2[] = "/etc/pam.conf";
-   struct stat st;
- 
--  if (stat (dir, &st) == 0 && st.st_mode & S_IFDIR)
-+#ifndef S_ISDIR
-+# define S_ISDIR(mode)   (((mode) & S_IFMT) == S_IFDIR)
-+#endif
-+  
-+  if (stat (dir, &st) == 0 && S_ISDIR(st.st_mode))
-     {
-       if (stat (file, &st) != 0)
-         fprintf (stderr,
--- a/open-src/app/xscreensaver/scf-smartcard.patch	Mon Aug 07 13:49:43 2006 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1330 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
- *
- */
-
-Support for the SCF smartcard framework in Solaris.   SCF has been declared
-obsolete by Sun and is being removed from the Solaris "Nevada" release, so
-this code will be removed as well soon.
-
-diff -urp -x '*~' config.h.in config.h.in
---- config.h.in	2006-05-10 08:48:35.644044000 -0700
-+++ config.h.in	2006-05-10 08:48:40.856997000 -0700
-@@ -269,6 +269,24 @@
-  */
- #define PAM_SERVICE_NAME "xscreensaver"
- 
-+/* Define this if using SCF to handle smart cards. 
-+ * bugid(4985708) xscreensaver uses its own pam stack and using
-+ * "xscreensaver" as the pam service name when authenticating using
-+ * smartcards, see bugid(4976405) fixing smartcard(im)
-+ */
-+
-+#define HAVE_SCF_SMARTCARD
-+
-+/* If using smart cards for authentication use xscreensaver as pam service name
-+ */
-+#define SCF_PAM_SERVICE_NAME "xscreensaver"
-+
-+/* Define this if fork1 is defined; this should happen only on Solaris
-+ * and only if HAVE_SCF_SMARTCARD is defined.
-+ */
-+
-+#undef HAVE_FORK1
-+
- /* Define if you have PAM and pam_strerror() requires two arguments.  */
- #undef PAM_STRERROR_TWO_ARGS
- 
-diff -urp -x '*~' configure.in configure.in
---- configure.in	2006-05-10 08:48:35.646544000 -0700
-+++ configure.in	2006-05-10 08:48:40.859304000 -0700
-@@ -1552,6 +1552,32 @@ if test "$enable_locking" = yes -a "$wit
-   fi
- fi
- 
-+#--- Begin SUNW addition
-+###############################################################################
-+#
-+#       Check for SCF smartcard framework.
-+#
-+###############################################################################
-+
-+have_scf_smartcard=no
-+with_scf_smartcard_req=unspecified
-+
-+AC_ARG_WITH(scf-smartcard, 
-+[  --with-scf-smartcard        Include support for SCF smartcard authentication.],
-+  [with_scf_smartcard="$withval"; with_scf_smartcard_req="$withval"],
-+	[with_scf_smartcard=yes])
-+
-+HANDLE_X_PATH_ARG(with_scf_smartcard, --with-scf-smartcard, scf-smartcard)
-+
-+if test "$enable_locking" = yes -a "$with_scf_smartcard" = yes; then
-+  AC_CHECK_LIB(smartcard, SCF_Session_getSession,
-+	[PASSWD_LIBS="$PASSWD_LIBS -lsmartcard"
-+	 PASSWD_SRCS="$PASSWD_SRCS \$(SCF_SRCS)"
-+	 PASSWD_OBJS="$PASSWD_OBJS \$(SCF_OBJS)"])
-+
-+fi
-+
-+#--- End SUNW addition
- 
- ###############################################################################
- #
-diff -urp -x '*~' driver/Makefile.in driver/Makefile.in
---- driver/Makefile.in	2006-05-10 08:48:35.667263000 -0700
-+++ driver/Makefile.in	2006-05-10 08:48:40.892557000 -0700
-@@ -110,6 +110,9 @@ KERBEROS_OBJS	= passwd-kerberos.o
- PAM_SRCS	= passwd-pam.c
- PAM_OBJS	= passwd-pam.o
- 
-+SCF_SRCS	= scf-smartcard.c
-+SCF_OBJS	= scf-smartcard.o
-+
- LOCK_SRCS_1	= lock.c passwd.c
- LOCK_OBJS_1	= lock.o passwd.o
- NOLOCK_SRCS_1	= lock.c
-diff -urp -x '*~' driver/XScreenSaver.ad.in driver/XScreenSaver.ad.in
---- driver/XScreenSaver.ad.in	2006-05-10 08:48:35.580225000 -0700
-+++ driver/XScreenSaver.ad.in	2006-05-10 08:48:40.872445000 -0700
-@@ -449,6 +449,37 @@ XScreenSaver.bourneShell:		/bin/sh
- *splash.demo.label:		Settings
- *splash.help.label:		Help
- 
-+! Resources for smartcard OCF messages
-+!
-+*message.OCF.nouser:                                 \
-+The user name could not be obtained from the card. \n\
-+Please remove and reinsert your card.
-+
-+*message.OCF.waitforcard:       \
-+There is no card in the reader.\n\
-+Insert your card to unlock the display.\n\
-+The display is locked by user %s.
-+
-+*message.OCF.waitremovallogoutwait: \
-+There is no card in the reader.\n\
-+Re-insert you card and authenticate yourself within %d seconds or you will \n\
-+be automatically logged out. \n\
-+The display is locked by user %s.
-+
-+*message.OCF.authrequired:      \
-+Smart Card detected. Authentication is required on this card .\n\
-+Locking the display for user %s.
-+
-+*message.OCF.wronguser: \
-+The card's owner is not permitted to unlock \n\
-+this display. Please remove the card.\n\
-+The display is locked by user %s.
-+
-+*message.OCF.default:   \
-+Unexpected card state: %x.\n\
-+Try reinserting your card. If the problem persists, \n\
-+contact your system administrator.\n\
-+The display is locked by user %s.
- 
- ! Resources for the Motif dialog boxes of the "xscreensaver-demo" program.
- ! 
-diff -urp -x '*~' driver/lock.c driver/lock.c
---- driver/lock.c	2006-05-10 08:48:35.674843000 -0700
-+++ driver/lock.c	2006-05-10 08:48:40.932264000 -0700
-@@ -17,6 +17,12 @@
- # include "config.h"
- #endif
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+#include <thread.h>
-+#include <signal.h>
-+#include <security/pam_appl.h>
-+#endif  /* HAVE_SCF_SMARTCARD */
-+
- #include <X11/Intrinsic.h>
- #include <X11/Xos.h>		/* for time() */
- #include <time.h>
-@@ -74,12 +80,82 @@ vms_passwd_valid_p(char *pw, Bool verbos
- extern void await_dying_children (saver_info *si);
- void hack_uid (saver_info *si);
- 
-+
-+#ifdef HAVE_SCF_SMARTCARD 
-+static void * smartcard_authenticate (void *);
-+static void scfevent_handler (SCF_Event_t event, 
-+                                  SCF_Terminal_t eventTerminal, void *unused);
-+static void card_removal_timeout (XtPointer, XtIntervalId *);
-+static void card_removal_logout_wait (XtPointer, XtIntervalId *);
-+static void start_wait_removal_timer (saver_info *);
-+static void report_smartcard_init_error (saver_info*, char*, uint32_t);
-+static void report_smartcard_error (char*, uint32_t);
-+static char * get_message (saver_info *);
-+static void set_smartcard_lock_state (saver_info *);
-+static Bool is_valid_unlock_user(char *);
-+static void force_exit (saver_info *si);
-+ 
-+static XtIntervalId card_removal_timeout_id;
-+static XtIntervalId card_removal_logout_wait_id;
-+/*
-+** S10 SCF API did  not use client_name and client_version
-+static char *client_name = "dtsession";
-+static char *client_version = "1";
-+*/
-+
-+static cond_t c_event_processed = DEFAULTCV;
-+static mutex_t m_event_processed = DEFAULTMUTEX;
-+static Bool b_event_processed = 1;
-+
-+static char * get_username(void);
-+static int run_PAMsession(char *, saver_info*);
-+
-+static cond_t c_got_message = DEFAULTCV;
-+static mutex_t m_got_message;
-+static Bool b_got_message = False;
-+
-+static cond_t c_got_response = DEFAULTCV;
-+static mutex_t m_got_response;
-+static Bool b_got_response = False;
-+
-+static cond_t c_got_username = DEFAULTCV;
-+static mutex_t m_got_username;
-+static Bool b_got_username = False;
-+
-+static cond_t c_validated_response = DEFAULTCV;
-+static mutex_t m_validated_response;
-+static Bool b_validated_response = False;
-+
-+static Bool  b_validation_succeeded;
-+static Bool b_validation_finished;
-+static Bool b_PAM_prompted;
-+static Bool b_got_PAM_message;
-+static Bool b_first_prompt;
-+
-+static thread_t pam_thread = (thread_t) NULL;
-+
-+static void wait_for_got_message (void);
-+
-+static char *saved_user_input = NULL;
-+static struct pam_message safe_pam_message;
-+static struct pam_message *saved_pam_message = &safe_pam_message;
-+static int conversation_function(int, const struct pam_message**,
-+				 struct pam_response **, void *);
-+#endif /* HAVE_SCF_SMARTCARD */
-+
- Bool g_passwd_dialog_created = 0;
- 
- #undef MAX
- #define MAX(a,b) ((a)>(b)?(a):(b))
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+#include "scf-smartcard.h"
-+/*
-+ * enum passwd_state is defined in scf-smartcard.h
-+ */
-+#else
- enum passwd_state { pw_read, pw_ok, pw_null, pw_fail, pw_cancel, pw_time };
-+#endif
- 
- 
- 
-@@ -91,6 +167,15 @@ enum passwd_state { pw_read, pw_ok, pw_n
- 
- 
- static void make_window (saver_info *si, enum window_type w_type);
-+
-+#ifdef HAVE_SCF_SMARTCARD
-+void make_passwd_window (saver_info *si);
-+static void make_message_window (saver_info *si);
-+static void message_animate_timer (XtPointer closure, XtIntervalId *id);
-+static void message_event_loop (saver_info *si);
-+
-+#endif /* HAVE_SCF_SMARTCARD */
-+
- static void draw_passwd_window (saver_info *si);
- void update_passwd_window (saver_info *si, const char *printed_passwd,
- 				  float ratio);
-@@ -290,6 +375,17 @@ spawn_external_passwd_process (saver_inf
-        */
-       hack_uid (si);
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+      if (si->scf_si && si->scf_si->use_smartcard)
-+	{
-+          char* command_with_arg = malloc (strlen(command) + 
-+						strlen("+use_smartcard"));
-+          sprintf(command_with_arg, "%s +use_smartcard", command);
-+          exec_command (p->shell, command_with_arg, 0);
-+	}
-+      else
-+#endif /*HAVE_SCF_SMARTCARD*/
-+
-       exec_command (p->shell, command, 0);
-       /* print_path_error (command); */
-       fprintf (stderr, "%s: couldn't exec: %s\n", 
-@@ -351,6 +447,10 @@ make_window (saver_info *si, enum window
-      fprintf(stderr, "-->make_window()\n");
- 
- #ifdef HAVE_XSCREENSAVER_LOCK
-+#ifdef HAVE_SCF_SMARTCARD
-+  if (w_type == w_dialog) /*if it is message then dont create the lock dialog*/
-+#endif /*HAVE_SCF_SMARTCARD*/
-+    {
-       if (spawn_external_passwd_process (si, si->pw_data))
- 	{ 
- /***************
-@@ -392,6 +492,18 @@ make_window (saver_info *si, enum window
- 
-   si->pw_data->heading_label = get_string_resource ("passwd.heading.label",
- 					   "Dialog.Label.Label");
-+#ifdef HAVE_SCF_SMARTCARD
-+   /* we never create dialog window; only pw_data->w_type == w_message */
-+    {
-+      si->pw_data->message_body_label = get_scf_message (si);
-+      if (si->prefs.verbose_p)
-+       {
-+	fprintf (stderr, "**SCF: calling get_scf_message() msg = %s*** \n",si->pw_data->message_body_label);
-+        fflush (stderr);
-+       }
-+    }
-+#endif /* HAVE_SCF_SMARTCARD */
-+
-   si->pw_data->date_label = get_string_resource ("dateFormat", "DateFormat");
- 
-   if (!si->pw_data->heading_label)
-@@ -479,6 +591,26 @@ make_window (saver_info *si, enum window
-     if (overall.width > si->pw_data->width) si->pw_data->width = overall.width;
-     si->pw_data->height += ascent + descent;
- 
-+#ifdef HAVE_SCF_SMARTCARD  
-+    /* else  si->pw_data->w_type == w_message */
-+      {
-+	char **label_lines = si->pw_data->message_body_label;
-+
-+	while (*label_lines && **label_lines)
-+	  {
-+	    XTextExtents (si->pw_data->body_font,
-+			  *label_lines, strlen(*label_lines),
-+			  &direction, &ascent, &descent, &overall);
-+	    if (overall.width > si->pw_data->width) si->pw_data->width = overall.width;
-+	    si->pw_data->height += ascent + descent;
-+	    if (*label_lines && **label_lines)
-+	      label_lines++;
-+	    else
-+	      break;
-+	  }
-+      }
-+#endif  /* HAVE_SCF_SMARTCARD */ 
-+
-     si->pw_data->width  += (si->pw_data->internal_border * 2);
-     si->pw_data->height += (si->pw_data->internal_border * 4);
- 
-@@ -607,17 +739,35 @@ draw_passwd_window (saver_info *si)
-   int sw;
-   int tb_height;
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+  if (pw->w_type == w_dialog)
-+#endif /* HAVE_SCF_SMARTCARD */
-+    {
- 
--  if (si->prefs.verbose_p)
--    fprintf (stderr, "-->draw_passwd_window() case w_dialog!!\n");
-+      if (si->prefs.verbose_p)
-+	fprintf (stderr, "-->draw_passwd_window() case w_dialog!!\n");
-+
-+      height = (pw->heading_font->ascent + pw->heading_font->descent +
-+		pw->body_font->ascent + pw->body_font->descent +
-+		(2 * MAX ((pw->label_font->ascent + pw->label_font->descent),
-+			  (pw->passwd_font->ascent + pw->passwd_font->descent +
-+			   (pw->shadow_width * 4)))) +
-+		pw->date_font->ascent + pw->date_font->descent
-+		);
-+    }
-+#ifdef HAVE_SCF_SMARTCARD
-+  else /* pw->w_type == w_message */
-+    {
-+      if (si->prefs.verbose_p)
-+	fprintf (stderr, "--> SCF::draw_passwd_window() case w_message!!\n");
-+
-+      height = (pw->heading_font->ascent + pw->heading_font->descent +
-+		pw->body_font->ascent + pw->body_font->descent +
-+		pw->date_font->ascent + pw->date_font->descent
-+		);
-+    }
-+#endif /* HAVE_SCF_SMARTCARD */
- 
--  height = (pw->heading_font->ascent + pw->heading_font->descent +
--	    pw->body_font->ascent + pw->body_font->descent +
--	    (2 * MAX ((pw->label_font->ascent + pw->label_font->descent),
--		      (pw->passwd_font->ascent + pw->passwd_font->descent +
--		       (pw->shadow_width * 4)))) +
--            pw->date_font->ascent + pw->date_font->descent
--            );
-   spacing = ((pw->height - (2 * pw->shadow_width) -
- 	      pw->internal_border - height)) / 8;
-   if (spacing < 0) spacing = 0;
-@@ -641,90 +791,117 @@ draw_passwd_window (saver_info *si)
-   /* text below top heading
-    */
-   XSetFont (si->dpy, gc1, pw->body_font->fid);
--  y1 += spacing + pw->body_font->ascent + pw->body_font->descent;
--  sw = string_width (pw->body_font, pw->body_label);
--  x2 = (x1 + ((x3 - x1 - sw) / 2));
--  XDrawString (si->dpy, si->passwd_dialog, gc1, x2, y1,
--	       pw->body_label, strlen(pw->body_label));
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+  if (pw->w_type == w_dialog)
-+#endif /* HAVE_SCF_SMARTCARD */
-+    {
-+      y1 += spacing + pw->body_font->ascent + pw->body_font->descent;
-+      sw = string_width (pw->body_font, pw->body_label);
-+      x2 = (x1 + ((x3 - x1 - sw) / 2));
-+      XDrawString (si->dpy, si->passwd_dialog, gc1, x2, y1,
-+		   pw->body_label, strlen(pw->body_label));
- 
--  tb_height = (pw->passwd_font->ascent + pw->passwd_font->descent +
--	       (pw->shadow_width * 4));
- 
--  /* the "User:" prompt
--   */
--  y1 += spacing;
--  y2 = y1;
--  XSetForeground (si->dpy, gc1, pw->foreground);
--  XSetFont (si->dpy, gc1, pw->label_font->fid);
--  y1 += (spacing + tb_height);
--  x2 = (x1 + pw->internal_border +
--	MAX(string_width (pw->label_font, pw->user_label),
--	    string_width (pw->label_font, pw->passwd_label)));
--  XDrawString (si->dpy, si->passwd_dialog, gc1,
--	       x2 - string_width (pw->label_font, pw->user_label),
--	       y1,
--	       pw->user_label, strlen(pw->user_label));
-+      tb_height = (pw->passwd_font->ascent + pw->passwd_font->descent +
-+		   (pw->shadow_width * 4));
- 
--  /* the "Password:" prompt
--   */
--  y1 += (spacing + tb_height);
--  XDrawString (si->dpy, si->passwd_dialog, gc1,
--	       x2 - string_width (pw->label_font, pw->passwd_label),
--	       y1,
--	       pw->passwd_label, strlen(pw->passwd_label));
-+      /* the "User:" prompt
-+       */
-+      y1 += spacing;
-+      y2 = y1;
-+      XSetForeground (si->dpy, gc1, pw->foreground);
-+      XSetFont (si->dpy, gc1, pw->label_font->fid);
-+      y1 += (spacing + tb_height);
-+      x2 = (x1 + pw->internal_border +
-+	    MAX(string_width (pw->label_font, pw->user_label),
-+		string_width (pw->label_font, pw->passwd_label)));
-+      XDrawString (si->dpy, si->passwd_dialog, gc1,
-+		   x2 - string_width (pw->label_font, pw->user_label),
-+		   y1,
-+		   pw->user_label, strlen(pw->user_label));
- 
-+      /* the "Password:" prompt
-+       */
-+      y1 += (spacing + tb_height);
-+      XDrawString (si->dpy, si->passwd_dialog, gc1,
-+		   x2 - string_width (pw->label_font, pw->passwd_label),
-+		   y1,
-+		   pw->passwd_label, strlen(pw->passwd_label));
- 
--  XSetForeground (si->dpy, gc2, pw->passwd_background);
-+      XSetForeground (si->dpy, gc2, pw->passwd_background);
- 
--  /* the "user name" text field
--   */
--  y1 = y2;
--  XSetForeground (si->dpy, gc1, pw->passwd_foreground);
--  XSetFont (si->dpy, gc1, pw->passwd_font->fid);
--  y1 += (spacing + tb_height);
--  x2 += (pw->shadow_width * 4);
--
--  pw->passwd_field_width = x3 - x2 - pw->internal_border;
--  pw->passwd_field_height = (pw->passwd_font->ascent +
--			     pw->passwd_font->descent +
--			     pw->shadow_width);
--
--  XFillRectangle (si->dpy, si->passwd_dialog, gc2,
--		  x2 - pw->shadow_width,
--		  y1 - (pw->passwd_font->ascent + pw->passwd_font->descent),
--		  pw->passwd_field_width, pw->passwd_field_height);
--  XDrawString (si->dpy, si->passwd_dialog, gc1, x2, y1,
--	       pw->user_string, strlen(pw->user_string));
-+      /* the "user name" text field
-+       */
-+      y1 = y2;
-+      XSetForeground (si->dpy, gc1, pw->passwd_foreground);
-+      XSetFont (si->dpy, gc1, pw->passwd_font->fid);
-+      y1 += (spacing + tb_height);
-+      x2 += (pw->shadow_width * 4);
-+
-+      pw->passwd_field_width = x3 - x2 - pw->internal_border;
-+      pw->passwd_field_height = (pw->passwd_font->ascent +
-+				 pw->passwd_font->descent +
-+				 pw->shadow_width);
- 
--  /* the "password" text field
--   */
--  y1 += (spacing + tb_height);
-+      XFillRectangle (si->dpy, si->passwd_dialog, gc2,
-+		      x2 - pw->shadow_width,
-+		      y1 - (pw->passwd_font->ascent + pw->passwd_font->descent),
-+		      pw->passwd_field_width, pw->passwd_field_height);
-+      XDrawString (si->dpy, si->passwd_dialog, gc1, x2, y1,
-+		   pw->user_string, strlen(pw->user_string));
- 
--  pw->passwd_field_x = x2 - pw->shadow_width;
--  pw->passwd_field_y = y1 - (pw->passwd_font->ascent +
--			     pw->passwd_font->descent);
-+      /* the "password" text field
-+       */
-+      y1 += (spacing + tb_height);
- 
--  /* The shadow around the text fields
--   */
--  y1 = y2;
--  y1 += (spacing + (pw->shadow_width * 3));
--  x1 = x2 - (pw->shadow_width * 2);
--  x2 = pw->passwd_field_width + (pw->shadow_width * 2);
--  y2 = pw->passwd_field_height + (pw->shadow_width * 2);
-+      pw->passwd_field_x = x2 - pw->shadow_width;
-+      pw->passwd_field_y = y1 - (pw->passwd_font->ascent +
-+				 pw->passwd_font->descent);
- 
--  draw_shaded_rectangle (si->dpy, si->passwd_dialog,
--			 x1, y1, x2, y2,
--			 pw->shadow_width,
--			 pw->shadow_bottom, pw->shadow_top);
-+      /* The shadow around the text fields
-+       */
-+      y1 = y2;
-+      y1 += (spacing + (pw->shadow_width * 3));
-+      x1 = x2 - (pw->shadow_width * 2);
-+      x2 = pw->passwd_field_width + (pw->shadow_width * 2);
-+      y2 = pw->passwd_field_height + (pw->shadow_width * 2);
-+
-+      draw_shaded_rectangle (si->dpy, si->passwd_dialog,
-+			     x1, y1, x2, y2,
-+			     pw->shadow_width,
-+			     pw->shadow_bottom, pw->shadow_top);
-+
-+      y1 += (spacing + pw->passwd_font->ascent + pw->passwd_font->descent +
-+	     (pw->shadow_width * 4));
-+      draw_shaded_rectangle (si->dpy, si->passwd_dialog,
-+			     x1, y1, x2, y2,
-+			     pw->shadow_width,
-+			     pw->shadow_bottom, pw->shadow_top);
-+    }
-+#ifdef HAVE_SCF_SMARTCARD
-+  else /* pw->w_type == w_message  */
-+    {
-+      char ** label_lines = pw->message_body_label;
-+   
-+      y1 += spacing;
-+      while (*label_lines && **label_lines)
-+	{ 
-+	  y1 += pw->body_font->ascent + pw->body_font->descent;
-+	  sw = string_width (pw->body_font, *label_lines);
-+	  x2 = (x1 + ((x3 - x1 - sw) / 2));
-+	  XDrawString (si->dpy, si->passwd_dialog, gc1, x2, y1,
-+		       *label_lines, strlen(*label_lines));
-+	  if (*label_lines && **label_lines)
-+	      label_lines++;
-+	   else
-+	      break;
-+	}
- 
--  y1 += (spacing + pw->passwd_font->ascent + pw->passwd_font->descent +
--	 (pw->shadow_width * 4));
--  draw_shaded_rectangle (si->dpy, si->passwd_dialog,
--			 x1, y1, x2, y2,
--			 pw->shadow_width,
--			 pw->shadow_bottom, pw->shadow_top);
-+      tb_height = 0;
- 
-+    }
-+#endif /* HAVE_SCF_SMARTCARD */
- 
-   /* The date, below the text fields
-    */
-@@ -839,68 +1016,86 @@ update_passwd_window (saver_info *si, co
-   XRectangle rects[1];
- 
-   pw->ratio = ratio;
--
--  if (si->prefs.verbose_p)
--    fprintf (stderr, "-->update_passwd_window() w_dialog !!\n");
--  
--  if (!si->pw_data->got_windowid )
-+#ifdef HAVE_SCF_SMARTCARD
-+  if (pw->w_type == w_dialog)
-+#endif /* HAVE_SCF_SMARTCARD */
-     {
-+
-       if (si->prefs.verbose_p)
--	fprintf (stderr, "-->update_passwd_window() lockdialog not created returning.. !!\n");
--      return;
-+	fprintf (stderr, "-->update_passwd_window() w_dialog !!\n");
-+
-+     if (!si->pw_data->got_windowid )
-+      {
-+        if (si->prefs.verbose_p)
-+	   fprintf (stderr, "-->update_passwd_window() lockdialog not created returning.. !!\n");
-+        return;
-+      }
-+
-+      gcv.foreground = pw->passwd_foreground;
-+      if (pw->passwd_font)
-+       gcv.font = pw->passwd_font->fid;
-+      gc1 = XCreateGC (si->dpy, si->passwd_dialog, GCForeground|GCFont, &gcv);
-+      gcv.foreground = pw->passwd_background;
-+    }
-+#ifdef HAVE_SCF_SMARTCARD
-+  else /* pw->w_type == w_message */
-+    {
-+      gcv.foreground = pw->foreground;
-+      gc1 = XCreateGC (si->dpy, si->passwd_dialog, GCForeground, &gcv);
-+      gcv.foreground = pw->background;
-     }
--  
--  gcv.foreground = pw->passwd_foreground;
--  if (pw->passwd_font)
--    gcv.font = pw->passwd_font->fid;
--  gc1 = XCreateGC (si->dpy, si->passwd_dialog, GCForeground|GCFont, &gcv);
--  gcv.foreground = pw->passwd_background;
-+#endif /* HAVE_SCF_SMARTCARD */
-+
-   gc2 = XCreateGC (si->dpy, si->passwd_dialog, GCForeground, &gcv);
- 
--  if (printed_passwd)
-+#ifdef HAVE_SCF_SMARTCARD
-+  if (pw->w_type == w_dialog)
-+#endif /* HAVE_SCF_SMARTCARD */
-     {
--      char *s = strdup (printed_passwd);
--      if (pw->passwd_string) free (pw->passwd_string);
--      pw->passwd_string = s;
--    }
-+      if (printed_passwd)
-+	{
-+	  char *s = strdup (printed_passwd);
-+	  if (pw->passwd_string) free (pw->passwd_string);
-+	  pw->passwd_string = s;
-+	}
- 
--  /* the "password" text field
--   */
--  rects[0].x =  pw->passwd_field_x;
--  rects[0].y =  pw->passwd_field_y;
--  rects[0].width = pw->passwd_field_width;
--  rects[0].height = pw->passwd_field_height;
-+      /* the "password" text field
-+       */
-+      rects[0].x =  pw->passwd_field_x;
-+      rects[0].y =  pw->passwd_field_y;
-+      rects[0].width = pw->passwd_field_width;
-+      rects[0].height = pw->passwd_field_height;
- 
--  XFillRectangle (si->dpy, si->passwd_dialog, gc2,
--                  rects[0].x, rects[0].y, rects[0].width, rects[0].height);
-+      XFillRectangle (si->dpy, si->passwd_dialog, gc2,
-+		      rects[0].x, rects[0].y, rects[0].width, rects[0].height);
- 
--  XSetClipRectangles (si->dpy, gc1, 0, 0, rects, 1, Unsorted);
-+      XSetClipRectangles (si->dpy, gc1, 0, 0, rects, 1, Unsorted);
- 
--  XDrawString (si->dpy, si->passwd_dialog, gc1,
--               rects[0].x + pw->shadow_width,
--               rects[0].y + (pw->passwd_font->ascent +
--                             pw->passwd_font->descent),
--               pw->passwd_string, strlen(pw->passwd_string));
-+      XDrawString (si->dpy, si->passwd_dialog, gc1,
-+		   rects[0].x + pw->shadow_width,
-+		   rects[0].y + (pw->passwd_font->ascent +
-+				 pw->passwd_font->descent),
-+		   pw->passwd_string, strlen(pw->passwd_string));
- 
--  XSetClipMask (si->dpy, gc1, None);
-+      XSetClipMask (si->dpy, gc1, None);
- 
--  /* The I-beam
--   */
--  if (pw->i_beam != 0)
--    {
--      x = (rects[0].x + pw->shadow_width +
--	   string_width (pw->passwd_font, pw->passwd_string));
--      y = rects[0].y + pw->shadow_width;
-+      /* The I-beam
-+       */
-+      if (pw->i_beam != 0)
-+	{
-+	  x = (rects[0].x + pw->shadow_width +
-+	       string_width (pw->passwd_font, pw->passwd_string));
-+	  y = rects[0].y + pw->shadow_width;
-+
-+	  if (x > rects[0].x + rects[0].width - 1)
-+	    x = rects[0].x + rects[0].width - 1;
-+	  XDrawLine (si->dpy, si->passwd_dialog, gc1, 
-+		     x, y, x, y + pw->passwd_font->ascent);
-+	}
- 
--      if (x > rects[0].x + rects[0].width - 1)
--        x = rects[0].x + rects[0].width - 1;
--      XDrawLine (si->dpy, si->passwd_dialog, gc1, 
--		 x, y, x, y + pw->passwd_font->ascent);
-+      pw->i_beam = (pw->i_beam + 1) % 4;
-     }
- 
--  pw->i_beam = (pw->i_beam + 1) % 4;
--
--
-   /* the thermometer
-    */
-   y = (pw->thermo_field_height - 2) * (1.0 - pw->ratio);
-@@ -1051,6 +1246,25 @@ destroy_passwd_window (saver_info *si)
-       
-       if (pw->heading_label) free (pw->heading_label);
-       if (pw->body_label)    free (pw->body_label);
-+
-+#ifdef HAVE_SCF_SMARTCARD
-+      if (pw->message_body_label)
-+	{
-+	  char ** label_lines = pw->message_body_label;
-+
-+	  /*
-+	   * The array of character strings was originally one character
-+	   * string before each line was split into a different string
-+	   * so just one free is required.
-+	   */
-+	  if (*label_lines)
-+	    {
-+	      free (*label_lines);
-+	    }
-+	  free (pw->message_body_label);
-+	}
-+#endif /* HAVE_SCF_SMARTCARD */
-+
-       if (pw->user_label)    free (pw->user_label);
-       if (pw->passwd_label)  free (pw->passwd_label);
-       if (pw->date_label)    free (pw->date_label);
-@@ -1068,10 +1282,15 @@ destroy_passwd_window (saver_info *si)
-       if (pw->background != black && pw->background != white)
- 	XFreeColors (si->dpy, cmap, &pw->background, 1, 0L);
- 
--      if (pw->passwd_foreground != black && pw->passwd_foreground != white)
--	XFreeColors (si->dpy, cmap, &pw->passwd_foreground, 1, 0L);
--      if (pw->passwd_background != black && pw->passwd_background != white)
--	XFreeColors (si->dpy, cmap, &pw->passwd_background, 1, 0L);
-+#ifdef HAVE_SCF_SMARTCARD
-+      if (pw->w_type == w_dialog)
-+#endif /* HAVE_SCF_SMARTCARD */
-+	{
-+	  if (pw->passwd_foreground != black && pw->passwd_foreground != white)
-+	    XFreeColors (si->dpy, cmap, &pw->passwd_foreground, 1, 0L);
-+	  if (pw->passwd_background != black && pw->passwd_background != white)
-+	    XFreeColors (si->dpy, cmap, &pw->passwd_background, 1, 0L);
-+	}
-       if (pw->thermo_foreground != black && pw->thermo_foreground != white)
- 	XFreeColors (si->dpy, cmap, &pw->thermo_foreground, 1, 0L);
-       if (pw->thermo_background != black && pw->thermo_background != white)
-@@ -1423,10 +1642,18 @@ handle_passwd_key (saver_info *si, XKeyE
-           XSync (si->dpy, False);
- 
- /***************mali99************************************************
-+ **** No need to call scf_passwd_valid_p, only xscreensaver.c calls 
-+ **** pam_passwd_valid_p() which drives pam. *************************
-+#ifdef HAVE_SCF_SMARTCARD
-+          pw->state = scf_passwd_valid_p(si, typed_passwd);
-+	  if (si->prefs.verbose_p)
-+	    fprintf (stderr,"scf_passwd_valid_p() returns status = %d\n",pw->state);
-+#else * ! HAVE_SCF_SMARTCARD *
-           if (passwd_valid_p (typed_passwd, p->verbose_p, PAM_SERVICE))
-             pw->state = pw_ok;
-           else
-             pw->state = pw_fail;
-+#endif * HAVE_SCF_SMARTCARD *
-           update_passwd_window (si, "", pw->ratio);
- ****************************************************************************/
-             pw->state = pw_ok;
-@@ -1507,6 +1734,18 @@ passwd_event_loop (saver_info *si)
-       else if (event.xany.type == KeyPress)
- 	handle_passwd_key (si, &event.xkey);
- #endif /* !HAVE_XSCREENSAVER_LOCK */
-+#ifdef HAVE_SCF_SMARTCARD
-+      else if  ((event.xany.type == 0) && has_smartcard_event_occurred())
-+	/* Synthethic event has been signalled  because of card insertion
-+         * or removal
-+         */
-+	{
-+	  if (si->prefs.verbose_p)
-+	    fprintf (stderr, "**SCF: calling handle_scf_event() ***\n");
-+	  handle_scf_event (si);
-+	  si->pw_data->state = pw_cancel;
-+	}
-+#endif /* HAVE_SCF_SMARTCARD */
-       else if (event.xany.window == si->passwd_dialog && event.xany.type == Expose &&
-                si->pw_data->passwd_label != NULL)
-        {
-@@ -1531,6 +1770,9 @@ passwd_event_loop (saver_info *si)
-     case pw_read: msg = strdup("pw_read"); break;
-     case pw_fail: msg = strdup("pw_fail"); break;
-     case pw_cancel: msg = strdup("pw_cancel"); break;
-+#ifdef HAVE_SCF_SMARTCARD
-+    case pw_another:   msg = strdup("pw_another"); break;
-+#endif
-     default:      msg = 0; 
- 	fprintf(stderr, "si->pw_data->state is bad, serious error\n");
-         break;
-@@ -1721,6 +1963,15 @@ unlock_p (saver_info *si)
-   passwd_event_loop (si);
- 
-   status = (si->pw_data->state == pw_ok);
-+#ifdef HAVE_SCF_SMARTCARD
-+  if (si->pw_data->state == pw_another)
-+    {
-+      /*
-+       * Generate synthetic event so that dialog is displayed
-+       */
-+      idle_timer ((XtPointer) si, 0);
-+    }
-+#endif /* HAVE_SCF_SMARTCARD */
- 
-   destroy_passwd_window (si);
- 
-@@ -1734,6 +1985,10 @@ unlock_p (saver_info *si)
- void
- set_locked_p (saver_info *si, Bool locked_p)
- {
-+#ifdef HAVE_SCF_SMARTCARD
-+  scf_set_locked_p (si, locked_p);
-+#endif /* HAVE_SCF_SMARTCARD */
-+
-   si->locked_p = locked_p;
- 
- #ifdef HAVE_XHPDISABLERESET
-@@ -1749,6 +2004,116 @@ set_locked_p (saver_info *si, Bool locke
-   store_saver_status (si);			/* store locked-p */
- }
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+static void
-+make_message_window (saver_info *si)
-+{
-+  if (si->prefs.verbose_p)
-+    fprintf (stderr, "**make_passwd_window() dialog should be message(1)!!\n");
-+
-+  make_window (si, w_message); 
-+}
-+
-+static void
-+message_animate_timer (XtPointer closure, XtIntervalId *id)
-+{
-+  saver_info *si = (saver_info *) closure;
-+  int tick = 166;
-+  scf_saver_info *scf_si = si->scf_si;
-+  passwd_dialog_data *pw = si->pw_data;
-+
-+  if (!pw|| !pw->prompt_screen) return;
-+
-+  if (si->scf_si->scdata->message_timeout)
-+    pw->ratio -= (1.0 / ((double) scf_si->scdata->message_timeout / (double) tick));
-+  if (pw->ratio < 0)
-+    {
-+      pw->ratio = 0;
-+      if (pw->state == pw_read)
-+	pw->state = pw_time;
-+    }
-+
-+  update_passwd_window (si, NULL, pw->ratio);
-+
-+  if (pw->state == pw_read)
-+    pw->timer = XtAppAddTimeOut (si->app, tick, message_animate_timer,
-+				 (XtPointer) si);
-+  else
-+    pw->timer = 0;
-+
-+  idle_timer ((XtPointer) si, id);
-+}
-+/*GOK BUG */
-+
-+
-+static void
-+message_event_loop (saver_info *si)
-+{
-+  saver_preferences *p = &si->prefs;
-+  XEvent event;
-+  message_animate_timer ((XtPointer) si, 0);
-+
-+  while (si->pw_data && si->pw_data->state == pw_read)
-+    {
-+      XtAppNextEvent (si->app, &event);
-+      if (event.xany.window == si->passwd_dialog && event.xany.type == Expose)
-+	draw_passwd_window (si);
-+      else if (event.xany.type == KeyPress)
-+        /* ignore KeyPress events */
-+        continue;
-+      else if  ((event.xany.type == 0) && has_smartcard_event_occurred())
-+	/* Synthethic event has been signalled */
-+	{
-+
-+	  if (si->prefs.verbose_p)
-+	    fprintf (stderr, "**message_animate_timer() calling handle_scf_event()*** \n");
-+	  handle_scf_event (si);
-+	  si->pw_data->state = pw_cancel;
-+	}
-+    else
-+	XtDispatchEvent (&event);
-+    }
-+
-+  if (si->pw_data && p->verbose_p)
-+    switch (si->pw_data->state)
-+      {
-+      case pw_null:
-+      case pw_cancel:
-+	fprintf (stderr, "%s: message entry cancelled.\n", blurb()); break;
-+      case pw_time:
-+	fprintf (stderr, "%s: message entry timed out.\n", blurb()); break;
-+      default: 
-+	fprintf (stderr, "%s: unexpected message entry: %d\n", blurb(),
-+		 si->pw_data->state); break;
-+      }
-+}
-+
-+Bool
-+display_message (saver_info *si)
-+{
-+  Screen *screen = si->default_screen->screen;
-+  Colormap cmap = DefaultColormapOfScreen (screen);
-+  Bool status = False;
-+
-+  raise_window (si, True, True, True);
-+
-+  if (si->pw_data || si->passwd_dialog)
-+    destroy_passwd_window (si);
-+
-+  make_message_window (si);
-+  if (cmap) XInstallColormap (si->dpy, cmap);
-+
-+  message_event_loop (si);
-+
-+  destroy_passwd_window (si);
-+
-+  cmap = si->default_screen->cmap;
-+  if (cmap) XInstallColormap (si->dpy, cmap);
-+
-+  return status;
-+}
-+
-+#endif /* HAVE_SCF_SMARTCARD */
- 
- #else  /*  NO_LOCKING -- whole file */
- 
-diff -urp -x '*~' driver/passwd-pam.c driver/passwd-pam.c
---- driver/passwd-pam.c	2006-05-10 08:48:35.676003000 -0700
-+++ driver/passwd-pam.c	2006-05-10 08:48:40.893332000 -0700
-@@ -62,6 +62,12 @@
- 
- #include <sys/stat.h>
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+#include <thread.h>
-+#include <signal.h>
-+#include <security/pam_appl.h>
-+#endif  /* HAVE_SCF_SMARTCARD */
-+
- #include <X11/Intrinsic.h>
- #include <X11/Xos.h>            /* for time() */
- #include <time.h>
-@@ -201,7 +207,7 @@ static void *suns_pam_implementation_blo
- Bool
- pam_passwd_valid_p ()
- {
--  const char *service = PAM_SERVICE_NAME;
-+  const char *service;
-   uid_t euid;
-   pam_handle_t *pamh = 0;
-   int pam_auth_status = 0;  /* Specific for pam_authenticate() status*/
-@@ -220,6 +226,8 @@ pam_passwd_valid_p ()
-     fprintf (stderr, "-->pam_passwd_valid_p()\n");
- 
-   if (!p) return False;
-+  /* 4818344(P1) xscreensaver does not  use PAM correctly */
-+  service = strdup (SCF_PAM_SERVICE_NAME);
- 
-   euid = geteuid();
- 
-@@ -496,6 +504,7 @@ pam_passwd_valid_p ()
- 
- 
-  DONE:
-+  if (service) free((void *)service);
-   if (user) free (user);
-   if (pamh)
-     {
-@@ -737,6 +746,27 @@ pam_conversation (int nmsgs,
-           write_to_child (si, tmp_msg);
-           sleep(1);
- 
-+          fprintf (stderr,"scf_scdata_state = %d\n",
-+                              si->scf_si->scdata->state);
-+          /* The following need to change to some other variable which gets set 
-+           * when the user hits OK button in the dialog displaying the TEXT_INFO or
-+           * ERROR_MSG. But we dont have buttons in dialog, and at the moment this
-+           * case only happens for smartcards so the following will work.
-+           */
-+          while (si->scf_si->use_smartcard && si->scf_si->scdata->state == SCD_WAIT_FOR_CARD)
-+           {
-+            XEvent event;
-+            XtAppNextEvent (si->app, &event);
-+            XtDispatchEvent (&event);
-+#if 0
-+             /* handle_typeahead (si);**/
-+              passwd_event_loop (si);
-+          if (c->verbose_p)
-+                fprintf (stderr,"scf_scdata_state = %d\n",
-+                              si->scf_si->scdata->state);
-+#endif /*0*/
-+           }
-+
-           if (c->verbose_p)
-             fprintf(stderr, "PAM_ERROR/PAM_TEXT_INFO msg[%d]-> %s\n",
- 					replies,msg[replies]->msg);
-diff -urp -x '*~' driver/subprocs.c driver/subprocs.c
---- driver/subprocs.c	2006-05-10 08:48:35.788404000 -0700
-+++ driver/subprocs.c	2006-05-10 08:48:40.879329000 -0700
-@@ -44,6 +44,11 @@
- # define fork  vfork
- #endif /* VMS */
- 
-+#ifdef sun
-+#define fork fork1
-+#endif
-+
-+
- #include <signal.h>		/* for the signal names */
- 
- #if !defined(SIGCHLD) && defined(SIGCLD)
-diff -urp -x '*~' driver/timers.c driver/timers.c
---- driver/timers.c	2006-05-10 08:48:35.781471000 -0700
-+++ driver/timers.c	2006-05-10 08:48:40.874330000 -0700
-@@ -56,6 +56,9 @@ extern Bool pam_passwd_valid_p(void);
- extern Bool blank_screen (saver_info *si);
- extern void unblank_screen (saver_info *si);
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+extern Bool Ignore_SmartCard;
-+#endif /* HAVE_SCF_SMARTCARD */
- 
- void
- idle_timer (XtPointer closure, XtIntervalId *id)
-@@ -580,6 +583,10 @@ sleep_until_idle (saver_info *si, Bool u
-   saver_preferences *p = &si->prefs;
-   XEvent event;
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+  scf_saver_info *scf_si = si->scf_si;
-+#endif
-+
-   /* We need to select events on all windows if we're not using any extensions.
-      Otherwise, we don't need to. */
-   Bool scanning_all_windows = !(si->using_xidle_extension ||
-@@ -607,6 +614,22 @@ sleep_until_idle (saver_info *si, Bool u
-                                    si->using_mit_saver_extension ||
-                                    si->using_sgi_saver_extension));
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+  static Bool display_required = False;
-+
-+  /*
-+   * When a card event occurs when we are waiting for idleness
-+   * we want to display the message immediately and not wait until 
-+   * the user presses a key or moves the mouse. The variable display_required
-+   * is set to true to indicate this situation.
-+   */
-+  if (display_required)
-+    {
-+      display_required = False;
-+      return;
-+    }
-+#endif /* HAVE_SCF_SMARTCARD */
-+
-   if (until_idle_p)
-     {
-       if (polling_for_idleness)
-@@ -629,6 +652,24 @@ sleep_until_idle (saver_info *si, Bool u
- 
-       switch (event.xany.type) {
-       case 0:		/* our synthetic "timeout" event has been signalled */
-+#ifdef HAVE_SCF_SMARTCARD
-+	/*
-+         * If the synthetic event has been signalled because of a
-+	 * smartcard event deal with it
-+	 */
-+	if (scf_si->use_smartcard && !Ignore_SmartCard)
-+	  {
-+	    if (has_smartcard_event_occurred ())
-+	      {
-+		handle_scf_event (si);
-+		set_smartcard_event_occurred (False);
-+  		if (si->prefs.verbose_p)
-+   		  fprintf(stderr,"case 0: (sleep_until_idle)\n");
-+		continue;
-+	      }
-+	  }
-+#endif /* HAVE_SCF_SMARTCARD */
-+
- 	if (until_idle_p)
- 	  {
- 	    Time idle;
-@@ -680,6 +721,28 @@ sleep_until_idle (saver_info *si, Bool u
- 		idle = 1000 * (si->last_activity_time - time ((time_t *) 0));
- 	      }
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+	    if (scf_si->use_smartcard  && !Ignore_SmartCard)
-+              {
-+                if ((scf_si->scdata->state == SCD_WAIT_FOR_CARD) ||
-+		    (scf_si->scdata->state == SCD_WAIT_REMOVAL_LOGOUT_WAIT) ||
-+		    (scf_si->scdata->state == SCD_AUTH_REQUIRED))
-+		  {
-+		    /*
-+		     * The smart card was removed or inserted while waiting for 
-+		     * idle timeout to occur. We set display_required so that the
-+		     * next time this function is called it will return
-+		     * immediately instead of waiting for mouse movement or
-+		     * key press.
-+		     */
-+		    display_required = True;
-+  		    if (si->prefs.debug_p)
-+   		      fprintf(stderr,"use_smartcard, setting display_required (sleep_until_idle)\n");
-+		    goto DONE;
-+		  }
-+              }
-+#endif /* HAVE_SCF_SMARTCARD */
-+
- 	    if (idle >= p->timeout)
-               {
-                 /* Look, we've been idle long enough.  We're done. */
-@@ -700,6 +763,25 @@ sleep_until_idle (saver_info *si, Bool u
-                   schedule_wakeup_event (si, p->timeout - idle, p->debug_p);
-               }
- 	  }
-+#ifdef HAVE_SCF_SMARTCARD
-+	else
-+          {
-+            /*
-+             * A smart card was reinserted or the smart card was removed 
-+             * after locking the screen so we want to get the dialog displayed.
-+             */
-+            if (scf_si->use_smartcard  && !Ignore_SmartCard)
-+	      {  
-+		if ((scf_si->scdata->state == SCD_WAIT_FOR_CARD) ||
-+		    (scf_si->scdata->state == SCD_AUTH_REQUIRED))
-+		  {
-+  	           if (si->prefs.debug_p)
-+   	            fprintf(stderr,"else(until_idle_p) (sleep_until_idle)\n");
-+		    goto DONE;
-+		  }
-+	      }
-+          } 
-+#endif /* HAVE_SCF_SMARTCARD */
- 	break;
- 
-       case ClientMessage:
-diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2006-05-10 08:48:35.764178000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:48:40.913194000 -0700
-@@ -156,11 +156,23 @@
- #include "visual.h"
- #include "usleep.h"
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+#include "scf-smartcard.h"
-+#endif /* HAVE_SCF_SMARTCARD */
-+
- extern Bool pam_passwd_valid_p ();
- 
- saver_info *global_si_kludge = 0;	/* I hate C so much... */
- 
- /* Globals */
-+#ifdef HAVE_SCF_SMARTCARD
-+  scf_saver_info the_scf_si;
-+  scf_saver_info  *ptr_osi = &the_scf_si;
-+  smartcard_info the_smi;
-+  smartcard_info *ptr_smi = &the_smi;
-+  Bool Ignore_SmartCard = True;
-+#endif /* HAVE_SCF_SMARTCARD */
-+
- Bool ok_to_unblank = False;
- 
- /* Global storage for gtk passwd lock dialog 
-@@ -182,6 +194,9 @@ static Atom XA_RESTART, XA_SELECT;
- static Atom XA_THROTTLE, XA_UNTHROTTLE;
- Atom XA_DEMO, XA_PREFS, XA_EXIT, XA_LOCK, XA_BLANK;
- Atom XA_UNLOCK_RATIO;
-+#ifdef HAVE_SCF_SMARTCARD
-+Atom XA_SMARTCARD;
-+#endif
- 
- 
- static XrmOptionDescRec options [] = {
-@@ -470,6 +485,9 @@ privileged_initialization (saver_info *s
-   lock_priv_init (*argc, argv, si->prefs.verbose_p);
- #endif /* NO_LOCKING */
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+  init_scf_properties (si);
-+#endif /* HAVE_SCF_SMARTCARD */
-   hack_uid (si);
- }
- 
-@@ -571,6 +589,9 @@ connect_to_server (saver_info *si, int *
-   XA_THROTTLE = XInternAtom (si->dpy, "THROTTLE", False);
-   XA_UNTHROTTLE = XInternAtom (si->dpy, "UNTHROTTLE", False);
-   XA_UNLOCK_RATIO = XInternAtom (si->dpy, "UNLOCK_RATIO", False);
-+#ifdef HAVE_SCF_SMARTCARD
-+  XA_SMARTCARD = XInternAtom (si->dpy, "SMARTCARD", False);
-+#endif 
- 
-   return toplevel_shell;
- }
-@@ -1260,6 +1281,13 @@ main (int argc, char **argv)
- 
-   memset(si, 0, sizeof(*si));
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+  memset(ptr_osi, 0, sizeof(*ptr_osi));
-+  memset(ptr_smi, 0, sizeof(*ptr_smi));
-+  si->scf_si = ptr_osi;
-+  si->scf_si->scdata = ptr_smi;
-+#endif /* HAVE_SCF_SMARTCARD */
-+
- /* Initialize and point si to pw_data i.e. the lock dialog struct */
-   memset(ptr_mygtkpwd, 0, sizeof(*ptr_mygtkpwd));
-   si->pw_data = ptr_mygtkpwd;
-@@ -1318,6 +1346,12 @@ main (int argc, char **argv)
-                              False);
- 
-   initialize_stderr (si);
-+
-+
-+#ifdef HAVE_SCF_SMARTCARD
-+  init_scf_handler(si);
-+#endif
-+
-   handle_signals (si);
- 
-   make_splash_dialog (si);
-@@ -1816,6 +1850,14 @@ handle_clientmessage (saver_info *si, XE
-             }
- 	}
-     }
-+#ifdef HAVE_SCF_SMARTCARD
-+  else if (type == XA_SMARTCARD)
-+    {
-+   	handle_scf_event (si);
-+   	return False;
-+    }
-+#endif /*HAVE_SCF_SMARTCARD*/
-+
-   else
-     {
-       char buf [1024];
-diff -urp -x '*~' driver/xscreensaver.h driver/xscreensaver.h
---- driver/xscreensaver.h	2006-05-10 08:48:35.728700000 -0700
-+++ driver/xscreensaver.h	2006-05-10 08:48:40.873132000 -0700
-@@ -20,6 +20,11 @@
- #include <string.h>
- #include <stdio.h>
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+#include <smartcard/scf.h>
-+#include "scf-smartcard.h"
-+#endif
-+
- #include "prefs.h"
- 
- extern char *progname;
-@@ -183,9 +188,14 @@ struct saver_info {
- 
-   XtIntervalId stderr_popup_timer;
- 
-+  /* =======================================================================
-+     SCF properties to support smart card use
-+     ======================================================================= */
-+#ifdef HAVE_SCF_SMARTCARD
-+  scf_saver_info *scf_si;
-+#endif /* HAVE_SCF_SMARTCARD */
- };
- 
--
- /* This structure holds all the data that applies to the screen-specific parts
-    of the display connection; if the display has multiple screens, there will
-    be one of these for each screen.
-@@ -335,6 +345,10 @@
-                             int to_screen_no);
- extern int mouse_screen (saver_info *si);
- 
-+#ifdef HAVE_SCF_SMARTCARD
-+extern Bool display_message (saver_info *si);
-+#endif /* HAVE_SCF_SMARTCARD */
-+
- /* =======================================================================
-    For lock.c
-    ======================================================================= */
-@@ -509,9 +524,28 @@ extern Bool display_is_on_console_p (sav
- extern Visual *get_best_gl_visual (saver_screen_info *ssi);
- extern void check_for_leaks (const char *where);
- 
-+/* ========================================================================
-+   functions exported from scf-smartcard.c
-+   ======================================================================== */
-+#ifdef HAVE_SCF_SMARTCARD
-+extern void scf_set_locked_p (saver_info *si, Bool locked_p);
-+extern enum passwd_state scf_passwd_valid_p (saver_info *si, char *typed_passwd);
-+extern Bool check_smartcard_dialog (saver_info *si);
-+extern char ** get_scf_message (saver_info *);
-+extern void init_scf_properties (saver_info *si);
-+extern void init_scf_handler (saver_info *si);
-+extern void handle_scf_event (saver_info *si);
-+extern char * scf_set_passwd_label (saver_info *si);
-+extern Bool has_smartcard_event_occurred (void);
-+extern void set_smartcard_event_occurred (Bool);
-+#endif /* HAVE_SCF_SMARTCARD */
-+
- extern Atom XA_VROOT, XA_XSETROOT_ID, XA_ESETROOT_PMAP_ID, XA_XROOTPMAP_ID;
- extern Atom XA_SCREENSAVER, XA_SCREENSAVER_VERSION, XA_SCREENSAVER_ID;
- extern Atom XA_SCREENSAVER_STATUS, XA_LOCK, XA_BLANK;
- extern Atom XA_DEMO, XA_PREFS;
-+#ifdef HAVE_SCF_SMARTCARD
-+extern Atom XA_SMARTCARD;
-+#endif /*HAVE_SCF_SMARTCARD*/
- 
- #endif /* __XSCREENSAVER_H__ */
--- a/open-src/app/xscreensaver/solaris-paths.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/solaris-paths.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -30,83 +30,74 @@
 
 Various fixes to deal with where we install things on Solaris:
 
-- Allow variables passed in from Makefile to override the values configure 
-  tries to determine for GNOME_DATADIR & GLADE_DATADIR, since we install 
-  in a different place for historical reasons.
-
 - Only run hacks from the hacks dir, not $PATH
 
-- Find xscreensaver-gl-helper even though it's not in $PATH
+- Find helper programs even though they are not in $PATH
+
+- Show author names when reading RSS feeds from sites like blogs.sun.com
 
-diff -urp -x '*~' configure.in configure.in
---- configure.in	2006-05-10 08:48:12.212319000 -0700
-+++ configure.in	2006-05-10 08:48:17.091582000 -0700
-@@ -2108,7 +2108,9 @@ if test "$with_gtk" = yes; then
-                    $ac_gnome_config_libs)
-   fi
- 
--
-+#--- Begin SUNW addition
-+ if test -z "$GNOME_DATADIR" ; then
-+#--- End SUNW addition
-   GNOME_DATADIR=""
-   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
-     if test -n "$pkg_config"; then
-@@ -2122,6 +2124,9 @@ if test "$with_gtk" = yes; then
-     fi
-     GNOME_DATADIR="$GNOME_DATADIR/share"
-   fi
-+#--- Begin SUNW addition
-+ fi
-+#--- End SUNW addition
+diff -urp -x '*~' driver/Makefile.in driver/Makefile.in
+--- driver/Makefile.in	2006-05-23 16:01:35.000000000 -0700
++++ driver/Makefile.in	2006-08-09 15:42:26.024807000 -0700
+@@ -26,7 +26,7 @@ INTLTOOL_MERGE	= @INTLTOOL_MERGE@
+ GTK_DATADIR	= @GTK_DATADIR@
+ GTK_APPDIR	= $(GTK_DATADIR)/applications
+ GTK_ICONDIR	= $(GTK_DATADIR)/pixmaps
+-GTK_GLADEDIR	= $(GTK_DATADIR)/xscreensaver/glade
++GTK_GLADEDIR	= $(prefix)/lib/xscreensaver/config
+ HACK_CONF_DIR	= @HACK_CONF_DIR@
  
-   # .desktop files go in different places in Gnome 1.x and Gnome 2.x...
-   if test "$have_gtk2" = yes; then
-@@ -3342,6 +3347,10 @@ fi
- # "/usr/X11R6/share/pixmaps/", which is wrong.  It needs to be the
- # Gnome/Gtk prefix, not the overall prefix.
- #
-+
-+#--- Begin SUNW addition
-+if test -z "$GLADE_DATADIR" ; then
-+#--- End SUNW addition
- if test -n "$GNOME_DATADIR" ; then
-   GLADE_DATADIR='$(GNOME_DATADIR)/xscreensaver'
- elif test "$have_gtk" = yes; then
-@@ -3358,6 +3367,9 @@ elif test "$have_gtk" = yes; then
- else
-   GLADE_DATADIR=''
- fi
-+#--- Begin SUNW addition
-+fi
-+#--- End SUNW addition
+ CC		= @CC@
+@@ -35,8 +35,11 @@ CFLAGS		= @CFLAGS@
+ LDFLAGS		= @LDFLAGS@
+ DEFS		= @DEFS@
+ INTL_DEFS	= -DLOCALEDIR=\"$(localedir)\"
+-SUBP_DEFS	= $(DEFS) -DDEFAULT_PATH_PREFIX='"@HACKDIR@"'
+-GTK_DEFS	= $(DEFS) -DDEFAULT_ICONDIR='"$(GTK_GLADEDIR)"'
++SUBP_DEFS	= $(DEFS) -DHACK_PATH='"@HACKDIR@"' \
++	-DDEFAULT_PATH_PREFIX='"@HACKDIR@:$(libexecdir)"' \
++	-DHELPER_PATH='"$(libexecdir)"'
++GTK_DEFS	= $(DEFS) -DDEFAULT_ICONDIR='"$(GTK_GLADEDIR)"' \
++			-DBINDIR='"$(bindir)"'
+ CONF_DEFS	= -DHACK_CONFIGURATION_PATH='"$(HACK_CONF_DIR)"'
  
- 
- # canonicalize slashes.
+ LIBS		= @LIBS@
+diff -urp -x '*~' driver/XScreenSaver.ad.in driver/XScreenSaver.ad.in
+--- driver/XScreenSaver.ad.in	2006-08-09 15:42:21.902455000 -0700
++++ driver/XScreenSaver.ad.in	2006-08-09 15:44:48.663894000 -0700
+@@ -96,7 +96,7 @@ GetViewPortIsFullOfLies: False
+ !
+ @GNOME24@*loadURL: gnome-open '%s'
+ @GNOME24@*manualCommand: gnome-terminal --title '%s manual' \
+-@GNOME24@		--command '/bin/sh -c "man %s; read foo"'
++@GNOME24@		--command '/bin/sh -c "man -M /usr/X11/man %s; read foo"'
+ !
+ !   Gnome 2.2:
+ !
 diff -urp -x '*~' driver/demo-Gtk.c driver/demo-Gtk.c
---- driver/demo-Gtk.c	2002-06-05 23:00:38.000000000 -0700
-+++ driver/demo-Gtk.c	2006-05-10 08:48:17.094156000 -0700
-@@ -770,7 +770,7 @@ restart_menu_cb (GtkWidget *widget, gpoi
+--- driver/demo-Gtk.c	2006-05-23 15:02:44.000000000 -0700
++++ driver/demo-Gtk.c	2006-08-09 15:42:26.027370000 -0700
+@@ -924,7 +924,7 @@ restart_menu_cb (GtkWidget *widget, gpoi
    flush_dialog_changes_and_save (s);
    xscreensaver_command (GDK_DISPLAY(), XA_EXIT, 0, False, NULL);
    sleep (1);
--  system ("xscreensaver -nosplash &");
-+  system ("/usr/openwin/bin/xscreensaver -nosplash &");
+-  if (system ("xscreensaver -nosplash &") < 0)
++  if (system (BINDIR "/xscreensaver -nosplash &") < 0)
+     fprintf (stderr, "%s: fork error\n", blurb());
  
    await_xscreensaver (s);
- }
-@@ -3940,7 +3940,7 @@ main (int argc, char **argv)
+@@ -4745,7 +4745,7 @@ main (int argc, char **argv)
  
        if (init_results == 1)
  	{
 -	  system ("xscreensaver -nosplash &");
-+	  system ("/usr/openwin/bin/xscreensaver -nosplash &");
++	  system (BINDIR "/xscreensaver -nosplash &");
  	  return 0;
  	}
  
 diff -urp -x '*~' driver/subprocs.c driver/subprocs.c
---- driver/subprocs.c	2002-03-05 18:10:17.000000000 -0800
-+++ driver/subprocs.c	2006-05-10 08:48:17.092506000 -0700
+--- driver/subprocs.c	2006-03-07 21:52:23.000000000 -0800
++++ driver/subprocs.c	2006-08-09 15:42:26.052932000 -0700
 @@ -14,6 +14,7 @@
  # include "config.h"
  #endif
@@ -115,7 +106,7 @@
  #include <ctype.h>
  #include <stdio.h>
  #include <string.h>
-@@ -605,6 +606,8 @@ print_path_error (const char *program)
+@@ -775,6 +776,8 @@ print_path_error (const char *program)
    free (cmd);
    perror (buf);
  
@@ -124,7 +115,7 @@
    if (errno == ENOENT &&
        (token = getenv("PATH")))
      {
-@@ -634,6 +637,7 @@ print_path_error (const char *program)
+@@ -805,6 +808,7 @@ print_path_error (const char *program)
          }
        fprintf (stderr, "\n");
      }
@@ -132,63 +123,42 @@
  }
  
  
-@@ -661,6 +665,11 @@ spawn_screenhack_1 (saver_screen_info *s
-           /* No hacks at all */
-           new_hack = -1;
-         }
-+      else if (p->screenhacks_count == 1)
-+        {
-+          /* Exactly one hack in the list */
-+          new_hack = 0;
-+        }
-       else if (si->selection_mode == -1)
-         {
-           /* Select the next hack, wrapping. */
-@@ -755,20 +764,34 @@ spawn_screenhack_1 (saver_screen_info *s
- 	  saver_exit (si, 1, 0);
+@@ -867,6 +871,8 @@ spawn_screenhack_1 (saver_screen_info *s
+ {
+   saver_info *si = ssi->global;
+   saver_preferences *p = &si->prefs;
++  char* complete_hack_command;
++  
+   raise_window (si, first_time_p, True, False);
+   XFlush (si->dpy);
+ 
+@@ -985,7 +991,17 @@ spawn_screenhack_1 (saver_screen_info *s
+       if (si->selection_mode < 0)
+ 	si->selection_mode = 0;
  
- 	case 0:
-+	 {
-+          /* We need complete path to hack command else any executable
-+           * with the same name in the path gets executed...and we should
-+           * really be using DEFAULT_PATH_PREFIX for the path where hacks are.
-+           */
-+	  char* complete_hack_command = malloc (strlen(hack->command) +
-+		      strlen ("/usr/openwin/lib/xscreensaver/hacks") + 10); 
-+
- 	  close (ConnectionNumber (si->dpy));	/* close display fd */
- 	  limit_subproc_memory (p->inferior_memory_limit, p->verbose_p);
- 	  hack_subproc_environment (ssi);	/* set $DISPLAY */
-+	  sprintf(complete_hack_command,
-+			"/usr/openwin/lib/xscreensaver/hacks/%s",
-+			hack->command);
- 
-           if (p->verbose_p)
-             fprintf (stderr, "%s: %d: spawning \"%s\" in pid %lu.\n",
-                      blurb(), ssi->number, hack->command,
-                      (unsigned long) getpid ());
- 
--	  exec_command (p->shell, hack->command, p->nice_inferior);
-+	  exec_command (p->shell, complete_hack_command, p->nice_inferior);
-+
-           /* If that returned, we were unable to exec the subprocess. */
--          print_path_error (hack->command);
-+          print_path_error (complete_hack_command);
-+	  free (complete_hack_command);
-           exit (1);  /* exits child fork */
- 	  break;
-+         }
- 
- 	default:
- 	  ssi->pid = forked;
-@@ -778,10 +801,41 @@ spawn_screenhack_1 (saver_screen_info *s
+-      forked = fork_and_exec (ssi, hack->command);
++      
++      /* We need complete path to hack command else any executable
++       * with the same name in the path gets executed.
++       */
++      complete_hack_command = malloc (10 + strlen(hack->command) +
++					      strlen (HACK_PATH)); 
++      sprintf(complete_hack_command, HACK_PATH"/%s", hack->command);
++      
++      
++      forked = fork_and_exec (ssi, complete_hack_command);
++      free (complete_hack_command);
+       switch ((int) forked)
+ 	{
+ 	case -1: /* fork failed */
+@@ -1003,10 +1019,41 @@ spawn_screenhack_1 (saver_screen_info *s
      }
  }
  
 +Bool
 +check_if_hacks_dir_exists(void)
 +{
-+  const char hackdir[] = "/usr/openwin/lib/xscreensaver/hacks";
++  const char hackdir[] = HACK_PATH;
 +
 +  int status;
 +  struct stat st;
@@ -223,12 +193,53 @@
    if (monitor_powered_on_p (si))
      {
        int i;
-@@ -947,7 +1001,7 @@ get_best_gl_visual (saver_screen_info *s
+@@ -1186,7 +1233,7 @@ get_best_gl_visual (saver_screen_info *s
    char *av[10];
    int ac = 0;
  
 -  av[ac++] = "xscreensaver-gl-helper";
-+  av[ac++] = "/usr/openwin/lib/xscreensaver/bin/xscreensaver-gl-helper";
++  av[ac++] = HELPER_PATH "/xscreensaver-gl-helper";
    av[ac] = 0;
  
    if (pipe (fds))
+diff -urp -x '*~' driver/xscreensaver-text driver/xscreensaver-text
+--- driver/xscreensaver-text	2006-04-14 19:29:49.000000000 -0700
++++ driver/xscreensaver-text	2006-08-09 15:42:26.053609000 -0700
+@@ -374,6 +374,10 @@ sub output() {
+       system ("cat", "/etc/redhat-release");
+     }
+ 
++    if (-f "/etc/release") {	    	    # "Solaris 10 3/05 s10_74L2a X86"
++      safe_system ("head", "-1", "/etc/release");
++    }
++
+     if (-f "/usr/sbin/system_profiler") {   # "Mac OS X 10.4.5 (8H14)"
+       my $sp =				    # "iMac G5"
+         `/usr/sbin/system_profiler SPSoftwareDataType SPHardwareDataType`;
+@@ -660,12 +664,15 @@ sub reformat_rss($) {
+     $i++;
+ 
+     my ($title, $body1, $body2, $body3);
++    my $author;
+     
+     $title = $3 if (m@<((TITLE)       [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
+     $body1 = $3 if (m@<((DESCRIPTION) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
+     $body2 = $3 if (m@<((CONTENT)     [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
+     $body3 = $3 if (m@<((SUMMARY)     [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
+ 
++    $author = $3 if (m@<((DC:CREATOR) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
++
+     # If there are both <description> and <content> or <content:encoded>,
+     # use whichever one contains more text.
+     #
+@@ -689,8 +696,9 @@ sub reformat_rss($) {
+ 
+     $title = rss_field_to_html ($title || '');
+     $body1 = rss_field_to_html ($body1 || '');
++    $author = rss_field_to_html ($author || '');
+ 
+-    reformat_html ("$title<P>$body1", 1);
++    reformat_html ("$title<BR>$author<P>$body1", 1);
+     print "\n";
+   }
+ }
--- a/open-src/app/xscreensaver/solaris-suncc-fixes.patch	Mon Aug 07 13:49:43 2006 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
- *
- */
-
-Patches to fix build problems on Solaris using Sun Studio compilers.
-These were submitted to jwz, who incorporated them into xscreensaver 4.11,
-so are not needed once we upgrade to 4.11 or later.
-
-Fixes:
-
-1. Only add Motif library options to $MOTIF_LIBS, so they're not used if
-   building with gtk instead of Motif
-
-2. Allow configure to detect DPMS on Solaris (Solaris dpms.h requires 
-   <X11/Xmd.h> - current XFree86 dpms.h includes that file directly).
-
-3. Use only pure-integral expressions in switch cases (our language lawyers
-   insist this is required by the C99 standard).
-
-diff -urp -x '*~' configure.in configure.in
---- configure.in	2002-06-11 02:02:00.000000000 -0700
-+++ configure.in	2006-05-10 08:47:54.754406000 -0700
-@@ -585,10 +585,10 @@ AC_DEFUN(AC_X_RANDOM_PATHS,
-       #
-       if test -f /usr/dt/include/Xm/Xm.h ; then
-         X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
--        X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
-+        MOTIF_LIBS="$MOTIF_LIBS -L/usr/dt/lib -R/usr/dt/lib"
- 
-         # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
--        AC_CHECK_LIB(gen, regcmp, [X_LIBS="$X_LIBS -lgen"])
-+        AC_CHECK_LIB(gen, regcmp, [MOTIF_LIBS="$MOTIF_LIBS -lgen"])
-       fi
-     ;;
-   esac])
-@@ -1139,7 +1139,8 @@ if test "$with_dpms" = yes; then
- 
-   # first check for dpms.h
-   AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes],,
--                    [#include <X11/Xlib.h>])
-+                    [#include <X11/Xlib.h>
-+		     #include <X11/Xmd.h>])
- 
-   # if that succeeded, then check for the DPMS code in the libraries
-   if test "$have_dpms" = yes; then
-diff -urp -x '*~' hacks/glx/glsnake.c hacks/glx/glsnake.c
---- hacks/glx/glsnake.c	2002-05-05 03:31:09.000000000 -0700
-+++ hacks/glx/glsnake.c	2006-05-10 08:47:54.755187000 -0700
-@@ -457,15 +457,15 @@ void calc_snake_metrics(glsnake_configur
-     y += GETSCALAR(prev_dest_dir, Y_MASK);
-     z += GETSCALAR(prev_dest_dir, Z_MASK);
- 
--    switch ((int) bp->node[i].dest_angle) {
--      case (int) (ZERO * 90.0):
-+    switch ((int) (bp->node[i].dest_angle / 90.0)) {
-+      case ZERO:
-         dest_dir = -prev_src_dir;
-         break;
--      case (int) (PIN * 90.0):
-+      case PIN:
-         dest_dir = prev_src_dir;
-         break;
--      case (int) (RIGHT * 90.):
--      case (int) (LEFT * 90.0):
-+      case RIGHT:
-+      case LEFT:
-         dest_dir = cross_product(prev_src_dir, prev_dest_dir);
-         if (bp->node[i].dest_angle == (int) (RIGHT * 90.0))
-           dest_dir = -dest_dir;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/app/xscreensaver/starfish.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+ * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
+
+Fix a memory leak and a core dump when resetting the starfish.
+(Submitted upstream to jwz on Aug 9, 2006.)
+
+diff -urp -x '*~' hacks/starfish.c hacks/starfish.c
+--- hacks/starfish.c	2006-03-12 03:04:27.000000000 -0800
++++ hacks/starfish.c	2006-08-09 13:45:20.130609000 -0700
+@@ -345,6 +345,7 @@ reset_starfish (struct state *st)
+       if (st->colors)
+ 	free (st->colors);
+       st->colors = 0;
++      XFreeGC(st->dpy, st->gc);
+     }
+ 
+   st->ncolors = get_integer_resource (st->dpy, "colors", "Colors");
+@@ -479,6 +480,8 @@ starfish_draw (Display *dpy, Window wind
+             s = reset_starfish (st);
+           else
+             s = make_window_starfish (st);
++
++	  st->starfish = s;
+         }
+     }
+ 
--- a/open-src/app/xscreensaver/sun-src/driver/scf-smartcard.c	Mon Aug 07 13:49:43 2006 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2005 +0,0 @@
-/* scf-smartcard.c --- Code to deal with smart card authentication
- *  for  xscreensaver, Copyright (c) 1993-1997, 1998, 2000
- *  Jamie Zawinski <[email protected]>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation.  No representations are made about the suitability of this
- * software for any purpose.  It is provided "as is" without express or 
- * implied warranty.
- *
- *
- * written by Padraig O'Briain ([email protected]) 
- *
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#ifndef NO_LOCKING  /* whole file */
-
-#include <thread.h>
-#include <signal.h>
-#include <security/pam_appl.h>
-#include <pwd.h>
-#include <ctype.h>
-
-#include <X11/Intrinsic.h>
-
-#include "xscreensaver.h"
-#include "resources.h"
-#include "scf-smartcard.h"
-
-#define CF_FILE_PATH	"/etc/smartcard/desktop.properties"
-#define BUF_LEN		256
-#define SEPARATOR	" \t\n"
-
-struct pam_data {
-  const char *user;
-  const char *typed_passwd;
-  Bool verbose_p;
-};
-
-extern  Bool Ignore_SmartCard;
-extern  scf_saver_info the_scf_si;
-extern  smartcard_info the_smi;
-extern  void destroy_passwd_window (saver_info *si);
-
-static int SmartCardGetProperty(FILE *fp, char *name, char *value, int max_value_len);
-static void * smartcard_authenticate (void *);
-static void set_smartcard_lock_state (saver_info *);
-static int run_PAMsession (char *, saver_info*);
-static int conversation_function (int, struct pam_message**,
-        struct pam_response **, void *);
-static void block_signals (void);
-
-static char * get_username(void);
-static Bool is_valid_unlock_user(char *);
-static void wait_for_got_message (saver_info *si);
-static char * get_smartcard_username (saver_info *si);
-static void 
-scfevent_handler (SCF_Event_t event,SCF_Terminal_t eventTerminal, void *data);
-static void card_removal_timeout (XtPointer, XtIntervalId *);
-static void start_wait_removal_timer (saver_info *);
-static void card_removal_logout_wait (XtPointer, XtIntervalId *);
-static void force_exit (saver_info *si);
-
-static void dont_block_for_pam (XtPointer ptr, XtIntervalId *invId);
-static XtIntervalId card_removal_logout_wait_id;
-static XtIntervalId card_removal_timeout_id;
-
-static void report_smartcard_init_error (saver_info*, char*, uint32_t);
-static void report_smartcard_error (char*, uint32_t);
-
-
-static struct pam_message safe_pam_message;
-static struct pam_message *saved_pam_message = &safe_pam_message;
-
-static Bool b_PAM_prompted;
-static Bool b_first_prompt;
-static thread_t pam_thread = (thread_t) NULL;
-
-static cond_t c_got_response = DEFAULTCV;
-static mutex_t m_got_response;
-static Bool b_got_response = False;
-
-static cond_t c_validated_response = DEFAULTCV;
-static mutex_t m_validated_response;
-static Bool b_validated_response = False;
-
-static cond_t c_got_username = DEFAULTCV;
-static mutex_t m_got_username;
-static Bool b_got_username = False;
-
-static cond_t c_got_message = DEFAULTCV;
-static mutex_t m_got_message;
-static Bool b_got_message = False;
-
-static cond_t c_event_processed = DEFAULTCV;
-static mutex_t m_event_processed = DEFAULTMUTEX;
-static Bool b_event_processed = True;
-
-static Bool  b_validation_succeeded;
-static Bool b_validation_finished;
-static Bool b_got_PAM_message;
-
-static char *saved_user_input = NULL;
-
-static Bool b_card_event_occurred = False;
-static XtSignalId sigusr2_id;
-static thread_t main_thread;
-static void sigusr2_handler(void);
-static void sigusr2_callback (XtPointer client_data, XtSignalId *id);
-static void synthetic_event_callback (XtPointer, XtIntervalId *);
-
-/*
- * This function is called when set_locked_p() is called, i.e when the
- * screen is being locked or unlocked. If the screen is being unlocked 
- * nothing is done. If the screen is being locked the authentication
- * thread is created if it does not already exist.
- */
-void scf_set_locked_p (saver_info *si, Bool locked_p)
-{
-  if ((si->scf_si) && (si->scf_si->use_smartcard))
-  {
-   if (locked_p)
-    {
-      /*
-       * Check that we have the name of the user for unlocking;
-       * otherwise do not lock
-       */
-      if (!get_username())
-      {
-        fprintf (real_stderr, 
-                 "%s: Unable to get username for authentication.\n", 
-                 blurb());
-        return;
-      }
-      /* 
-       * When locking the screen we create the Authentication thread
-       * if it does not already exist
-       */ 
-     if (!pam_thread)
-      {
-        int b_created_auth_thread = 1;
-        set_smartcard_lock_state(si);
-
-        thr_setconcurrency (5);
-        if (thr_create (NULL, 0, smartcard_authenticate, (void *) si, 
-          THR_BOUND | THR_NEW_LWP | THR_DETACHED, &pam_thread) != 0)
-        {
-          b_created_auth_thread = 0;
-        }
-        if (!b_created_auth_thread)
-        {
-          /*
-           * Unable to create a thread so output an error
-           * and do not lock
-           */
-          fprintf (real_stderr, 
-                 "%s: Unable to create a thread for authentication.\n", 
-                 blurb());
-          return;
-        }
-      }
-    }
-    else
-    {
-     if (si->prefs.verbose_p)
-      fprintf(stderr,"in else of locked_p i.e. screen not already locked\n");
-
-      pam_thread = (thread_t) NULL;
-      /*
-       * The screen is being unlocked so update the state
-       */
-      si->scf_si->scdata->state = SCD_AUTH_CARD_PRESENT;
-      if (si->scf_si->scdata->wait_removal_logout_timer)
-      {
-        if (card_removal_logout_wait_id != (XtIntervalId) 0)
-              XtRemoveTimeOut (card_removal_logout_wait_id);
-        si->scf_si->scdata->wait_removal_logout_timer = 1;
-      }
-    }
-  }
-}
-
-/*
- * This function is called in handle_passwd_key() to do SCF specific
- * processing of the data entred by the user.
- */ 
-enum passwd_state 
-scf_passwd_valid_p (saver_info *si, char *typed_passwd)
-{
-  saver_preferences *p = &si->prefs;
-  enum passwd_state return_state;
-
-/*mali  if (si->scf_si->use_smartcard)***/
-  if (0)
-  {
-    /*
-     * When using smart card the user name is determined from the card
-     * so there is no need to call PAM with a different user if the 
-     * validation failed.
-     * When using smart card more than one item of data may be 
-     * prompted for to complete the validation.
-     */
-    saved_user_input = typed_passwd;
-    mutex_lock (&m_got_response);
-    b_got_response = True;
-    b_validated_response = False;
-    b_validation_finished = False;
-    cond_signal (&c_got_response);
-    mutex_unlock (&m_got_response);
-    /*
-     * We now wait for the validation to complete
-     */
-/**mali
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> scf_passwd_valid_p use_smartcard is True\n");
-  XtAppAddTimeOut (si->app,
-                   1000,
-                   dont_block_for_pam, (XtPointer) si);
-    mutex_lock (&m_validated_response);
-    while (b_validated_response == False)
-      cond_wait (&c_validated_response, &m_validated_response);
-    mutex_unlock (&m_validated_response);
-****/
-
-    if ((!b_validation_finished) || (!b_validation_succeeded))
-    {
-      if (!b_validation_finished)
-      {
-        return_state = pw_another;
-      }
-      else
-      {
-        return_state = pw_fail;
-        /*
-         * PAM will be called again so tell the thread that we have
-         * user to authenticate
-         */
-        mutex_lock (&m_got_username); 
-        b_validation_finished = False;
-        b_got_username = True;
-        cond_signal (&c_got_username);
-        mutex_unlock (&m_got_username);
-      }
-      /*
-       * We wait for PAM to generate the next prompt before
-       * continuing
-       */
-      wait_for_got_message(si);
-    }
-    else
-    {
-      return_state = pw_ok;
-    } 
-  }
-  else {
-   if (si->prefs.verbose_p)
-   {
-     fprintf (stderr, "---> scf_passwd_valid_p calling passwd_valid_p\n");
-   }
-   if (passwd_valid_p ())
-      return (pw_ok);
-    else
-      return (pw_fail);
-  }
-  return return_state;
-}
-
-/*
- * This function checks what type of dialog should be displayed
- * based on the card state.
- */
-Bool 
-check_smartcard_dialog (saver_info *si)
-{
-  /*
-   * ret_val == False means display authentication dialog
-   * ret_val == True means display message 
-   */
-  Bool ret_val = False;
-
-  if (si->prefs.verbose_p)
-   {
-     fprintf (stderr, "---> check_smartcard_dialog()\n");
-     fprintf (stderr, "use_smartcard=%d state=%d\n", si->scf_si->use_smartcard, si->scf_si->scdata->state);
-   }
-
-  if (si->scf_si->use_smartcard)
-  {
-    switch (si->scf_si->scdata->state)
-    {
-      /* if card is present dont put any message on screen **/
-      case SCD_AUTH_CARD_PRESENT:
-	ret_val = False;
-	break;
-
-      case SCD_WAIT_FOR_CARD:
-      case SCD_WAIT_REMOVAL_LOGOUT_WAIT:
-      case SCD_NO_USER:
-      case SCD_WRONG_USER:
-        ret_val = True;
-        break;
-
-      case SCD_AUTH_REQUIRED:
-      {
-        char *sm_user;
-
-        sm_user = get_smartcard_username(si); 
-
-        /* if ((sm_user) && is_valid_unlock_user (sm_user)) */
-        if ((sm_user))
-        {
-          /*
-           * Tell the authentication thread to continue as we now have a 
-           * valid user name to authenticate
-           */
-	if (si->prefs.verbose_p)
-         fprintf (stderr, "---> got valid user continue to authenticate!!!\n");
-
-          mutex_lock (&m_got_username);
-          b_got_username = True;
-          cond_signal (&c_got_username);
-          mutex_unlock (&m_got_username);
-
-          si->scf_si->scdata->state = SCD_AUTH_IN_PROGRESS;
-
-          /*
-           * Wait for PAM to prompt
-           */
-
-          wait_for_got_message (si);
-
-          if (!b_got_PAM_message)
-          {
-            /*
-             * The PAM conversation function was not called, probably because
-             * the card was removed very quickly
-             */
-/*mali no need for this..causing AUTH_REQUIRED message to pop up..
-	    if (si->prefs.verbose_p)
-               fprintf (stderr, "---> setting SCD_AUTH_REQUIRED!!!\n");
-            si->scf_si->scdata->state = SCD_AUTH_REQUIRED;
-****/
-          si->scf_si->scdata->state = SCD_AUTH_IN_PROGRESS;
-            ret_val = False;
-          }
-        }
-        else
-        {
-          si->scf_si->scdata->state = (sm_user) ? SCD_WRONG_USER : SCD_NO_USER;
-	  if (si->prefs.verbose_p)
-            fprintf (stderr, "in else state=%d\n", si->scf_si->scdata->state);
-          ret_val = True;
-        }
-        break;
-      } 
-      default:
-        break;
-    }      
-  }
-  if (si->prefs.verbose_p)
-   {
-    fprintf (stderr, "<--- check_smartcard_dialog ret_val=%d state=%d\n", 
-				     ret_val, si->scf_si->scdata->state);
-   }
-  return ret_val;
-}
-
-/*
- * This function returns the message which should be displayed to the user
- * for the smart card state in an array of character strings, each one
- * corresponding to one line.
- */
-char **
-get_scf_message (saver_info *si)
-{
-  char *msg, *lockmsg;
-  char *puser;
-
-  if (si->prefs.verbose_p)
-    fprintf (stderr, "---> get_scf_message()\n");
-
-  /*si->scf_si->scdata->message_timeout = si->prefs.passwd_timeout;**/
-  si->scf_si->scdata->message_timeout = 10000;
-  puser = get_username ();
-  if (!puser) puser = "";
-
-  if (si->prefs.verbose_p)
-   {
-    fprintf(stderr, "*********SMARTCARD PROPS ***********\n");
-    fprintf(stderr, "\t--> username=%s \n", puser);
-    fprintf(stderr,"\t\tmsg timeout=%d\n",si->scf_si->scdata->message_timeout);
-    fprintf(stderr,"\t\t STATE=%d\n",si->scf_si->scdata->state);
-    fprintf(stderr,"\t\tlogoutWait=%d\n",si->scf_si->card_removal_logout_wait);
-    fprintf(stderr, "************************************\n");
-   }
-
-
-/***mali we are getting timeout=60000 which is too long*/ 
-/* This is set from message_timeout = si->prefs.passwd_timeout
-   which is usually in minutes hence it is too long setting it 10 secs
-   No...people filed bug against this 4771114 so not resetting it to 10sec
-  si->scf_si->scdata->message_timeout = 10000;
-*******/
-
-  switch (si->scf_si->scdata->state) {
-
-    case SCD_WAIT_FOR_CARD:
-      /* If ignore card removal is True then no need to display logout msg */
-      if (si->scf_si->reauth_after_card_removal)
-       {
-      	msg = get_string_resource ("message.SCF.waitforcard", 
-					"Dialog.Label.Label");
-      	if (msg == NULL)
-		msg = strdup ("Please insert your smartcard..");
-        si->scf_si->scdata->message_timeout = si->scf_si->reauth_timeout; 
-        /*mali si->scf_si->reauth_timeout; use this instead of 10000 */
-        /*si->scf_si->scdata->message_timeout = si->scf_si->reauth_timeout;*/
-        lockmsg = (char *) malloc (strlen (msg) + strlen (puser) +1);
-        sprintf (lockmsg, msg, puser);
-       }
-      else /* ignore_card_removal is False, we tell user he will be logged out*/
-       {
-        msg = get_string_resource ("message.SCF.waitremovallogoutwait", 
-                                   "Dialog.Label.Label");
-        if (msg == NULL)
-	    msg = strdup ("Waiting to Log you out...in %d secs. Locked by user %s");
-        lockmsg = (char *) malloc (strlen (msg) + 10 /* for integer */ + 
-               				+ strlen (puser) + 1);
-        si->scf_si->scdata->message_timeout = 
-			si->scf_si->card_removal_logout_wait * 1000;
-        sprintf (lockmsg, msg, si->scf_si->card_removal_logout_wait/1000, puser);
-       }
-      break;
-
-    case SCD_WAIT_REMOVAL_LOGOUT_WAIT:
-      msg = get_string_resource ("message.SCF.waitremovallogoutwait", 
-           "Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup ("Waiting to Log you out...");
-
-      si->scf_si->scdata->message_timeout = 
-				si->scf_si->card_removal_logout_wait * 1000;
-/*mali too long		si->scf_si->card_removal_logout_wait * 1000;
-***/
-      lockmsg = (char *) malloc (strlen (msg) + 10 /* for integer */ + 
-               + strlen (puser) + 1);
-      sprintf (lockmsg, msg, si->scf_si->card_removal_logout_wait/1000, puser);
-      break;
-
-    case SCD_AUTH_REQUIRED:
-      msg = get_string_resource ("message.SCF.authrequired", 
-                "Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup ("Authorization is required...");
-      lockmsg = (char *) malloc (strlen (msg) + strlen (puser) +1);
-      sprintf (lockmsg, msg, puser);
-      break;
-
-    case SCD_WRONG_USER:
-      msg = get_string_resource ("message.SCF.wronguser", 
-                "Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup ("You are the wrong user system already locked by another user...");
-      lockmsg = (char *) malloc (strlen (msg) + strlen (puser) +1);
-      sprintf (lockmsg, msg, puser);
-      break;
-
-   case SCD_NO_USER:
-      msg = get_string_resource ("message.SCF.nouser", "Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup ("No such user found...");
-      lockmsg = (char *) malloc (strlen (msg) + strlen (puser) +1);
-      sprintf (lockmsg, msg, puser);
-      break;
-
-/*mali all cases added*/
-   case SCD_AUTH_CARD_PRESENT:
-      msg = get_string_resource ("message.SCF.authcardpresent", 
-				     "Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup ("Could not get message string for SCD_AUTH_CARD_PRESENT");
-      lockmsg = (char *) malloc (strlen (msg) + strlen (puser) +1);
-      sprintf (lockmsg, msg, puser);
-      break;
-
-   case SCD_WAIT_REMOVAL_TIMEOUT:
-      msg = get_string_resource ("message.SCF.waitremovaltimeout", 
-					"Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup 
-		("Could not get message string for SCD_WAIT_REMOVAL_TIMEOUT");
-      lockmsg = (char *) malloc (strlen (msg) + strlen (puser) +1);
-      sprintf (lockmsg, msg, puser);
-      break;
-
-   case SCD_CARD_REMOVAL_IGNORED:
-      msg = get_string_resource ("message.SCF.cardremovalignored", 
-					"Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup 
-		("Could not get message string for SCD_CARD_REMOVAL_IGNORED");
-      lockmsg = (char *) malloc (strlen (msg) + strlen (puser) +1);
-      sprintf (lockmsg, msg, puser);
-      break;
-
-   case SCD_ANY_CARD_PRESENT:
-      msg = get_string_resource ("message.SCF.anycardpresent", 
-				        "Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup ("Could not get message string for SCD_ANY_CARD_PRESENT");
-      lockmsg = (char *) malloc (strlen (msg) + strlen (puser) +1);
-      sprintf (lockmsg, msg, puser);
-      break;
-
-   case SCD_WAIT_REMOVAL_LOGOUT_EXPIRED:
-      msg = get_string_resource ("message.SCF.waitremovallogoutexpired", 
-				 "Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup 
-	  ("Could not get message string for SCD_WAIT_REMOVAL_LOGUT_EXPIRED");
-      lockmsg = (char *) malloc (strlen (msg) + strlen (puser) +1);
-      sprintf (lockmsg, msg, puser);
-      break;
-
-   case SCD_AUTH_IN_PROGRESS:
-      msg = get_string_resource ("message.SCF.authinprogress", 
-				 "Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup ("Could not get message string for SCD_AUTH_IN_PROGRESS");
-      lockmsg = (char *) malloc (strlen (msg) + strlen (puser) +1);
-      sprintf (lockmsg, msg, puser);
-      break;
-
-   default:
-      msg = get_string_resource ("message.SCF.default", "Dialog.Label.Label");
-      if (msg == NULL)
-	msg = strdup 
-	        ("Could not get message string for default smartcard state");
-      lockmsg = (char *) malloc (strlen (msg) + 10 /* for integer */ + 
-               + strlen (puser) + 1);
-      sprintf (lockmsg, msg, si->scf_si->scdata->state, puser);
-      break;
-  } 
-
-  if (si->prefs.verbose_p)
-   {
-     fprintf(stderr, "\t\tlockmsg is %s \n", lockmsg);
-     fprintf(stderr,"\t\t<--scf_get_message  STATE=%d\n",
-				si->scf_si->scdata->state);
-   }
-
-  free (msg);
-  {
-    /*
-     * Split the string into an array of character strings, one per line
-     */
-    int i = 0;
-    char ** return_array;
-    char * pchar;
-
-    pchar = lockmsg;
-
-    while ((pchar = strchr (pchar, '\n')))
-    {
-      i++;
-      pchar++;
-    }
-
-    return_array = (char **) malloc ((i+1) * sizeof (char *));
-    if (return_array)
-    {
-       i = 0;
-       return_array[i] = lockmsg;
-       pchar = lockmsg;
-
-       while ((pchar = strchr (pchar, '\n')))
-       {
-         *pchar = '\0';
-         return_array[++i] = ++pchar;
-       }
-
-       return_array[++i] = NULL;
-    }
-    return return_array;
-  }
-}
-
-/*************************************<->*************************************
- *
- * SmartCardGetProperty(fp name value max_value_len)
- *
- *
- *  Description:
- *  -----------
- *  Retrieves specified smartcard property value from a file.
- *
- *
- *  Inputs:
- *  ------
- *  fp		  = File handle, in this case : /etc/smartcard/desktop.properties
- *  name	  = Name of the property to retrieve a value for
- *  value	  = Char buffer to store retrieved values into.
- *  max_value_len = Maximum number of bytes to be written to value buffer.
- *
- *
- *  Outputs:
- *  -------
- *  Return = 0 on error or if property (name) not found, 'n' where n is the number
- *      	of bytes written to char buffer "value".
- *
- *
- *  Comments:
- *  --------
- *  This is a replacement for SCF_GetClientProperty() see bugid #4499187.
- *
- *************************************<->***********************************/
-
-static int SmartCardGetProperty(FILE *fp, char *name, char *value, int max_value_len)
-{
-    register int i = 0;
-    char buf[BUF_LEN];
-    char *ptr1, *ptr2, *tmp_buf, *ptr3 = NULL;
-
-    if (fp == NULL)
-	return (0);
- 
-
-    /*
-     * Reset file offset to origin of file
-     * so stuff doesn't get skipped over.
-     */
-    fseek(fp, 0, SEEK_SET);
-
-    while (fgets(buf, BUF_LEN, fp) != NULL) {
-            /* Skip over white space first */
-            ptr3 = buf;
-            i = 0;
-            while (buf[i] && isspace (buf[i])) {
-		i++;
-                    ptr3++;
-		}
-	/* Then get rid of # */
-	for (i = 0; i < strlen(ptr3); i++) {
-            if (ptr3[i] == '#') {
-		ptr3[i] = NULL;
-		break;
-            }
-	}
-
-	/*
-         * then, divide ptr3 by =
-	 * ptr1 points to the top of the left-hand side
-	 * ptr2 points to the top of the right-hand side
-	 */
-	if (ptr3[0] == NULL)
-            continue;
-
-	ptr1 = ptr3;
-	for (i = 0; i < strlen(ptr3); i++) {
-            if (ptr3[i] == '=') {
-		ptr3[i] = NULL;
-		ptr2 = ptr3 + i + 1;
-		break;
-            }
-	}
-        if (*ptr1 == NULL || *ptr2 == NULL)
-            break;
-
-	tmp_buf = strtok(ptr1, SEPARATOR);
-
-	/* more than 1 tokens in the left -> error */
-        if (strtok(NULL, SEPARATOR) != NULL)
-            break;
-
-	if (strcmp(name, tmp_buf) == 0) {
-            /* property name matched. */
-            tmp_buf = strtok(ptr2, SEPARATOR);
-            /* more than 1 tokens in the right -> error */
-            if (strtok(NULL, SEPARATOR) != NULL)
-		break;
-            if (strlcpy(value, tmp_buf, max_value_len) >= max_value_len)
-	     {
-               fprintf(stderr, "Error Not enough space to write smartcard property name=%s value=%s max_val_len=%d tmp_buf=%s\n", name, value, max_value_len, tmp_buf);
-                            return 0;
-	     }
-            return (strlen(value));
-	}
-    }
-/**** if debugging *****
-    fprintf(stderr, "Error fgets failed for property name=%s buf=%s\n", name, buf);
-**/
-    return (0);
-}
-
-
-/*
- * The function must be called while we are still root.
- *
- * It gets the values for SCF properties used when screen locking
- */
-void
-init_scf_properties (saver_info *si)
-{
-  char str_buf[BUF_LEN];
-  int i, rv;
-  FILE *fp = NULL;
-
-#define TYPE_INT 0
-#define TYPE_BOOL 1
-
-  struct ocfProperties {
-    char* name;
-    int type;
-    char ** value;
-  } ;
-
-struct ocfProperties* OcfProperties;
-
-
-/***************************************************************************
-   Solaris 8 and Solaris 9 have different names for these properties
-   We are no longer using SCF_GetClientProperty call instead we have our
-   own function SmartCardGetProperty() which is much more reliable.
-   Hence we need two sets of property names to look for in appropriate files
-   for solaris8 and solaris9
-
-   IMP in future dtsession should be changed to xscreensaver for sol8 props.
-****************************************************************************/
-struct ocfProperties OcfProperties_sol8[] = {
-    "ocf.client.dtsession.root.useSmartCard",		TYPE_BOOL,
-    (char **) &(the_scf_si.use_smartcard),
-    "ocf.client.dtsession.root.cardRemovalTimeout",	TYPE_INT,
-    (char **) &(the_scf_si.card_removal_timeout),
-    "ocf.client.dtsession.root.ignoreCardRemoval",	TYPE_BOOL,
-    (char **) &(the_scf_si.ignore_card_removal),
-    "ocf.client.dtsession.root.reauthAfterCardRemoval",	TYPE_BOOL,
-    (char **) &(the_scf_si.reauth_after_card_removal),
-    "ocf.client.dtsession.root.reauthTimeout",		TYPE_INT,
-    (char **) &(the_scf_si.reauth_timeout),
-    "ocf.client.dtsession.root.cardRemovalLogoutWait",	TYPE_INT,
-    (char **) &(the_scf_si.card_removal_logout_wait),
-    "ocf.client.dtsession.root.firstCardEventTimeout",	TYPE_INT,
-    (char **) &(the_scf_si.first_card_event_timeout),
-  };
-
-struct ocfProperties OcfProperties_sol9[] = {
-    "desktop.useSmartCard",		TYPE_BOOL,
-    (char **) &(the_scf_si.use_smartcard),
-    "desktop.cardRemovalTimeout",	TYPE_INT,
-    (char **) &(the_scf_si.card_removal_timeout),
-    "desktop.ignoreCardRemoval",	TYPE_BOOL,
-    (char **) &(the_scf_si.ignore_card_removal),
-    "desktop.reauthAfterCardRemoval",	TYPE_BOOL,
-    (char **) &(the_scf_si.reauth_after_card_removal),
-    "desktop.reauthTimeout",		TYPE_INT,
-    (char **) &(the_scf_si.reauth_timeout),
-    "desktop.cardRemovalLogoutWait",	TYPE_INT,
-    (char **) &(the_scf_si.card_removal_logout_wait),
-    "desktop.firstCardEventTimeout",	TYPE_INT,
-    (char **) &(the_scf_si.first_card_event_timeout),
-  };
-
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> init_scf_properties()\n");
-
-#define NUM_SCF_PROPERTIES  7
-
-/* Assume Solaris 9 try to open /etc/smartcard/desktop.properties file */
-
-  OcfProperties = OcfProperties_sol9;
-
-  fp = fopen(CF_FILE_PATH, "r");
-  if (fp == NULL)
-   {
-    OcfProperties = OcfProperties_sol8;
-
-  if (si->prefs.verbose_p)
-     {
-      fprintf (stderr,"-->Could not open %s to read ocf props\n",
-					CF_FILE_PATH);
-      fprintf (stderr,"-->Instead Trying to open opencard.properties file.\n");
-     }
-
-    fp = fopen("/etc/smartcard/opencard.properties", "r");
-
-    if (fp == NULL)
-     {
-       fprintf (stderr, "---> Failed to open opencard.properties file!! \n");
-       fprintf (stderr, "---> Failed to open desktop.properties file!! \n");
-       fprintf (stderr, "---> SmartCard is not going to work!! \n");
-     }
-   }
-
-  if (fp != NULL) 
-    {
-      /*
-       * First check the value of "use_smart_card". If this is set to false,
-       * garbage or not specified at all then there's no point in  retrieving
-       * the rest of the smartcard settings
-       */
-      rv = SmartCardGetProperty (fp,OcfProperties[0].name,	
-				            str_buf,sizeof(str_buf));
-
-      if (si->prefs.verbose_p)
-         fprintf (stderr, "---> rv = %d prop=%s value=%s\n\n",
-			rv, OcfProperties[0].name, str_buf);
-      if (rv > 0) 
-	{
-	  if (!strcasecmp (str_buf, "true"))
-	   {
-	    *((Boolean *) OcfProperties[0].value) = 1;
-           }
-	  else 
-	    {
-	      *((Boolean *) OcfProperties[0].value) = 0;
-	      the_scf_si.use_smartcard = 0;
-	      return;
-	    }
-	} 
-      else 
-	{
-	  /*SmartCardGetProperty Failed*/
-	  the_scf_si.use_smartcard = 0;
-	  if (si->prefs.verbose_p)
-	   {
-              fprintf (stderr, "Could not read smartcard vals from /etc/");
-	      fprintf (stderr, "smartcard file using default values!!!\n");
-           }
-          goto FORCEDEFAULT;
-	}
-
-      for (i=1; i < NUM_SCF_PROPERTIES; i++) 
-	{
-	  rv = SmartCardGetProperty (fp, OcfProperties[i].name, str_buf, 
-					sizeof(str_buf));
-
-          if (si->prefs.verbose_p)
-            fprintf (stderr, "---> rv = %d prop=%s value=%s\n",
-			rv, OcfProperties[i].name, str_buf);
-
-	  if (rv > 0) 
-	    {
-	      switch (OcfProperties[i].type) 
-		{
-		case TYPE_INT:
-		  *((int *) OcfProperties[i].value) = atoi (str_buf);
-		  break;
-		case TYPE_BOOL:
-		  if (!strcasecmp (str_buf, "true"))
-                    *((Boolean *) OcfProperties[i].value) = 1;
-		  else
-                    /* If value is false or any non-true value, set to 0 */
-                    *((Boolean *) OcfProperties[i].value) = 0;
-		  break;
-		default:
-          	 if (si->prefs.verbose_p)
-		   fprintf(stderr,"Unknown Type for prop=%s\n",OcfProperties[i].name);
-		
-		}
-	    }
-	  else /* rv == 0 Error */
-	   {
-            if (si->prefs.verbose_p)
-             fprintf (stderr, "---> rv = %d Error Reading prop=%s value=%s\n",
-			rv, OcfProperties[i].name, str_buf);
-
-	    /* Setting negative will be set to default by FORCEDEFAULT */
-	    *((int*)OcfProperties[i].value) = -1;
-	   }
-	     
-	}
-      fclose(fp);
-
-    } /* if fp !=NULL */
-
-  /*
-   * Print Smart Card resource values
-   */
-
- if (si->prefs.verbose_p) 
-  {
-   fprintf(stderr,"\nSmartCard Values from desktop/opencard properties file\n");
-   fprintf(stderr,"\t\tcardRemovalTimout:%d\n",the_scf_si.card_removal_timeout);
-   fprintf(stderr,"\t\tignoreCardRemoval=%d\n",the_scf_si.ignore_card_removal);
-   fprintf(stderr,"\t\treauthAfterCardRmv=%d\n",(Bool)the_scf_si.reauth_after_card_removal);
-   fprintf(stderr,"\t\treauthTimeout=%d\n",the_scf_si.reauth_timeout);
-   fprintf(stderr,"\t\tcardRemovalLogoutWait=%d\n\n",the_scf_si.card_removal_logout_wait);
-  }
-
-
-  /*
-   * Sanity check for Smart Card resource values
-   *
-   * If values are non-zero multiply by 1000 to be ready for use 
-   * in Xlib calls
-   *
-   */
-FORCEDEFAULT:
-  if (!the_scf_si.ignore_card_removal)
-   {
-     Ignore_SmartCard = False;
-     if (si->prefs.verbose_p)
-      fprintf(stderr, "***Setting ignore_smartcard --> False\n");
-   }
-
-  if (the_scf_si.card_removal_timeout < 0)
-    the_scf_si.card_removal_timeout = 0;
-  else
-    the_scf_si.card_removal_timeout *= 1000;
-  if (the_scf_si.reauth_timeout < 0)
-    the_scf_si.reauth_timeout = 0;
-  else
-    the_scf_si.reauth_timeout *= 1000;
-  if (the_scf_si.card_removal_logout_wait <= 0)
-    /* logout wait should be long else it just logs you out*/
-    the_scf_si.card_removal_logout_wait = 1000;/*default*/
-  else 
-    the_scf_si.card_removal_logout_wait *= 1000;
-
-  si->scf_si = &the_scf_si;  /*just to make sure */
-}
-
-/*
- * This function initializes the SCF event handler so that we are informed
- * of events such as card insertion and card removal.
- */
-void
-init_scf_handler (saver_info *si)
-{
-  uint64_t time_since_validated;
-  Bool b_card_present = True;
-  struct sigaction sigact;
-  
-	SCF_Status_t status;
-        SCF_Session_t session;
-        SCF_Terminal_t terminal;
-        SCF_Card_t card;
-        SCF_ListenerHandle_t listenerHandle;
-
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> init_scf_handler()\n");
-
-  if (!si->scf_si->use_smartcard)
-   {
-    if (si->prefs.verbose_p)
-     {
-      fprintf (stderr, "---> returning from init_scf_handler() since use_");
-      fprintf (stderr, "smartcard is false: %d\n", si->scf_si->use_smartcard);
-     }
-    return;
-   }
-
-  main_thread = thr_self();
-  /*
-   * Register the signal callback with Xt and get the signal Id for use in 
-   * the signal handler.
-   */
-  sigusr2_id = XtAppAddSignal (si->app, sigusr2_callback, si);
-  /*
-   * Register a signal handler so that we are informed when a card event 
-   * occurs
-   */
-  sigact.sa_handler = sigusr2_handler;
-  sigfillset(&sigact.sa_mask);
-  sigact.sa_flags = 0;
-  (void)sigaction(SIGUSR2, &sigact, NULL);
-
-  si->scf_si->scdata->session_handle = NULL;
-  si->scf_si->scdata->smartcard_username = (char *)NULL;
-   
-  status = SCF_Session_getSession(&(si->scf_si->scdata->session_handle));
-  if (status != SCF_STATUS_SUCCESS) {
-	report_smartcard_init_error (si, "SCF_Session_getSession",status);
-        return;
-  }
-/* it needs to invoke smartcard GUI to config the smartcard dev first */
-        
-  status = SCF_Session_getTerminal(si->scf_si->scdata->session_handle,
-	NULL, 
-	&(si->scf_si->scdata->terminal_handle));
-  if (status != SCF_STATUS_SUCCESS) {
-	report_smartcard_init_error (si, "SCF_Session_getTerminal",status);
-	SCF_Session_close(si->scf_si->scdata->session_handle);
-	return;
-  }
-
-  status = SCF_Terminal_addEventListener(si->scf_si->scdata->terminal_handle, 
-	(SCF_EVENT_CARDINSERTED | SCF_EVENT_CARDREMOVED),
-	&scfevent_handler,
-	(void *)si, 
-	&si->scf_si->scdata->myListener);
-  if (status != SCF_STATUS_SUCCESS) {
-	report_smartcard_init_error (si,"SCF_Terminal_addEventListener",status);
-	SCF_Session_close(si->scf_si->scdata->session_handle);
-	return;
-  }
-
-
-/*
-	smartcard is used 
-*/
-  si->scf_si->use_smartcard = True;
-  b_card_present = False;
-  time_since_validated = 0;
-  si->scf_si->scdata->state = SCD_WAIT_FOR_CARD;
- 
-        /*
-         * Check that there is a card in the reader
-	 * and validated card ?
-         */
-        
-  status = SCF_Terminal_getCard(si->scf_si->scdata->terminal_handle,
-		&(si->scf_si->scdata->card_handle));
-  if (status == SCF_STATUS_NOCARD ) {
-	return;
-  }
-  else if (status == SCF_STATUS_SUCCESS) 
-  {
-  si->scf_si->scdata->state = SCD_AUTH_CARD_PRESENT;
-  b_card_present = True;
-  get_smartcard_username (si);
-   /*
-   * We reach here if the card was removed or there is an unauthenticated 
-   * card in the reader. The value of b_card_present tells us which one.
-   */
-
-      /*
-       * There is an unauthenticated card in the reader so a card must
-       * have been removed, We set the state accordingly.
-       */
-      if (si->scf_si->ignore_card_removal)
-      {
-        si->scf_si->scdata->state = SCD_CARD_REMOVAL_IGNORED;
-      }
-      else 
-      {
-	if (si->prefs.verbose_p)
-	 {
-	   fprintf(stderr, "init_scf_handler() locking screen and");
-           fprintf(stderr, " setting SCD_CARD_PRESENT\n"); 
-	 }
-        set_locked_p (si, True);
-      }
-  } /* SCF_STATUS_SUCCESS */
-  else {
-	report_smartcard_init_error (si, "SCF_Session_getCard",status);
-	SCF_Session_close(si->scf_si->scdata->session_handle);
-	return;
-  }
-
-}
-
-/*
- * This event takes the appropriate action following a card event, i.e.
- * a card removal or card insertion.
- */
-void
-handle_scf_event (saver_info *si)
-{
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> handle_scf_event() state=%d\n",
-				si->scf_si->scdata->state);
-
-  if (si->scf_si->scdata->state != SCD_WAIT_REMOVAL_LOGOUT_EXPIRED)
-  {
-    /*
-     * Ignore card events when card state is SCD_WAIT_REMOVAL_LOGOUT_EXIRED
-     * as the user should be forced out
-     */
-    if (si->scf_si->scdata->last_event == SCF_EVENT_CARDREMOVED)
-    {
-      /*
-       * The smart card has been removed so clear the cached user name
-       */
-      if (si->scf_si->scdata->smartcard_username)
-      {
-        free (si->scf_si->scdata->smartcard_username);
-        si->scf_si->scdata->smartcard_username = NULL;
-      }
-      switch (si->scf_si->scdata->state)
-      {
-        case SCD_WAIT_FOR_CARD:
-	 if (!si->scf_si->ignore_card_removal)
-	  {
-            card_removal_timeout_id = XtAppAddTimeOut (si->app,
-                                 si->scf_si->card_removal_timeout,
-                                 card_removal_timeout, (XtPointer) si);
-            si->scf_si->scdata->state = SCD_WAIT_FOR_CARD;
-
-	    /*mali added 12.13 to lock if card is removed
-              this introduced the bug 4771083, i.e. we should wait
-	      for card_removal_timeout before locking display, so
-	      moving this call in card_removal_timeout function..
-	    set_locked_p(si, True);
-	    ******************************/
-         
-            idle_timer ((XtPointer) si, 0);
-	  }
-          break;
-        case SCD_AUTH_CARD_PRESENT:
-        case SCD_ANY_CARD_PRESENT:
-          card_removal_timeout_id = XtAppAddTimeOut (si->app,
-                                 si->scf_si->card_removal_timeout,
-                                 card_removal_timeout, (XtPointer) si);
-          si->scf_si->scdata->state = SCD_WAIT_REMOVAL_TIMEOUT;
-          break;
-
-        case SCD_WRONG_USER:
-        case SCD_NO_USER:
-        case SCD_AUTH_IN_PROGRESS:
-        case SCD_AUTH_REQUIRED:
-          card_removal_timeout_id = XtAppAddTimeOut (si->app,
-                                 si->scf_si->card_removal_timeout,
-                                 card_removal_timeout, (XtPointer) si);
-          /*does not work si->scf_si->scdata->state = SCD_WAIT_REMOVAL_TIMEOUT;*/
-          si->scf_si->scdata->state = SCD_WAIT_FOR_CARD;
-          /*
-           * Generate synthetic event so that dialog is displayed
-           */
-          idle_timer ((XtPointer) si, 0);
-          break;
-        default:
-          break;
-      }
-    } 
-    else if (si->scf_si->scdata->last_event == SCF_EVENT_CARDINSERTED)
-    {
-      if (si->scf_si->scdata->state == SCD_WAIT_REMOVAL_TIMEOUT)
-      {
-        XtRemoveTimeOut (card_removal_timeout_id);
-        si->scf_si->scdata->state = SCD_ANY_CARD_PRESENT;
-      }
-      else if (si->scf_si->scdata->state == SCD_CARD_REMOVAL_IGNORED)
-      {
-        si->scf_si->scdata->state = SCD_ANY_CARD_PRESENT;
-      }
-      else
-      {
-        if (si->scf_si->scdata->state == SCD_WAIT_REMOVAL_LOGOUT_WAIT)
-          si->scf_si->scdata->wait_removal_logout_timer = 1;
-        si->scf_si->scdata->state = SCD_AUTH_REQUIRED;
-        /*
-         * Generate synthetic event so that dialog is displayed
-         */
-        idle_timer ((XtPointer) si, 0);
-      }
-    }
-  }
-  mutex_lock (&m_event_processed);
-  b_event_processed = True;
-  cond_signal (&c_event_processed);
-  mutex_unlock (&m_event_processed);
-  cond_init (&c_event_processed, NULL, NULL); /*initialize again */
-  mutex_init (&m_event_processed, NULL, NULL); /*initialize again */
-}
-
-/*
- * This function sets the label on the xscreensaver passwd dialog to
- * the text returned by th PAM prompt
- */
-char *
-scf_set_passwd_label (saver_info *si)
-{
-  char *label = 0;
-
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> scf_set_passwd_label()\n");
-
-  if (si->scf_si->use_smartcard)
-  {
-    if ((saved_pam_message->msg_style == PAM_PROMPT_ECHO_OFF) ||
-      (saved_pam_message->msg_style == PAM_PROMPT_ECHO_ON))
-    {
-        label = strdup(saved_pam_message->msg);
-        if (si->prefs.verbose_p)
-          fprintf (stderr, "$$$$--->$$$ \t passwd_prompt_label= %s\n",label);
-    }
-  }
-  return label;
-}
-
-static void* 
-smartcard_authenticate (void *xx)
-{
-  saver_info *si = xx;
-  int status;
-
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> smartcard_authenticate()\n");
-  block_signals();
-
-  b_validation_succeeded = False;
-  b_validation_finished = False;
-
-  while (!b_validation_succeeded)
-  {
-    /*
-     * We wait here for a user name to authenticate
-     */
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> \tinside while of smartcard_authenticate()\n");
-
-    mutex_lock (&m_got_username);
-    while (b_got_username == False) 
-      cond_wait (&c_got_username, &m_got_username);
-    b_got_username= False;
-    mutex_unlock (&m_got_username);
- 
-    b_got_PAM_message = False;
- 
-    status = run_PAMsession (get_smartcard_username(si), si);
-/*mali1117    status = pam_passwd_valid_p (get_smartcard_username(si), si);**/
-
-    if (!b_got_PAM_message)
-    {
-      /*
-       * The conversation function was probably interrupted so we need to 
-       * reset b_got_response.
-       */
-      b_got_response = False;
-      if (si->prefs.verbose_p)
-         fprintf (stderr, "---> conv func interrupted resetting b_got_response i.e. did not get PAM_message in smartcard_authenticate()\n");
-      /*
-       * The conversation function did not send any message to the user
-       * so we need to restart the UI thread which is waiting.
-       */
-      mutex_lock (&m_got_message);
-      b_got_message = True;
-      mutex_unlock (&m_got_message);
-      cond_signal (&c_got_message);
-      continue;
-    }
-    mutex_lock (&m_validated_response);
-    b_validation_succeeded = (status == PAM_SUCCESS);
-    b_validated_response = True;
-    b_validation_finished = True;
-    cond_signal (&c_validated_response);
-    mutex_unlock (&m_validated_response);
-  } /* end while */
-  return 0;
-}
-
-static void set_smartcard_lock_state(saver_info *si)
-{
-  /*
-   * This function sets the smart card state when the screen is being locked.
-   * It is also called when the lock dialog is being displayed
-   * as the card state may not be correct.
-   */
- if (si->prefs.verbose_p)
-    fprintf (stderr, "---> set_smartcard_lock_state() state:%d\n", 
-					si->scf_si->scdata->state);
-
-  switch (si->scf_si->scdata->state)
-  {
-    case SCD_AUTH_CARD_PRESENT:
-    case SCD_ANY_CARD_PRESENT:
-     {
-      si->scf_si->scdata->state = SCD_AUTH_REQUIRED; 
-      if (si->prefs.verbose_p)
-        fprintf (stderr, "---> SCD_AUTH/ANY_CARD_PRESENT\n");
-      break;
-     }
-    case SCD_WAIT_REMOVAL_TIMEOUT:
-      XtRemoveTimeOut (card_removal_timeout_id);
-      if (si->prefs.verbose_p)
-        fprintf (stderr, "---> SCD_WAIT_REMOVAL_TIMEOUT\n");
-      /* FALL THRU */
-    case SCD_CARD_REMOVAL_IGNORED:
-      si->scf_si->scdata->state = SCD_WAIT_FOR_CARD;
-      /*
-       * Generate synthetic event so that dialog is displayed
-       */
-      if (si->prefs.verbose_p)
-         fprintf (stderr, "---> SCD_CARD_REMOVAL_IGNORED\n");
-      idle_timer ((XtPointer) si, 0);
-      break;
-/*** mali
-    case SCD_WAIT_FOR_CARD:
-     {
-      si->scf_si->scdata->state = SCD_WAIT_FOR_CARD;
-      fprintf (stderr, "---> SCD_WAIT_FOR_CARD\n");
-      break;
-     }
-    case SCD_WAIT_REMOVAL_LOGOUT_WAIT:
-     {
-      si->scf_si->scdata->state = SCD_WAIT_REMOVAL_LOGOUT_WAIT;
-      fprintf (stderr, "---> SCD_WAIT_REMOVAL_LOGOUT_WAIT\n");
-      idle_timer ((XtPointer) si, 0);
-      break;
-     }
-    case SCD_WAIT_REMOVAL_LOGOUT_EXPIRED:
-     {
-      si->scf_si->scdata->state = SCD_WAIT_REMOVAL_LOGOUT_EXPIRED;
-      fprintf (stderr, "---> SCD_WAIT_REMOVAL_LOGOUT_EXPIRED\n");
-      idle_timer ((XtPointer) si, 0);
-      break;
-     }
-    case SCD_AUTH_REQUIRED:
-     {
-      si->scf_si->scdata->state = SCD_AUTH_REQUIRED;
-      fprintf (stderr, "---> SCD_AUTH_REQUIRED\n");
-      idle_timer ((XtPointer) si, 0);
-      break;
-     }
-    case SCD_WRONG_USER:
-     {
-      si->scf_si->scdata->state = SCD_WRONG_USER;
-      fprintf (stderr, "---> SCD_WRONG_USER\n");
-      idle_timer ((XtPointer) si, 0);
-      break;
-     }
-    case SCD_AUTH_IN_PROGRESS:
-     {
-      si->scf_si->scdata->state = SCD_AUTH_IN_PROGRESS;
-      fprintf (stderr, "---> SCD_AUTH_IN_PROGRESS\n");
-      idle_timer ((XtPointer) si, 0);
-      break;
-     }
-    case SCD_NO_USER:
-     {
-      si->scf_si->scdata->state = SCD_NO_USER;
-      fprintf (stderr, "---> SCD_NO_USER\n");
-      idle_timer ((XtPointer) si, 0);
-      break;
-     }
-****/
-
-    default:
-      /* Unexpected card state */
-      if (si->prefs.verbose_p)
-        fprintf (stderr, "---> !! unexpected card state\n");
-      break;
-  }
-}
-
-
-static int run_PAMsession (char *user_name, saver_info *si)
-{
-/* it is SCF_PAM_SERVICE_NAME(dtsession) defined by config.h */
-  const char *service = SCF_PAM_SERVICE_NAME;
-  struct pam_conv pc = {conversation_function, (void *) NULL };
-  struct pam_data c;
-  pam_handle_t *pamh = NULL;
-  int status;
-  saver_preferences *p = &si->prefs;
-
-  if (si->prefs.verbose_p)
-    fprintf (stderr, "---> run_PAMsession\n");
-
-  c.user = strdup (user_name);
-  c.typed_passwd = strdup ("");
-  c.verbose_p = p->verbose_p;
-
-  pc.appdata_ptr = (void*) &c;
-
-  /*
-   * This will be set to True in the conversation function
-   */
-  b_PAM_prompted = False;
-
-/* PAM needs root privileges****/
-
-  status = pam_start (service, user_name,  &pc, &pamh);
-  if (p->verbose_p)
-  {
-    fprintf (real_stderr, "%s: pam_start( \"%s\", \"%s\", ...) ===> "
-        "%d (%s)\n", blurb(), service, user_name,
-        status, pam_strerror(pamh, status)); 
-  }
-  if (status == PAM_SUCCESS)
-  {
-#ifdef PAM_MSG_VERSION
-    /*
-     * This allows the Solaris PAM module to use the new PAM message types
-     * required to support smart cards.
-     */
-
-    status = pam_set_item (pamh, PAM_MSG_VERSION, PAM_MSG_VERSION_V2);
-    if (status != PAM_SUCCESS)
-    {
-      if (p->verbose_p)
-      {
-        fprintf (stderr, "%s: pam_set_item(...) ===> "
-          "%d (%s)\n", blurb(), 
-          status, pam_strerror(pamh, status)); 
-      }
-    }
-#endif /* PAM_MSG_VERSION */
-
-fprintf(stderr,"\n\n DUDE Calling pam_authenticate in run_PAMsession\n\n");
-
-    status = pam_authenticate (pamh, 0);
-    if (si->prefs.verbose_p)
-      fprintf (stderr, "---> pam_authenticate returned status= %d\n",status);
-    pam_end (pamh, PAM_ABORT);
-  }
- else /*pam_start FAILED */
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> pam_start returned status= %d\n",status);
-
-  return status;
-
-}
-
-
-static int
-conversation_function (int num_msg, struct pam_message **msg,
-        struct pam_response **response, void *appdata_ptr)
-{
-  struct pam_message *m;
-  struct pam_response *r;
-  int k;
-  char *temp;
-  char errbuf[PAM_MAX_MSG_SIZE];
-
-  fprintf (stderr, "---> conversation_function -->num_msg= %d\n",num_msg);
-  if (num_msg < 0)
-    return (PAM_CONV_ERR);
-
-  *response = (struct pam_response*)
-    calloc (num_msg, sizeof (struct pam_response));
-
-  if (*response == NULL)
-    return (PAM_CONV_ERR);
-
-  k = num_msg;
-  m = *msg;
-  r = *response;
-  while (k--)
-  {
-    switch (m->msg_style)
-    {
-      case PAM_PROMPT_ECHO_ON:
-      case PAM_PROMPT_ECHO_OFF:
-                 
-	if ((the_scf_si.use_smartcard)) {
-		char *smUser;
-		pam_handle_t *pamh = *((pam_handle_t **) appdata_ptr);
-		if (! pamh
-			|| pam_get_item(pamh, PAM_USER,
-			(void **) &smUser) != PAM_SUCCESS
-			|| smUser == NULL) {
-			the_smi.state = (enum scstate) SCD_NO_USER;
-                           return (PAM_ABORT);
-                       }
-                       
-		if (! is_valid_unlock_user(smUser)) {
-			the_smi.state = (enum scstate) SCD_WRONG_USER;
-			return (PAM_ABORT);
-                       }
-		the_smi.smartcard_username =(char *) strdup(smUser);
-		}
-
-        b_PAM_prompted = True;
-        b_got_PAM_message = True;
-        memcpy (saved_pam_message, m, sizeof(*m));
-        /*
-         * PAM has requested some input so we tell the UI thread
-         */
-        if (b_first_prompt)
-        {
-          b_first_prompt = False;
-        }
-        else
-        {
-          /*
-           * Tell the UI thread that the first prompt was validated and that
-           * there is more to come
-           */
-          mutex_lock (&m_validated_response);
-          b_validated_response = True;
-          b_validation_finished = False;
-          cond_signal (&c_validated_response);
-          mutex_unlock (&m_validated_response);
-        }
-        mutex_lock (&m_got_message);
-        b_got_message = True;
-        mutex_unlock (&m_got_message);
-        cond_signal (&c_got_message);
-        /*
-         * We must now wait for the user input to be supplied
-         */
-        mutex_lock (&m_got_response);
-        while (b_got_response == False)
-          cond_wait (&c_got_response, &m_got_response);
-        b_got_response = False;
-        mutex_unlock (&m_got_response);
-        /*
-         * saved_user_input being NULL means that the PAM conversation
-         * should be interrupted because converstion function was called
-         * in another thread with message style PAM_CONV_INTERRUPT.
-         * This ususlly means someone removed the smart card.
-         */
-        if (saved_user_input == NULL)
-        {
-          return (PAM_ABORT);
-        }
-
-        r->resp = (char *) malloc (strlen (saved_user_input) + 1);
-        if (r->resp == NULL) 
-        {
-          /*
-           * We need to free all previous responses
-           * __pam_free_resp (num_msg, *response);
-           */
-          struct pam_response	*rr;
-          int i;
-
-          rr = *response;
-          for (i = 0; i < num_msg; i++, rr++) 
-          {
-            if (rr->resp) 
-            {
-              free(r->resp);
-              rr->resp = NULL;
-            }
-          }
-          free(response);
-          *response = NULL;
-          return PAM_CONV_ERR;
-        }
-        (void) strcpy (r->resp, saved_user_input);
-        r->resp_retcode = 0;
-        m++;
-        r++;
-        break;
-
-      case PAM_ERROR_MSG:
-        m++;
-        r++;
-        break;
-
-      case PAM_TEXT_INFO:
-        m++;
-        r++;
-        break;
-
-#ifdef PAM_MSG_VERSION
-      case PAM_CONV_INTERRUPT:
-        memcpy (saved_pam_message, m, sizeof(*m));
-        if (thr_self() != pam_thread)
-        {
-          /*
-           * We need to interrupt the other thread running the PAM
-           * conversation function as it will be waiting on a condition 
-           * variable. 
-           */
-          saved_user_input = NULL;
-          mutex_lock (&m_got_response);
-          b_got_response = True;
-          b_validated_response = False;
-          cond_signal (&c_got_response);
-          mutex_unlock (&m_got_response);
-          return (PAM_SUCCESS);
-        }
-        m++;
-        r++;
-        break;
-#endif /* PAM_MSG_VERSION */
-        
-      default:
-        fprintf (real_stderr, "%s, Unknown PAM Message type %d\n",
-            blurb(), m->msg_style);
-        break; 
-    }
-  }
-  fprintf (stderr, "---> conversation_function returning PAM_SUCCESS\n");
-  return(PAM_SUCCESS);
-}
-
-static void  
-block_signals (void)
-{
-  sigset_t new;
-  /*
-   * We block any signal which the main thread deals with to make sure it is
-   * caught by the main thread
-   *
-   * The list of signals was got from windows.c
-   */
-  sigemptyset (&new);
-  sigaddset (&new, SIGCHLD);
-  sigaddset (&new, SIGHUP);
-  sigaddset (&new, SIGINT);
-  sigaddset (&new, SIGQUIT);
-  sigaddset (&new, SIGILL);
-  sigaddset (&new, SIGTRAP);
-  sigaddset (&new, SIGIOT);
-  sigaddset (&new, SIGABRT);
-#ifdef SIGEMT
-  sigaddset (&new, SIGEMT);
-#endif
-  sigaddset (&new, SIGFPE);
-  sigaddset (&new, SIGBUS);
-  sigaddset (&new, SIGSEGV);
-#ifdef SIGSYS
-  sigaddset (&new, SIGSYS);
-#endif
-  sigaddset (&new, SIGTERM);
-#ifdef SIGXCPU
-  sigaddset (&new, SIGXCPU);
-#endif
-#ifdef SIGXFSZ
-  sigaddset (&new, SIGXFSZ);
-#endif
-#ifdef SIGDANGER
-  sigaddset (&new, SIGDANGER);
-#endif
-  thr_sigsetmask (SIG_BLOCK, &new, NULL);
-}
-
-static char * 
-get_username (void)
-{
-  static char *puser = NULL;
-
-  if (!puser)
-  {
-    struct passwd * pwd;
-    pwd = getpwuid (getuid ());
-    if (pwd) 
-    {
-      puser = pwd->pw_name;
-    }
-  }
-  return (puser);
-}
-
-static Bool
-is_valid_unlock_user (char * sm_user)
-{
-  char *loggedin_user = get_username ();
-  Bool b_ret = True;
-
-  if (sm_user == NULL)
-  {
-    b_ret = False;
-  }
-  else if (loggedin_user != NULL)
-  {
-    if (strcmp (sm_user, loggedin_user))
-    {
-      if (strcmp (sm_user, "root"))
-      {
-        b_ret = False;
-      }
-    }
-  }
-  else 
-  {
-    b_ret = False;
-  }
-  return b_ret;    
-}
-
-static void
-dont_block_for_pam (XtPointer ptr, XtIntervalId *invId)
-{
-  saver_info *si = (saver_info *) ptr;
-  
-    b_got_message = True; 
-    b_got_PAM_message = True; 
-    b_validated_response = True;
-    b_validation_finished = True;
-/*    cond_signal (&c_validated_response);*/
-}
-
-static void 
-wait_for_got_message (saver_info *si)
-{
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> wait_for_got_message()\n");
-  XtAppAddTimeOut (si->app,
-                   100,
-                   dont_block_for_pam, (XtPointer) si);
-    mutex_lock (&m_got_message);
-    while (b_got_message == False)
-     {
-	cond_wait (&c_got_message, &m_got_message);
-	if (si->prefs.verbose_p)
-           fprintf (stderr, "---> \t while of wait_for_got_message()\n");
-     }
-    b_got_message = False;
-    mutex_unlock (&m_got_message);
-}
-
-static char * 
-get_smartcard_username (saver_info *si)
-{
-/*
-**	 Since OCF_UserInfoCardService() is not availabe
-**	 it can be obtained from pam_smarcard module
-*/
-    return ((char *)the_smi.smartcard_username) ; 
-}
-
-
-static void 
-scfevent_handler(SCF_Event_t event, SCF_Terminal_t eventTerminal,void *data)
-{
-  SCF_Status_t status;
-  saver_info *si = (saver_info *) data;
-
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> scfevent_handler() state=%d\n",
-				si->scf_si->scdata->state);
-
-  /*
-   * We wait for the previous event to be dealt with before proceeding
-   */
-  mutex_lock (&m_event_processed);
-  while (!b_event_processed)
-    cond_wait (&c_event_processed, &m_event_processed);
-  b_event_processed = False;
-  mutex_unlock (&m_event_processed);
-
-  if (event == SCF_EVENT_CARDINSERTED)
-  {
-    si->scf_si->scdata->state = SCD_AUTH_REQUIRED;
-    if (si->prefs.verbose_p)
-       fprintf (stderr, "---> EVENT==> CARD INSERTED()\n");
-  }
-  else if (event == SCF_EVENT_CARDREMOVED)
-  {
-
-    si->scf_si->scdata->state = SCD_WAIT_FOR_CARD;
-    b_event_processed = True; /* reinitialize to True */
-
-    if (si->prefs.verbose_p)
-     {
-       fprintf (stderr, "---> EVENT==> CARD REMOVED()\n");
-       fprintf (stderr, "---> setting state=%d\n",si->scf_si->scdata->state);
-     }
-  }
-  else
-  {
-    if (si->prefs.verbose_p)
-       fprintf (stderr, "---> EVENT==> NO CARD INSERTED OR REMOVED()\n");
-    return;
-  }
-  /*
-   * Store the SCF event for card insert or remove
-   */
-  si->scf_si->scdata->last_event = event;
-  thr_kill (main_thread, SIGUSR2);
-#if 1
-  /*
-   * We send a ClientMessage which corresponds to this event
-   * so that the UI thread can deal with it.
-   */
-  {
-    XEvent xevent;
-
-    /*
-     * Store the SCF event
-     */
-    si->scf_si->scdata->last_event = event;
-
-    xevent.xany.type = ClientMessage;
-    xevent.xclient.display = si->dpy;
-    xevent.xclient.window = 0;
-    xevent.xclient.message_type = XA_SCREENSAVER;
-    xevent.xclient.format = 32;
-    memset (&xevent.xclient.data, 0, sizeof (xevent.xclient.data));
-    xevent.xclient.data.l[0] = (long) XA_SMARTCARD;
-    if (! XSendEvent (si->dpy, si->screens[0].screensaver_window, 
-        False, 0L, &xevent))
-    {
-        fprintf (real_stderr, "XSendEvent failed\n");
-    }
-    XFlush (si->dpy);
-  }
-#endif
-
-  if (si->prefs.verbose_p)
-   fprintf (stderr, "<--- scfevent_handler() state=%d\n",
-	si->scf_si->scdata->state);
-
-}
-
-static void
-card_removal_timeout (XtPointer ptr, XtIntervalId *invId)
-{
-  saver_info *si = (saver_info *) ptr;
-  /*
-   * This callback decides what to do when cardRemovalTimeout has expired
-   */
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> card_removal_timeout state:%d\n",
-				    si->scf_si->scdata->state);
-
-  if (!si->scf_si->ignore_card_removal)
-    set_locked_p(si, True);
-
-  if (!si->scf_si->ignore_card_removal && 
-       si->scf_si->scdata->state != SCD_AUTH_IN_PROGRESS &&
-       !si->scf_si->reauth_after_card_removal)
-    {
-        start_wait_removal_timer (si);
-    }
-
-#if OLDCODE
-  if (si->scf_si->scdata->state == SCD_WAIT_REMOVAL_TIMEOUT)
-  {
-    /*
-     * We make sure that we are in the expected state
-     */
-    if (si->scf_si->ignore_card_removal)
-    {
-      if (si->locked_p)
-      {
-        si->scf_si->scdata->state = SCD_WAIT_FOR_CARD;
-        /*
-         * Generate synthetic event so that dialog is displayed
-         */
-        idle_timer ((XtPointer) si, invId);
-      }
-      else
-      {
-        si->scf_si->scdata->state = SCD_CARD_REMOVAL_IGNORED;
-      }
-    }
-    else if (si->scf_si->reauth_after_card_removal)
-    {
-      si->scf_si->scdata->state = SCD_WAIT_FOR_CARD;
-      if (si->prefs.verbose_p)
-         fprintf (stderr, "SCD_WAIT_FOR_CARD calling set_locked_p \n");
-      set_locked_p (si, True);
-      /*
-       * Generate synthetic event so that dialog is displayed
-       */
-      idle_timer ((XtPointer) si, invId);
-    }
-    else
-    {
-        start_wait_removal_timer (si);
-    }
-  }
-#endif /*oldcode*/
-}
-
-static void 
-start_wait_removal_timer (saver_info *si)
-{
-  if (si->prefs.verbose_p)
-    fprintf (stderr, "---> start_wait_removal_timeout value:%d \n",
-                              si->scf_si->card_removal_logout_wait);
-
-  si->scf_si->scdata->state = SCD_WAIT_REMOVAL_LOGOUT_WAIT;
-
-/*mali somehow timer is too short and calls force_exit()**/
-
-  card_removal_logout_wait_id = XtAppAddTimeOut (si->app,
-                                 si->scf_si->card_removal_logout_wait,
-				 /*10000, mali*/
-                                 card_removal_logout_wait,
-                                 (XtPointer) si);
-  set_locked_p (si, True);
-  /*
-   * Generate synthetic event so that dialog is displayed
-   */
-  idle_timer ((XtPointer) si, 0);
-}
-
-static void
-card_removal_logout_wait (XtPointer ptr, XtIntervalId *invId)
-{
-  saver_info *si = (saver_info *) ptr;
-
-  if (si->prefs.verbose_p)
-    fprintf (stderr, "---> card_removal_logout_wait\n");
-
-/*mali  si->scf_si->scdata->state = SCD_WAIT_REMOVAL_LOGOUT_EXPIRED;**
-  we dont really want to log user out do we and if we do..how to do it?
-  pkill gnome-session or /usr/dt/bin/dtconfig -kill or /etc/init.d/dtlogin 
-  stop so for now setting state to AUTH_REQUIRED 
-  si->scf_si->scdata->state = SCD_AUTH_REQUIRED; */
-
-  si->scf_si->scdata->state = SCD_WAIT_REMOVAL_LOGOUT_EXPIRED;
-  force_exit(si);
-}
-
-static void
-force_exit (saver_info *si)
-{
-  /*
-   * This function is called after cardRemovalLogoutWait has expired and
-   * should cause the user to be logged out
-   */
-  if (si->prefs.verbose_p)
-     fprintf (stderr, "---> force_exit\n");
-/*  saver_exit (si, -1, 0); */
-/*mali */ destroy_passwd_window (si);
-  exec_command (si->prefs.shell, "pkill gnome-session", 0);
-}
-  
-static void
-report_smartcard_init_error (saver_info *si, char *name, uint32_t code)
-{
-  char *message = "%s: Smart Card initialization failed\n"
-              "The function %s returned error code %d - disabling locking.\n";
-  fprintf (real_stderr ? real_stderr : stderr, message, blurb(), name, code);
-
-  if (si->prefs.verbose_p)
-    fprintf (stderr, "---> report_smartcard_init_error\n");
-
-  if (!si->locking_disabled_p)
-  {
-    si->locking_disabled_p = True;
-    si->nolock_reason = "SCF function failure";
-  }
-}
-
-static void
-report_smartcard_error (char *name, uint32_t code)
-{
-  char *message = "%s: Call to SCF failed\n"
-                 "    The function %s returned error code %d\n";
-  fprintf (real_stderr ? real_stderr : stderr, message, blurb(), name, code);
-}
-
-/*
- * The Unix signal handler that is registering with sigaction.
- * It uses XtNoticeSignal to tell the Intrinsics to invoke the signal
- * handler assocaited with the signal ID.
- */
-static void sigusr2_handler (void)
-{
-  XtNoticeSignal (sigusr2_id);
-}
-
-static void sigusr2_callback (XtPointer client_data, XtSignalId *id)
-{
-  /*
-   * This function generates an X event by calling XtAppAddTimeOut with
-   * a timeout value of 0. It is called so that the event loop is called
-   * after the card event has been processed.
-   */
-  saver_info *si = (saver_info *) client_data;
-
-  if (si->prefs.verbose_p)
-    fprintf (stderr, "---> siguser2_callback\n");
-
-  XtAppAddTimeOut (si->app,
-                   1,
-                   synthetic_event_callback,
-                   (XtPointer) si);
-}    
-
-static void synthetic_event_callback (XtPointer client_data, XtIntervalId * id)
-{
-  set_smartcard_event_occurred (True);
-  idle_timer ( (saver_info *) client_data, 0);
-}
-
-Bool has_smartcard_event_occurred (void)
-{
-  Bool ret_val = b_card_event_occurred;
-
-  if (b_card_event_occurred)
-  {
-    b_card_event_occurred = False;
-  }
-  return ret_val;
-}
-
-void set_smartcard_event_occurred (Bool val)
-{
-  b_card_event_occurred = val;
-}
-#endif /* NO_LOCKING -- whole file */
--- a/open-src/app/xscreensaver/sun-src/driver/scf-smartcard.h	Mon Aug 07 13:49:43 2006 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/* scf-smartcard.h --- Code to deal with smart card authentication
- * for xscreensaver, Copyright (c) 1993-1998, 2000 Jamie Zawinski <[email protected]>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation.  No representations are made about the suitability of this
- * software for any purpose.  It is provided "as is" without express or 
- * implied warranty.
- *
- *
- * written by Padraig O'Briain ([email protected]) 
- *
- * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
- *
- */
-
-#ifndef __SCF_SMARTCARD_H__
-#define __SCF_SMARTCARD_H__
-
-enum passwd_state { pw_read, pw_ok, pw_null, pw_fail, pw_cancel, pw_time , pw_another};
-
-typedef struct scf_saver_info scf_saver_info;
-
-typedef struct smartcard_info smartcard_info;
-
-struct scf_saver_info {
-  Bool use_smartcard;
-  int card_removal_timeout;
-  Bool ignore_card_removal;
-  Bool reauth_after_card_removal;
-  Time reauth_timeout;
-  Time card_removal_logout_wait;
-  Time first_card_event_timeout;
-  smartcard_info* scdata;
-};
-
-enum scstate {
-    SCD_AUTH_CARD_PRESENT,
-    SCD_WAIT_REMOVAL_TIMEOUT,
-    SCD_CARD_REMOVAL_IGNORED,
-    SCD_WAIT_FOR_CARD,
-    SCD_WAIT_REMOVAL_LOGOUT_WAIT,
-    SCD_ANY_CARD_PRESENT,
-    SCD_WAIT_REMOVAL_LOGOUT_EXPIRED,
-    SCD_AUTH_REQUIRED,
-    SCD_WRONG_USER,
-    SCD_AUTH_IN_PROGRESS,
-    SCD_NO_USER
-};
-
-struct smartcard_info {
-  enum scstate state;
-  int wait_removal_logout_timer;
-  SCF_Event_t last_event;
-  SCF_Session_t session_handle;
-  SCF_Terminal_t terminal_handle;
-  SCF_Card_t card_handle;
-  SCF_ListenerHandle_t myListener;
-  char * smartcard_username;
-  Time message_timeout;
-};
-
-#endif /* __SCF_SMARTCARD_H__ */
--- a/open-src/app/xscreensaver/sun-src/driver/xscreensaver-demo.glade2p	Mon Aug 07 13:49:43 2006 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
-
-<glade-project>
-  <name>xscreensaver-demo</name>
-  <program_name>xscreensaver-demo</program_name>
-  <source_directory></source_directory>
-  <pixmaps_directory>../utils/images</pixmaps_directory>
-  <gnome_support>FALSE</gnome_support>
-  <use_widget_names>TRUE</use_widget_names>
-  <output_main_file>FALSE</output_main_file>
-  <output_support_files>FALSE</output_support_files>
-  <output_build_files>FALSE</output_build_files>
-</glade-project>
--- a/open-src/app/xscreensaver/tooltips.patch	Mon Aug 07 13:49:43 2006 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
- *
- */
-
-Sun bug 4818062:
-	mouse-over displays incorrect information
-	http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4818062
-
-diff -urp -x '*~' driver/xscreensaver-demo.glade2 driver/xscreensaver-demo.glade2
---- driver/xscreensaver-demo.glade2	2006-05-10 08:49:02.837844000 -0700
-+++ driver/xscreensaver-demo.glade2	2006-05-10 08:49:10.988281000 -0700
-@@ -385,7 +385,7 @@
- 		  <child>
- 		    <widget class="GtkSpinButton" id="lock_spinbutton">
- 		      <property name="visible">True</property>
--		      <property name="tooltip" translatable="yes">How long before the monitor goes completely black.</property>
-+		      <property name="tooltip" translatable="yes">How long before the screen becomes locked.</property>
- 		      <property name="can_focus">True</property>
- 		      <property name="climb_rate">15</property>
- 		      <property name="digits">0</property>
-@@ -439,7 +439,7 @@
- 		  <child>
- 		    <widget class="GtkSpinButton" id="cycle_spinbutton">
- 		      <property name="visible">True</property>
--		      <property name="tooltip" translatable="yes">How long before the monitor goes completely black.</property>
-+		      <property name="tooltip" translatable="yes">How long before the new hack sub-process starts.</property>
- 		      <property name="can_focus">True</property>
- 		      <property name="climb_rate">15</property>
- 		      <property name="digits">0</property>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/app/xscreensaver/topblock.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -0,0 +1,1770 @@
+Strip Control-M's from end of lines to make Unix compilers less whiny.
+
+diff -urp -x '*~' hacks/glx/topblock.c hacks/glx/topblock.c
+--- hacks/glx/topblock.c	2006-05-17 17:20:00.000000000 -0700
++++ hacks/glx/topblock.c	2006-08-08 15:26:10.398366000 -0700
+@@ -1,835 +1,835 @@
+-/* topblock, Copyright (c) 2006 rednuht <[email protected]>
+- *
+- * Permission to use, copy, modify, distribute, and sell this software and its
+- * documentation for any purpose is hereby granted without fee, provided that
+- * the above copyright notice appear in all copies and that both that
+- * copyright notice and this permission notice appear in supporting
+- * documentation.  No representations are made about the suitability of this
+- * software for any purpose.  It is provided "as is" without express or 
+- * implied warranty.
+- *
+- * 
+- *
+-
+-topBlock - a simple openGL 3D hack of falling blocks
+-based on jwz's dangerball hack
+-
+-The proporations of the blocks and their features is not even close to the commercial building block products offered by a variety companies.
+-
+-information on this hack might be found at 
+-http://www.jumpstation.co.uk/xscreensaver/topblock/
+-
+-History
+-25/02/2006 v1.0 release
+-29/04/2006 v1.11 updated to better fit with xscreensaver v5
+-                 colors defaults to 7 (no black)
+-*/
+-
+-#include <math.h>
+-
+-# define refresh_topBlock 0
+-
+-#define DEFAULTS	"*delay:	10000       \n" \
+-			"*count:        30           \n" \
+-			"*showFPS:      False       \n" \
+-			"*wireframe:    False       \n" \
+-
+-#undef countof
+-#define countof(x) (sizeof((x))/sizeof((*x)))
+-
+-#include "xlockmore.h"
+-#include "topblock.h"
+-#include "sphere.h"
+-#include <ctype.h>
+-
+-#ifdef USE_GL /* whole file */
+-
+-#ifdef HAVE_COCOA
+-# include <OpenGL/glu.h>
+-#else
+-# include <GL/glu.h>
+-#endif
+-
+-typedef struct
+-{
+-  GLXContext *glx_context;
+-  int numFallingBlocks;
+-  GLfloat highest,highestFalling;
+-  GLfloat eyeLine,eyeX,eyeY,eyeZ;
+-  int carpetWidth, carpetLength;
+-  int followMode;
+-  GLfloat followRadius,followAngle;
+-  int plusheight;
+-  GLuint	carpet;
+-  GLuint	block;
+-  NODE *blockNodeRoot;
+-  NODE *blockNodeFollow;
+-  GLfloat rotation;
+-} topBlockSTATE;
+-
+-/* parameter vars */
+-Bool override;
+-Bool rotate;
+-Bool follow;
+-Bool drawCarpet;
+-Bool drawBlob;
+-Bool drawNipples;
+-GLfloat rotateSpeed;
+-GLfloat camX;
+-GLfloat camY;
+-GLfloat camZ;
+-GLfloat dropSpeed;
+-int maxFalling;
+-int maxColors;
+-int size;
+-int spawn;
+-int resolution;
+-
+-static XrmOptionDescRec opts[] = {
+-  { "-size",        ".size",        XrmoptionSepArg, 0 },
+-  { "-spawn",       ".spawn",       XrmoptionSepArg, 0 },
+-  { "-camX",        ".camX",        XrmoptionSepArg, 0 },
+-  { "-camY",        ".camY",        XrmoptionSepArg, 0 },
+-  { "-camZ",        ".camZ",        XrmoptionSepArg, 0 },
+-  { "+rotate",      ".rotate",      XrmoptionNoArg, "False" },
+-  { "-rotate",      ".rotate",      XrmoptionNoArg, "True" },
+-  { "+carpet",      ".carpet",      XrmoptionNoArg, "False" },
+-  { "+nipples",     ".nipples",     XrmoptionNoArg, "False" },
+-  { "-blob",        ".blob",        XrmoptionNoArg, "True" },
+-  { "-rotateSpeed", ".rotateSpeed", XrmoptionSepArg, 0 },
+-  { "-follow",      ".follow",      XrmoptionNoArg, "True" },
+-  { "-maxFalling",  ".maxFalling",  XrmoptionSepArg, 0 },
+-  { "-resolution",  ".resolution",  XrmoptionSepArg, 0 },
+-  { "-maxColors",   ".maxColors",   XrmoptionSepArg, 0 },
+-  { "-dropSpeed",   ".dropSpeed",   XrmoptionSepArg, 0 },
+-  { "-override",    ".override",    XrmoptionNoArg, "True" },
+-};
+-
+-#define DEF_override      "False"
+-#define DEF_rotate        "True"
+-#define DEF_follow        "False"
+-#define DEF_drawCarpet    "True"
+-#define DEF_drawBlob      "False"
+-#define DEF_drawNipples   "True"
+-#define DEF_rotateSpeed   "10"
+-#define DEF_maxFalling    "500"
+-#define DEF_maxColors     "7"
+-#define DEF_size          "2"
+-#define DEF_spawn         "50"
+-#define DEF_resolution    "4"
+-#define DEF_camX          "1"
+-#define DEF_camY          "20"
+-#define DEF_camZ          "25"
+-#define DEF_dropSpeed     "4"
+-
+-static argtype vars[] = {
+-  {&override,     "override",     "Override",     DEF_override,     t_Bool},
+-  {&rotate,       "rotate",       "Rotate",       DEF_rotate,       t_Bool},
+-  {&drawCarpet,   "carpet",       "Carpet",       DEF_drawCarpet,   t_Bool},
+-  {&drawNipples,  "nipples",      "Nipples",      DEF_drawNipples,  t_Bool},
+-  {&drawBlob,     "blob",         "Blob",         DEF_drawBlob,     t_Bool},
+-  {&rotateSpeed,  "rotateSpeed",  "RotateSpeed",  DEF_rotateSpeed,  t_Float},
+-  {&follow,       "follow",       "Follow",       DEF_follow,       t_Bool},
+-  {&camX,         "camX",         "camX",         DEF_camX,         t_Float},
+-  {&camY,         "camY",         "camY",         DEF_camY,         t_Float},
+-  {&camZ,         "camZ",         "camZ",         DEF_camZ,         t_Float},
+-  {&size,         "size",         "size",         DEF_size,         t_Int},
+-  {&spawn,        "spawn",        "spawn",        DEF_spawn,        t_Int},
+-  {&maxFalling,   "maxFalling",   "maxFalling",   DEF_maxFalling,   t_Int},
+-  {&resolution,   "resolution",   "resolution",   DEF_resolution,   t_Int},
+-  {&maxColors,    "maxColors",    "maxColors",    DEF_maxColors,    t_Int},
+-  {&dropSpeed,    "dropSpeed",    "DropSpeed",    DEF_dropSpeed,    t_Float},
+-};
+-
+-static topBlockSTATE *tbs = NULL;
+-
+-ModeSpecOpt topBlock_opts = {countof(opts), opts, countof(vars), vars, NULL};
+-
+-/* Window management, etc */
+-ENTRYPOINT void
+-reshape_topBlock (ModeInfo *mi, int width, int height) {
+-  GLfloat h = (GLfloat) height / (GLfloat) width;
+-  glViewport (0, 0, (GLint) width, (GLint) height);
+-  glMatrixMode(GL_PROJECTION);
+-  glLoadIdentity();
+-  gluPerspective (60.0, 1/h, 1.0, 1000.0);
+-  glMatrixMode(GL_MODELVIEW);
+-  glLoadIdentity();
+-  glClear(GL_COLOR_BUFFER_BIT);
+-}
+-
+-/* clean up on exit, not required ... */
+-ENTRYPOINT void
+-  release_topBlock(ModeInfo *mi) {
+-  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
+-	NODE *llCurrent, *llOld;
+-	llCurrent = tb->blockNodeRoot;
+-	while (llCurrent != NULL) {
+-		llOld = llCurrent;
+-		llCurrent = llCurrent->next;
+-		free(llOld);
+-	}
+-}
+-
+-/* setup */
+-ENTRYPOINT void 
+-init_topBlock (ModeInfo *mi)
+-{
+-  topBlockSTATE *tb;
+-  int wire = MI_IS_WIREFRAME(mi);
+-
+-  if (!tbs) {
+-    tbs = (topBlockSTATE *)
+-      calloc (MI_NUM_SCREENS(mi), sizeof (topBlockSTATE));
+-    if (!tbs) {
+-      fprintf(stderr, "%s: out of memory\n", progname);
+-      exit(1);
+-    }
+-  }
+-
+-  tb = &tbs[MI_SCREEN(mi)];
+-
+-  tb->glx_context = init_GL(mi);
+-
+-  reshape_topBlock (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+-
+-	if (wire) { drawNipples=False; }
+-  tb->numFallingBlocks=0;
+-
+-	if (size>10) { size = 10; }
+-	if (size<1) { size = 2; }
+-	tb->carpetWidth = 8 * size;
+-	tb->carpetLength = tb->carpetWidth;
+-  
+-  maxFalling=maxFalling*size;
+-
+-	if (spawn<4) { spawn=4; }
+-	if (spawn>1000) { spawn=1000; }
+-
+-	if (rotateSpeed<1) {rotateSpeed=1; }
+-	if (rotateSpeed>1000) {rotateSpeed=1000;}
+-  rotateSpeed = rotateSpeed / 100;
+-
+-	if (resolution<4) {resolution=4;}
+-	if (resolution>20) {resolution=20;}
+-  resolution=resolution*2;
+-
+-	if (maxColors<1) {maxColors=1;}
+-	if (maxColors>8) {maxColors=8;}
+-
+-	if (dropSpeed<1) {dropSpeed=1;}
+-	if (dropSpeed>9) {dropSpeed=9;} /* 10+ produces blocks that can pass through each other */
+-  
+-	dropSpeed = 80/dropSpeed;
+-	dropSpeed = (blockHeight/dropSpeed); 
+-
+-  tb->glx_context = init_GL(mi);
+-
+-  reshape_topBlock (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+-  if (0==1) {
+-      glClearColor(1.0f, 1.0f, 1.0f, 0.5f);
+-  } else {
+-      glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
+-  }
+-  glClearDepth(1.0f);
+-  if (!wire) {
+-    GLfloat pos[4] = {10.0, 10.0, 1.0, 0.0};
+-    GLfloat amb[4] = {0.1, 0.1, 0.1, 1.0};
+-    GLfloat dif[4] = {1.0, 1.0, 1.0, 1.0};
+-    GLfloat spc[4] = {0.0, 1.0, 1.0, 1.0};
+-
+-    glEnable(GL_LIGHTING);
+-    glEnable(GL_LIGHT0);
+-    glLightfv(GL_LIGHT0, GL_POSITION, pos);
+-    glLightfv(GL_LIGHT0, GL_AMBIENT,  amb); 
+-    glLightfv(GL_LIGHT0, GL_DIFFUSE,  dif);
+-    glLightfv(GL_LIGHT0, GL_SPECULAR, spc); 
+-  }
+-	glDepthFunc(GL_LEQUAL);
+-  glEnable(GL_DEPTH_TEST);
+-  glDisable(GL_CULL_FACE); /* all objects exhibit a reverse side */
+-  glCullFace(GL_BACK); 
+-
+-	if (drawBlob) {
+-    buildBlobBlock(mi); 
+-	} else {
+-	  buildBlock(mi);		/* build the display list holding the simple block */
+-	}
+-  buildCarpet(mi);		/* build the base */
+-	tb->highest=0;
+-	tb->highestFalling=0;
+-	tb->eyeLine=tb->highest;
+-	tb->eyeX=0;
+-	tb->eyeY=0;
+-	tb->eyeZ=0;
+-	tb->followMode=0;
+-  if (follow) {
+-    tb->plusheight=100;
+-    camZ=camZ-60;
+-  } else {
+-    tb->rotation=random() % 360;
+-    tb->eyeY=10;
+-    tb->plusheight=30;
+-  }
+-	tb->followRadius=0;
+-  /* override camera settings */
+-  if (override) {
+-    tb->plusheight=100;
+-    drawCarpet=False;
+-    camX=0;
+-    camY=1;
+-    camZ=0;
+-    tb->eyeX=-1;
+-    tb->eyeY=20;
+-    tb->eyeZ=0;
+-  }
+-}
+-
+-/* provides the per frame entertainment */
+-ENTRYPOINT void
+-draw_topBlock (ModeInfo *mi) {
+-  	Display *dpy = MI_DISPLAY(mi);
+-  	Window window = MI_WINDOW(mi);
+-  	NODE *llCurrent;
+-  	NODE *llNode;
+-  	topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
+-  	GLfloat spcN1x,spcN1y,spcN2x,spcN2y;
+-  	GLfloat spcC1x,spcC1y,spcC2x,spcC2y;
+-  	int wire = MI_IS_WIREFRAME(mi);
+-	  GLfloat color[4];	
+-
+-  if (!tb->glx_context)
+-    return;
+-  glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(tb->glx_context));
+-
+-	generateNewBlock(mi);
+-
+-	if (rotate) { tb->rotation += rotateSpeed; } 
+-	if (tb->rotation>=360) { tb->rotation=tb->rotation-360; } 
+-
+-	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);		/* clear current */
+-	glLoadIdentity();	/* resets directions, do it every time ! */
+-
+-	if (!follow) {
+-		if (tb->highest>tb->eyeLine) { tb->eyeLine=tb->eyeLine + ((tb->highest-tb->eyeLine)/100);	} /* creates a smooth camera transition */
+-		gluLookAt(camX, camY+tb->eyeLine, camZ, tb->eyeX, tb->eyeY+tb->eyeLine, tb->eyeZ, 0.0, 1.0, 0.0);		/* setup viewer, xyz cam, xyz looking at and where is up normaly 0,1,0 */
+-		glRotatef(90, 1.0, 0.0, 0.0);			/* x axis */
+-	} else {
+-		glRotatef(90, 0.0, 0.0, 1.0);     /* z axis */
+-		followBlock(mi);
+-	}
+-	/* rotate the world */
+-	glRotatef(tb->rotation, 0.0, 0.0, 1.0);		
+-
+-	llCurrent = tb->blockNodeRoot;
+-	if (drawCarpet) {
+-		/* center carpet */
+-		glTranslatef(0.0-(tb->carpetWidth/2),0.0-(tb->carpetLength/2),0.0);
+-		glCallList(tb->carpet);
+-		glTranslatef(0.0+(tb->carpetWidth/2),0.0+(tb->carpetLength/2),0.0);
+-		glTranslatef(0.0,0.0,-0.55);
+-	}
+-	tb->highestFalling=0;
+-	while (llCurrent != NULL) {	/* for each block */
+-		glPushMatrix();	/* save state */
+-		/* set color */
+-		switch (llCurrent->color) { 
+-			case 0:
+-				color[0] = 1.0f;	
+-				color[1] = 0.0f;	
+-				color[2] = 0.0f;	
+-				color[3] = 1.0f;	
+-				break;
+-			case 1:
+-				color[0] = 0.0f;	
+-				color[1] = 1.0f;	
+-				color[2] = 0.0f;	
+-				color[3] = 1.0f;	
+-				break;
+-			case 2:
+-				color[0] = 0.0f;	
+-				color[1] = 0.0f;	
+-				color[2] = 1.0f;	
+-				color[3] = 1.0f;	
+-				break;
+-			case 3:
+-				color[0] = 0.95f;	
+-				color[1] = 0.95f;	
+-				color[2] = 0.95f;	
+-				color[3] = 1.0f;	
+-				break;
+-			case 4:
+-				color[0] = 1.0f;	
+-				color[1] = 0.5f;	
+-				color[2] = 0.0f;	
+-				color[3] = 1.0f;	
+-				break;
+-			case 5:
+-				color[0] = 1.0f;	
+-				color[1] = 1.0f;	
+-				color[2] = 0.0f;	
+-				color[3] = 1.0f;	
+-				break;
+-			case 6: 
+-				color[0] = 0.5f;	
+-				color[1] = 0.5f;	
+-				color[2] = 0.5f;	
+-				color[3] = 1.0f;	
+-				break;
+-			case 7:
+-				color[0] = 0.05f;	
+-				color[1] = 0.05f;	
+-				color[2] = 0.05f;	
+-				color[3] = 1.0f;	
+-				break;
+-		} 
+-		if (wire) { glColor3fv(color); }
+-		else { glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color); }
+-
+-		if (llCurrent->falling==1) {
+-    	spcC2x = 0;
+-	    spcC2y = 0;
+-	    spcN2x = 0;
+-	    spcN2y = 0;
+-			if (llCurrent->height>tb->highestFalling) {tb->highestFalling=llCurrent->height;}
+-			/* all blocks fall at the same rate to avoid mid air collisions */
+-			llCurrent->height=llCurrent->height-dropSpeed;
+-			if (llCurrent->height<=0) {
+-				llCurrent->falling=0;
+-				if (tb->highest==0) { 
+-					tb->highest=tb->highest+blockHeight; 
+-				}
+-			} 
+-			if ( (llCurrent->height<=tb->highest+1) && (llCurrent->falling==1) ) {
+-				/* check for collision */
+-				llNode = tb->blockNodeRoot;
+-				spcC1x = llCurrent->x;
+-				spcC1y = llCurrent->y;
+-				switch(llCurrent->rotation) {
+-					case getOrientation(0):
+-						spcC2x = spcC1x;
+-						spcC2y = spcC1y-2;
+-						break;
+-					case getOrientation(1):
+-						spcC2x = spcC1x+2;
+-						spcC2y = spcC1y;
+-						break;
+-					case getOrientation(2):
+-						spcC2x = spcC1x;
+-						spcC2y = spcC1y+2;
+-						break;
+-					case getOrientation(3):
+-						spcC2x = spcC1x-2;
+-						spcC2y = spcC1y;
+-						break;
+-				}
+-				while (llNode != NULL) {
+-					if ( (llNode->falling==0) && (llCurrent->falling==1) ) {
+-						spcN1x = llNode->x;
+-						spcN1y = llNode->y;
+-						switch(llNode->rotation) {
+-							case getOrientation(0):
+-								spcN2x = spcN1x;
+-								spcN2y = spcN1y-2;
+-								break;
+-							case getOrientation(1):
+-								spcN2x = spcN1x+2;
+-								spcN2y = spcN1y;
+-								break;
+-							case getOrientation(2):
+-								spcN2x = spcN1x;
+-								spcN2y = spcN1y+2;
+-								break;
+-							case getOrientation(3):
+-								spcN2x = spcN1x-2;
+-								spcN2y = spcN1y;
+-								break;
+-						}
+-						if ( 
+-							( (spcC1x==spcN1x) && (spcC1y==spcN1y) ) ||
+-							( (spcC1x==spcN2x) && (spcC1y==spcN2y) ) ||
+-							( (spcC2x==spcN2x) && (spcC2y==spcN2y) ) ||
+-							( (spcC2x==spcN1x) && (spcC2y==spcN1y) )
+-						){
+-				      if ( (llCurrent->height<=llNode->height+blockHeight+TOLLERANCE) && (llCurrent->height>=llNode->height+blockHeight-TOLLERANCE) )  {
+-						    llCurrent->falling=0;
+-							  llCurrent->height=llNode->height+blockHeight; /* if this is missing then small errors build up until the model fails */
+-							  if ( (llCurrent->height<=tb->highest+TOLLERANCE) && (llCurrent->height>=tb->highest-TOLLERANCE) ) { 
+-							   tb->highest=tb->highest+blockHeight; 
+-							  }
+-						  }
+-					  }
+-				  }
+-				  llNode=llNode->next;
+-			  }				
+-		  }
+-	  } 
+-  	/* set location in space */
+-	  glTranslatef(llCurrent->x,llCurrent->y,-llCurrent->height);
+-	  /* rotate */
+-  	glRotatef(llCurrent->rotation, 0.0f, 0.0f, 1.0f);
+-  	if ((tb->followMode==0) && (llCurrent->next==NULL)) {
+-  		tb->blockNodeFollow = llCurrent;
+-  		tb->followMode=1;
+-  	} 
+-  	llCurrent = llCurrent->next;
+-  	/* draw   */
+-  	glCallList(tb->block); 
+-  	glPopMatrix();	/* restore state */
+-  } 
+-  if (mi->fps_p) do_fps (mi);
+-  glFinish();
+-
+-	if (tb->highest>(5*maxFalling)) { drawCarpet=False; }
+-  glXSwapBuffers(dpy, window);
+-}
+-
+-
+-
+-/* camera is in follow mode, work out where we should be looking */
+-static void followBlock(ModeInfo *mi) {
+-	GLfloat xLen,yLen,cx,cy,rangle,xTarget,yTarget;
+-  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
+-  cx=0;cy=0;
+-	if ((tb->blockNodeFollow!=NULL) && (tb->followMode==1)){
+-
+-		if (tb->highest>tb->eyeLine) { tb->eyeLine=tb->eyeLine + ((tb->highest-tb->eyeLine)/100);	} 
+-		  /*tb->blockNodeFollow->color=1;  only noticable if you set the colors to 1 */
+-		
+-			if (tb->blockNodeFollow->height > tb->eyeZ) { tb->eyeZ=tb->eyeZ +  ((tb->blockNodeFollow->height - tb->eyeZ)/100); } 
+-			if (tb->blockNodeFollow->height < tb->eyeZ) { tb->eyeZ=tb->eyeZ - ((tb->eyeZ - tb->blockNodeFollow->height)/100); } 
+-		
+-
+-		/* when the scene is rotated we need to know where the block is in the 2 dimensional coordinates of the carpet area
+-		   (see http://www.jumpstation.co.uk/rotation/)
+-		*/
+-
+-		if (tb->followRadius==0) {		
+-			xLen = tb->blockNodeFollow->x-cx;
+-			yLen = tb->blockNodeFollow->y-cy;
+-			tb->followRadius=sqrt( (xLen*xLen) + (yLen*yLen) );	
+-			tb->followAngle = (180/M_PI) * asin(xLen/tb->followRadius); 
+-			tb->followAngle = quadrantCorrection(tb->followAngle,(int)cx,(int)cy,(int)tb->blockNodeFollow->x,(int)tb->blockNodeFollow->y);
+-		}
+-		rangle = (tb->followAngle+tb->rotation) * M_PI /180;
+-		xTarget = cos(rangle) * tb->followRadius + cx;
+-		yTarget = sin(rangle) * tb->followRadius + cy;
+-		if (tb->followAngle>360) { tb->followAngle=tb->followAngle-360; }
+-
+-		if (xTarget < tb->eyeX) { tb->eyeX=tb->eyeX - ((tb->eyeX - xTarget)/100); }
+-		if (xTarget > tb->eyeX) { tb->eyeX=tb->eyeX + ((xTarget - tb->eyeX)/100); }
+-
+-		if (yTarget < tb->eyeY) { tb->eyeY=tb->eyeY - ((tb->eyeY - yTarget)/100); }
+-		if (yTarget > tb->eyeY) { tb->eyeY=tb->eyeY + ((yTarget - tb->eyeY)/100); }
+- /*
+-		tb->eyeX = xTarget;
+-		tb->eyeY = yTarget;
+-***************************************************************************
+-*/
+-		if (!tb->blockNodeFollow->falling) {  
+-			tb->followMode=0; 
+-			/*tb->blockNodeFollow->color=2;  only noticable if you set the colors to 1 */
+-			tb->followRadius=0;
+-		} 
+-	}
+-	gluLookAt(camX, camY, camZ-tb->eyeLine, tb->eyeX, tb->eyeY, -tb->eyeZ,-1.0,0.0,0.0);
+-}
+-
+-/* each quater of the circle has to be adjusted for */
+-static double quadrantCorrection(double angle,int cx,int cy,int x,int y) {
+-	if ((x>=cx) && (y>=cy)) {
+-		angle = angle + (90-(angle-90) * 2); 
+-	} else if ((x>=cx) && (y<=cy)) {
+-		angle = angle + 90; 
+-	} else if ((x<=cx) && (y<=cy)) {
+-		angle = angle + 90; 
+-	} else if ((x<=cx) && (y>=cy)) {
+-		angle = angle + (90-(angle-90) * 2); 
+-	}
+-	return(angle-180);
+-}
+-
+-/* if random chance then create a new falling block */
+-static void generateNewBlock(ModeInfo *mi) {
+-	NODE *llCurrent, *llTail;
+-	GLfloat startOffx, startOffy;
+-	int endOffx, endOffy;
+-  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
+-	if ( ((random() % spawn) == 1) && (tb->highestFalling<getHeight((tb->plusheight-blockHeight)+tb->highest)) ) {	
+-		startOffx=0;
+-		endOffx=0;
+-		startOffy=0;
+-		endOffy=0;
+-		tb->numFallingBlocks++;
+-		llTail = tb->blockNodeRoot; 
+-		if (llTail == NULL) {
+-			if ((llCurrent = ((NODE*) malloc(sizeof(NODE)))) == NULL) {	fprintf(stderr, "%s: out of memory.\n", progname); }
+-			llTail = llCurrent;
+-			tb->blockNodeRoot = llCurrent; 
+-		} else {
+-			if (tb->numFallingBlocks>=maxFalling) {
+-				/* recycle */
+-				llCurrent=llTail->next;
+-				tb->blockNodeRoot=llCurrent->next;
+-			} else {
+-				if ((llCurrent = ((NODE*) malloc(sizeof(NODE)))) == NULL) {	fprintf(stderr, "%s: out of memory..\n", progname); }
+-			}
+-			while (llTail->next != NULL) { llTail = llTail->next; } /* find last item in list */
+-		}
+-		llCurrent->falling=1;
+-		llCurrent->rotation=getOrientation(random() % 4); 
+-		if (llCurrent->rotation==getOrientation(0)) {
+-			startOffx=1.0;
+-			endOffx=0;
+-			startOffy=3.0;
+-			endOffy=-1;
+-		} else if (llCurrent->rotation==getOrientation(1)) {
+-			startOffx=1.0;
+-			endOffx=-1;
+-			startOffy=1.0;
+-			endOffy=0;		
+-		} else if (llCurrent->rotation==getOrientation(2)) {
+-			startOffx=1.0;
+-			endOffx=0;
+-			startOffy=3.0;
+-			endOffy=-1;		
+-		} else if (llCurrent->rotation==getOrientation(3)) { 
+-			startOffx=5.0;
+-			endOffx=-1;
+-			startOffy=1.0;
+-			endOffy=0;		
+-		}
+-
+-		llCurrent->x=(startOffx-(tb->carpetLength/2)) + getLocation(random() % ((tb->carpetLength/2)+endOffx) );
+-		llCurrent->y=(startOffy-(tb->carpetLength/2)) + getLocation(random() % ((tb->carpetLength/2)+endOffy) );
+-		llCurrent->color=(random() % maxColors);
+-		llCurrent->height=getHeight(tb->plusheight+tb->highest); 
+-		if (tb->numFallingBlocks>=maxFalling) {
+-			tb->numFallingBlocks--;
+-			tb->numFallingBlocks--;
+-		} 
+-		llTail->next = llCurrent;
+-		llTail = llCurrent;
+-		llTail->next = NULL;
+-
+-	}
+-}
+-
+-/* called at init this creates the 'carpet' display list item */
+-static void buildCarpet(ModeInfo *mi) {
+-	int i,c,x,y;
+-	GLfloat color[4];
+-  	int wire = MI_IS_WIREFRAME(mi);
+-  	topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
+-  	GLUquadricObj *quadratic;
+-		color[0] = 0.0f;	
+-		color[1] = 1.0f;	
+-		color[2] = 0.0f;	
+-		color[3] = 1.0f;	
+-	tb->carpet=glGenLists(1);	/* only one */
+-	glNewList(tb->carpet,GL_COMPILE);
+-	glPushMatrix();	/* save state */
+-  	x=tb->carpetWidth;
+-  	y=tb->carpetLength;
+-	if (wire) { glColor3fv(color); }
+-	else { glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color); }
+-	/* draw carpet plane */
+-	glBegin( wire ? GL_LINE_LOOP : GL_QUADS );
+-		/* draw top */
+-		glNormal3f( 0, 0, -1 );
+-		glVertex3f(0.0,0.0,0.0);
+-		glVertex3f(x,0.0,0.0);
+-		glVertex3f(x,y,0.0);
+-		glVertex3f(0.0,y,0.0);
+-	    if (wire) { glEnd(); } 
+-		else {
+-		/* add edge pieces */
+-		/* side 1 */
+-		glNormal3f( 0, -1, 0 );
+-		glVertex3f(0.0,0.0,0.0);
+-		glVertex3f(x,0.0,0.0);
+-		glVertex3f(x,0,singleThick);
+-		glVertex3f(0.0,0,singleThick);
+-		/* side 2 */
+-		glNormal3f( -1, 0, 0 );
+-		glVertex3f(0.0,0.0,0.0);
+-		glVertex3f(0,y,0.0);
+-		glVertex3f(0,y,singleThick);
+-		glVertex3f(0.0,0,singleThick);
+-		/* side 3 */
+-		glNormal3f( 1, 0, 0 );
+-		glVertex3f(x,0.0,0.0);
+-		glVertex3f(x,y,0.0);
+-		glVertex3f(x,y,singleThick);
+-		glVertex3f(x,0,singleThick);
+-		/* side 4 */
+-		glNormal3f( 0, 1, 0 );
+-		glVertex3f(0,y,0.0);
+-		glVertex3f(x,y,0.0);
+-		glVertex3f(x,y,singleThick);
+-		glVertex3f(0,y,singleThick);
+-		}
+-	glEnd();
+-	/* nipples */
+-	if (drawNipples) {
+-		quadratic=gluNewQuadric();			/* Create A Pointer To The Quadric Object */
+-		gluQuadricNormals(quadratic, GLU_SMOOTH);	/* Create Smooth Normals  */
+-		gluQuadricTexture(quadratic, GL_TRUE);		/* Create Texture Coords  */
+-		glTranslatef(0.5f,0.5f,-.25);			/* move to the cylinder center */
+-		for (c=0;c<x;c++) {
+-			glPushMatrix();	/* save state */
+-			for (i=0;i<y;i++) {
+-				gluCylinder(quadratic, cylSize, cylSize, 0.25f, resolution, resolution);	/* quad, radius(bottom, radius(top), height, subdivisions (around Z), subdevisions (along Z) */
+-				glRotatef(180, 0.0f, 1.0f, 0.0f); /* they are upside down */
+-				gluDisk(quadratic, 0.0f, cylSize, resolution, resolution );	 /* inner size (cd hole), outer size (radius), subdivisions radial, subdivisions circular  */
+-				glRotatef(180, 0.0f, 1.0f, 0.0f); /* recover */
+-				glTranslatef(0.0f,1.0f,0.0f);			/* move to the next cylinder center (backward) */
+-			}
+-			glPopMatrix();	/* save state */
+-			glTranslatef(1.0f,0.0f,0.0f);			/* reset   */
+-		}
+-	}
+-	glPopMatrix();	/* restore state */
+-	glEndList();	
+-}
+-
+-/* using the verticies arrays builds the plane, now with normals */
+-static void polygonPlane(int wire, int a, int b, int c , int d, int i)
+-{
+-	GLfloat topBlockNormals[5][3] = { {0,0,-1},	{0,1,0}, {1,0,0}, {0,0,1}, {0,-1,0} };
+-	GLfloat topBlockVertices[8][3] = { {-0.49,-2.97,-0.99}, {0.99,-2.97,-0.99}, {0.99,0.99,-0.99}  , {-0.49,0.99,-0.99}, {-0.49,-2.97,0.99} , {0.99,-2.97,0.99}, {0.99,0.99,0.99}   , {-0.49,0.99,0.99} };
+-	glBegin( wire ? GL_LINE_LOOP : GL_POLYGON);
+-		glNormal3fv(topBlockNormals[i] );
+-		glVertex3fv(topBlockVertices[a]);
+-		glVertex3fv(topBlockVertices[b]);
+-		glVertex3fv(topBlockVertices[c]);
+-		glVertex3fv(topBlockVertices[d]);
+-	glEnd();
+-}
+-
+-/* called at init this creates the 'block' display list item */
+-/* the spheres came about originaly as quick way to test the directional lighting/normals */
+-static void buildBlock(ModeInfo *mi) {
+-	int i,c;
+-  int wire = MI_IS_WIREFRAME(mi);
+-  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
+-	GLUquadricObj *quadratic;
+-	tb->block=glGenLists(1);	/* only one */
+-	glNewList(tb->block,GL_COMPILE);
+-	glPushMatrix();	/* save state */
+-	glRotatef(90, 0.0f, 1.0f, 0.0f);
+-	/* base */
+-	polygonPlane(wire, 0,3,2,1,0);
+-	polygonPlane(wire, 2,3,7,6,1);
+-	polygonPlane(wire, 1,2,6,5,2); 
+-	polygonPlane(wire, 4,5,6,7,3); 
+-	polygonPlane(wire, 0,1,5,4,4);
+-	if (drawNipples) {
+-		/* nipples */
+-		/* draw 8 cylinders each with a disk cap */
+-		quadratic=gluNewQuadric();			/* Create A Pointer To The Quadric Object  */
+-		gluQuadricNormals(quadratic, GLU_SMOOTH);	/* Create Smooth Normals  */
+-		glRotatef(90, 0.0f, 1.0f, 0.0f);		/* 'aim' the pointer ready for the cylinder */
+-		glTranslatef(0.5f,0.5f,0.99f);			/* move to the cylinder center */
+-		for (c=0;c<2;c++) {
+-			for (i=0;i<4;i++) {
+-				gluCylinder(quadratic, cylSize, cylSize, 0.25f, resolution, resolution);	/* quad, radius(bottom, radius(top), height, subdivisions (around Z), subdevisions (along Z) */
+-				glTranslatef(0.0f,0.0f,0.25f);			/* move to the cylinder cap  */
+-				gluDisk(quadratic, 0.0f, cylSize, resolution, resolution );	 /* inner size (cd hole), outer size (radius), subdivisions radial, subdivisions circular  */
+-				glTranslatef(0.0f,0.0f,-0.25f);			/* move back from the cylinder cap  */
+-				if (c==0) {	
+-					glTranslatef(0.0f,-1.0f,0.0f);			/* move to the next cylinder center (forward) */
+-				} else {
+-					glTranslatef(0.0f,1.0f,0.0f);			/* move to the next cylinder center (backward) */
+-				}
+-			}
+-			glTranslatef(-1.0f,1.0f,0.0f);			/* move to the cylinder center */
+-		}
+-		/* udders */
+-		/* 3 cylinders on the underside */
+-		glTranslatef(1.5f,-2.5f,-1.5f);		/* move to the center, under the top of the brick	 */
+-		for (c=0;c<3;c++) {
+-			gluCylinder(quadratic, uddSize, uddSize, 1.5f, resolution, resolution);	/* quad, radius(bottom, radius(top), height, subdivisions (around Z), subdevisions (along Z) */
+-			glTranslatef(0.0f,-1.0f,0.0f);		/* move to the center */	
+-		}
+-	}
+-	glPopMatrix();	/* restore state */
+-	glEndList();	
+-}
+-
+-/* 
+-	rip off of the builBlock() function creating the GL compilied pointer "block" but only creates two spheres.
+-	spheres are created with unit_sphere from spheres.h to allow wire frame 
+-*/
+-static void buildBlobBlock(ModeInfo *mi) {
+-  int wire = MI_IS_WIREFRAME(mi);
+-  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
+-	tb->block=glGenLists(1);	/* only one */
+-	glNewList(tb->block,GL_COMPILE);
+-	glPushMatrix();
+-  glScalef(1.4,1.4,1.4);
+-  unit_sphere (resolution/2,resolution, wire);
+-  glPopMatrix();
+-  glTranslatef(0.0f,-2.0f,0.0f);
+-  glScalef(1.4,1.4,1.4);
+-  unit_sphere (resolution/2,resolution, wire);
+-	glEndList();	
+-}
+-
+-
+-/* handle input events or not if daemon running the show */
+-ENTRYPOINT Bool 
+-topBlock_handle_event (ModeInfo *mi, XEvent *event) {
+-  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
+-	if (event->xany.type == KeyPress)    {
+-    KeySym keysym;
+-    char c = 0;
+-    XLookupString (&event->xkey, &c, 1, &keysym, 0);
+-    if (c == 'a') {
+-			tb->eyeX=tb->eyeX+1;
+-			return True;
+-		} else if (c == 'z') {
+-			tb->eyeX=tb->eyeX-1;
+-			return True;
+-		} else if (c == 's') {
+-			tb->eyeY=tb->eyeY+1;
+-			return True;
+-		} else if (c == 'x') {
+-			tb->eyeY=tb->eyeY-1;
+-			return True;
+-		} else if (c == 'd') {
+-			tb->eyeZ=tb->eyeZ+1;
+-			return True;
+-		} else if (c == 'c') {
+-			tb->eyeZ=tb->eyeZ-1;
+-			return True;
+-		} else if (c == 'f') {
+-			camX=camX+1;
+-			return True;
+-		} else if (c == 'v') {
+-			camX=camX-1;
+-			return True;
+-		} else if (c == 'g') {
+-			camY=camY+1;
+-			return True;
+-		} else if (c == 'b') {
+-			camY=camY-1;
+-			return True;
+-		} else if (c == 'h') {
+-			camZ=camZ+1;
+-			return True;
+-		} else if (c == 'n') {
+-			camZ=camZ-1;
+-			return True;
+-		} else if (c == 'r') {
+-			tb->rotation += 1;
+-			return True;
+-		}
+-	}
+-	return False;
+-}
+-
+-/* this is tha main change for v5 compatability and acompanying ENTRYPOINTS */
+-XSCREENSAVER_MODULE_2 ("topBlock", topblock, topBlock)
+-
+-#endif /* USE_GL */
++/* topblock, Copyright (c) 2006 rednuht <[email protected]>
++ *
++ * Permission to use, copy, modify, distribute, and sell this software and its
++ * documentation for any purpose is hereby granted without fee, provided that
++ * the above copyright notice appear in all copies and that both that
++ * copyright notice and this permission notice appear in supporting
++ * documentation.  No representations are made about the suitability of this
++ * software for any purpose.  It is provided "as is" without express or 
++ * implied warranty.
++ *
++ * 
++ *
++
++topBlock - a simple openGL 3D hack of falling blocks
++based on jwz's dangerball hack
++
++The proporations of the blocks and their features is not even close to the commercial building block products offered by a variety companies.
++
++information on this hack might be found at 
++http://www.jumpstation.co.uk/xscreensaver/topblock/
++
++History
++25/02/2006 v1.0 release
++29/04/2006 v1.11 updated to better fit with xscreensaver v5
++                 colors defaults to 7 (no black)
++*/
++
++#include <math.h>
++
++# define refresh_topBlock 0
++
++#define DEFAULTS	"*delay:	10000       \n" \
++			"*count:        30           \n" \
++			"*showFPS:      False       \n" \
++			"*wireframe:    False       \n" \
++
++#undef countof
++#define countof(x) (sizeof((x))/sizeof((*x)))
++
++#include "xlockmore.h"
++#include "topblock.h"
++#include "sphere.h"
++#include <ctype.h>
++
++#ifdef USE_GL /* whole file */
++
++#ifdef HAVE_COCOA
++# include <OpenGL/glu.h>
++#else
++# include <GL/glu.h>
++#endif
++
++typedef struct
++{
++  GLXContext *glx_context;
++  int numFallingBlocks;
++  GLfloat highest,highestFalling;
++  GLfloat eyeLine,eyeX,eyeY,eyeZ;
++  int carpetWidth, carpetLength;
++  int followMode;
++  GLfloat followRadius,followAngle;
++  int plusheight;
++  GLuint	carpet;
++  GLuint	block;
++  NODE *blockNodeRoot;
++  NODE *blockNodeFollow;
++  GLfloat rotation;
++} topBlockSTATE;
++
++/* parameter vars */
++Bool override;
++Bool rotate;
++Bool follow;
++Bool drawCarpet;
++Bool drawBlob;
++Bool drawNipples;
++GLfloat rotateSpeed;
++GLfloat camX;
++GLfloat camY;
++GLfloat camZ;
++GLfloat dropSpeed;
++int maxFalling;
++int maxColors;
++int size;
++int spawn;
++int resolution;
++
++static XrmOptionDescRec opts[] = {
++  { "-size",        ".size",        XrmoptionSepArg, 0 },
++  { "-spawn",       ".spawn",       XrmoptionSepArg, 0 },
++  { "-camX",        ".camX",        XrmoptionSepArg, 0 },
++  { "-camY",        ".camY",        XrmoptionSepArg, 0 },
++  { "-camZ",        ".camZ",        XrmoptionSepArg, 0 },
++  { "+rotate",      ".rotate",      XrmoptionNoArg, "False" },
++  { "-rotate",      ".rotate",      XrmoptionNoArg, "True" },
++  { "+carpet",      ".carpet",      XrmoptionNoArg, "False" },
++  { "+nipples",     ".nipples",     XrmoptionNoArg, "False" },
++  { "-blob",        ".blob",        XrmoptionNoArg, "True" },
++  { "-rotateSpeed", ".rotateSpeed", XrmoptionSepArg, 0 },
++  { "-follow",      ".follow",      XrmoptionNoArg, "True" },
++  { "-maxFalling",  ".maxFalling",  XrmoptionSepArg, 0 },
++  { "-resolution",  ".resolution",  XrmoptionSepArg, 0 },
++  { "-maxColors",   ".maxColors",   XrmoptionSepArg, 0 },
++  { "-dropSpeed",   ".dropSpeed",   XrmoptionSepArg, 0 },
++  { "-override",    ".override",    XrmoptionNoArg, "True" },
++};
++
++#define DEF_override      "False"
++#define DEF_rotate        "True"
++#define DEF_follow        "False"
++#define DEF_drawCarpet    "True"
++#define DEF_drawBlob      "False"
++#define DEF_drawNipples   "True"
++#define DEF_rotateSpeed   "10"
++#define DEF_maxFalling    "500"
++#define DEF_maxColors     "7"
++#define DEF_size          "2"
++#define DEF_spawn         "50"
++#define DEF_resolution    "4"
++#define DEF_camX          "1"
++#define DEF_camY          "20"
++#define DEF_camZ          "25"
++#define DEF_dropSpeed     "4"
++
++static argtype vars[] = {
++  {&override,     "override",     "Override",     DEF_override,     t_Bool},
++  {&rotate,       "rotate",       "Rotate",       DEF_rotate,       t_Bool},
++  {&drawCarpet,   "carpet",       "Carpet",       DEF_drawCarpet,   t_Bool},
++  {&drawNipples,  "nipples",      "Nipples",      DEF_drawNipples,  t_Bool},
++  {&drawBlob,     "blob",         "Blob",         DEF_drawBlob,     t_Bool},
++  {&rotateSpeed,  "rotateSpeed",  "RotateSpeed",  DEF_rotateSpeed,  t_Float},
++  {&follow,       "follow",       "Follow",       DEF_follow,       t_Bool},
++  {&camX,         "camX",         "camX",         DEF_camX,         t_Float},
++  {&camY,         "camY",         "camY",         DEF_camY,         t_Float},
++  {&camZ,         "camZ",         "camZ",         DEF_camZ,         t_Float},
++  {&size,         "size",         "size",         DEF_size,         t_Int},
++  {&spawn,        "spawn",        "spawn",        DEF_spawn,        t_Int},
++  {&maxFalling,   "maxFalling",   "maxFalling",   DEF_maxFalling,   t_Int},
++  {&resolution,   "resolution",   "resolution",   DEF_resolution,   t_Int},
++  {&maxColors,    "maxColors",    "maxColors",    DEF_maxColors,    t_Int},
++  {&dropSpeed,    "dropSpeed",    "DropSpeed",    DEF_dropSpeed,    t_Float},
++};
++
++static topBlockSTATE *tbs = NULL;
++
++ModeSpecOpt topBlock_opts = {countof(opts), opts, countof(vars), vars, NULL};
++
++/* Window management, etc */
++ENTRYPOINT void
++reshape_topBlock (ModeInfo *mi, int width, int height) {
++  GLfloat h = (GLfloat) height / (GLfloat) width;
++  glViewport (0, 0, (GLint) width, (GLint) height);
++  glMatrixMode(GL_PROJECTION);
++  glLoadIdentity();
++  gluPerspective (60.0, 1/h, 1.0, 1000.0);
++  glMatrixMode(GL_MODELVIEW);
++  glLoadIdentity();
++  glClear(GL_COLOR_BUFFER_BIT);
++}
++
++/* clean up on exit, not required ... */
++ENTRYPOINT void
++  release_topBlock(ModeInfo *mi) {
++  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
++	NODE *llCurrent, *llOld;
++	llCurrent = tb->blockNodeRoot;
++	while (llCurrent != NULL) {
++		llOld = llCurrent;
++		llCurrent = llCurrent->next;
++		free(llOld);
++	}
++}
++
++/* setup */
++ENTRYPOINT void 
++init_topBlock (ModeInfo *mi)
++{
++  topBlockSTATE *tb;
++  int wire = MI_IS_WIREFRAME(mi);
++
++  if (!tbs) {
++    tbs = (topBlockSTATE *)
++      calloc (MI_NUM_SCREENS(mi), sizeof (topBlockSTATE));
++    if (!tbs) {
++      fprintf(stderr, "%s: out of memory\n", progname);
++      exit(1);
++    }
++  }
++
++  tb = &tbs[MI_SCREEN(mi)];
++
++  tb->glx_context = init_GL(mi);
++
++  reshape_topBlock (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
++
++	if (wire) { drawNipples=False; }
++  tb->numFallingBlocks=0;
++
++	if (size>10) { size = 10; }
++	if (size<1) { size = 2; }
++	tb->carpetWidth = 8 * size;
++	tb->carpetLength = tb->carpetWidth;
++  
++  maxFalling=maxFalling*size;
++
++	if (spawn<4) { spawn=4; }
++	if (spawn>1000) { spawn=1000; }
++
++	if (rotateSpeed<1) {rotateSpeed=1; }
++	if (rotateSpeed>1000) {rotateSpeed=1000;}
++  rotateSpeed = rotateSpeed / 100;
++
++	if (resolution<4) {resolution=4;}
++	if (resolution>20) {resolution=20;}
++  resolution=resolution*2;
++
++	if (maxColors<1) {maxColors=1;}
++	if (maxColors>8) {maxColors=8;}
++
++	if (dropSpeed<1) {dropSpeed=1;}
++	if (dropSpeed>9) {dropSpeed=9;} /* 10+ produces blocks that can pass through each other */
++  
++	dropSpeed = 80/dropSpeed;
++	dropSpeed = (blockHeight/dropSpeed); 
++
++  tb->glx_context = init_GL(mi);
++
++  reshape_topBlock (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
++  if (0==1) {
++      glClearColor(1.0f, 1.0f, 1.0f, 0.5f);
++  } else {
++      glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
++  }
++  glClearDepth(1.0f);
++  if (!wire) {
++    GLfloat pos[4] = {10.0, 10.0, 1.0, 0.0};
++    GLfloat amb[4] = {0.1, 0.1, 0.1, 1.0};
++    GLfloat dif[4] = {1.0, 1.0, 1.0, 1.0};
++    GLfloat spc[4] = {0.0, 1.0, 1.0, 1.0};
++
++    glEnable(GL_LIGHTING);
++    glEnable(GL_LIGHT0);
++    glLightfv(GL_LIGHT0, GL_POSITION, pos);
++    glLightfv(GL_LIGHT0, GL_AMBIENT,  amb); 
++    glLightfv(GL_LIGHT0, GL_DIFFUSE,  dif);
++    glLightfv(GL_LIGHT0, GL_SPECULAR, spc); 
++  }
++	glDepthFunc(GL_LEQUAL);
++  glEnable(GL_DEPTH_TEST);
++  glDisable(GL_CULL_FACE); /* all objects exhibit a reverse side */
++  glCullFace(GL_BACK); 
++
++	if (drawBlob) {
++    buildBlobBlock(mi); 
++	} else {
++	  buildBlock(mi);		/* build the display list holding the simple block */
++	}
++  buildCarpet(mi);		/* build the base */
++	tb->highest=0;
++	tb->highestFalling=0;
++	tb->eyeLine=tb->highest;
++	tb->eyeX=0;
++	tb->eyeY=0;
++	tb->eyeZ=0;
++	tb->followMode=0;
++  if (follow) {
++    tb->plusheight=100;
++    camZ=camZ-60;
++  } else {
++    tb->rotation=random() % 360;
++    tb->eyeY=10;
++    tb->plusheight=30;
++  }
++	tb->followRadius=0;
++  /* override camera settings */
++  if (override) {
++    tb->plusheight=100;
++    drawCarpet=False;
++    camX=0;
++    camY=1;
++    camZ=0;
++    tb->eyeX=-1;
++    tb->eyeY=20;
++    tb->eyeZ=0;
++  }
++}
++
++/* provides the per frame entertainment */
++ENTRYPOINT void
++draw_topBlock (ModeInfo *mi) {
++  	Display *dpy = MI_DISPLAY(mi);
++  	Window window = MI_WINDOW(mi);
++  	NODE *llCurrent;
++  	NODE *llNode;
++  	topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
++  	GLfloat spcN1x,spcN1y,spcN2x,spcN2y;
++  	GLfloat spcC1x,spcC1y,spcC2x,spcC2y;
++  	int wire = MI_IS_WIREFRAME(mi);
++	  GLfloat color[4];	
++
++  if (!tb->glx_context)
++    return;
++  glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(tb->glx_context));
++
++	generateNewBlock(mi);
++
++	if (rotate) { tb->rotation += rotateSpeed; } 
++	if (tb->rotation>=360) { tb->rotation=tb->rotation-360; } 
++
++	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);		/* clear current */
++	glLoadIdentity();	/* resets directions, do it every time ! */
++
++	if (!follow) {
++		if (tb->highest>tb->eyeLine) { tb->eyeLine=tb->eyeLine + ((tb->highest-tb->eyeLine)/100);	} /* creates a smooth camera transition */
++		gluLookAt(camX, camY+tb->eyeLine, camZ, tb->eyeX, tb->eyeY+tb->eyeLine, tb->eyeZ, 0.0, 1.0, 0.0);		/* setup viewer, xyz cam, xyz looking at and where is up normaly 0,1,0 */
++		glRotatef(90, 1.0, 0.0, 0.0);			/* x axis */
++	} else {
++		glRotatef(90, 0.0, 0.0, 1.0);     /* z axis */
++		followBlock(mi);
++	}
++	/* rotate the world */
++	glRotatef(tb->rotation, 0.0, 0.0, 1.0);		
++
++	llCurrent = tb->blockNodeRoot;
++	if (drawCarpet) {
++		/* center carpet */
++		glTranslatef(0.0-(tb->carpetWidth/2),0.0-(tb->carpetLength/2),0.0);
++		glCallList(tb->carpet);
++		glTranslatef(0.0+(tb->carpetWidth/2),0.0+(tb->carpetLength/2),0.0);
++		glTranslatef(0.0,0.0,-0.55);
++	}
++	tb->highestFalling=0;
++	while (llCurrent != NULL) {	/* for each block */
++		glPushMatrix();	/* save state */
++		/* set color */
++		switch (llCurrent->color) { 
++			case 0:
++				color[0] = 1.0f;	
++				color[1] = 0.0f;	
++				color[2] = 0.0f;	
++				color[3] = 1.0f;	
++				break;
++			case 1:
++				color[0] = 0.0f;	
++				color[1] = 1.0f;	
++				color[2] = 0.0f;	
++				color[3] = 1.0f;	
++				break;
++			case 2:
++				color[0] = 0.0f;	
++				color[1] = 0.0f;	
++				color[2] = 1.0f;	
++				color[3] = 1.0f;	
++				break;
++			case 3:
++				color[0] = 0.95f;	
++				color[1] = 0.95f;	
++				color[2] = 0.95f;	
++				color[3] = 1.0f;	
++				break;
++			case 4:
++				color[0] = 1.0f;	
++				color[1] = 0.5f;	
++				color[2] = 0.0f;	
++				color[3] = 1.0f;	
++				break;
++			case 5:
++				color[0] = 1.0f;	
++				color[1] = 1.0f;	
++				color[2] = 0.0f;	
++				color[3] = 1.0f;	
++				break;
++			case 6: 
++				color[0] = 0.5f;	
++				color[1] = 0.5f;	
++				color[2] = 0.5f;	
++				color[3] = 1.0f;	
++				break;
++			case 7:
++				color[0] = 0.05f;	
++				color[1] = 0.05f;	
++				color[2] = 0.05f;	
++				color[3] = 1.0f;	
++				break;
++		} 
++		if (wire) { glColor3fv(color); }
++		else { glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color); }
++
++		if (llCurrent->falling==1) {
++    	spcC2x = 0;
++	    spcC2y = 0;
++	    spcN2x = 0;
++	    spcN2y = 0;
++			if (llCurrent->height>tb->highestFalling) {tb->highestFalling=llCurrent->height;}
++			/* all blocks fall at the same rate to avoid mid air collisions */
++			llCurrent->height=llCurrent->height-dropSpeed;
++			if (llCurrent->height<=0) {
++				llCurrent->falling=0;
++				if (tb->highest==0) { 
++					tb->highest=tb->highest+blockHeight; 
++				}
++			} 
++			if ( (llCurrent->height<=tb->highest+1) && (llCurrent->falling==1) ) {
++				/* check for collision */
++				llNode = tb->blockNodeRoot;
++				spcC1x = llCurrent->x;
++				spcC1y = llCurrent->y;
++				switch(llCurrent->rotation) {
++					case getOrientation(0):
++						spcC2x = spcC1x;
++						spcC2y = spcC1y-2;
++						break;
++					case getOrientation(1):
++						spcC2x = spcC1x+2;
++						spcC2y = spcC1y;
++						break;
++					case getOrientation(2):
++						spcC2x = spcC1x;
++						spcC2y = spcC1y+2;
++						break;
++					case getOrientation(3):
++						spcC2x = spcC1x-2;
++						spcC2y = spcC1y;
++						break;
++				}
++				while (llNode != NULL) {
++					if ( (llNode->falling==0) && (llCurrent->falling==1) ) {
++						spcN1x = llNode->x;
++						spcN1y = llNode->y;
++						switch(llNode->rotation) {
++							case getOrientation(0):
++								spcN2x = spcN1x;
++								spcN2y = spcN1y-2;
++								break;
++							case getOrientation(1):
++								spcN2x = spcN1x+2;
++								spcN2y = spcN1y;
++								break;
++							case getOrientation(2):
++								spcN2x = spcN1x;
++								spcN2y = spcN1y+2;
++								break;
++							case getOrientation(3):
++								spcN2x = spcN1x-2;
++								spcN2y = spcN1y;
++								break;
++						}
++						if ( 
++							( (spcC1x==spcN1x) && (spcC1y==spcN1y) ) ||
++							( (spcC1x==spcN2x) && (spcC1y==spcN2y) ) ||
++							( (spcC2x==spcN2x) && (spcC2y==spcN2y) ) ||
++							( (spcC2x==spcN1x) && (spcC2y==spcN1y) )
++						){
++				      if ( (llCurrent->height<=llNode->height+blockHeight+TOLLERANCE) && (llCurrent->height>=llNode->height+blockHeight-TOLLERANCE) )  {
++						    llCurrent->falling=0;
++							  llCurrent->height=llNode->height+blockHeight; /* if this is missing then small errors build up until the model fails */
++							  if ( (llCurrent->height<=tb->highest+TOLLERANCE) && (llCurrent->height>=tb->highest-TOLLERANCE) ) { 
++							   tb->highest=tb->highest+blockHeight; 
++							  }
++						  }
++					  }
++				  }
++				  llNode=llNode->next;
++			  }				
++		  }
++	  } 
++  	/* set location in space */
++	  glTranslatef(llCurrent->x,llCurrent->y,-llCurrent->height);
++	  /* rotate */
++  	glRotatef(llCurrent->rotation, 0.0f, 0.0f, 1.0f);
++  	if ((tb->followMode==0) && (llCurrent->next==NULL)) {
++  		tb->blockNodeFollow = llCurrent;
++  		tb->followMode=1;
++  	} 
++  	llCurrent = llCurrent->next;
++  	/* draw   */
++  	glCallList(tb->block); 
++  	glPopMatrix();	/* restore state */
++  } 
++  if (mi->fps_p) do_fps (mi);
++  glFinish();
++
++	if (tb->highest>(5*maxFalling)) { drawCarpet=False; }
++  glXSwapBuffers(dpy, window);
++}
++
++
++
++/* camera is in follow mode, work out where we should be looking */
++static void followBlock(ModeInfo *mi) {
++	GLfloat xLen,yLen,cx,cy,rangle,xTarget,yTarget;
++  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
++  cx=0;cy=0;
++	if ((tb->blockNodeFollow!=NULL) && (tb->followMode==1)){
++
++		if (tb->highest>tb->eyeLine) { tb->eyeLine=tb->eyeLine + ((tb->highest-tb->eyeLine)/100);	} 
++		  /*tb->blockNodeFollow->color=1;  only noticable if you set the colors to 1 */
++		
++			if (tb->blockNodeFollow->height > tb->eyeZ) { tb->eyeZ=tb->eyeZ +  ((tb->blockNodeFollow->height - tb->eyeZ)/100); } 
++			if (tb->blockNodeFollow->height < tb->eyeZ) { tb->eyeZ=tb->eyeZ - ((tb->eyeZ - tb->blockNodeFollow->height)/100); } 
++		
++
++		/* when the scene is rotated we need to know where the block is in the 2 dimensional coordinates of the carpet area
++		   (see http://www.jumpstation.co.uk/rotation/)
++		*/
++
++		if (tb->followRadius==0) {		
++			xLen = tb->blockNodeFollow->x-cx;
++			yLen = tb->blockNodeFollow->y-cy;
++			tb->followRadius=sqrt( (xLen*xLen) + (yLen*yLen) );	
++			tb->followAngle = (180/M_PI) * asin(xLen/tb->followRadius); 
++			tb->followAngle = quadrantCorrection(tb->followAngle,(int)cx,(int)cy,(int)tb->blockNodeFollow->x,(int)tb->blockNodeFollow->y);
++		}
++		rangle = (tb->followAngle+tb->rotation) * M_PI /180;
++		xTarget = cos(rangle) * tb->followRadius + cx;
++		yTarget = sin(rangle) * tb->followRadius + cy;
++		if (tb->followAngle>360) { tb->followAngle=tb->followAngle-360; }
++
++		if (xTarget < tb->eyeX) { tb->eyeX=tb->eyeX - ((tb->eyeX - xTarget)/100); }
++		if (xTarget > tb->eyeX) { tb->eyeX=tb->eyeX + ((xTarget - tb->eyeX)/100); }
++
++		if (yTarget < tb->eyeY) { tb->eyeY=tb->eyeY - ((tb->eyeY - yTarget)/100); }
++		if (yTarget > tb->eyeY) { tb->eyeY=tb->eyeY + ((yTarget - tb->eyeY)/100); }
++ /*
++		tb->eyeX = xTarget;
++		tb->eyeY = yTarget;
++***************************************************************************
++*/
++		if (!tb->blockNodeFollow->falling) {  
++			tb->followMode=0; 
++			/*tb->blockNodeFollow->color=2;  only noticable if you set the colors to 1 */
++			tb->followRadius=0;
++		} 
++	}
++	gluLookAt(camX, camY, camZ-tb->eyeLine, tb->eyeX, tb->eyeY, -tb->eyeZ,-1.0,0.0,0.0);
++}
++
++/* each quater of the circle has to be adjusted for */
++static double quadrantCorrection(double angle,int cx,int cy,int x,int y) {
++	if ((x>=cx) && (y>=cy)) {
++		angle = angle + (90-(angle-90) * 2); 
++	} else if ((x>=cx) && (y<=cy)) {
++		angle = angle + 90; 
++	} else if ((x<=cx) && (y<=cy)) {
++		angle = angle + 90; 
++	} else if ((x<=cx) && (y>=cy)) {
++		angle = angle + (90-(angle-90) * 2); 
++	}
++	return(angle-180);
++}
++
++/* if random chance then create a new falling block */
++static void generateNewBlock(ModeInfo *mi) {
++	NODE *llCurrent, *llTail;
++	GLfloat startOffx, startOffy;
++	int endOffx, endOffy;
++  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
++	if ( ((random() % spawn) == 1) && (tb->highestFalling<getHeight((tb->plusheight-blockHeight)+tb->highest)) ) {	
++		startOffx=0;
++		endOffx=0;
++		startOffy=0;
++		endOffy=0;
++		tb->numFallingBlocks++;
++		llTail = tb->blockNodeRoot; 
++		if (llTail == NULL) {
++			if ((llCurrent = ((NODE*) malloc(sizeof(NODE)))) == NULL) {	fprintf(stderr, "%s: out of memory.\n", progname); }
++			llTail = llCurrent;
++			tb->blockNodeRoot = llCurrent; 
++		} else {
++			if (tb->numFallingBlocks>=maxFalling) {
++				/* recycle */
++				llCurrent=llTail->next;
++				tb->blockNodeRoot=llCurrent->next;
++			} else {
++				if ((llCurrent = ((NODE*) malloc(sizeof(NODE)))) == NULL) {	fprintf(stderr, "%s: out of memory..\n", progname); }
++			}
++			while (llTail->next != NULL) { llTail = llTail->next; } /* find last item in list */
++		}
++		llCurrent->falling=1;
++		llCurrent->rotation=getOrientation(random() % 4); 
++		if (llCurrent->rotation==getOrientation(0)) {
++			startOffx=1.0;
++			endOffx=0;
++			startOffy=3.0;
++			endOffy=-1;
++		} else if (llCurrent->rotation==getOrientation(1)) {
++			startOffx=1.0;
++			endOffx=-1;
++			startOffy=1.0;
++			endOffy=0;		
++		} else if (llCurrent->rotation==getOrientation(2)) {
++			startOffx=1.0;
++			endOffx=0;
++			startOffy=3.0;
++			endOffy=-1;		
++		} else if (llCurrent->rotation==getOrientation(3)) { 
++			startOffx=5.0;
++			endOffx=-1;
++			startOffy=1.0;
++			endOffy=0;		
++		}
++
++		llCurrent->x=(startOffx-(tb->carpetLength/2)) + getLocation(random() % ((tb->carpetLength/2)+endOffx) );
++		llCurrent->y=(startOffy-(tb->carpetLength/2)) + getLocation(random() % ((tb->carpetLength/2)+endOffy) );
++		llCurrent->color=(random() % maxColors);
++		llCurrent->height=getHeight(tb->plusheight+tb->highest); 
++		if (tb->numFallingBlocks>=maxFalling) {
++			tb->numFallingBlocks--;
++			tb->numFallingBlocks--;
++		} 
++		llTail->next = llCurrent;
++		llTail = llCurrent;
++		llTail->next = NULL;
++
++	}
++}
++
++/* called at init this creates the 'carpet' display list item */
++static void buildCarpet(ModeInfo *mi) {
++	int i,c,x,y;
++	GLfloat color[4];
++  	int wire = MI_IS_WIREFRAME(mi);
++  	topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
++  	GLUquadricObj *quadratic;
++		color[0] = 0.0f;	
++		color[1] = 1.0f;	
++		color[2] = 0.0f;	
++		color[3] = 1.0f;	
++	tb->carpet=glGenLists(1);	/* only one */
++	glNewList(tb->carpet,GL_COMPILE);
++	glPushMatrix();	/* save state */
++  	x=tb->carpetWidth;
++  	y=tb->carpetLength;
++	if (wire) { glColor3fv(color); }
++	else { glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color); }
++	/* draw carpet plane */
++	glBegin( wire ? GL_LINE_LOOP : GL_QUADS );
++		/* draw top */
++		glNormal3f( 0, 0, -1 );
++		glVertex3f(0.0,0.0,0.0);
++		glVertex3f(x,0.0,0.0);
++		glVertex3f(x,y,0.0);
++		glVertex3f(0.0,y,0.0);
++	    if (wire) { glEnd(); } 
++		else {
++		/* add edge pieces */
++		/* side 1 */
++		glNormal3f( 0, -1, 0 );
++		glVertex3f(0.0,0.0,0.0);
++		glVertex3f(x,0.0,0.0);
++		glVertex3f(x,0,singleThick);
++		glVertex3f(0.0,0,singleThick);
++		/* side 2 */
++		glNormal3f( -1, 0, 0 );
++		glVertex3f(0.0,0.0,0.0);
++		glVertex3f(0,y,0.0);
++		glVertex3f(0,y,singleThick);
++		glVertex3f(0.0,0,singleThick);
++		/* side 3 */
++		glNormal3f( 1, 0, 0 );
++		glVertex3f(x,0.0,0.0);
++		glVertex3f(x,y,0.0);
++		glVertex3f(x,y,singleThick);
++		glVertex3f(x,0,singleThick);
++		/* side 4 */
++		glNormal3f( 0, 1, 0 );
++		glVertex3f(0,y,0.0);
++		glVertex3f(x,y,0.0);
++		glVertex3f(x,y,singleThick);
++		glVertex3f(0,y,singleThick);
++		}
++	glEnd();
++	/* nipples */
++	if (drawNipples) {
++		quadratic=gluNewQuadric();			/* Create A Pointer To The Quadric Object */
++		gluQuadricNormals(quadratic, GLU_SMOOTH);	/* Create Smooth Normals  */
++		gluQuadricTexture(quadratic, GL_TRUE);		/* Create Texture Coords  */
++		glTranslatef(0.5f,0.5f,-.25);			/* move to the cylinder center */
++		for (c=0;c<x;c++) {
++			glPushMatrix();	/* save state */
++			for (i=0;i<y;i++) {
++				gluCylinder(quadratic, cylSize, cylSize, 0.25f, resolution, resolution);	/* quad, radius(bottom, radius(top), height, subdivisions (around Z), subdevisions (along Z) */
++				glRotatef(180, 0.0f, 1.0f, 0.0f); /* they are upside down */
++				gluDisk(quadratic, 0.0f, cylSize, resolution, resolution );	 /* inner size (cd hole), outer size (radius), subdivisions radial, subdivisions circular  */
++				glRotatef(180, 0.0f, 1.0f, 0.0f); /* recover */
++				glTranslatef(0.0f,1.0f,0.0f);			/* move to the next cylinder center (backward) */
++			}
++			glPopMatrix();	/* save state */
++			glTranslatef(1.0f,0.0f,0.0f);			/* reset   */
++		}
++	}
++	glPopMatrix();	/* restore state */
++	glEndList();	
++}
++
++/* using the verticies arrays builds the plane, now with normals */
++static void polygonPlane(int wire, int a, int b, int c , int d, int i)
++{
++	GLfloat topBlockNormals[5][3] = { {0,0,-1},	{0,1,0}, {1,0,0}, {0,0,1}, {0,-1,0} };
++	GLfloat topBlockVertices[8][3] = { {-0.49,-2.97,-0.99}, {0.99,-2.97,-0.99}, {0.99,0.99,-0.99}  , {-0.49,0.99,-0.99}, {-0.49,-2.97,0.99} , {0.99,-2.97,0.99}, {0.99,0.99,0.99}   , {-0.49,0.99,0.99} };
++	glBegin( wire ? GL_LINE_LOOP : GL_POLYGON);
++		glNormal3fv(topBlockNormals[i] );
++		glVertex3fv(topBlockVertices[a]);
++		glVertex3fv(topBlockVertices[b]);
++		glVertex3fv(topBlockVertices[c]);
++		glVertex3fv(topBlockVertices[d]);
++	glEnd();
++}
++
++/* called at init this creates the 'block' display list item */
++/* the spheres came about originaly as quick way to test the directional lighting/normals */
++static void buildBlock(ModeInfo *mi) {
++	int i,c;
++  int wire = MI_IS_WIREFRAME(mi);
++  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
++	GLUquadricObj *quadratic;
++	tb->block=glGenLists(1);	/* only one */
++	glNewList(tb->block,GL_COMPILE);
++	glPushMatrix();	/* save state */
++	glRotatef(90, 0.0f, 1.0f, 0.0f);
++	/* base */
++	polygonPlane(wire, 0,3,2,1,0);
++	polygonPlane(wire, 2,3,7,6,1);
++	polygonPlane(wire, 1,2,6,5,2); 
++	polygonPlane(wire, 4,5,6,7,3); 
++	polygonPlane(wire, 0,1,5,4,4);
++	if (drawNipples) {
++		/* nipples */
++		/* draw 8 cylinders each with a disk cap */
++		quadratic=gluNewQuadric();			/* Create A Pointer To The Quadric Object  */
++		gluQuadricNormals(quadratic, GLU_SMOOTH);	/* Create Smooth Normals  */
++		glRotatef(90, 0.0f, 1.0f, 0.0f);		/* 'aim' the pointer ready for the cylinder */
++		glTranslatef(0.5f,0.5f,0.99f);			/* move to the cylinder center */
++		for (c=0;c<2;c++) {
++			for (i=0;i<4;i++) {
++				gluCylinder(quadratic, cylSize, cylSize, 0.25f, resolution, resolution);	/* quad, radius(bottom, radius(top), height, subdivisions (around Z), subdevisions (along Z) */
++				glTranslatef(0.0f,0.0f,0.25f);			/* move to the cylinder cap  */
++				gluDisk(quadratic, 0.0f, cylSize, resolution, resolution );	 /* inner size (cd hole), outer size (radius), subdivisions radial, subdivisions circular  */
++				glTranslatef(0.0f,0.0f,-0.25f);			/* move back from the cylinder cap  */
++				if (c==0) {	
++					glTranslatef(0.0f,-1.0f,0.0f);			/* move to the next cylinder center (forward) */
++				} else {
++					glTranslatef(0.0f,1.0f,0.0f);			/* move to the next cylinder center (backward) */
++				}
++			}
++			glTranslatef(-1.0f,1.0f,0.0f);			/* move to the cylinder center */
++		}
++		/* udders */
++		/* 3 cylinders on the underside */
++		glTranslatef(1.5f,-2.5f,-1.5f);		/* move to the center, under the top of the brick	 */
++		for (c=0;c<3;c++) {
++			gluCylinder(quadratic, uddSize, uddSize, 1.5f, resolution, resolution);	/* quad, radius(bottom, radius(top), height, subdivisions (around Z), subdevisions (along Z) */
++			glTranslatef(0.0f,-1.0f,0.0f);		/* move to the center */	
++		}
++	}
++	glPopMatrix();	/* restore state */
++	glEndList();	
++}
++
++/* 
++	rip off of the builBlock() function creating the GL compilied pointer "block" but only creates two spheres.
++	spheres are created with unit_sphere from spheres.h to allow wire frame 
++*/
++static void buildBlobBlock(ModeInfo *mi) {
++  int wire = MI_IS_WIREFRAME(mi);
++  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
++	tb->block=glGenLists(1);	/* only one */
++	glNewList(tb->block,GL_COMPILE);
++	glPushMatrix();
++  glScalef(1.4,1.4,1.4);
++  unit_sphere (resolution/2,resolution, wire);
++  glPopMatrix();
++  glTranslatef(0.0f,-2.0f,0.0f);
++  glScalef(1.4,1.4,1.4);
++  unit_sphere (resolution/2,resolution, wire);
++	glEndList();	
++}
++
++
++/* handle input events or not if daemon running the show */
++ENTRYPOINT Bool 
++topBlock_handle_event (ModeInfo *mi, XEvent *event) {
++  topBlockSTATE *tb = &tbs[MI_SCREEN(mi)];
++	if (event->xany.type == KeyPress)    {
++    KeySym keysym;
++    char c = 0;
++    XLookupString (&event->xkey, &c, 1, &keysym, 0);
++    if (c == 'a') {
++			tb->eyeX=tb->eyeX+1;
++			return True;
++		} else if (c == 'z') {
++			tb->eyeX=tb->eyeX-1;
++			return True;
++		} else if (c == 's') {
++			tb->eyeY=tb->eyeY+1;
++			return True;
++		} else if (c == 'x') {
++			tb->eyeY=tb->eyeY-1;
++			return True;
++		} else if (c == 'd') {
++			tb->eyeZ=tb->eyeZ+1;
++			return True;
++		} else if (c == 'c') {
++			tb->eyeZ=tb->eyeZ-1;
++			return True;
++		} else if (c == 'f') {
++			camX=camX+1;
++			return True;
++		} else if (c == 'v') {
++			camX=camX-1;
++			return True;
++		} else if (c == 'g') {
++			camY=camY+1;
++			return True;
++		} else if (c == 'b') {
++			camY=camY-1;
++			return True;
++		} else if (c == 'h') {
++			camZ=camZ+1;
++			return True;
++		} else if (c == 'n') {
++			camZ=camZ-1;
++			return True;
++		} else if (c == 'r') {
++			tb->rotation += 1;
++			return True;
++		}
++	}
++	return False;
++}
++
++/* this is tha main change for v5 compatability and acompanying ENTRYPOINTS */
++XSCREENSAVER_MODULE_2 ("topBlock", topblock, topBlock)
++
++#endif /* USE_GL */
+diff -urp -x '*~' hacks/glx/topblock.h hacks/glx/topblock.h
+--- hacks/glx/topblock.h	2006-05-03 13:48:43.000000000 -0700
++++ hacks/glx/topblock.h	2006-08-08 15:26:10.403238000 -0700
+@@ -1,45 +1,45 @@
+-/* topblock - openGL based hack  */
+-
+-static void buildCarpet(ModeInfo *);
+-static void polygonPlane(int, int, int, int, int ,int);
+-static void buildBlock(ModeInfo *);
+-static void generateNewBlock(ModeInfo *);
+-static void followBlock(ModeInfo *);
+-static void buildBlobBlock(ModeInfo *);
+-static double quadrantCorrection(double,int,int,int,int);
+-
+-/* this structure holds all the attributes about a block */
+-typedef struct blockNode {
+-	int color;		/* indexed */
+-	int rotation;		/* indexed: 0=S-N, 1=W-E, 2=N-S, 3=E-W */
+-	GLfloat height;
+-	GLfloat x;
+-	GLfloat y;
+-	int falling;		
+-	struct blockNode *next;
+-} NODE;
+-
+-
+-/* some handy macros and definitions */
+-#define blockHeight 1.49f
+-#define getHeight(a) (a * blockHeight)
+-
+-#define getOrientation(a) (a * 90)
+-
+-#define blockWidth 2.0f
+-#define getLocation(a) (a * blockWidth)
+-
+-#define TOLLERANCE 0.1
+-
+-#define cylSize 0.333334f
+-#define uddSize 0.4f
+-#define	singleThick 0.29	/* defines the thickness of the carpet */
+-
+-
+-
+-
+-
+-
+-
+-
+-
++/* topblock - openGL based hack  */
++
++static void buildCarpet(ModeInfo *);
++static void polygonPlane(int, int, int, int, int ,int);
++static void buildBlock(ModeInfo *);
++static void generateNewBlock(ModeInfo *);
++static void followBlock(ModeInfo *);
++static void buildBlobBlock(ModeInfo *);
++static double quadrantCorrection(double,int,int,int,int);
++
++/* this structure holds all the attributes about a block */
++typedef struct blockNode {
++	int color;		/* indexed */
++	int rotation;		/* indexed: 0=S-N, 1=W-E, 2=N-S, 3=E-W */
++	GLfloat height;
++	GLfloat x;
++	GLfloat y;
++	int falling;		
++	struct blockNode *next;
++} NODE;
++
++
++/* some handy macros and definitions */
++#define blockHeight 1.49f
++#define getHeight(a) (a * blockHeight)
++
++#define getOrientation(a) (a * 90)
++
++#define blockWidth 2.0f
++#define getLocation(a) (a * blockWidth)
++
++#define TOLLERANCE 0.1
++
++#define cylSize 0.333334f
++#define uddSize 0.4f
++#define	singleThick 0.29	/* defines the thickness of the carpet */
++
++
++
++
++
++
++
++
++
--- a/open-src/app/xscreensaver/trusted.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/trusted.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -31,9 +31,9 @@
 Support needed for Solaris Trusted Extensions / Trusted Java Desktop System.
 
 diff -urp -x '*~' configure.in configure.in
---- configure.in	2006-05-10 08:49:50.311248000 -0700
-+++ configure.in	2006-05-10 08:49:57.787065000 -0700
-@@ -3308,6 +3308,18 @@ fi
+--- configure.in	2006-08-08 17:27:15.440757000 -0700
++++ configure.in	2006-08-08 17:27:22.191138000 -0700
+@@ -3440,6 +3440,18 @@ fi
  AC_SUBST([XPM_LOGO_FILE])
  AC_SUBST([XPM_LOGO_NAME])
  
@@ -53,9 +53,9 @@
  
  if test "$have_kerberos" = yes; then
 diff -urp -x '*~' driver/Makefile.in driver/Makefile.in
---- driver/Makefile.in	2006-05-10 08:49:50.406340000 -0700
-+++ driver/Makefile.in	2006-05-10 08:49:57.796787000 -0700
-@@ -101,6 +101,10 @@ GTK_OBJS	= demo-Gtk.o demo-Gtk-conf.o @G
+--- driver/Makefile.in	2006-08-08 17:27:15.943106000 -0700
++++ driver/Makefile.in	2006-08-08 17:27:22.192257000 -0700
+@@ -103,6 +103,10 @@ GTK_OBJS	= demo-Gtk.o demo-Gtk-conf.o @G
  GTK_LOCK_SRCS	= lock-Gtk.c remote.c
  GTK_LOCK_OBJS	= lock-Gtk.o remote.o
  
@@ -66,8 +66,8 @@
  PWENT_SRCS	= passwd-pwent.c
  PWENT_OBJS	= passwd-pwent.o
  
-@@ -808,8 +812,10 @@ demo-Gtk-conf.o: demo-Gtk-conf.c
- 	  $(srcdir)/demo-Gtk-conf.c
+@@ -774,8 +778,10 @@ lock.o:
+ 	  $(srcdir)/lock.c
  
  # lock-Gtk takes extra -D and -I options.
 +@TRUSTED_XPM_COMMENT@ TRUSTED_LOGO_DEFS=-DTRUSTED_XPM_LOGO_FILE=\"@TRUSTED_XPM_LOGO_FILE@\" \
@@ -78,7 +78,7 @@
  
  lock-Gtk.o: lock-Gtk.c
  	$(CC) -c $(INCLUDES) -I$(ICON_SRC) $(GTK_DEFS) \
-@@ -825,8 +831,9 @@ XScreenSaver_ad.h: XScreenSaver.ad
+@@ -794,8 +800,9 @@ XScreenSaver_Xm_ad.h: XScreenSaver-Xm.ad
  
  # The executables linked in this directory.
  #
@@ -90,7 +90,7 @@
  
  xscreensaver-command: $(CMD_OBJS)
  	$(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
-@@ -839,8 +846,9 @@ xscreensaver-demo: @PREFERRED_DEMO_PROGR
+@@ -814,8 +821,9 @@ xscreensaver-demo: @PREFERRED_DEMO_PROGR
  xscreensaver-lock: @PREFERRED_LOCK_PROGRAM@
  	$(INSTALL_PROGRAM) @PREFERRED_LOCK_PROGRAM@ $@
  
@@ -101,18 +101,21 @@
  	$(GTK_LIBS) $(XML_LIBS) $(X_PRE_LIBS) -lXt -lX11 \
  	$(XDPMS_LIBS) -lXext \
  	$(X_EXTRA_LIBS)
-@@ -850,13 +858,15 @@ xscreensaver-demo-Xm: $(DEMO_OBJS) $(MOT
+@@ -825,16 +833,18 @@ xscreensaver-demo-Xm: $(DEMO_OBJS) $(MOT
  	$(MOTIF_LIBS) $(INTL_LIBS) $(X_PRE_LIBS) -lXt -lX11 \
- 	$(XDPMS_LIBS) -lXext $(X_EXTRA_LIBS)
+ 	$(XDPMS_LIBS) $(XINERAMA_LIBS) -lXext $(X_EXTRA_LIBS)
  
 -xscreensaver-demo-Gtk: $(DEMO_OBJS) $(GTK_OBJS)
 -	$(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(GTK_OBJS) $(LIBS) $(X_LIBS) \
--	$(GTK_LIBS) $(XML_LIBS) $(INTL_LIBS) $(X_PRE_LIBS) -lXt -lX11 \
+-	$(GTK_LIBS) $(XPM_LIBS) $(XML_LIBS) $(INTL_LIBS) $(X_PRE_LIBS) \
 +xscreensaver-demo-Gtk: $(DEMO_OBJS) $(GTK_OBJS) $(TRUSTED_OBJS)
 +	$(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(GTK_OBJS) $(TRUSTED_OBJS) \
-+	$(LIBS) $(X_LIBS) $(GTK_LIBS) $(XML_LIBS) $(INTL_LIBS) \
-+	$(TRUSTED_LIBS) $(X_PRE_LIBS) -lXt -lX11 \
- 	$(XDPMS_LIBS) -lXext $(X_EXTRA_LIBS)
++	$(LIBS) $(X_LIBS) $(GTK_LIBS) $(XPM_LIBS) $(XML_LIBS) $(INTL_LIBS) \
++	$(TRUSTED_LIBS) $(X_PRE_LIBS) \
+ 	-lXt -lX11 $(XDPMS_LIBS) $(XINERAMA_LIBS) -lXext $(X_EXTRA_LIBS)
+ 
+ demo-Gtk.o: XScreenSaver_ad.h
+ demo-Xm.o:  XScreenSaver_ad_Xm.h
  
 -xscreensaver-getimage: $(GETIMG_OBJS)
 -	$(CC) $(LDFLAGS) -o $@ $(GETIMG_OBJS) $(GETIMG_LIBS) -lm
@@ -120,12 +123,12 @@
 +	$(CC) $(LDFLAGS) -o $@ $(GETIMG_OBJS) $(TRUSTED_OBJS) \
 +	$(GETIMG_LIBS) $(TRUSTED_LIBS) -lm
  
- 
- TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
+ pdf2jpeg: $(PDF2JPEG_OBJS)
+ 	$(OBJCC) $(LDFLAGS) -o $@ $(PDF2JPEG_OBJS) $(PDF2JPEG_LIBS) -lm
 diff -urp -x '*~' driver/demo-Gtk.c driver/demo-Gtk.c
---- driver/demo-Gtk.c	2006-05-10 08:49:50.661964000 -0700
-+++ driver/demo-Gtk.c	2006-05-10 08:49:57.837940000 -0700
-@@ -112,6 +112,8 @@
+--- driver/demo-Gtk.c	2006-08-08 17:27:16.160940000 -0700
++++ driver/demo-Gtk.c	2006-08-08 17:27:22.195132000 -0700
+@@ -136,6 +136,8 @@
  #include <string.h>
  #include <ctype.h>
  
@@ -134,7 +137,7 @@
  #ifdef HAVE_GTK2
  enum {
    COL_ENABLED,
-@@ -126,6 +128,7 @@ extern void exec_command (const char *sh
+@@ -153,6 +155,7 @@ static void hack_subproc_environment (Wi
  #undef countof
  #define countof(x) (sizeof((x))/sizeof((*x)))
  
@@ -142,7 +145,7 @@
  
  char *progname = 0;
  char *progclass = "XScreenSaver";
-@@ -2231,10 +2234,15 @@ update_list_sensitivity (state *s)
+@@ -2673,10 +2676,15 @@ update_list_sensitivity (state *s)
  #endif /* !HAVE_GTK2 */
  }
  
@@ -157,8 +160,8 @@
 +  static gboolean tsol_multi_label_session = False;
    saver_preferences *p = &s->prefs;
  
-   /* The file supports timeouts of less than a minute, but the GUI does
-@@ -2361,9 +2369,61 @@ populate_prefs_page (state *s)
+   Bool can_lock_p = True;
+@@ -2855,10 +2863,62 @@ populate_prefs_page (state *s)
      SENSITIZE ("pwd_spinbutton", p->pwd_p);
      SENSITIZE ("pwd_mlabel",     p->pwd_p);
  
@@ -214,14 +217,15 @@
 +    }
 +    else
 +    {
-     SENSITIZE ("lock_spinbutton", p->lock_p);
-     SENSITIZE ("lock_mlabel",     p->lock_p);
+     SENSITIZE ("lock_button",     can_lock_p);
+     SENSITIZE ("lock_spinbutton", can_lock_p && p->lock_p);
+     SENSITIZE ("lock_mlabel",     can_lock_p && p->lock_p);
 -
 +    }
      /* DPMS
       */
      SENSITIZE ("dpms_frame",              dpms_supported);
-@@ -2392,6 +2452,7 @@ populate_prefs_page (state *s)
+@@ -2887,6 +2947,7 @@ populate_prefs_page (state *s)
  
  # undef SENSITIZE
    }
@@ -229,7 +233,7 @@
  }
  
  
-@@ -4043,7 +4104,7 @@ main (int argc, char **argv)
+@@ -4845,7 +4906,7 @@ main (int argc, char **argv)
                                       applicationShellWidgetClass,
                                       dpy, 0, 0);
  
@@ -239,9 +243,9 @@
    XtGetApplicationNameAndClass (dpy, &progname, &progclass);
    XSetErrorHandler (demo_ehandler);
 diff -urp -x '*~' driver/prefs.c driver/prefs.c
---- driver/prefs.c	2006-05-10 08:49:50.519771000 -0700
-+++ driver/prefs.c	2006-05-10 08:49:57.816439000 -0700
-@@ -36,6 +36,7 @@
+--- driver/prefs.c	2006-08-08 17:27:16.076574000 -0700
++++ driver/prefs.c	2006-08-08 17:27:22.267393000 -0700
+@@ -37,6 +37,7 @@
  # include "vms-pwd.h"
  #endif /* VMS */
  
@@ -249,22 +253,23 @@
  
  /* This file doesn't need the Xt headers, so stub these types out... */
  #undef XtPointer
-@@ -65,12 +66,13 @@
+@@ -66,6 +67,7 @@
  
  #include "prefs.h"
  #include "resources.h"
--
 +#include "trusted-utils.h"
  
- extern char *progname;
+ /* don't use realpath() on fedora system */
+ #ifdef _FORTIFY_SOURCE
+@@ -77,6 +79,7 @@ extern char *progname;
  extern char *progclass;
  extern const char *blurb (void);
  
 +Display *global_dpy;
  
  
- static void get_screenhacks (saver_preferences *p);
-@@ -970,6 +972,9 @@ free_screenhack_list (screenhack **list,
+ static void get_screenhacks (Display *, saver_preferences *);
+@@ -1021,6 +1024,9 @@ free_screenhack_list (screenhack **list,
    free (list);
  }
  
@@ -274,22 +279,22 @@
  
  
  /* Populate `saver_preferences' with the contents of the resource database.
-@@ -1010,7 +1015,10 @@ load_init_file (saver_preferences *p)
-   p->xsync_p	    = get_boolean_resource ("synchronous", "Synchronous");
-   p->verbose_p	    = get_boolean_resource ("verbose", "Boolean");
-   p->timestamp_p    = get_boolean_resource ("timestamp", "Boolean");
--  p->lock_p	    = get_boolean_resource ("lock", "Boolean");
+@@ -1061,7 +1067,10 @@ load_init_file (Display *dpy, saver_pref
+   p->xsync_p	    = get_boolean_resource (dpy, "synchronous", "Synchronous");
+   p->verbose_p	    = get_boolean_resource (dpy, "verbose", "Boolean");
+   p->timestamp_p    = get_boolean_resource (dpy, "timestamp", "Boolean");
+-  p->lock_p	    = get_boolean_resource (dpy, "lock", "Boolean");
 +  if ( tsol_is_multi_label_session() )
 +    p->lock_p       = True; /* always lock in a Multi Label Session */
 +  else
-+    p->lock_p       = get_boolean_resource ("lock", "Boolean");
-   /* *bugid 5077981 pwd timeout */
-   p->pwd_p	    = get_boolean_resource ("passwdTimeoutEnabled", "Boolean");
-   p->lock_vt_p	    = get_boolean_resource ("lockVTs", "Boolean");
-@@ -1030,6 +1038,27 @@ load_init_file (saver_preferences *p)
-   p->lock_timeout    = 1000 * get_minutes_resource ("lockTimeout", "Time");
-   p->cycle           = 1000 * get_minutes_resource ("cycle", "Time");
-   p->passwd_timeout  = 1000 * get_seconds_resource ("passwdTimeout", "Time");
++    p->lock_p       = get_boolean_resource (dpy, "lock", "Boolean");
+   p->fade_p	    = get_boolean_resource (dpy, "fade", "Boolean");
+   p->unfade_p	    = get_boolean_resource (dpy, "unfade", "Boolean");
+   p->fade_seconds   = 1000 * get_seconds_resource (dpy, "fadeSeconds", "Time");
+@@ -1085,6 +1094,27 @@ load_init_file (Display *dpy, saver_pref
+   p->lock_timeout    = 1000 * get_minutes_resource (dpy, "lockTimeout", "Time");
+   p->cycle           = 1000 * get_minutes_resource (dpy, "cycle", "Time");
+   p->passwd_timeout  = 1000 * get_seconds_resource (dpy, "passwdTimeout", "Time");
 +  if ( tsol_is_multi_label_session() )
 +  {
 +    userattr_t *uent;
@@ -311,13 +316,13 @@
 +    else
 +      p->lock_cmd = LOCK_CMD;
 +  }
-   p->pointer_timeout = 1000 * get_seconds_resource ("pointerPollTime", "Time");
-   p->notice_events_timeout = 1000*get_seconds_resource("windowCreationTimeout",
- 						       "Time");
+   /* *bugid 5077981 pwd timeout */
+   p->pwd_p	    = get_boolean_resource (dpy, "passwdTimeoutEnabled", "Boolean");
+   p->pointer_timeout = 1000 * get_seconds_resource (dpy, "pointerPollTime", "Time");
 diff -urp -x '*~' driver/prefs.h driver/prefs.h
---- driver/prefs.h	2006-05-10 08:49:50.407982000 -0700
-+++ driver/prefs.h	2006-05-10 08:49:57.831994000 -0700
-@@ -70,6 +70,7 @@ struct saver_preferences {
+--- driver/prefs.h	2006-08-08 17:27:15.972813000 -0700
++++ driver/prefs.h	2006-08-08 17:27:22.267954000 -0700
+@@ -81,6 +81,7 @@ struct saver_preferences {
    Time initial_delay;		/* how long to sleep after launch */
    Time splash_duration;		/* how long the splash screen stays up */
    Time timeout;			/* how much idle time before activation */
@@ -326,35 +331,34 @@
    Time cycle;			/* how long each hack should run */
    Time passwd_timeout;		/* how much time before pw dialog goes down */
 diff -urp -x '*~' driver/subprocs.c driver/subprocs.c
---- driver/subprocs.c	2006-05-10 08:49:50.587973000 -0700
-+++ driver/subprocs.c	2006-05-10 08:49:57.835657000 -0700
-@@ -74,6 +74,7 @@ extern int kill (pid_t, int);		/* signal
- #include "xscreensaver.h"
+--- driver/subprocs.c	2006-08-08 17:27:16.150981000 -0700
++++ driver/subprocs.c	2006-08-08 17:27:22.269506000 -0700
+@@ -71,6 +71,7 @@ extern int kill (pid_t, int);		/* signal
+ #include "exec.h"
  #include "yarandom.h"
  #include "visual.h"    /* for id_to_visual() */
 +#include "trusted-utils.h"
  
  extern saver_info *global_si_kludge;	/* I hate C so much... */
  
-@@ -820,6 +821,14 @@ spawn_screenhack_1 (saver_screen_info *s
-                       ssi->number, complete_hack_command,
-                      (unsigned long) getpid (), p->nice_inferior);
- 
-+	  if ( tsol_is_multi_label_session() )
-+	    if (p->lock_cmd == LOGOUT_CMD)
-+	    {
-+	      free (complete_hack_command);
-+	      exec_command (p->shell, "/usr/bin/pkill gnome-session", 0);
-+	      exit(1);
-+	    }
-+	      
- 	  exec_command (p->shell, complete_hack_command, p->nice_inferior);
- 
-           /* If that returned, we were unable to exec the subprocess. */
+@@ -1020,6 +1021,13 @@ spawn_screenhack_1 (saver_screen_info *s
+ 					      strlen (HACK_PATH)); 
+       sprintf(complete_hack_command, HACK_PATH"/%s", hack->command);
+       
++      if ( tsol_is_multi_label_session() )
++	if (p->lock_cmd == LOGOUT_CMD)
++	  {
++	    free (complete_hack_command);
++	    exec_command (p->shell, "/usr/bin/pkill gnome-session", 0);
++	    exit(1);
++	  }
+       
+       forked = fork_and_exec (ssi, complete_hack_command);
+       free (complete_hack_command);
 diff -urp -x '*~' driver/xscreensaver-getimage.c driver/xscreensaver-getimage.c
---- driver/xscreensaver-getimage.c	2002-05-29 13:49:34.000000000 -0700
-+++ driver/xscreensaver-getimage.c	2006-05-10 08:49:57.797465000 -0700
-@@ -58,6 +58,7 @@ static char *defaults[] = {
+--- driver/xscreensaver-getimage.c	2006-03-09 13:35:35.000000000 -0800
++++ driver/xscreensaver-getimage.c	2006-08-08 17:27:22.270497000 -0700
+@@ -83,6 +83,7 @@ static char *defaults[] = {
   0
  };
  
@@ -362,19 +366,19 @@
  
  
  char *progname = 0;
-@@ -596,7 +597,7 @@ main (int argc, char **argv)
+@@ -1761,7 +1762,7 @@ main (int argc, char **argv)
+ 
    toplevel = XtAppInitialize (&app, progclass, 0, 0, &argc, argv,
- 			      defaults, 0, 0);
-   argv[0] = progname;
+                               defaults, 0, 0);
 -  dpy = XtDisplay (toplevel);
 +  global_dpy = dpy = XtDisplay (toplevel);
    screen = XtScreen (toplevel);
    db = XtDatabase (dpy);
- 
+   XtGetApplicationNameAndClass (dpy, &s, &progclass);
 diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2006-05-10 08:49:50.641581000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:49:57.862256000 -0700
-@@ -189,6 +189,7 @@ passwd_dialog_data *ptr_mygtkpwd = &mygt
+--- driver/xscreensaver.c	2006-08-08 17:27:16.183058000 -0700
++++ driver/xscreensaver.c	2006-08-08 17:27:22.283861000 -0700
+@@ -198,6 +198,7 @@ passwd_dialog_data *ptr_mygtkpwd = &mygt
  char *progname = 0;
  char *progclass = 0;
  XrmDatabase db = 0;
@@ -382,7 +386,7 @@
  
  
  static Atom XA_SCREENSAVER_RESPONSE;
-@@ -1381,6 +1382,7 @@ while (debug_flag)
+@@ -1517,6 +1518,7 @@ while (debug_flag)
    hack_environment (si);
  
    shell = connect_to_server (si, &argc, argv);
--- a/open-src/app/xscreensaver/xinput.patch	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/app/xscreensaver/xinput.patch	Thu Aug 10 09:55:02 2006 -0700
@@ -34,66 +34,68 @@
 
 
 diff -urp -x '*~' driver/Makefile.in driver/Makefile.in
---- driver/Makefile.in	2006-05-10 08:48:46.809952000 -0700
-+++ driver/Makefile.in	2006-05-10 08:48:52.404220000 -0700
-@@ -197,7 +197,7 @@ DEMO_OBJS	= prefs.o dpms.o remote.o exec
+--- driver/Makefile.in	2006-08-08 15:24:49.603877000 -0700
++++ driver/Makefile.in	2006-08-08 15:24:55.050626000 -0700
+@@ -210,7 +210,7 @@ PDF2JPEG_LIBS	= -framework Cocoa
  
  SAVER_LIBS	= $(LIBS) $(X_LIBS) $(XMU_LIBS) @SAVER_LIBS@ \
- 		  $(XDPMS_LIBS) $(GL_LIBS) $(X_PRE_LIBS) \
+ 		  $(XDPMS_LIBS) $(XINERAMA_LIBS) $(GL_LIBS) $(X_PRE_LIBS) \
 -		  -lXt -lX11 -lXext $(X_EXTRA_LIBS) \
 +		  -lXt -lX11 -lXext -lXi $(X_EXTRA_LIBS) \
  		  $(PASSWD_LIBS)
  
  CMD_LIBS	= $(LIBS) $(X_LIBS) \
 diff -urp -x '*~' driver/XScreenSaver.ad.in driver/XScreenSaver.ad.in
---- driver/XScreenSaver.ad.in	2006-05-10 08:48:46.868803000 -0700
-+++ driver/XScreenSaver.ad.in	2006-05-10 08:48:52.397560000 -0700
-@@ -66,6 +66,7 @@
- *mitSaverExtension:	False
+--- driver/XScreenSaver.ad.in	2006-08-08 15:24:49.627321000 -0700
++++ driver/XScreenSaver.ad.in	2006-08-08 15:24:55.051108000 -0700
+@@ -73,6 +73,7 @@
+ *sgiSaverExtension:	True
  *xidleExtension:	True
  *procInterrupts:	True
 +*xinputExtensionDev:	True
  
- ! This is what the "Demo" button on the splash screen runs (/bin/sh syntax.)
- *demoCommand: xscreensaver-demo
+ ! Set this to True if you are experiencing longstanding XFree86 bug #421
+ ! (xscreensaver not covering the whole screen)
 diff -urp -x '*~' driver/prefs.c driver/prefs.c
---- driver/prefs.c	2006-05-10 08:48:46.891011000 -0700
-+++ driver/prefs.c	2006-05-10 08:48:52.388565000 -0700
-@@ -279,6 +279,7 @@ static const char * const prefs[] = {
-   "mitSaverExtension",
+--- driver/prefs.c	2006-08-08 15:24:49.631015000 -0700
++++ driver/prefs.c	2006-08-08 15:24:55.052054000 -0700
+@@ -303,6 +303,7 @@ static const char * const prefs[] = {
    "xidleExtension",
+   "GetViewPortIsFullOfLies",
    "procInterrupts",
 +  "xinputExtensionDev",
    "overlayStderr",
    "overlayTextBackground",	/* not saved -- X resources only */
    "overlayTextForeground",	/* not saved -- X resources only */
-@@ -810,6 +811,10 @@ write_init_file (saver_preferences *p, c
-       CHECK("mitSaverExtension")type = pref_bool, b=p->use_mit_saver_extension;
+@@ -857,6 +858,11 @@ write_init_file (Display *dpy,
+       CHECK("mitSaverExtension") continue;  /* don't save */
        CHECK("xidleExtension")	type = pref_bool, b = p->use_xidle_extension;
        CHECK("procInterrupts")	type = pref_bool, b = p->use_proc_interrupts;
 +	                        /* Adding XInputExtension Dev support
 +#5077966 P1 "password prompt cant be directly activated by GOK device"
 +                                */
-+CHECK("xinputExtensionDev") type = pref_bool, b=p->use_xinputdev_extension;
++      CHECK("xinputExtensionDev") type = pref_bool, 
++                                        b = p->use_xinputdev_extension;
+       CHECK("GetViewPortIsFullOfLies")  type = pref_bool,
+ 					b = p->getviewport_full_of_lies_p;
        CHECK("overlayStderr")	type = pref_bool, b = overlay_stderr_p;
-       CHECK("overlayTextBackground") continue;  /* don't save */
-       CHECK("overlayTextForeground") continue;  /* don't save */
-@@ -1060,6 +1065,11 @@ load_init_file (saver_preferences *p)
-   p->use_sgi_saver_extension = get_boolean_resource ("sgiSaverExtension",
+@@ -1129,6 +1135,12 @@ load_init_file (Display *dpy, saver_pref
+   p->use_sgi_saver_extension = get_boolean_resource (dpy,
+                                                      "sgiSaverExtension",
  						     "Boolean");
-   p->use_proc_interrupts = get_boolean_resource ("procInterrupts", "Boolean");
++ 
 +                                  /* Adding XInputExtension Dev support
 +#5077966 P1 "password prompt cant be directly activated by GOK device"
 +                                */
 +  p->use_xinputdev_extension = 
-+	get_boolean_resource ("xinputExtensionDev", "Boolean");
- 
-   get_screenhacks (p);                /* Parse the "programs" resource. */
++	get_boolean_resource (dpy, "xinputExtensionDev", "Boolean");
+   p->use_proc_interrupts = get_boolean_resource (dpy,
+                                                  "procInterrupts", "Boolean");
  
 diff -urp -x '*~' driver/prefs.h driver/prefs.h
---- driver/prefs.h	2006-05-10 08:48:46.902760000 -0700
-+++ driver/prefs.h	2006-05-10 08:48:52.389118000 -0700
-@@ -91,6 +91,10 @@ struct saver_preferences {
+--- driver/prefs.h	2006-08-08 15:24:49.631360000 -0700
++++ driver/prefs.h	2006-08-08 15:24:55.052341000 -0700
+@@ -109,6 +109,10 @@ struct saver_preferences {
    Bool use_mit_saver_extension;
    Bool use_sgi_saver_extension;
    Bool use_proc_interrupts;
@@ -102,14 +104,14 @@
 +				*/
 +  Bool use_xinputdev_extension;
  
-   char *shell;			/* where to find /bin/sh */
+   Bool getviewport_full_of_lies_p; /* XFree86 bug #421 */
  
 diff -urp -x '*~' driver/timers.c driver/timers.c
---- driver/timers.c	2006-05-10 08:48:46.849018000 -0700
-+++ driver/timers.c	2006-05-10 08:48:52.407651000 -0700
-@@ -60,6 +60,12 @@ extern void unblank_screen (saver_info *
- extern Bool Ignore_SmartCard;
- #endif /* HAVE_SCF_SMARTCARD */
+--- driver/timers.c	2006-08-08 15:24:49.622337000 -0700
++++ driver/timers.c	2006-08-08 15:24:55.053314000 -0700
+@@ -68,6 +68,12 @@ extern Bool blank_screen (saver_info *si
+ extern void unblank_screen (saver_info *si);
+ 
  
 +                                /* Adding XInputExtension Dev support
 +#5077966 P1 "password prompt cant be directly activated by GOK device"
@@ -120,7 +122,7 @@
  void
  idle_timer (XtPointer closure, XtIntervalId *id)
  {
-@@ -609,10 +615,14 @@ sleep_until_idle (saver_info *si, Bool u
+@@ -708,10 +714,14 @@ sleep_until_idle (saver_info *si, Bool u
       and query the server with that extension.  For our purposes, polling
       /proc/interrupts is just like polling the mouse position.  It has to
       happen on the same kind of schedule. */
@@ -134,9 +136,9 @@
 +                                   si->using_sgi_saver_extension) ||
 +				   si->using_xinputdev_extension);
  
- #ifdef HAVE_SCF_SMARTCARD
-   static Bool display_required = False;
-@@ -1000,6 +1010,49 @@ sleep_until_idle (saver_info *si, Bool u
+   if (until_idle_p)
+     {
+@@ -1067,6 +1077,49 @@ sleep_until_idle (saver_info *si, Bool u
  	  }
  	else
  #endif /* HAVE_SGI_SAVER_EXTENSION */
@@ -184,12 +186,12 @@
 +
 +       else
  
-           /* Just some random event.  Let the Widgets handle it, if desired. */
- 	  dispatch_event (si, &event);
+ #ifdef HAVE_RANDR
+         if (event.type == (si->randr_event_number + RRScreenChangeNotify))
 diff -urp -x '*~' driver/xscreensaver.c driver/xscreensaver.c
---- driver/xscreensaver.c	2006-05-10 08:48:46.850383000 -0700
-+++ driver/xscreensaver.c	2006-05-10 08:48:52.422327000 -0700
-@@ -820,12 +820,18 @@ initialize_server_extensions (saver_info
+--- driver/xscreensaver.c	2006-08-08 15:24:49.623491000 -0700
++++ driver/xscreensaver.c	2006-08-08 15:24:55.054560000 -0700
+@@ -953,12 +953,18 @@ initialize_server_extensions (saver_info
    Bool server_has_mit_saver_extension_p = False;
    Bool system_has_proc_interrupts_p = False;
    const char *piwhy = 0;
@@ -208,7 +210,7 @@
  #ifdef HAVE_XIDLE_EXTENSION
    server_has_xidle_extension_p = query_xidle_extension (si);
  #endif
-@@ -838,6 +844,10 @@ initialize_server_extensions (saver_info
+@@ -971,6 +977,10 @@ initialize_server_extensions (saver_info
  #ifdef HAVE_PROC_INTERRUPTS
    system_has_proc_interrupts_p = query_proc_interrupts_available (si, &piwhy);
  #endif
@@ -219,9 +221,9 @@
  
    if (!server_has_xidle_extension_p)
      si->using_xidle_extension = False;
-@@ -874,6 +884,22 @@ initialize_server_extensions (saver_info
- 		 blurb());
-     }
+@@ -1020,6 +1030,22 @@ initialize_server_extensions (saver_info
+   query_randr_extension (si);
+ #endif
  
 +                                /* Adding XInputExtension Dev support
 +#5077966 P1 "password prompt cant be directly activated by GOK device"
@@ -242,9 +244,9 @@
    if (!system_has_proc_interrupts_p)
      {
        si->using_proc_interrupts = False;
-@@ -1964,6 +1990,8 @@ analyze_display (saver_info *si)
+@@ -2175,6 +2201,8 @@ analyze_display (saver_info *si)
  #     endif
-    }, { "XINERAMA",                             "Xinerama",
+    }, { "Apple-DRI",                            "Apple-DRI (XDarwin)",
          True
 +   }, { "XInputExtension",                             "XInputExtension",
 +        True
@@ -252,11 +254,11 @@
    };
  
 diff -urp -x '*~' driver/xscreensaver.h driver/xscreensaver.h
---- driver/xscreensaver.h	2006-05-10 08:48:46.850991000 -0700
-+++ driver/xscreensaver.h	2006-05-10 08:48:52.404876000 -0700
-@@ -80,6 +80,12 @@ struct saver_info {
-   int sgi_saver_ext_event_number;
-   int sgi_saver_ext_error_number;
+--- driver/xscreensaver.h	2006-08-08 15:24:49.613614000 -0700
++++ driver/xscreensaver.h	2006-08-08 15:24:55.055086000 -0700
+@@ -84,6 +84,12 @@ struct saver_info {
+   int randr_event_number;
+   int randr_error_number;
  # endif
 +                                 /* Adding XInputExtension Dev support
 +#5077966 P1 "password prompt cant be directly activated by GOK device"
@@ -267,7 +269,7 @@
  
  
    /* =======================================================================
-@@ -305,6 +311,10 @@ extern Bool query_xidle_extension (saver
+@@ -324,6 +330,10 @@ extern Bool query_randr_extension (saver
  #ifdef HAVE_PROC_INTERRUPTS
  extern Bool query_proc_interrupts_available (saver_info *, const char **why);
  #endif
@@ -279,8 +281,8 @@
  /* Display Power Management System (DPMS) interface. */
  extern Bool monitor_powered_on_p (saver_info *si);
 diff -urp -x '*~' driver/xset.c driver/xset.c
---- driver/xset.c	2006-05-10 08:48:46.708383000 -0700
-+++ driver/xset.c	2006-05-10 08:48:52.421037000 -0700
+--- driver/xset.c	2006-08-08 15:24:49.613951000 -0700
++++ driver/xset.c	2006-08-08 15:24:55.055931000 -0700
 @@ -34,6 +34,22 @@
  #ifdef _VROOT_H_
  ERROR!  You must not include vroot.h in this file.
@@ -446,7 +448,7 @@
  
  /* SGI SCREEN_SAVER server extension hackery.
   */
-@@ -252,6 +403,15 @@ disable_builtin_screensaver (saver_info 
+@@ -296,6 +447,15 @@ disable_builtin_screensaver (saver_info 
  # ifdef HAVE_SGI_SAVER_EXTENSION
  	if (si->using_sgi_saver_extension) init_sgi_saver_extension(si);
  # endif
--- a/open-src/common/Makefile.inc	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/common/Makefile.inc	Thu Aug 10 09:55:02 2006 -0700
@@ -28,7 +28,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)Makefile.inc	1.62	06/07/28
+# @(#)Makefile.inc	1.63	06/08/09
 #
 
 BUILD_DATE:sh=date +'%e-%B-%Y'
@@ -36,7 +36,8 @@
 
 ### Default compiler & options
 CC     			= cc
-DEFAULT_OPT_CFLAGS 	= -xO4 -xbuiltin -xlibmil -xprefetch
+CXX			= CC
+DEFAULT_OPT_CFLAGS 	= -xO4 -xbuiltin -xlibmil -xprefetch -xdepend
 OPT_CFLAGS 		= $(DEFAULT_OPT_CFLAGS)
 CFLAGS 			=  -v -mc $(OPT_CFLAGS) $(ARCH_FLAGS)
 LDFLAGS 		= -z combreloc -z lazyload $(MAPFILES_FOR_ALL)
@@ -51,6 +52,7 @@
 LIB_LDFLAGS 		= $(LDFLAGS) $(LIB_REQUIRED_LDFLAGS)
 
 # Flags for programs
+PROG_CFLAGS		= $(CFLAGS)
 PROG_LDFLAGS		= $(LDFLAGS) $(MAPFILES_FOR_PROGS) -B direct
 
 # Linker mapfiles to link with for better performance & security
@@ -233,3 +235,29 @@
 	@echo "Installing dependency proto/X11"
 	(cd $(TOP)/proto/X11 ; make install)
 
+### Useful rules for maintaining patch sets
+
+# regenerate patches against new baseline to reduce messages about hunks
+# having fuzz or offsets when applying patches - new patches will be in new/
+
+regen-patches: $(SOURCE_PATCHES)
+	CUR_LIST=""
+	rm -rf tmp-regen
+	make SOURCE_PATCHES="$(CUR_LIST)" BUILD_DIR=tmp-regen source_gen
+	mkdir -p new
+	for f in $(SOURCE_PATCHES) ; do \
+	    echo '=================' $$f ; \
+	    rm -rf prev ; \
+	    mv tmp-regen prev ; \
+	    $(MAKE) SOURCE_PATCHES="$${CUR_LIST} $$f" BUILD_DIR=tmp-regen source_gen ; \
+	    awk '/^--- /	{exit} \
+		 /^diff -u/	{exit} \
+			 	{print}' $$f > new/$$f ; \
+	    gdiff -urp -x '*~' ./prev ./tmp-regen \
+		| sed -e 's% \./prev$(SOURCE_DIR)/% %' -e 's% \./tmp-regen$(SOURCE_DIR)/% %' \
+		| grep -v '^Common subdirectories:' \
+		| grep -v '^Only in ' \
+		>> new/$$f ; \
+	    CUR_LIST="$${CUR_LIST} new/$$f" ; \
+	done
+	rm -rf tmp-regen
--- a/open-src/common/suntouch-manpages.pl	Mon Aug 07 13:49:43 2006 -0700
+++ b/open-src/common/suntouch-manpages.pl	Thu Aug 10 09:55:02 2006 -0700
@@ -29,7 +29,7 @@
 # or other dealings in this Software without prior written authorization
 # of the copyright holder.
 #
-# @(#)suntouch-manpages.pl	1.1	06/07/28
+# @(#)suntouch-manpages.pl	1.2	06/08/09
 #
 
 # Updates manual pages to include standard Sun man page sections
@@ -37,13 +37,14 @@
 # Arguments: 
 #	-a '{attribute, value}, ...' - entries for Attributes section table
 #	-l libname		     - add library line to synopsis
+#	-p path			     - add path to command in synopsis
 
 use Getopt::Std;
 use integer;
 use strict;
 
 my %opts;
-getopts('a:l:', \%opts);
+getopts('a:l:p:', \%opts);
 
 my $add_attributes = 0;
 my $attributes;
@@ -61,6 +62,14 @@
   $library = $opts{"l"};
 }
 
+my $add_path_to_synopsis = 0;
+my $synpath;
+
+if (exists($opts{"p"})) {
+  $add_path_to_synopsis = 1;
+  $synpath = $opts{"p"};
+}
+
 my $filename;
 
 while ($filename = shift) {
@@ -97,12 +106,17 @@
   while ($nextline = <IN>) {
     print OUT $nextline;
 
-    if ($add_library_to_synopsis) {
-      if ($nextline =~ m/.SH[\s "]*SYNOPSIS/) {
+    if ($nextline =~ m/.SH[\s "]*SYNOPSIS/) {
+      if ($add_library_to_synopsis) {
 	print OUT ".nf\n",
 	  q(\fBcc\fR [ \fIflag\fR\&.\&.\&. ] \fIfile\fR\&.\&.\&. \fB\-l),
 	    $library, q(\fR [ \fIlibrary\fR\&.\&.\&. ]), "\n.fi\n";
       }
+      elsif ($add_path_to_synopsis) {
+	$nextline = <IN>;
+	$nextline =~ s/^(\.B[IR]*\s+\"?)/$1$synpath/;
+	print OUT $nextline;
+      }
     }
   }
 
--- a/packages/SUNWxscreensaver-hacks-gl/copyright.add	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks-gl/copyright.add	Thu Aug 10 09:55:02 2006 -0700
@@ -1,6 +1,7 @@
 
-The xscreensaver base software is Copyright 1991-2002 by Jamie Zawinski
-<[email protected]>.
+The xscreensaver base software is Copyright (c) 1991-2006 Jamie Zawinski 
+<[email protected]>
+
 Permission to use, copy, modify, distribute, and sell this software and its
 documentation for any purpose is hereby granted without fee, provided that
 the above copyright notice appear in all copies and that both that
--- a/packages/SUNWxscreensaver-hacks-gl/depend.i386	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks-gl/depend.i386	Thu Aug 10 09:55:02 2006 -0700
@@ -1,14 +1,44 @@
-#	Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved
-#	Use is subject to license terms
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-#	@(#)depend.i386	1.1	05/05/05 Sun Microsystems, Inc.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)depend.i386	1.2	06/08/09 SMI"
+#
+# XScreenSaver OpenGL display modules
 
-P SUNWcsr	Core Sparc, (Root)
-P SUNWcsu	Core Sparc, (Usr)
+P SUNWcsr	Core Solaris, (Root)
+P SUNWcsu	Core Solaris, (Usr)
 P SUNWcsl	Core Solaris, (Shared Libs)
+P SUNWcar	Core Architecture, (Root)
+P SUNWkvm	Core Architecture, (Usr)
+P SUNWlibmsr	Math & Microtasking Libraries (Root)
 P SUNWxorg-mesa	Mesa OpenGL for Solaris Runtime Libraries
 P SUNWgnome-base-libs  GNOME base GUI libraries
-P SUNWlibms	Forte Developer Bundled shared libm
 P SUNWxwplt	X Window System platform software
 P SUNWxwrtl	X Window System & Graphics Runtime Library Links in /usr/lib
 P SUNWxwsvr	XScreenSaver
--- a/packages/SUNWxscreensaver-hacks-gl/depend.sparc	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks-gl/depend.sparc	Thu Aug 10 09:55:02 2006 -0700
@@ -1,14 +1,44 @@
-#	Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved
-#	Use is subject to license terms
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-#	@(#)depend.sparc	1.4	04/12/17 Sun Microsystems, Inc.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)depend.sparc	1.5	06/08/09 SMI"
+#
+# XScreenSaver OpenGL display modules
 
-P SUNWcsr	Core Sparc, (Root)
-P SUNWcsu	Core Sparc, (Usr)
+P SUNWcsr	Core Solaris, (Root)
+P SUNWcsu	Core Solaris, (Usr)
 P SUNWcsl	Core Solaris, (Shared Libs)
+P SUNWcar	Core Architecture, (Root)
+P SUNWkvm	Core Architecture, (Usr)
+P SUNWlibmsr	Math & Microtasking Libraries (Root)
 P SUNWglrt	Sun OpenGL for Solaris Runtime Libraries
 P SUNWgnome-base-libs  GNOME base GUI libraries
-P SUNWlibms	Forte Developer Bundled shared libm
 P SUNWxwplt	X Window System platform software
 P SUNWxwrtl	X Window System & Graphics Runtime Library Links in /usr/lib
 P SUNWxwsvr	XScreenSaver
--- a/packages/SUNWxscreensaver-hacks-gl/pkginfo.tmpl	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks-gl/pkginfo.tmpl	Thu Aug 10 09:55:02 2006 -0700
@@ -1,7 +1,35 @@
-#	Copyright 2003 Sun Microsystems, Inc. All Rights Reserved
-#	Use is subject to license terms
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-#	@(#)pkginfo.tmpl	1.1	03/11/17 Sun Microsystems, Inc.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)pkginfo.tmpl	1.2	06/08/09 SMI"
+#
+# XScreenSaver OpenGL display modules
 
 PKG="SUNWxscreensaver-hacks-gl"
 NAME="XScreenSaver OpenGL display mode modules"
@@ -16,6 +44,6 @@
 HOTLINE="Please contact your local service provider"
 EMAIL=""
 MAXINST="1000"
-SUNW_PKGTYPE="ow"
+SUNW_PKGTYPE="usr"
 CLASSES=none 
 SUNW_PKGVERS=1.0
--- a/packages/SUNWxscreensaver-hacks-gl/prototype_com	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks-gl/prototype_com	Thu Aug 10 09:55:02 2006 -0700
@@ -1,7 +1,33 @@
-#	Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved
-#	Use is subject to license terms
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-#       "@(#)prototype_com	1.5	05/05/03 Sun Microsystems"
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)prototype_com	1.6	06/08/09 SMI"
 #
 
 i pkginfo
@@ -9,118 +35,236 @@
 
 # OpenGL hacks and helper app
 
-!HOME=../openwin
-d none openwin 0755 root bin
-d none openwin/lib 0755 root bin
-d none openwin/lib/xscreensaver 0755 root bin
+!HOME=../usr/X11
+d none X11 0755 root bin
+d none X11/lib 0755 root bin
+d none X11/lib/xscreensaver 0755 root bin
 
 !search      $HOME/bin
-d none openwin/lib/xscreensaver/bin 0755 root bin
-f none openwin/lib/xscreensaver/bin/xscreensaver-gl-helper 0555 root bin
+d none X11/lib/xscreensaver/bin 0755 root bin
+f none X11/lib/xscreensaver/bin/xscreensaver-gl-helper 0555 root bin
 
 !search      $HOME/lib/xscreensaver/hacks
-d none openwin/lib/xscreensaver/hacks 0755 root bin
-f none openwin/lib/xscreensaver/hacks/atlantis 0555 root bin
-f none openwin/lib/xscreensaver/hacks/boxed 0555 root bin
-f none openwin/lib/xscreensaver/hacks/bubble3d 0555 root bin
-f none openwin/lib/xscreensaver/hacks/cage 0555 root bin
-f none openwin/lib/xscreensaver/hacks/circuit 0555 root bin
-f none openwin/lib/xscreensaver/hacks/cubenetic 0555 root bin
-f none openwin/lib/xscreensaver/hacks/dangerball 0555 root bin
-f none openwin/lib/xscreensaver/hacks/endgame 0555 root bin
-f none openwin/lib/xscreensaver/hacks/engine 0555 root bin
-f none openwin/lib/xscreensaver/hacks/gears 0555 root bin
-f none openwin/lib/xscreensaver/hacks/gflux 0555 root bin
-f none openwin/lib/xscreensaver/hacks/glforestfire 0555 root bin
-f none openwin/lib/xscreensaver/hacks/glplanet 0555 root bin
-f none openwin/lib/xscreensaver/hacks/glsnake 0555 root bin
-f none openwin/lib/xscreensaver/hacks/gltext 0555 root bin
-f none openwin/lib/xscreensaver/hacks/lament 0555 root bin
-f none openwin/lib/xscreensaver/hacks/lavalite 0555 root bin
-f none openwin/lib/xscreensaver/hacks/menger 0555 root bin
-f none openwin/lib/xscreensaver/hacks/moebius 0555 root bin
-f none openwin/lib/xscreensaver/hacks/molecule 0555 root bin
-f none openwin/lib/xscreensaver/hacks/morph3d 0555 root bin
-f none openwin/lib/xscreensaver/hacks/pipes 0555 root bin
-f none openwin/lib/xscreensaver/hacks/pulsar 0555 root bin
-f none openwin/lib/xscreensaver/hacks/queens 0555 root bin
-f none openwin/lib/xscreensaver/hacks/rubik 0555 root bin
-f none openwin/lib/xscreensaver/hacks/sballs 0555 root bin
-f none openwin/lib/xscreensaver/hacks/sierpinski3d 0555 root bin
-f none openwin/lib/xscreensaver/hacks/spheremonics 0555 root bin
-f none openwin/lib/xscreensaver/hacks/sproingies 0555 root bin
-f none openwin/lib/xscreensaver/hacks/stairs 0555 root bin
-f none openwin/lib/xscreensaver/hacks/starwars 0555 root bin
-f none openwin/lib/xscreensaver/hacks/stonerview 0555 root bin
-f none openwin/lib/xscreensaver/hacks/superquadrics 0555 root bin
+d none X11/lib/xscreensaver/hacks 0755 root bin
+f none X11/lib/xscreensaver/hacks/antinspect 0555 root bin
+f none X11/lib/xscreensaver/hacks/antmaze 0555 root bin
+f none X11/lib/xscreensaver/hacks/antspotlight 0555 root bin
+f none X11/lib/xscreensaver/hacks/atlantis 0555 root bin
+f none X11/lib/xscreensaver/hacks/atunnel 0555 root bin
+f none X11/lib/xscreensaver/hacks/blinkbox 0555 root bin
+f none X11/lib/xscreensaver/hacks/blocktube 0555 root bin
+f none X11/lib/xscreensaver/hacks/boing 0555 root bin
+f none X11/lib/xscreensaver/hacks/bouncingcow 0555 root bin
+f none X11/lib/xscreensaver/hacks/boxed 0555 root bin
+f none X11/lib/xscreensaver/hacks/bubble3d 0555 root bin
+f none X11/lib/xscreensaver/hacks/cage 0555 root bin
+f none X11/lib/xscreensaver/hacks/carousel 0555 root bin
+f none X11/lib/xscreensaver/hacks/circuit 0555 root bin
+f none X11/lib/xscreensaver/hacks/crackberg 0555 root bin
+f none X11/lib/xscreensaver/hacks/cube21 0555 root bin
+f none X11/lib/xscreensaver/hacks/cubenetic 0555 root bin
+f none X11/lib/xscreensaver/hacks/cubestorm 0555 root bin
+f none X11/lib/xscreensaver/hacks/dangerball 0555 root bin
+f none X11/lib/xscreensaver/hacks/endgame 0555 root bin
+f none X11/lib/xscreensaver/hacks/engine 0555 root bin
+f none X11/lib/xscreensaver/hacks/flipflop 0555 root bin
+f none X11/lib/xscreensaver/hacks/flipscreen3d 0555 root bin
+f none X11/lib/xscreensaver/hacks/fliptext 0555 root bin
+f none X11/lib/xscreensaver/hacks/flurry 0555 root bin
+f none X11/lib/xscreensaver/hacks/gears 0555 root bin
+f none X11/lib/xscreensaver/hacks/gflux 0555 root bin
+f none X11/lib/xscreensaver/hacks/glblur 0555 root bin
+f none X11/lib/xscreensaver/hacks/gleidescope 0555 root bin
+f none X11/lib/xscreensaver/hacks/glforestfire 0555 root bin
+f none X11/lib/xscreensaver/hacks/glhanoi 0555 root bin
+f none X11/lib/xscreensaver/hacks/glknots 0555 root bin
+f none X11/lib/xscreensaver/hacks/glmatrix 0555 root bin
+f none X11/lib/xscreensaver/hacks/glplanet 0555 root bin
+f none X11/lib/xscreensaver/hacks/glschool 0555 root bin
+f none X11/lib/xscreensaver/hacks/glslideshow 0555 root bin
+f none X11/lib/xscreensaver/hacks/glsnake 0555 root bin
+f none X11/lib/xscreensaver/hacks/gltext 0555 root bin
+f none X11/lib/xscreensaver/hacks/hypertorus 0555 root bin
+f none X11/lib/xscreensaver/hacks/jigglypuff 0555 root bin
+f none X11/lib/xscreensaver/hacks/juggler3d 0555 root bin
+f none X11/lib/xscreensaver/hacks/klein 0555 root bin
+f none X11/lib/xscreensaver/hacks/lament 0555 root bin
+f none X11/lib/xscreensaver/hacks/lavalite 0555 root bin
+f none X11/lib/xscreensaver/hacks/menger 0555 root bin
+f none X11/lib/xscreensaver/hacks/mirrorblob 0555 root bin
+f none X11/lib/xscreensaver/hacks/moebius 0555 root bin
+f none X11/lib/xscreensaver/hacks/molecule 0555 root bin
+f none X11/lib/xscreensaver/hacks/morph3d 0555 root bin
+f none X11/lib/xscreensaver/hacks/noof 0555 root bin
+f none X11/lib/xscreensaver/hacks/pinion 0555 root bin
+f none X11/lib/xscreensaver/hacks/pipes 0555 root bin
+f none X11/lib/xscreensaver/hacks/polyhedra 0555 root bin
+f none X11/lib/xscreensaver/hacks/polytopes 0555 root bin
+f none X11/lib/xscreensaver/hacks/providence 0555 root bin
+f none X11/lib/xscreensaver/hacks/pulsar 0555 root bin
+f none X11/lib/xscreensaver/hacks/queens 0555 root bin
+f none X11/lib/xscreensaver/hacks/rubik 0555 root bin
+f none X11/lib/xscreensaver/hacks/sballs 0555 root bin
+f none X11/lib/xscreensaver/hacks/sierpinski3d 0555 root bin
+f none X11/lib/xscreensaver/hacks/spheremonics 0555 root bin
+f none X11/lib/xscreensaver/hacks/sproingies 0555 root bin
+f none X11/lib/xscreensaver/hacks/stairs 0555 root bin
+f none X11/lib/xscreensaver/hacks/starwars 0555 root bin
+f none X11/lib/xscreensaver/hacks/stonerview 0555 root bin
+f none X11/lib/xscreensaver/hacks/superquadrics 0555 root bin
+f none X11/lib/xscreensaver/hacks/tangram 0555 root bin
+f none X11/lib/xscreensaver/hacks/timetunnel 0555 root bin
+f none X11/lib/xscreensaver/hacks/topblock 0555 root bin
 
-!search $HOME/share/man/man1
-1 s none openwin/man=./share/man
-1 d none openwin/share 0755 root bin
-1 d none openwin/share/man 0755 root bin
-d none openwin/share/man/man1 0755 root bin
-f none openwin/share/man/man1/xscreensaver-gl-helper.1 0444 root bin
-f none openwin/share/man/man1/atlantis.1 0444 root bin
-f none openwin/share/man/man1/boxed.1 0444 root bin
-f none openwin/share/man/man1/cage.1 0444 root bin
-f none openwin/share/man/man1/circuit.1 0444 root bin
-f none openwin/share/man/man1/cubenetic.1 0444 root bin
-f none openwin/share/man/man1/dangerball.1 0444 root bin
-f none openwin/share/man/man1/endgame.1 0444 root bin
-f none openwin/share/man/man1/engine.1 0444 root bin
-f none openwin/share/man/man1/extrusion.1 0444 root bin
-f none openwin/share/man/man1/gears.1 0444 root bin
-f none openwin/share/man/man1/gflux.1 0444 root bin
-f none openwin/share/man/man1/glplanet.1 0444 root bin
-f none openwin/share/man/man1/glsnake.1 0444 root bin
-f none openwin/share/man/man1/gltext.1 0444 root bin
-f none openwin/share/man/man1/lament.1 0444 root bin
-f none openwin/share/man/man1/lavalite.1 0444 root bin
-f none openwin/share/man/man1/menger.1 0444 root bin
-f none openwin/share/man/man1/moebius.1 0444 root bin
-f none openwin/share/man/man1/molecule.1 0444 root bin
-f none openwin/share/man/man1/morph3d.1 0444 root bin
-f none openwin/share/man/man1/pipes.1 0444 root bin
-f none openwin/share/man/man1/pulsar.1 0444 root bin
-f none openwin/share/man/man1/queens.1 0444 root bin
-f none openwin/share/man/man1/rubik.1 0444 root bin
-f none openwin/share/man/man1/sballs.1 0444 root bin
-f none openwin/share/man/man1/spheremonics.1 0444 root bin
-f none openwin/share/man/man1/sproingies.1 0444 root bin
-f none openwin/share/man/man1/stairs.1 0444 root bin
-f none openwin/share/man/man1/starwars.1 0444 root bin 
-f none openwin/share/man/man1/superquadrics.1 0444 root bin
+!search $HOME/share/man/man6
+1 s none X11/man=share/man
+1 d none X11/share 0755 root bin
+1 d none X11/share/man 0755 root bin
+d none X11/share/man/man6 0755 root bin
+f none X11/share/man/man6/xscreensaver-gl-helper.6 0444 root bin
+f none X11/share/man/man6/antinspect.6 0444 root bin
+f none X11/share/man/man6/antmaze.6 0444 root bin
+f none X11/share/man/man6/antspotlight.6 0444 root bin
+f none X11/share/man/man6/atlantis.6 0444 root bin
+f none X11/share/man/man6/atunnel.6 0444 root bin
+f none X11/share/man/man6/blinkbox.6 0444 root bin
+f none X11/share/man/man6/blocktube.6 0444 root bin
+f none X11/share/man/man6/boing.6 0444 root bin
+f none X11/share/man/man6/bouncingcow.6 0444 root bin
+f none X11/share/man/man6/boxed.6 0444 root bin
+f none X11/share/man/man6/bubble3d.6 0444 root bin
+f none X11/share/man/man6/cage.6 0444 root bin
+f none X11/share/man/man6/carousel.6 0444 root bin
+f none X11/share/man/man6/circuit.6 0444 root bin
+f none X11/share/man/man6/crackberg.6 0444 root bin
+f none X11/share/man/man6/cube21.6 0444 root bin
+f none X11/share/man/man6/cubenetic.6 0444 root bin
+f none X11/share/man/man6/cubestorm.6 0444 root bin
+f none X11/share/man/man6/dangerball.6 0444 root bin
+f none X11/share/man/man6/endgame.6 0444 root bin
+f none X11/share/man/man6/engine.6 0444 root bin
+f none X11/share/man/man6/extrusion.6 0444 root bin
+f none X11/share/man/man6/flipflop.6 0444 root bin
+f none X11/share/man/man6/flipscreen3d.6 0444 root bin
+f none X11/share/man/man6/fliptext.6 0444 root bin
+f none X11/share/man/man6/flurry.6 0444 root bin
+f none X11/share/man/man6/gears.6 0444 root bin
+f none X11/share/man/man6/gflux.6 0444 root bin
+f none X11/share/man/man6/glblur.6 0444 root bin
+f none X11/share/man/man6/gleidescope.6 0444 root bin
+f none X11/share/man/man6/glforestfire.6 0444 root bin
+f none X11/share/man/man6/glhanoi.6 0444 root bin
+f none X11/share/man/man6/glknots.6 0444 root bin
+f none X11/share/man/man6/glmatrix.6 0444 root bin
+f none X11/share/man/man6/glplanet.6 0444 root bin
+f none X11/share/man/man6/glschool.6 0444 root bin
+f none X11/share/man/man6/glslideshow.6 0444 root bin
+f none X11/share/man/man6/glsnake.6 0444 root bin
+f none X11/share/man/man6/gltext.6 0444 root bin
+f none X11/share/man/man6/hypertorus.6 0444 root bin
+f none X11/share/man/man6/jigglypuff.6 0444 root bin
+f none X11/share/man/man6/juggler3d.6 0444 root bin
+f none X11/share/man/man6/klein.6 0444 root bin
+f none X11/share/man/man6/lament.6 0444 root bin
+f none X11/share/man/man6/lavalite.6 0444 root bin
+f none X11/share/man/man6/menger.6 0444 root bin
+f none X11/share/man/man6/mirrorblob.6 0444 root bin
+f none X11/share/man/man6/moebius.6 0444 root bin
+f none X11/share/man/man6/molecule.6 0444 root bin
+f none X11/share/man/man6/morph3d.6 0444 root bin
+f none X11/share/man/man6/noof.6 0444 root bin
+f none X11/share/man/man6/pinion.6 0444 root bin
+f none X11/share/man/man6/pipes.6 0444 root bin
+f none X11/share/man/man6/polyhedra.6 0444 root bin
+f none X11/share/man/man6/polytopes.6 0444 root bin
+f none X11/share/man/man6/providence.6 0444 root bin
+f none X11/share/man/man6/pulsar.6 0444 root bin
+f none X11/share/man/man6/queens.6 0444 root bin
+f none X11/share/man/man6/rubik.6 0444 root bin
+f none X11/share/man/man6/sballs.6 0444 root bin
+f none X11/share/man/man6/sierpinski3d.6 0444 root bin
+f none X11/share/man/man6/spheremonics.6 0444 root bin
+f none X11/share/man/man6/sproingies.6 0444 root bin
+f none X11/share/man/man6/stairs.6 0444 root bin
+f none X11/share/man/man6/starwars.6 0444 root bin
+f none X11/share/man/man6/stonerview.6 0444 root bin
+f none X11/share/man/man6/superquadrics.6 0444 root bin
+f none X11/share/man/man6/tangram.6 0444 root bin
+f none X11/share/man/man6/timetunnel.6 0444 root bin
+f none X11/share/man/man6/topblock.6 0444 root bin
 
 !search      $HOME/lib/xscreensaver/config/control-center-2.0/
-d none openwin/lib/xscreensaver/config 0755 root bin
-d none openwin/lib/xscreensaver/config/control-center-2.0 0755 root other
-f none openwin/lib/xscreensaver/config/control-center-2.0/atlantis.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/boxed.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/bubble3d.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/cage.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/circuit.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/cubenetic.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/dangerball.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/engine.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/gears.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/gflux.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/glforestfire.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/glplanet.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/glsnake.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/gltext.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/lament.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/menger.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/moebius.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/molecule.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/morph3d.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/pipes.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/pulsar.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/rubik.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/sballs.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/sierpinski3d.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/spheremonics.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/sproingies.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/stairs.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/starwars.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/stonerview.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/superquadrics.xml 0444 root bin
+d none X11/lib/xscreensaver/config 0755 root bin
+d none X11/lib/xscreensaver/config/control-center-2.0 0755 root other
+f none X11/lib/xscreensaver/config/control-center-2.0/antinspect.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/antmaze.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/antspotlight.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/atlantis.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/atunnel.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/blinkbox.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/blocktube.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/boing.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/bouncingcow.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/boxed.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/bubble3d.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/cage.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/carousel.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/circuit.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/crackberg.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/cube21.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/cubenetic.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/cubestorm.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/dangerball.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/endgame.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/engine.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/fireflies.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/flipflop.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/flipscreen3d.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/fliptext.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/flurry.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/gears.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/gflux.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/glblur.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/gleidescope.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/glforestfire.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/glhanoi.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/glknots.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/glmatrix.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/glplanet.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/glschool.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/glslideshow.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/glsnake.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/gltext.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/hypertorus.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/jigglypuff.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/juggler3d.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/klein.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/lament.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/lavalite.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/menger.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/mirrorblob.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/moebius.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/molecule.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/morph3d.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/noof.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/pinion.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/pipes.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/polyhedra.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/polytopes.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/providence.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/pulsar.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/queens.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/rubik.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/sballs.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/sierpinski3d.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/spheremonics.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/sproingies.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/stairs.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/starwars.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/stonerview.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/superquadrics.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/tangram.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/timetunnel.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/topblock.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xplanet.xml 0444 root bin
+
--- a/packages/SUNWxscreensaver-hacks-gl/prototype_i386	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks-gl/prototype_i386	Thu Aug 10 09:55:02 2006 -0700
@@ -1,9 +1,35 @@
 #
-# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-# ident	"@(#)prototype_i386	1.1	05/05/03 SMI"
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)prototype_i386	1.2	06/08/09 SMI"
+#
+# XScreenSaver OpenGL display modules
 
 i depend=depend.i386
 
--- a/packages/SUNWxscreensaver-hacks-gl/prototype_sparc	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks-gl/prototype_sparc	Thu Aug 10 09:55:02 2006 -0700
@@ -1,9 +1,35 @@
 #
-# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-# ident	"@(#)prototype_sparc	1.1	05/05/03 SMI"
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)prototype_sparc	1.2	06/08/09 SMI"
+#
+# XScreenSaver OpenGL display modules
 
 i depend=depend.sparc
 
--- a/packages/SUNWxscreensaver-hacks/copyright.add	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks/copyright.add	Thu Aug 10 09:55:02 2006 -0700
@@ -1,6 +1,7 @@
 
-The xscreensaver base software is Copyright 1991-2002 by Jamie Zawinski
-<[email protected]>.
+The xscreensaver base software is Copyright (c) 1991-2006 Jamie Zawinski 
+<[email protected]>
+
 Permission to use, copy, modify, distribute, and sell this software and its
 documentation for any purpose is hereby granted without fee, provided that
 the above copyright notice appear in all copies and that both that
--- a/packages/SUNWxscreensaver-hacks/depend	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks/depend	Thu Aug 10 09:55:02 2006 -0700
@@ -1,13 +1,43 @@
-#	Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved
-#	Use is subject to license terms
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-#	@(#)depend	1.3	04/12/17 Sun Microsystems, Inc.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)depend	1.4	06/08/09 SMI"
+#
+# XScreenSaver non-OpenGL display modules
 
-P SUNWcsr	Core Sparc, (Root)
-P SUNWcsu	Core Sparc, (Usr)
+P SUNWcsr	Core Solaris, (Root)
+P SUNWcsu	Core Solaris, (Usr)
 P SUNWcsl	Core Solaris, (Shared Libs)
+P SUNWcar	Core Architecture, (Root)
+P SUNWkvm	Core Architecture, (Usr)
 P SUNWgnome-base-libs  GNOME base GUI libraries
-P SUNWlibms	Forte Developer Bundled shared libm
+P SUNWlibmsr	Math & Microtasking Libraries (Root)
 P SUNWxwplt	X Window System platform software
 P SUNWxwrtl	X Window System & Graphics Runtime Library Links in /usr/lib
 P SUNWxwsvr	XScreenSaver
--- a/packages/SUNWxscreensaver-hacks/pkginfo.tmpl	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks/pkginfo.tmpl	Thu Aug 10 09:55:02 2006 -0700
@@ -1,7 +1,34 @@
-#	Copyright 2003 Sun Microsystems, Inc. All Rights Reserved
-#	Use is subject to license terms
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-#	@(#)pkginfo.tmpl	1.1	03/11/17 Sun Microsystems, Inc.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)pkginfo.tmpl	1.2	06/08/09 SMI"
+#
 
 PKG="SUNWxscreensaver-hacks"
 NAME="XScreenSaver display mode modules"
@@ -16,6 +43,6 @@
 HOTLINE="Please contact your local service provider"
 EMAIL=""
 MAXINST="1000"
-SUNW_PKGTYPE="ow"
+SUNW_PKGTYPE="usr"
 CLASSES=none 
 SUNW_PKGVERS=1.0
--- a/packages/SUNWxscreensaver-hacks/prototype	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxscreensaver-hacks/prototype	Thu Aug 10 09:55:02 2006 -0700
@@ -1,314 +1,456 @@
-#	Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved
-#	Use is subject to license terms
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-#	@(#)prototype	1.2	03/11/17 Sun Microsystems, Inc.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)prototype	1.3	06/08/09 SMI"
 
 i pkginfo
 i copyright
 i depend 
 
-# Many of the search paths in this file look strange due to the weird
-# Xscreensaver install process
-
-!HOME=../openwin
-d none openwin 0755 root bin
-d none openwin/lib 0755 root bin
-d none openwin/lib/xscreensaver 0755 root bin
+!HOME=../usr/X11
+d none X11 0755 root bin
+d none X11/lib 0755 root bin
+d none X11/lib/xscreensaver 0755 root bin
 
 !search      $HOME/lib/xscreensaver/hacks
-d none openwin/lib/xscreensaver/hacks 0755 root bin
-f none openwin/lib/xscreensaver/hacks/anemone 0555 root bin
-f none openwin/lib/xscreensaver/hacks/ant 0555 root bin
-f none openwin/lib/xscreensaver/hacks/apollonian 0555 root bin
-f none openwin/lib/xscreensaver/hacks/attraction 0555 root bin
-f none openwin/lib/xscreensaver/hacks/blaster 0555 root bin
-f none openwin/lib/xscreensaver/hacks/bouboule 0555 root bin
-f none openwin/lib/xscreensaver/hacks/braid 0555 root bin
-f none openwin/lib/xscreensaver/hacks/ccurve 0555 root bin
-f none openwin/lib/xscreensaver/hacks/compass 0555 root bin
-f none openwin/lib/xscreensaver/hacks/coral 0555 root bin
-f none openwin/lib/xscreensaver/hacks/critical 0555 root bin
-f none openwin/lib/xscreensaver/hacks/crystal 0555 root bin
-f none openwin/lib/xscreensaver/hacks/cynosure 0555 root bin
-f none openwin/lib/xscreensaver/hacks/deco 0555 root bin
-f none openwin/lib/xscreensaver/hacks/deluxe 0555 root bin
-f none openwin/lib/xscreensaver/hacks/demon 0555 root bin
-f none openwin/lib/xscreensaver/hacks/discrete 0555 root bin
-f none openwin/lib/xscreensaver/hacks/drift 0555 root bin
-f none openwin/lib/xscreensaver/hacks/epicycle 0555 root bin
-f none openwin/lib/xscreensaver/hacks/euler2d 0555 root bin
-f none openwin/lib/xscreensaver/hacks/fadeplot 0555 root bin
-f none openwin/lib/xscreensaver/hacks/flag 0555 root bin
-f none openwin/lib/xscreensaver/hacks/flame 0555 root bin
-f none openwin/lib/xscreensaver/hacks/flow 0555 root bin
-f none openwin/lib/xscreensaver/hacks/fluidballs 0555 root bin
-f none openwin/lib/xscreensaver/hacks/forest 0555 root bin
-f none openwin/lib/xscreensaver/hacks/galaxy 0555 root bin
-f none openwin/lib/xscreensaver/hacks/goop 0555 root bin
-f none openwin/lib/xscreensaver/hacks/grav 0555 root bin
-f none openwin/lib/xscreensaver/hacks/greynetic 0555 root bin
-f none openwin/lib/xscreensaver/hacks/halo 0555 root bin
-f none openwin/lib/xscreensaver/hacks/helix 0555 root bin
-f none openwin/lib/xscreensaver/hacks/hopalong 0555 root bin
-f none openwin/lib/xscreensaver/hacks/hyperball 0555 root bin
-f none openwin/lib/xscreensaver/hacks/hypercube 0555 root bin
-f none openwin/lib/xscreensaver/hacks/ifs 0555 root bin
-f none openwin/lib/xscreensaver/hacks/imsmap 0555 root bin
-f none openwin/lib/xscreensaver/hacks/interference 0555 root bin
-f none openwin/lib/xscreensaver/hacks/juggle 0555 root bin
-f none openwin/lib/xscreensaver/hacks/kaleidescope 0555 root bin
-f none openwin/lib/xscreensaver/hacks/kumppa 0555 root bin
-f none openwin/lib/xscreensaver/hacks/laser 0555 root bin
-f none openwin/lib/xscreensaver/hacks/lightning 0555 root bin
-f none openwin/lib/xscreensaver/hacks/lisa 0555 root bin
-f none openwin/lib/xscreensaver/hacks/lissie 0555 root bin
-f none openwin/lib/xscreensaver/hacks/lmorph 0555 root bin
-f none openwin/lib/xscreensaver/hacks/loop 0555 root bin
-f none openwin/lib/xscreensaver/hacks/maze 0555 root bin
-f none openwin/lib/xscreensaver/hacks/moire 0555 root bin
-f none openwin/lib/xscreensaver/hacks/moire2 0555 root bin
-f none openwin/lib/xscreensaver/hacks/mountain 0555 root bin
-f none openwin/lib/xscreensaver/hacks/munch 0555 root bin
-f none openwin/lib/xscreensaver/hacks/nerverot 0555 root bin
-f none openwin/lib/xscreensaver/hacks/pedal 0555 root bin
-f none openwin/lib/xscreensaver/hacks/penetrate 0555 root bin
-f none openwin/lib/xscreensaver/hacks/petri 0555 root bin
-f none openwin/lib/xscreensaver/hacks/polyominoes 0555 root bin
-f none openwin/lib/xscreensaver/hacks/pyro 0555 root bin
-f none openwin/lib/xscreensaver/hacks/qix 0555 root bin
-f none openwin/lib/xscreensaver/hacks/rd-bomb 0555 root bin
-f none openwin/lib/xscreensaver/hacks/rocks 0555 root bin
-f none openwin/lib/xscreensaver/hacks/rorschach 0555 root bin
-f none openwin/lib/xscreensaver/hacks/rotor 0555 root bin
-f none openwin/lib/xscreensaver/hacks/rotzoomer 0555 root bin
-f none openwin/lib/xscreensaver/hacks/shadebobs 0555 root bin
-f none openwin/lib/xscreensaver/hacks/sierpinski 0555 root bin
-f none openwin/lib/xscreensaver/hacks/sonar 0555 root bin
-f none openwin/lib/xscreensaver/hacks/speedmine 0555 root bin
-f none openwin/lib/xscreensaver/hacks/sphere 0555 root bin
-f none openwin/lib/xscreensaver/hacks/spiral 0555 root bin
-f none openwin/lib/xscreensaver/hacks/squiral 0555 root bin
-f none openwin/lib/xscreensaver/hacks/starfish 0555 root bin
-f none openwin/lib/xscreensaver/hacks/strange 0555 root bin
-f none openwin/lib/xscreensaver/hacks/swirl 0555 root bin
-f none openwin/lib/xscreensaver/hacks/t3d 0555 root bin
-f none openwin/lib/xscreensaver/hacks/thornbird 0555 root bin
-f none openwin/lib/xscreensaver/hacks/triangle 0555 root bin
-f none openwin/lib/xscreensaver/hacks/truchet 0555 root bin
-f none openwin/lib/xscreensaver/hacks/twang 0555 root bin
-f none openwin/lib/xscreensaver/hacks/vermiculate 0555 root bin
-f none openwin/lib/xscreensaver/hacks/vidwhacker 0555 root bin
-f none openwin/lib/xscreensaver/hacks/vines 0555 root bin
-f none openwin/lib/xscreensaver/hacks/wander 0555 root bin
-f none openwin/lib/xscreensaver/hacks/whirlwindwarp 0555 root bin
-f none openwin/lib/xscreensaver/hacks/whirlygig 0555 root bin
-f none openwin/lib/xscreensaver/hacks/worm 0555 root bin
-f none openwin/lib/xscreensaver/hacks/xflame 0555 root bin
-f none openwin/lib/xscreensaver/hacks/xjack 0555 root bin
-f none openwin/lib/xscreensaver/hacks/xmatrix 0555 root bin
-f none openwin/lib/xscreensaver/hacks/xrayswarm 0555 root bin
-f none openwin/lib/xscreensaver/hacks/xspirograph 0555 root bin
-f none openwin/lib/xscreensaver/hacks/xsublim 0555 root bin
+d none X11/lib/xscreensaver/hacks 0755 root bin
+f none X11/lib/xscreensaver/hacks/anemone 0555 root bin
+f none X11/lib/xscreensaver/hacks/anemotaxis 0555 root bin
+f none X11/lib/xscreensaver/hacks/apollonian 0555 root bin
+f none X11/lib/xscreensaver/hacks/apple2 0555 root bin
+f none X11/lib/xscreensaver/hacks/attraction 0555 root bin
+f none X11/lib/xscreensaver/hacks/barcode 0555 root bin
+f none X11/lib/xscreensaver/hacks/blaster 0555 root bin
+f none X11/lib/xscreensaver/hacks/blitspin 0555 root bin
+f none X11/lib/xscreensaver/hacks/bouboule 0555 root bin
+f none X11/lib/xscreensaver/hacks/boxfit 0555 root bin
+f none X11/lib/xscreensaver/hacks/braid 0555 root bin
+f none X11/lib/xscreensaver/hacks/bsod 0555 root bin
+f none X11/lib/xscreensaver/hacks/bubbles 0555 root bin
+f none X11/lib/xscreensaver/hacks/bumps 0555 root bin
+f none X11/lib/xscreensaver/hacks/ccurve 0555 root bin
+f none X11/lib/xscreensaver/hacks/celtic 0555 root bin
+f none X11/lib/xscreensaver/hacks/cloudlife 0555 root bin
+f none X11/lib/xscreensaver/hacks/compass 0555 root bin
+f none X11/lib/xscreensaver/hacks/coral 0555 root bin
+f none X11/lib/xscreensaver/hacks/critical 0555 root bin
+f none X11/lib/xscreensaver/hacks/crystal 0555 root bin
+f none X11/lib/xscreensaver/hacks/cynosure 0555 root bin
+f none X11/lib/xscreensaver/hacks/decayscreen 0555 root bin
+f none X11/lib/xscreensaver/hacks/deco 0555 root bin
+f none X11/lib/xscreensaver/hacks/deluxe 0555 root bin
+f none X11/lib/xscreensaver/hacks/demon 0555 root bin
+f none X11/lib/xscreensaver/hacks/discrete 0555 root bin
+f none X11/lib/xscreensaver/hacks/distort 0555 root bin
+f none X11/lib/xscreensaver/hacks/drift 0555 root bin
+f none X11/lib/xscreensaver/hacks/epicycle 0555 root bin
+f none X11/lib/xscreensaver/hacks/eruption 0555 root bin
+f none X11/lib/xscreensaver/hacks/euler2d 0555 root bin
+f none X11/lib/xscreensaver/hacks/fadeplot 0555 root bin
+f none X11/lib/xscreensaver/hacks/fiberlamp 0555 root bin
+f none X11/lib/xscreensaver/hacks/fireworkx 0555 root bin
+f none X11/lib/xscreensaver/hacks/flag 0555 root bin
+f none X11/lib/xscreensaver/hacks/flame 0555 root bin
+f none X11/lib/xscreensaver/hacks/flow 0555 root bin
+f none X11/lib/xscreensaver/hacks/fluidballs 0555 root bin
+f none X11/lib/xscreensaver/hacks/fontglide 0555 root bin
+f none X11/lib/xscreensaver/hacks/forest 0555 root bin
+f none X11/lib/xscreensaver/hacks/fuzzyflakes 0555 root bin
+f none X11/lib/xscreensaver/hacks/galaxy 0555 root bin
+f none X11/lib/xscreensaver/hacks/goop 0555 root bin
+f none X11/lib/xscreensaver/hacks/grav 0555 root bin
+f none X11/lib/xscreensaver/hacks/greynetic 0555 root bin
+f none X11/lib/xscreensaver/hacks/halftone 0555 root bin
+f none X11/lib/xscreensaver/hacks/halo 0555 root bin
+f none X11/lib/xscreensaver/hacks/helix 0555 root bin
+f none X11/lib/xscreensaver/hacks/hopalong 0555 root bin
+f none X11/lib/xscreensaver/hacks/hyperball 0555 root bin
+f none X11/lib/xscreensaver/hacks/hypercube 0555 root bin
+f none X11/lib/xscreensaver/hacks/ifs 0555 root bin
+f none X11/lib/xscreensaver/hacks/imsmap 0555 root bin
+f none X11/lib/xscreensaver/hacks/interaggregate 0555 root bin
+f none X11/lib/xscreensaver/hacks/interference 0555 root bin
+f none X11/lib/xscreensaver/hacks/intermomentary 0555 root bin
+f none X11/lib/xscreensaver/hacks/jigsaw 0555 root bin
+f none X11/lib/xscreensaver/hacks/juggle 0555 root bin
+f none X11/lib/xscreensaver/hacks/julia 0555 root bin
+f none X11/lib/xscreensaver/hacks/kaleidescope 0555 root bin
+f none X11/lib/xscreensaver/hacks/kumppa 0555 root bin
+f none X11/lib/xscreensaver/hacks/laser 0555 root bin
+f none X11/lib/xscreensaver/hacks/lightning 0555 root bin
+f none X11/lib/xscreensaver/hacks/lisa 0555 root bin
+f none X11/lib/xscreensaver/hacks/lissie 0555 root bin
+f none X11/lib/xscreensaver/hacks/lmorph 0555 root bin
+f none X11/lib/xscreensaver/hacks/loop 0555 root bin
+f none X11/lib/xscreensaver/hacks/maze 0555 root bin
+f none X11/lib/xscreensaver/hacks/memscroller 0555 root bin
+f none X11/lib/xscreensaver/hacks/metaballs 0555 root bin
+f none X11/lib/xscreensaver/hacks/mismunch 0555 root bin
+f none X11/lib/xscreensaver/hacks/moire 0555 root bin
+f none X11/lib/xscreensaver/hacks/moire2 0555 root bin
+f none X11/lib/xscreensaver/hacks/mountain 0555 root bin
+f none X11/lib/xscreensaver/hacks/munch 0555 root bin
+f none X11/lib/xscreensaver/hacks/nerverot 0555 root bin
+f none X11/lib/xscreensaver/hacks/noseguy 0555 root bin
+f none X11/lib/xscreensaver/hacks/pacman 0555 root bin
+f none X11/lib/xscreensaver/hacks/pedal 0555 root bin
+f none X11/lib/xscreensaver/hacks/penetrate 0555 root bin
+f none X11/lib/xscreensaver/hacks/penrose 0555 root bin
+f none X11/lib/xscreensaver/hacks/petri 0555 root bin
+f none X11/lib/xscreensaver/hacks/phosphor 0555 root bin
+f none X11/lib/xscreensaver/hacks/piecewise 0555 root bin
+f none X11/lib/xscreensaver/hacks/polyominoes 0555 root bin
+f none X11/lib/xscreensaver/hacks/pong 0555 root bin
+f none X11/lib/xscreensaver/hacks/popsquares 0555 root bin
+f none X11/lib/xscreensaver/hacks/pyro 0555 root bin
+f none X11/lib/xscreensaver/hacks/qix 0555 root bin
+f none X11/lib/xscreensaver/hacks/rd-bomb 0555 root bin
+f none X11/lib/xscreensaver/hacks/ripples 0555 root bin
+f none X11/lib/xscreensaver/hacks/rocks 0555 root bin
+f none X11/lib/xscreensaver/hacks/rorschach 0555 root bin
+f none X11/lib/xscreensaver/hacks/rotor 0555 root bin
+f none X11/lib/xscreensaver/hacks/rotzoomer 0555 root bin
+f none X11/lib/xscreensaver/hacks/shadebobs 0555 root bin
+f none X11/lib/xscreensaver/hacks/sierpinski 0555 root bin
+f none X11/lib/xscreensaver/hacks/slidescreen 0555 root bin
+f none X11/lib/xscreensaver/hacks/slip 0555 root bin
+f none X11/lib/xscreensaver/hacks/speedmine 0555 root bin
+f none X11/lib/xscreensaver/hacks/sphere 0555 root bin
+f none X11/lib/xscreensaver/hacks/spiral 0555 root bin
+f none X11/lib/xscreensaver/hacks/spotlight 0555 root bin
+f none X11/lib/xscreensaver/hacks/squiral 0555 root bin
+f none X11/lib/xscreensaver/hacks/starfish 0555 root bin
+f none X11/lib/xscreensaver/hacks/strange 0555 root bin
+f none X11/lib/xscreensaver/hacks/substrate 0555 root bin
+f none X11/lib/xscreensaver/hacks/swirl 0555 root bin
+f none X11/lib/xscreensaver/hacks/t3d 0555 root bin
+f none X11/lib/xscreensaver/hacks/thornbird 0555 root bin
+f none X11/lib/xscreensaver/hacks/triangle 0555 root bin
+f none X11/lib/xscreensaver/hacks/truchet 0555 root bin
+f none X11/lib/xscreensaver/hacks/twang 0555 root bin
+f none X11/lib/xscreensaver/hacks/vermiculate 0555 root bin
+f none X11/lib/xscreensaver/hacks/vidwhacker 0555 root bin
+f none X11/lib/xscreensaver/hacks/vines 0555 root bin
+f none X11/lib/xscreensaver/hacks/wander 0555 root bin
+f none X11/lib/xscreensaver/hacks/webcollage-helper 0555 root bin
+f none X11/lib/xscreensaver/hacks/whirlwindwarp 0555 root bin
+f none X11/lib/xscreensaver/hacks/whirlygig 0555 root bin
+f none X11/lib/xscreensaver/hacks/worm 0555 root bin
+f none X11/lib/xscreensaver/hacks/wormhole 0555 root bin
+f none X11/lib/xscreensaver/hacks/xanalogtv 0555 root bin
+f none X11/lib/xscreensaver/hacks/xflame 0555 root bin
+f none X11/lib/xscreensaver/hacks/xjack 0555 root bin
+f none X11/lib/xscreensaver/hacks/xlyap 0555 root bin
+f none X11/lib/xscreensaver/hacks/xmatrix 0555 root bin
+f none X11/lib/xscreensaver/hacks/xrayswarm 0555 root bin
+f none X11/lib/xscreensaver/hacks/xspirograph 0555 root bin
+f none X11/lib/xscreensaver/hacks/xsublim 0555 root bin
+f none X11/lib/xscreensaver/hacks/zoom 0555 root bin
 
-!search $HOME/share/man/man1
-1 s none openwin/man=./share/man
-1 d none openwin/share 0755 root bin
-1 d none openwin/share/man 0755 root bin
-d none openwin/share/man/man1 0755 root bin
-f none openwin/share/man/man1/anemone.1 0444 root bin
-f none openwin/share/man/man1/ant.1 0444 root bin
-f none openwin/share/man/man1/apollonian.1 0444 root bin
-f none openwin/share/man/man1/attraction.1 0444 root bin
-f none openwin/share/man/man1/blaster.1 0444 root bin
-f none openwin/share/man/man1/bouboule.1 0444 root bin
-f none openwin/share/man/man1/braid.1 0444 root bin
-f none openwin/share/man/man1/ccurve.1 0444 root bin
-f none openwin/share/man/man1/compass.1 0444 root bin
-f none openwin/share/man/man1/coral.1 0444 root bin
-f none openwin/share/man/man1/critical.1 0444 root bin
-f none openwin/share/man/man1/crystal.1 0444 root bin
-f none openwin/share/man/man1/cynosure.1 0444 root bin
-f none openwin/share/man/man1/deco.1 0444 root bin
-f none openwin/share/man/man1/deluxe.1 0444 root bin
-f none openwin/share/man/man1/demon.1 0444 root bin
-f none openwin/share/man/man1/discrete.1 0444 root bin
-f none openwin/share/man/man1/drift.1 0444 root bin
-f none openwin/share/man/man1/epicycle.1 0444 root bin
-f none openwin/share/man/man1/euler2d.1 0444 root bin
-f none openwin/share/man/man1/fadeplot.1 0444 root bin
-f none openwin/share/man/man1/flag.1 0444 root bin
-f none openwin/share/man/man1/flame.1 0444 root bin
-f none openwin/share/man/man1/flow.1 0444 root bin
-f none openwin/share/man/man1/fluidballs.1 0444 root bin
-f none openwin/share/man/man1/forest.1 0444 root bin
-f none openwin/share/man/man1/galaxy.1 0444 root bin
-f none openwin/share/man/man1/goop.1 0444 root bin
-f none openwin/share/man/man1/grav.1 0444 root bin
-f none openwin/share/man/man1/greynetic.1 0444 root bin
-f none openwin/share/man/man1/halo.1 0444 root bin
-f none openwin/share/man/man1/helix.1 0444 root bin
-f none openwin/share/man/man1/hopalong.1 0444 root bin
-f none openwin/share/man/man1/hyperball.1 0444 root bin
-f none openwin/share/man/man1/hypercube.1 0444 root bin
-f none openwin/share/man/man1/ifs.1 0444 root bin 
-f none openwin/share/man/man1/imsmap.1 0444 root bin
-f none openwin/share/man/man1/kaleidescope.1 0444 root bin
-f none openwin/share/man/man1/kumppa.1 0444 root bin
-f none openwin/share/man/man1/laser.1 0444 root bin
-f none openwin/share/man/man1/lightning.1 0444 root bin
-f none openwin/share/man/man1/lisa.1 0444 root bin
-f none openwin/share/man/man1/lissie.1 0444 root bin
-f none openwin/share/man/man1/lmorph.1 0444 root bin
-f none openwin/share/man/man1/loop.1 0444 root bin
-f none openwin/share/man/man1/maze.1 0444 root bin
-f none openwin/share/man/man1/moire.1 0444 root bin
-f none openwin/share/man/man1/moire2.1 0444 root bin
-f none openwin/share/man/man1/mountain.1 0444 root bin
-f none openwin/share/man/man1/munch.1 0444 root bin
-f none openwin/share/man/man1/nerverot.1 0444 root bin
-f none openwin/share/man/man1/pedal.1 0444 root bin
-f none openwin/share/man/man1/penetrate.1 0444 root bin
-f none openwin/share/man/man1/petri.1 0444 root bin
-f none openwin/share/man/man1/polyominoes.1 0444 root bin
-f none openwin/share/man/man1/pyro.1 0444 root bin
-f none openwin/share/man/man1/qix.1 0444 root bin
-f none openwin/share/man/man1/rd-bomb.1 0444 root bin
-f none openwin/share/man/man1/rocks.1 0444 root bin
-f none openwin/share/man/man1/rorschach.1 0444 root bin
-f none openwin/share/man/man1/rotor.1 0444 root bin
-f none openwin/share/man/man1/rotzoomer.1 0444 root bin
-f none openwin/share/man/man1/shadebobs.1 0444 root bin
-f none openwin/share/man/man1/sierpinski.1 0444 root bin
-f none openwin/share/man/man1/sonar.1 0444 root bin
-f none openwin/share/man/man1/speedmine.1 0444 root bin
-f none openwin/share/man/man1/sphere.1 0444 root bin
-f none openwin/share/man/man1/spiral.1 0444 root bin
-f none openwin/share/man/man1/squiral.1 0444 root bin
-f none openwin/share/man/man1/starfish.1 0444 root bin 
-f none openwin/share/man/man1/strange.1 0444 root bin
-f none openwin/share/man/man1/swirl.1 0444 root bin
-f none openwin/share/man/man1/t3d.1 0444 root bin
-f none openwin/share/man/man1/thornbird.1 0444 root bin
-f none openwin/share/man/man1/triangle.1 0444 root bin
-f none openwin/share/man/man1/truchet.1 0444 root bin
-f none openwin/share/man/man1/twang.1 0444 root bin
-f none openwin/share/man/man1/vermiculate.1 0444 root bin
-f none openwin/share/man/man1/vidwhacker.1 0444 root bin
-f none openwin/share/man/man1/vines.1 0444 root bin
-f none openwin/share/man/man1/wander.1 0444 root bin
-f none openwin/share/man/man1/whirlwindwarp.1 0444 root bin
-f none openwin/share/man/man1/whirlygig.1 0444 root bin
-f none openwin/share/man/man1/worm.1 0444 root bin
-f none openwin/share/man/man1/xflame.1 0444 root bin
-f none openwin/share/man/man1/xjack.1 0444 root bin
-f none openwin/share/man/man1/xmatrix.1 0444 root bin
-f none openwin/share/man/man1/xrayswarm.1 0444 root bin
-f none openwin/share/man/man1/xspirograph.1 0444 root bin
-f none openwin/share/man/man1/xsublim.1 0444 root bin
+!search $HOME/share/man/man6
+s none X11/man=share/man
+d none X11/share 0755 root bin
+d none X11/share/man 0755 root bin
+d none X11/share/man/man6 0755 root bin
+f none X11/share/man/man6/anemone.6 0444 root bin
+f none X11/share/man/man6/anemotaxis.6 0444 root bin
+f none X11/share/man/man6/apollonian.6 0444 root bin
+f none X11/share/man/man6/apple2.6 0444 root bin
+f none X11/share/man/man6/attraction.6 0444 root bin
+f none X11/share/man/man6/barcode.6 0444 root bin
+f none X11/share/man/man6/blaster.6 0444 root bin
+f none X11/share/man/man6/blitspin.6 0444 root bin
+f none X11/share/man/man6/bouboule.6 0444 root bin
+f none X11/share/man/man6/boxfit.6 0444 root bin
+f none X11/share/man/man6/braid.6 0444 root bin
+f none X11/share/man/man6/bsod.6 0444 root bin
+f none X11/share/man/man6/bubbles.6 0444 root bin
+f none X11/share/man/man6/bumps.6 0444 root bin
+f none X11/share/man/man6/ccurve.6 0444 root bin
+f none X11/share/man/man6/celtic.6 0444 root bin
+f none X11/share/man/man6/cloudlife.6 0444 root bin
+f none X11/share/man/man6/compass.6 0444 root bin
+f none X11/share/man/man6/coral.6 0444 root bin
+f none X11/share/man/man6/critical.6 0444 root bin
+f none X11/share/man/man6/crystal.6 0444 root bin
+f none X11/share/man/man6/cynosure.6 0444 root bin
+f none X11/share/man/man6/decayscreen.6 0444 root bin
+f none X11/share/man/man6/deco.6 0444 root bin
+f none X11/share/man/man6/deluxe.6 0444 root bin
+f none X11/share/man/man6/demon.6 0444 root bin
+f none X11/share/man/man6/discrete.6 0444 root bin
+f none X11/share/man/man6/distort.6 0444 root bin
+f none X11/share/man/man6/drift.6 0444 root bin
+f none X11/share/man/man6/epicycle.6 0444 root bin
+f none X11/share/man/man6/eruption.6 0444 root bin
+f none X11/share/man/man6/euler2d.6 0444 root bin
+f none X11/share/man/man6/fadeplot.6 0444 root bin
+f none X11/share/man/man6/fiberlamp.6 0444 root bin
+f none X11/share/man/man6/fireworkx.6 0444 root bin
+f none X11/share/man/man6/flag.6 0444 root bin
+f none X11/share/man/man6/flame.6 0444 root bin
+f none X11/share/man/man6/flow.6 0444 root bin
+f none X11/share/man/man6/fluidballs.6 0444 root bin
+f none X11/share/man/man6/fontglide.6 0444 root bin
+f none X11/share/man/man6/forest.6 0444 root bin
+f none X11/share/man/man6/fuzzyflakes.6 0444 root bin
+f none X11/share/man/man6/galaxy.6 0444 root bin
+f none X11/share/man/man6/goop.6 0444 root bin
+f none X11/share/man/man6/grav.6 0444 root bin
+f none X11/share/man/man6/greynetic.6 0444 root bin
+f none X11/share/man/man6/halftone.6 0444 root bin
+f none X11/share/man/man6/halo.6 0444 root bin
+f none X11/share/man/man6/helix.6 0444 root bin
+f none X11/share/man/man6/hopalong.6 0444 root bin
+f none X11/share/man/man6/hyperball.6 0444 root bin
+f none X11/share/man/man6/hypercube.6 0444 root bin
+f none X11/share/man/man6/ifs.6 0444 root bin
+f none X11/share/man/man6/imsmap.6 0444 root bin
+f none X11/share/man/man6/interaggregate.6 0444 root bin
+f none X11/share/man/man6/interference.6 0444 root bin
+f none X11/share/man/man6/intermomentary.6 0444 root bin
+f none X11/share/man/man6/jigsaw.6 0444 root bin
+f none X11/share/man/man6/juggle.6 0444 root bin
+f none X11/share/man/man6/julia.6 0444 root bin
+f none X11/share/man/man6/kaleidescope.6 0444 root bin
+f none X11/share/man/man6/kumppa.6 0444 root bin
+f none X11/share/man/man6/laser.6 0444 root bin
+f none X11/share/man/man6/lightning.6 0444 root bin
+f none X11/share/man/man6/lisa.6 0444 root bin
+f none X11/share/man/man6/lissie.6 0444 root bin
+f none X11/share/man/man6/lmorph.6 0444 root bin
+f none X11/share/man/man6/loop.6 0444 root bin
+f none X11/share/man/man6/maze.6 0444 root bin
+f none X11/share/man/man6/memscroller.6 0444 root bin
+f none X11/share/man/man6/metaballs.6 0444 root bin
+f none X11/share/man/man6/mismunch.6 0444 root bin
+f none X11/share/man/man6/moire.6 0444 root bin
+f none X11/share/man/man6/moire2.6 0444 root bin
+f none X11/share/man/man6/mountain.6 0444 root bin
+f none X11/share/man/man6/munch.6 0444 root bin
+f none X11/share/man/man6/nerverot.6 0444 root bin
+f none X11/share/man/man6/noseguy.6 0444 root bin
+f none X11/share/man/man6/pacman.6 0444 root bin
+f none X11/share/man/man6/pedal.6 0444 root bin
+f none X11/share/man/man6/penetrate.6 0444 root bin
+f none X11/share/man/man6/penrose.6 0444 root bin
+f none X11/share/man/man6/petri.6 0444 root bin
+f none X11/share/man/man6/phosphor.6 0444 root bin
+f none X11/share/man/man6/piecewise.6 0444 root bin
+f none X11/share/man/man6/polyominoes.6 0444 root bin
+f none X11/share/man/man6/pong.6 0444 root bin
+f none X11/share/man/man6/pyro.6 0444 root bin
+f none X11/share/man/man6/qix.6 0444 root bin
+f none X11/share/man/man6/rd-bomb.6 0444 root bin
+f none X11/share/man/man6/ripples.6 0444 root bin
+f none X11/share/man/man6/rocks.6 0444 root bin
+f none X11/share/man/man6/rorschach.6 0444 root bin
+f none X11/share/man/man6/rotor.6 0444 root bin
+f none X11/share/man/man6/rotzoomer.6 0444 root bin
+f none X11/share/man/man6/shadebobs.6 0444 root bin
+f none X11/share/man/man6/sierpinski.6 0444 root bin
+f none X11/share/man/man6/slidescreen.6 0444 root bin
+f none X11/share/man/man6/slip.6 0444 root bin
+f none X11/share/man/man6/speedmine.6 0444 root bin
+f none X11/share/man/man6/sphere.6 0444 root bin
+f none X11/share/man/man6/spiral.6 0444 root bin
+f none X11/share/man/man6/spotlight.6 0444 root bin
+f none X11/share/man/man6/squiral.6 0444 root bin
+f none X11/share/man/man6/starfish.6 0444 root bin
+f none X11/share/man/man6/strange.6 0444 root bin
+f none X11/share/man/man6/substrate.6 0444 root bin
+f none X11/share/man/man6/swirl.6 0444 root bin
+f none X11/share/man/man6/t3d.6 0444 root bin
+f none X11/share/man/man6/thornbird.6 0444 root bin
+f none X11/share/man/man6/triangle.6 0444 root bin
+f none X11/share/man/man6/truchet.6 0444 root bin
+f none X11/share/man/man6/twang.6 0444 root bin
+f none X11/share/man/man6/vermiculate.6 0444 root bin
+f none X11/share/man/man6/vidwhacker.6 0444 root bin
+f none X11/share/man/man6/vines.6 0444 root bin
+f none X11/share/man/man6/wander.6 0444 root bin
+f none X11/share/man/man6/whirlwindwarp.6 0444 root bin
+f none X11/share/man/man6/whirlygig.6 0444 root bin
+f none X11/share/man/man6/worm.6 0444 root bin
+f none X11/share/man/man6/wormhole.6 0444 root bin
+f none X11/share/man/man6/xanalogtv.6 0444 root bin
+f none X11/share/man/man6/xflame.6 0444 root bin
+f none X11/share/man/man6/xjack.6 0444 root bin
+f none X11/share/man/man6/xlyap.6 0444 root bin
+f none X11/share/man/man6/xmatrix.6 0444 root bin
+f none X11/share/man/man6/xrayswarm.6 0444 root bin
+f none X11/share/man/man6/xspirograph.6 0444 root bin
+f none X11/share/man/man6/xsublim.6 0444 root bin
+f none X11/share/man/man6/zoom.6 0444 root bin
 
 
 !search      $HOME/lib/xscreensaver/config/control-center-2.0/
-d none openwin/lib/xscreensaver/config 0755 root bin
-d none openwin/lib/xscreensaver/config/control-center-2.0 0755 root other
-f none openwin/lib/xscreensaver/config/control-center-2.0/ant.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/apollonian.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/attraction.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/blaster.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/bouboule.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/braid.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/ccurve.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/compass.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/coral.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/cosmos.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/critical.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/crystal.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/cynosure.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/deco.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/deluxe.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/demon.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/discrete.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/drift.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/electricsheep.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/epicycle.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/euler2d.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/extrusion.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/fadeplot.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/flag.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/flame.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/flow.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/fluidballs.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/forest.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/galaxy.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/goban.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/goop.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/grav.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/greynetic.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/halo.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/helix.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/hopalong.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/hyperball.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/hypercube.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/ifs.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/imsmap.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/interference.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/juggle.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/kaleidescope.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/kumppa.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/laser.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/lightning.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/lisa.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/lissie.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/lmorph.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/loop.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/maze.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/moire.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/moire2.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/mountain.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/munch.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/nerverot.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/pedal.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/penetrate.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/petri.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/polyominoes.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/pyro.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/qix.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/rd-bomb.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/rocks.xml 0444 root bin 
-f none openwin/lib/xscreensaver/config/control-center-2.0/rorschach.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/rotor.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/rotzoomer.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/shadebobs.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/sierpinski.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/sonar.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/speedmine.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/sphere.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/sphereEversion.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/spiral.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/squiral.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/ssystem.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/starfish.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/strange.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/swirl.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/t3d.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/thornbird.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/triangle.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/truchet.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/twang.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/vermiculate.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/vidwhacker.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/vines.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/wander.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/whirlwindwarp.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/whirlygig.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/worm.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xaos.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xdaliclock.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xearth.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xfishtank.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xflame.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xjack.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xmatrix.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xmountains.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xrayswarm.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xsnow.xml 0444 root bin
-f none openwin/lib/xscreensaver/config/control-center-2.0/xspirograph.xml 0444 root bin
+d none X11/lib/xscreensaver/config 0755 root bin
+d none X11/lib/xscreensaver/config/control-center-2.0 0755 root other
+f none X11/lib/xscreensaver/config/control-center-2.0/anemone.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/anemotaxis.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/apollonian.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/apple2.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/attraction.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/barcode.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/blaster.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/blitspin.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/bouboule.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/boxfit.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/braid.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/bsod.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/bubbles.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/bumps.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/ccurve.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/celtic.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/cloudlife.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/compass.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/coral.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/cosmos.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/critical.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/crystal.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/cynosure.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/decayscreen.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/deco.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/deluxe.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/demon.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/discrete.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/distort.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/drift.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/electricsheep.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/epicycle.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/eruption.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/euler2d.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/fadeplot.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/fiberlamp.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/fireworkx.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/flag.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/flame.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/flow.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/fluidballs.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/fontglide.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/forest.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/fuzzyflakes.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/galaxy.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/goban.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/goop.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/grav.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/greynetic.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/halftone.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/halo.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/helix.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/hopalong.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/hyperball.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/hypercube.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/ifs.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/imsmap.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/interaggregate.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/interference.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/intermomentary.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/jigsaw.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/juggle.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/julia.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/kaleidescope.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/kumppa.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/laser.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/lightning.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/lisa.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/lissie.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/lmorph.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/loop.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/maze.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/memscroller.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/metaballs.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/mismunch.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/moire.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/moire2.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/mountain.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/munch.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/nerverot.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/noseguy.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/pacman.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/pedal.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/penetrate.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/penrose.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/petri.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/phosphor.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/piecewise.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/polyominoes.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/pong.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/popsquares.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/pyro.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/qix.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/rd-bomb.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/ripples.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/rocks.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/rorschach.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/rotor.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/rotzoomer.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/shadebobs.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/sierpinski.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/slidescreen.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/slip.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/speedmine.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/sphere.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/sphereeversion.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/spiral.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/spotlight.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/squiral.xml 0444 root bin
+#f none X11/lib/xscreensaver/config/control-center-2.0/ssystem.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/starfish.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/strange.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/substrate.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/swirl.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/t3d.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/thornbird.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/triangle.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/truchet.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/twang.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/vermiculate.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/vidwhacker.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/vines.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/wander.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/whirlwindwarp.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/whirlygig.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/worm.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/wormhole.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xanalogtv.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xaos.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xdaliclock.xml 0444 root bin
+#f none X11/lib/xscreensaver/config/control-center-2.0/xearth.xml 0444 root bin
+#f none X11/lib/xscreensaver/config/control-center-2.0/xfishtank.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xflame.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xjack.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xlyap.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xmatrix.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xmountains.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xrayswarm.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xsnow.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/xspirograph.xml 0444 root bin
+f none X11/lib/xscreensaver/config/control-center-2.0/zoom.xml 0444 root bin
--- a/packages/SUNWxwsvr/copyright.add	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxwsvr/copyright.add	Thu Aug 10 09:55:02 2006 -0700
@@ -1,6 +1,6 @@
 
-The xscreensaver base software is Copyright 1991-2002 by Jamie Zawinski
-<[email protected]>.
+xscreensaver, Copyright (c) 1991-2006 Jamie Zawinski <[email protected]>
+
 Permission to use, copy, modify, distribute, and sell this software and its
 documentation for any purpose is hereby granted without fee, provided that
 the above copyright notice appear in all copies and that both that
--- a/packages/SUNWxwsvr/depend	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxwsvr/depend	Thu Aug 10 09:55:02 2006 -0700
@@ -1,15 +1,41 @@
-#	Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved
-#	Use is subject to license terms
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-#	@(#)depend	1.3	05/05/03 Sun Microsystems, Inc.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)depend	1.4	06/08/09 SMI"
+#
 
 P SUNWcsr	Core Sparc, (Root)
 P SUNWcsu	Core Sparc, (Usr)
 P SUNWcsl	Core Solaris, (Shared Libs)
 P SUNWgnome-base-libs  GNOME base GUI libraries
-P SUNWlibms	Forte Developer Bundled shared libm
+P SUNWlibms	Math & Microtasking Libraries (Usr)
 P SUNWlxml	The XML library
-P SUNWocf	Open Card Framework
 P SUNWxwplt	X Window System platform software
 P SUNWxwrtl	X Window System & Graphics Runtime Library Links in /usr/lib
 P SUNWzlib	The Zip compression library
--- a/packages/SUNWxwsvr/pkginfo.tmpl	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxwsvr/pkginfo.tmpl	Thu Aug 10 09:55:02 2006 -0700
@@ -1,7 +1,34 @@
-#	Copyright 2003 Sun Microsystems, Inc. All Rights Reserved
-#	Use is subject to license terms
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-#	@(#)pkginfo.tmpl	1.3	03/12/17 Sun Microsystems, Inc.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)pkginfo.tmpl	1.4	06/08/09 SMI"
+#
 
 PKG="SUNWxwsvr"
 NAME="XScreenSaver"
@@ -16,6 +43,6 @@
 HOTLINE="Please contact your local service provider"
 EMAIL=""
 MAXINST="1000"
-SUNW_PKGTYPE="ow"
+SUNW_PKGTYPE="usr"
 CLASSES=none 
 SUNW_PKGVERS=1.0
--- a/packages/SUNWxwsvr/prototype	Mon Aug 07 13:49:43 2006 -0700
+++ b/packages/SUNWxwsvr/prototype	Thu Aug 10 09:55:02 2006 -0700
@@ -1,7 +1,35 @@
-#	Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved
-#	Use is subject to license terms
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
 #
-#	@(#)prototype	1.7	04/07/01 Sun Microsystems, Inc.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+# 
+#
+# ident	"@(#)prototype	1.8	06/08/09 SMI"
+#
+# XScreenSaver daemon and utility programs
 
 i pkginfo
 i copyright
@@ -10,67 +38,82 @@
 # Many of the search paths in this file look strange due to the weird
 # Xscreensaver install process
 
-!HOME=../openwin
+!HOME=../usr
 
-!search      $HOME/bin
 d none bin 0755 root bin
-f none bin/screensaver-properties-capplet 0755 root bin
+s none bin/screensaver-properties-capplet=../X11/bin/xscreensaver-demo
 
-!search      $HOME/bin
+!search      $HOME/X11/bin
 d none openwin 0755 root bin
 d none openwin/bin 0755 root bin
-f none openwin/bin/xscreensaver 4755 root bin
-f none openwin/bin/xscreensaver-command 0755 root bin
-f none openwin/bin/xscreensaver-demo 0755 root bin
+s none openwin/bin/xscreensaver=../../X11/bin/xscreensaver
+s none openwin/bin/xscreensaver-command=../../X11/bin/xscreensaver-command
+s none openwin/bin/xscreensaver-demo=../../X11/bin/xscreensaver-demo
 
 d none openwin/lib 0755 root bin
-d none openwin/lib/xscreensaver 0755 root bin
-d none openwin/lib/xscreensaver/bin 0755 root bin
-!search      $HOME/lib/xscreensaver/bin
-f none openwin/lib/xscreensaver/bin/xscreensaver-lock 0555 root bin
-!search      $HOME/bin
-f none openwin/lib/xscreensaver/bin/xscreensaver-getimage 0555 root bin
-f none openwin/lib/xscreensaver/bin/xscreensaver-getimage-file 0555 root bin 
-f none openwin/lib/xscreensaver/bin/xscreensaver-getimage-video 0555 root bin
+s none openwin/lib/xscreensaver=../../X11/lib/xscreensaver
+
+!search      $HOME/X11/bin
+d none X11 				0755 root bin
+d none X11/bin 				0755 root bin
+f none X11/bin/xscreensaver 		4555 root bin
+f none X11/bin/xscreensaver-command 	0555 root bin
+f none X11/bin/xscreensaver-demo 	0555 root bin
+
+d none X11/lib 				0755 root bin
+d none X11/lib/xscreensaver 		0755 root bin
+d none X11/lib/xscreensaver/bin 	0755 root bin
+!search      $HOME/X11/lib/xscreensaver/bin
+f none X11/lib/xscreensaver/bin/xscreensaver-lock 		0555 root bin
+!search      $HOME/X11/bin
+f none X11/lib/xscreensaver/bin/xscreensaver-getimage		0555 root bin
+f none X11/lib/xscreensaver/bin/xscreensaver-getimage-file	0555 root bin 
+f none X11/lib/xscreensaver/bin/xscreensaver-getimage-video	0555 root bin
+f none X11/lib/xscreensaver/bin/xscreensaver-text 		0555 root bin
 
-!search $HOME/share/man/man1
-1 s none openwin/man=./share/man
-1 d none openwin/share 0755 root bin
-1 d none openwin/share/man 0755 root bin
-d none openwin/share/man/man1 0755 root bin
-f none openwin/share/man/man1/xscreensaver-command.1 0444 root bin
-f none openwin/share/man/man1/xscreensaver-demo.1 0444 root bin 
-f none openwin/share/man/man1/xscreensaver-getimage-file.1 0444 root bin
-f none openwin/share/man/man1/xscreensaver-getimage-video.1 0444 root bin 
-f none openwin/share/man/man1/xscreensaver-getimage.1 0444 root bin
-f none openwin/share/man/man1/xscreensaver.1 0444 root bin
+!search $HOME/X11/share/man/man1
+s none X11/man=share/man
+d none X11/share 					0755 root bin
+d none X11/share/man 					0755 root bin
+d none X11/share/man/man1 				0755 root bin
+f none X11/share/man/man1/xscreensaver-command.1	0444 root bin
+f none X11/share/man/man1/xscreensaver-demo.1 		0444 root bin 
+f none X11/share/man/man1/xscreensaver-getimage-file.1	0444 root bin
+f none X11/share/man/man1/xscreensaver-getimage-video.1 0444 root bin 
+f none X11/share/man/man1/xscreensaver-getimage.1 	0444 root bin
+f none X11/share/man/man1/xscreensaver.1 		0444 root bin
 
-!search      $HOME/lib/X11/app-defaults
+!search      $HOME/X11/lib/X11/app-defaults
+d none X11/lib/X11 				0755 root bin
+d none X11/lib/X11/app-defaults 		0755 root bin
+f none X11/lib/X11/app-defaults/XScreenSaver 	0444 root bin
+
 d none openwin/lib/app-defaults 0755 root bin
-f none openwin/lib/app-defaults/XScreenSaver 0444 root bin
+s none openwin/lib/app-defaults/XScreenSaver=../../../X11/lib/X11/app-defaults/XScreenSaver
 
-!search      $HOME/lib/xscreensaver/config/applications
+!search      $HOME/share/applications
 d none share 0755 root sys
 d none share/applications 0755 root other 
-f none share/applications/screensaver-properties.desktop 0444 root bin
+f none share/applications/screensaver-properties.desktop=../usr/share/applications/gnome-screensaver-properties.desktop 0444 root bin
 
 d none share/gnome 0755 root other
 d none share/gnome/control-center-2.0 0755 root other
-!search      $HOME/share/control-center-2.0/capplets
+!search      $HOME/X11/share/control-center-2.0/capplets
 d none share/gnome/control-center-2.0/capplets 0755 root other
 s none share/gnome/control-center-2.0/capplets/screensaver-properties.desktop=../../../applications/screensaver-properties.desktop
 
-!search      $HOME/lib/xscreensaver/config/control-center-2.0/
-d none openwin/lib/xscreensaver/config 0755 root bin
-d none openwin/lib/xscreensaver/config/control-center-2.0 0755 root other
-f none openwin/lib/xscreensaver/config/control-center-2.0/README 0444 root bin
+!search      $HOME/X11/lib/xscreensaver/config/control-center-2.0/
+d none X11/lib/xscreensaver/config 0755 root bin
+d none X11/lib/xscreensaver/config/control-center-2.0 0755 root other
+f none X11/lib/xscreensaver/config/control-center-2.0/README 0444 root bin
 
-!search      $HOME/lib/xscreensaver/config
-f none openwin/lib/xscreensaver/config/screensaver-cmndln.xpm 0444 root bin
-f none openwin/lib/xscreensaver/config/screensaver-colorselector.xpm 0444 root bin
-f none openwin/lib/xscreensaver/config/screensaver-diagnostic.xpm 0444 root bin
-f none openwin/lib/xscreensaver/config/screensaver-locking.xpm 0444 root bin
-f none openwin/lib/xscreensaver/config/screensaver-power.xpm 0444 root bin
-f none openwin/lib/xscreensaver/config/screensaver-snap.xpm 0444 root bin
-f none openwin/lib/xscreensaver/config/xscreensaver-demo.glade2 0444 root bin
-f none openwin/lib/xscreensaver/config/xscreensaver.xpm 0444 root bin
+!search      $HOME/X11/lib/xscreensaver/config
+f none X11/lib/xscreensaver/config/screensaver-cmndln.png 0444 root bin
+f none X11/lib/xscreensaver/config/screensaver-colorselector.png 0444 root bin
+f none X11/lib/xscreensaver/config/screensaver-diagnostic.png 0444 root bin
+f none X11/lib/xscreensaver/config/screensaver-locking.png 0444 root bin
+f none X11/lib/xscreensaver/config/screensaver-power.png 0444 root bin
+f none X11/lib/xscreensaver/config/screensaver-snap.png 0444 root bin
+f none X11/lib/xscreensaver/config/xscreensaver-demo.glade2 0444 root bin
+!search	     $HOME/share/pixmaps
+f none X11/lib/xscreensaver/config/xscreensaver.xpm 0444 root bin