$OpenBSD: patch-capplets_about-me_gnome-about-me_c,v 1.3 2009/01/31 12:23:29 jasper Exp $

Spawn a gnome-terminal to allow users to change their passwords, as we cannot
fork passwd(1) to the background.
From Open Solaris' control-center-01-passwd-in-terminal.diff

--- capplets/about-me/gnome-about-me.c.orig	Wed Sep 24 18:36:23 2008
+++ capplets/about-me/gnome-about-me.c	Sat Jan 31 13:10:58 2009
@@ -23,6 +23,7 @@
 #  include <config.h>
 #endif
 
+#include <sys/types.h>
 #include <glib/gstdio.h>
 #include <gnome.h>
 #include <pwd.h>
@@ -330,12 +331,17 @@ static char *
 get_user_login (void)
 {
 	char buf[LINE_MAX * 4];
-	struct passwd pwd, *err;
+	struct passwd *pwd;
 
 	int i;
 #if defined(__sun) && !defined(_POSIX_PTHREAD_SEMANTICS)
 	i = getpwuid_r (getuid (), &pwd, buf, sizeof (buf));
 	return (i != 0) ? g_strdup (pwd.pw_name) : NULL;
+#elif __OpenBSD__
+	pwd = getpwuid(getuid());
+	if (pwd == NULL)
+		return NULL;
+	return g_strdup (pwd->pw_name);
 #else
 	i = getpwuid_r (getuid (), &pwd, buf, sizeof (buf), &err);
 	return ((i == 0) && (err == &pwd)) ? g_strdup (pwd.pw_name) : NULL;
@@ -853,7 +859,25 @@ about_me_passwd_clicked_cb (GtkWidget *button, GnomeAb
 	GladeXML *dialog;
 
 	dialog = me->dialog;
+#if defined(__OpenBSD__)
+	/* Use gnome-terminal embedded passwd due to inability to fork passwd in
+	 * the background.
+	 */
+	{
+	    GError  *error = NULL;
+	    gchar   *command = NULL;
+
+	    command = g_strdup_printf("gnome-terminal --window --title '%s' --hide-menubar -e /usr/bin/passwd",
+				    _("Change password") );
+
+	    if ( command != NULL ) {
+		g_spawn_command_line_async( command, &error);
+		g_free(command);
+	    }
+	}
+#else
 	gnome_about_me_password (GTK_WINDOW (WID ("about-me-dialog")));
+#endif
 }
 
 static gint
