2005-11-15 Brian Cameron <[email protected]>
authorbc99092
Tue, 15 Nov 2005 23:31:20 +0000
changeset 6282 b2dbe64e9060
parent 6281 375d1b6b687b
child 6283 0875a0f97359
2005-11-15 Brian Cameron <[email protected]> * control-center.spec: Now build about-me applet. * patches/control-center-22-about-me.diff: Patch to make about-me build on Solaris. I notice that when you run gnome-about-me from the command line, changing password happens fast, but seems much slower when launching it from the panel (though it still works). This will need to be looked into, but for now it builds. * Solaris/ChangeLog: Updating to include comment that got left out for 11-07 change to gnome-media.
Solaris/ChangeLog
control-center.spec
patches/control-center-22-about-me.diff
--- a/Solaris/ChangeLog	Tue Nov 15 11:12:45 2005 +0000
+++ b/Solaris/ChangeLog	Tue Nov 15 23:31:20 2005 +0000
@@ -39,6 +39,16 @@
 	picked up by the pixbuf loaders - otherwise it seems not to 
 	grok it. Fix pointed out by Henry Jen.
 
+2005-11-07  Brian Cameron  <[email protected]>
+
+	* SUNWgnome-media:  Add /usr/X11/lib to LDFLAGS and 
+	  /usr/X11/include to CFLAGS when building gst-plugins so
+	  xvimagesink plugin builds.  The xvimagesink uses the
+	  Xvideo Xserver extension and is faster than using
+	  the ximagesink.  I understand Xvideo only works when
+	  using the Xorg Xserver, so Xsun users will need to
+	  continue using the ximagesink plugin.
+
 2005-11-04  Damien Carbery <[email protected]>
 
 	* SUNWgnome-screensaver.spec: Remove ACLOCAL_FLAGS setting as bugs 
--- a/control-center.spec	Tue Nov 15 11:12:45 2005 +0000
+++ b/control-center.spec	Tue Nov 15 23:31:20 2005 +0000
@@ -54,6 +54,7 @@
 Patch19:      control-center-19-fix-keyboard-dialog.diff
 Patch20:      control-center-20-mouse-dialog.diff
 Patch21:      control-center-21-disable-gnome-screensaver.diff
+Patch22:      control-center-22-about-me.diff
 URL:          http://www.gnome.org
 BuildRoot:    %{_tmppath}/%{name}-%{version}-build
 Docdir:       %{_defaultdocdir}/control-center2
@@ -128,6 +129,7 @@
 %patch19 -p1
 %patch20 -p1
 %patch21 -p1
+%patch22 -p1
 
 %build
 %ifos linux
@@ -156,7 +158,8 @@
     --prefix=%{_prefix} \
     --libexecdir=%{_libexecdir} \
     --sysconfdir=%{_sysconfdir} \
-    --disable-scrollkeeper
+    --disable-scrollkeeper \
+    --enable-aboutme
 make -j $CPUS
 
 %install
@@ -243,6 +246,10 @@
 
 
 %changelog
+* Tue Nov 15 2005 - [email protected]
+- Patch code so about-me applet can build, and turn on --enable-aboutme
+  at configure time.
+
 * Wed Nov 09 2005 - [email protected]
 - Disable gnome-screensaver temporarily. Fixes #6346174.
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/control-center-22-about-me.diff	Tue Nov 15 23:31:20 2005 +0000
@@ -0,0 +1,387 @@
+--- control-center-2.12.1/configure.in-orig	2005-11-15 12:31:27.619054000 -0600
++++ control-center-2.12.1/configure.in	2005-11-15 13:07:25.813492000 -0600
+@@ -265,6 +265,52 @@ dnl ====================================
+ dnl About-me
+ dnl ==============================================
+ 
++AC_CHECK_HEADERS([pty.h stropts.h])
++AC_CHECK_FUNCS(forkpty,, AC_CHECK_LIB(util,forkpty, [AC_DEFINE(HAVE_FORKPTY)] [ABOUTME_LIBS="$ABOUTME_LIBS -lutil"]))
++AC_SUBST(ABOUTME_LIBS)
++
++dnl -----  pseudo terminal handling
++dnl -----  os        pty master      streams modules
++dnl -----  aix       /dev/ptc        - (loads ldterm by default)
++dnl -----  hpux      /dev/ptmx       ldterm ptem
++dnl -----  solaris   /dev/ptmx       ldterm ptem ttcompat
++
++dnl -----  aix loads module ldterm by default and wants no ptem
++dnl -----  ptmx takes precedence
++AC_MSG_CHECKING([for master pty])
++if test -r /dev/ptc ; then
++  if test -r /dev/ptmx ; then
++    AC_DEFINE_UNQUOTED(MASTERPTYDEV, "/dev/ptmx", [hp and sun style pty master])
++    AC_MSG_RESULT(ptmx)
++  else
++    AC_DEFINE_UNQUOTED(MASTERPTYDEV, "/dev/ptc", [aix style pty master])
++    AC_MSG_RESULT(ptc)
++  fi
++elif test -r /dev/ptmx ; then
++  AC_DEFINE_UNQUOTED(MASTERPTYDEV, "/dev/ptmx", [hp and sun style pty master])
++  AC_MSG_RESULT(ptmx)
++else
++  AC_DEFINE_UNQUOTED(MASTERPTYDEV, "/dev/null", [lets see what happens])
++fi
++
++dnl -----  this will succeed on solaris and fail on hpux
++AC_MSG_CHECKING(if your system supports the ttcompat streams module)
++AC_RUN_IFELSE([AC_LANG_SOURCE([[
++#include <stdio.h>
++#include <fcntl.h>
++#include <stropts.h>
++main()
++{ int line;
++
++  if ( (line = open("/dev/ptmx", O_RDWR)) >= 0 &&
++       ioctl(line, I_PUSH, "ttcompat") == 0 )
++    exit(0);
++  exit(1);
++}
++]])],[AC_DEFINE(HAVE_TTCOMPAT, 1,
++             "Define if your system supports the ttcompat streams module")
++   AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(assuming no)])
++
+ AC_MSG_CHECKING([whether to enable About Me])
+ AC_ARG_ENABLE([aboutme],
+    AC_HELP_STRING([--enable-aboutme],
+--- control-center-2.12.1/capplets/about-me/Makefile.am-orig	2005-11-15 13:05:42.828462000 -0600
++++ control-center-2.12.1/capplets/about-me/Makefile.am	2005-11-15 13:07:41.987636000 -0600
+@@ -5,7 +5,7 @@ pixmap_DATA = 				\
+ 	gnome-about-me-bulb-on.png	\
+ 	gnome-about-me-bulb-off.png
+ 
+-gnome_about_me_LDADD = $(GNOMECC_CAPPLETS_LIBS) $(LIBEBOOK_LIBS) -lutil
++gnome_about_me_LDADD = $(GNOMECC_CAPPLETS_LIBS) $(LIBEBOOK_LIBS) $(ABOUTME_LIBS)
+ gnome_about_me_LDFLAGS = -export-dynamic
+ gnome_about_me_SOURCES = 		\
+ 	eel-alert-dialog.c		\
+--- control-center-2.12.1/capplets/about-me/gnome-about-me.c-orig	2005-11-15 12:35:28.431596000 -0600
++++ control-center-2.12.1/capplets/about-me/gnome-about-me.c	2005-11-15 15:11:21.922016000 -0600
+@@ -262,8 +262,13 @@ get_user_login (void)
+ 	struct passwd pwd, *err;
+ 
+ 	int i;
+-	i = getpwuid_r(getuid(), &pwd, buf, sizeof(buf), &err);
+-	return ((i == 0) && (err == &pwd)) ? g_strdup(pwd.pw_name) : NULL;
++#if sun
++	i = getpwuid_r (getuid (), &pwd, buf, sizeof (buf));
++	return (i != 0) ? g_strdup (pwd.pw_name) : NULL;
++#else
++	i = getpwuid_r (getuid (), &pwd, buf, sizeof (buf), &err);
++	return ((i == 0) && (err == &pwd)) ? g_strdup (pwd.pw_name) : NULL;
++#endif
+ }
+ 
+ /*
+--- control-center-2.12.1/capplets/about-me/gnome-about-me-password.c-orig	2005-11-15 12:27:57.950320000 -0600
++++ control-center-2.12.1/capplets/about-me/gnome-about-me-password.c	2005-11-15 15:20:02.921922000 -0600
+@@ -25,6 +25,7 @@
+ #  include <config.h>
+ #endif
+ 
++#include <stropts.h>
+ #include <gnome.h>
+ #include <pwd.h>
+ #include <stdlib.h>
+@@ -35,11 +36,26 @@
+ #include <sys/wait.h>
+ #include <sys/poll.h>
+ #include <termios.h>
++#if HAVE_PTY_H
+ #include <pty.h>
++#endif
++#if HAVE_STROPTS_H
++#include <stropts.h>
++#endif
++
++
++#if sun
++#include <sys/types.h>
++#include <signal.h>
++#endif
+ 
+ #include "capplet-util.h"
+ #include "eel-alert-dialog.h"
+ 
++#ifndef HAVE_FORKPTY
++pid_t forkpty(int *, char *, struct termios *, struct winsize *);
++#endif
++
+ typedef struct {
+ 	GladeXML  *xml;
+ 
+@@ -293,8 +309,9 @@ update_password (PasswordDialog *pdialog
+ 	write_to_backend (pdialog, old_password);
+ 
+ 	/* New password */
+-	s = read_from_backend (pdialog, "assword: ", "failure", NULL);
+-	if (g_strrstr (s, "failure") != NULL) {
++	s = read_from_backend (pdialog, "assword: ", "failure", "wrong", NULL);
++	if (g_strrstr (s, "failure") != NULL ||
++	    g_strrstr (s, "wrong") != NULL) {
+ 		g_free (s);
+ 		return -1;
+ 	}
+@@ -308,7 +325,7 @@ update_password (PasswordDialog *pdialog
+ 		
+ 	write_to_backend (pdialog, retyped_password);
+ 	
+-	s = read_from_backend (pdialog, "successfully", "short", "panlindrome", "simple", "similar", "wrapped", "recovered",  "unchanged", NULL);
++	s = read_from_backend (pdialog, "successfully", "short", "panlindrome", "simple", "similar", "wrapped", "recovered", "unchanged", "match", "numeric or special", NULL);
+ 	if (g_strrstr (s, "recovered") != NULL) {
+ 		retcode = -2;
+ 	} else if (g_strrstr (s, "short") != NULL) {
+@@ -323,17 +340,242 @@ update_password (PasswordDialog *pdialog
+ 	} else if ((g_strrstr (s, "similar") != NULL) || (g_strrstr (s, "wrapped") != NULL)) {
+ 		*msg = g_strdup (_("Old and new passwords are too similar"));
+ 		retcode = -3;
+-	} else if (g_strrstr (s, "unchanged") != NULL) {
++	} else if (g_strrstr (s, "numeric or special") != NULL) {
++		*msg = g_strdup (_("Must contain numeric or special character(s)"));
++		retcode = -3;
++	} else if ((g_strrstr (s, "unchanged") != NULL) ||
++		   (g_strrstr (s, "match") != NULL)) {
+ 		kill (pdialog->backend_pid, SIGKILL);
+ 		*msg = g_strdup (_("Old and new password are the same"));
+ 		retcode = -3;
+-	}
++        }
+ 
+ 	g_free (s);
+ 	
+ 	return retcode;
+ }
+ 
++#ifndef HAVE_FORKPTY
++/* 
++//  Emulation of the BSD function forkpty.
++//  Copied from rootsh (http://sourceforge.net/projects/rootsh) also
++//  under GPL license.
++*/
++#ifndef MASTERPTYDEV
++#  error you need to specify a master pty device
++#endif
++pid_t forkpty(int *amaster,  char  *name,  struct  termios *termp, struct winsize *winp) {
++  /*
++  //  amaster		A pointer to the master pty's file descriptor which
++  //			will be set here.
++  //  
++  //  name		If name is NULL, the name of the slave pty will be
++  //			returned in name.
++  //  
++  //  termp		If termp is not NULL, the ter minal parameters
++  //			of the slave will be set to the values in termp.
++  //  
++  //  winsize		If winp is not NULL, the window size of the  slave
++  //			will be set to the values in winp.
++  //  
++  //  currentterm	A structure filled with the characteristics of
++  //			the current controlling terminal.
++  //  
++  //  currentwinsize	A structure filled with size characteristics of
++  //			the current controlling terminal.
++  //  
++  //  pid		The process id of the forked child process.
++  //  
++  //  master		The file descriptor of the master pty.
++  //  
++  //  slave		The file descriptor of the slave pty.
++  //  
++  //  slavename		The file name of the slave pty.
++  //  
++  */
++  struct termios currentterm;
++  struct winsize currentwinsize;
++  struct winsize *finalwinsize;
++  pid_t pid;
++  int master, slave;
++  char *slavename;
++
++  /* 
++  //  Get current settings if termp was not provided by the caller.
++  */
++  if (termp == NULL) {
++    tcgetattr(STDIN_FILENO, &currentterm);
++    termp = &currentterm;
++  }
++
++  /* 
++  //  Same for window size.
++  */
++  if (winp == NULL) {
++    ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&currentwinsize);
++    finalwinsize = &currentwinsize;
++  } else {
++    finalwinsize = winp;
++  }
++
++  /*
++  //  Get a master pseudo-tty.
++  */
++  if ((master = open(MASTERPTYDEV, O_RDWR)) < 0) {
++    perror(MASTERPTYDEV);
++    return(-1);
++  }
++
++  /*
++  //  Set the permissions on the slave pty.
++  */
++  if (grantpt(master) < 0) {
++    perror("grantpt");
++    close(master);
++    return(-1);
++  }
++
++  /*
++  //  Unlock the slave pty.
++  */
++  if (unlockpt(master) < 0) {
++    perror("unlockpt");
++    close(master);
++    return(-1);
++  }
++
++  /*
++  //  Start a child process.
++  */
++  if ((pid = fork()) < 0) {
++    perror("fork in forkpty");
++    close(master);
++    return(-1);
++  }
++
++  /*
++  //  The child process will open the slave, which will become
++  //  its controlling terminal.
++  */
++  if (pid == 0) {
++    /*
++    //  Get rid of our current controlling terminal.
++    */
++    setsid();
++
++    /*
++    //  Get the name of the slave pseudo tty.
++    */
++    if ((slavename = ptsname(master)) == NULL) {
++      perror("ptsname");
++      close(master);
++      return(-1);
++    }
++
++    /* 
++    //  Open the slave pseudo tty.
++    */
++    if ((slave = open(slavename, O_RDWR)) < 0) {
++      perror(slavename);
++      close(master);
++      return(-1);
++    }
++
++#ifndef AIX_COMPAT
++    /*
++    //  Push the pseudo-terminal emulation module.
++    */
++    if (ioctl(slave, I_PUSH, "ptem") < 0) {
++      perror("ioctl: ptem");
++      close(master);
++      close(slave);
++      return(-1);
++    }
++
++    /*
++    //  Push the terminal line discipline module.
++    */
++    if (ioctl(slave, I_PUSH, "ldterm") < 0) {
++      perror("ioctl: ldterm");
++      close(master);
++      close(slave);
++      return(-1);
++    }
++
++#ifdef HAVE_TTCOMPAT
++    /*
++    //  Push the compatibility for older ioctl calls module (solaris).
++    */
++    if (ioctl(slave, I_PUSH, "ttcompat") < 0) {
++      perror("ioctl: ttcompat");
++      close(master);
++      close(slave);
++      return(-1);
++    }
++#endif
++#endif
++
++    /*
++    //  Copy the caller's terminal modes to the slave pty.
++    */
++    if (tcsetattr(slave, TCSANOW, termp) < 0) {
++      perror("tcsetattr: slave pty");
++      close(master);
++      close(slave);
++      return(-1);
++    }
++
++    /*
++    //  Set the slave pty window size to the caller's size.
++    */
++    if (ioctl(slave, TIOCSWINSZ, finalwinsize) < 0) {
++      perror("ioctl: slave winsz");
++      close(master);
++      close(slave);
++      return(-1);
++    }
++
++    /*
++    //  Close the logfile and the master pty.
++    //  No need for these in the slave process.
++    */
++    close(master);
++
++    /*
++    //  Set the slave to be our standard input, output and error output.
++    //  Then get rid of the original file descriptor.
++    */
++    dup2(slave, 0);
++    dup2(slave, 1);
++    dup2(slave, 2);
++    close(slave);
++    /*
++    //  If the caller wants it, give him back the slave pty's name.
++    */
++    if (name != NULL) strcpy(name, slavename);
++    return(0); 
++  } else {
++    /*
++    //  Return the slave pty device name if caller wishes so.
++    */
++    if (name != NULL) {          
++      if ((slavename = ptsname(master)) == NULL) {
++        perror("ptsname");
++        close(master);
++        return(-1);
++      }
++      strcpy(name, slavename);
++    }
++    /*
++    //  Return the file descriptor for communicating with the process
++    //  to the caller.
++    */
++    *amaster = master; 
++    return(pid);      
++  }
++}
++#endif
++
+ static gint
+ spawn_passwd (PasswordDialog *pdialog)
+ {