--- a/ChangeLog Fri Nov 21 07:04:34 2008 +0000
+++ b/ChangeLog Fri Nov 21 21:16:14 2008 +0000
@@ -1,3 +1,12 @@
+2008-11-21 Brian Cameron <[email protected]>
+
+ * SUNWgnome-display-mgr.spec, ext-sources/svc-gdm, ext-sources/gdm.xml,
+ base-specs/gdm.xml: Add /lib/svc/method/svc-gdm SMF method file so
+ that the "stop" method does not cause errors on shutdown/restart.
+ * patches/gdm-06-dbus.spec: Remove this patch. It is no longer needed
+ for programs like GOK to startup from GDM since D-Bus autostart is
+ working better now. Renumber other GDM patches.
+
2008-11-21 Wang Xin <[email protected]>
* patches/libgnome-02-indiana-default.diff: Use default Monospace font.
@@ -18,21 +27,22 @@
2008-11-20 Jerry Yu <[email protected]>
- * SUNWhamster.spec:Add %build_l10n section and correct attributes for some files.
+ * SUNWhamster.spec:Add %build_l10n section and correct attributes for
+ some files.
2008-11-20 Jeff Cai <[email protected]>
* base-specs/seahorse.spec:
* patches/seahorse-09-key-name.diff:
- Add patch to refresh key names when they change
- Fix #561641
+ Add patch to refresh key names when they change
+ Fix #561641
2008-11-20 Jerry Tan <[email protected]>
- * base-specs/gthumb.spec:
- * patches/gthumb-04-zh-ja-locale.diff
- add patch to fix bug 6718848
-
+ * base-specs/gthumb.spec:
+ * patches/gthumb-04-zh-ja-locale.diff
+ add patch to fix bug 6718848
+
2008-11-20 Takao Fujiwara <[email protected]>
* SUNWprint-monitor.spec: Updated to fix pkgmap.
@@ -47,8 +57,7 @@
2008-11-20 Wang Xin <[email protected]>
- Reomve SUNWgnome-sys-suspend. Please refer to LSARC/2008/669.
-
+ Remove SUNWgnome-sys-suspend. Please refer to LSARC/2008/669.
* SUNWgnome-sys-suspend.spec:
* copyright/SUNWgnome-sys-suspend.copyright:
* manpages/Makefile:
@@ -65,8 +74,8 @@
2008-11-20 Dave Lin <[email protected]>
* SUNWdia.spec: Comment out line %{_datadir}/gnome/help/dia/[a-d]*
- since no [a-d]* locale available at this point.(Should uncomment
- it if they're there).
+ since no [a-d]* locale available at this point.(Should uncomment
+ it if they're there).
* SUNWdia.spec: Correct the share/man, share/omf attributes issue.
2008-11-19 Darren Kenny <[email protected]>
@@ -87,15 +96,14 @@
* SUNWpython-cssutils.spec:
* base-specs/python-cssutils.spec:
* copyright/SUNWpython-cssutils.copyright:
- move python-cssutils to spec-files-other.
+ move python-cssutils to spec-files-other.
2008-11-19 Jeff Cai <[email protected]>
* base-specs/seahorse.spec:
* patches/seahorse-08-progress-pos.diff:
- Add patch to solve the progress window covers the pasword
- window.
- Fix #561476
+ Add patch to solve the progress window covers the pasword window.
+ Fix #561476
2008-11-19 Jeff Cai <[email protected]>
@@ -105,8 +113,8 @@
* base-specs/enchant.spec:
* patches/enchant-02-build-request-dict.diff:
- Add patch -02-build-request-dic to solve the build issue
- with SunStudio 12
+ Add patch -02-build-request-dic to solve the build issue with
+ SunStudio 12
2008-11-18 Takao Fujiwara <[email protected]>
@@ -124,7 +132,7 @@
* copyright/SUNWlibpigment.copyright
* copyright/SUNWlibpigment-python.copyright
* patches/pigment-01-disable-glx.diff
- move pigment into spec-file-other
+ move pigment into spec-file-other
2008-11-17 Brian Cameron <[email protected]>
@@ -138,8 +146,8 @@
2008-11-17 Alfred Peng <[email protected]>
* patches/firefox3-11-getting-started-bookmark.diff:
- Update the Firefox default bookmark for OpenSolaris 2008.11 to
- include planet OpenSolaris.
+ Update the Firefox default bookmark for OpenSolaris 2008.11 to
+ include planet OpenSolaris.
2008-11-17 Brian Lu <[email protected]>
@@ -151,7 +159,7 @@
2008-11-17 Erwann Chenede - <[email protected]>
- * patches/nautilus-13-zfs-snapshot.diff : fix for 5013
+ * patches/nautilus-13-zfs-snapshot.diff : fix for 5013
2008-11-17 Chris Wang <[email protected]>
@@ -162,7 +170,6 @@
2008-11-17 Wang Xin <[email protected]>
Fix python application installation problem.
-
* base-specs/Pyrex.spec:
* base-specs/dogtail.spec:
* base-specs/elementtree.spec:
@@ -236,8 +243,10 @@
2008-11-14 Jerry Yu <[email protected]>
* SUNWpython-cssutils.spec: (new) Added for python-cssutils project
- * base-specs/python-cssutils.spec:(new) Added for python-cssutils project
- * copyright/SUNWpython-cssutils.copyright: (new) python-cssutils copyright file
+ * base-specs/python-cssutils.spec:(new) Added for python-cssutils
+ project
+ * copyright/SUNWpython-cssutils.copyright: (new) python-cssutils
+ copyright file
2008-11-14 Jerry Yu <[email protected]>
@@ -252,7 +261,7 @@
2008-11-14 Jim Li <[email protected]>
* patches/system-tools-backends-08-users.diff:
- filter out no existed shell from shell lists
+ filter out no existed shell from shell lists
2008-11-14 Jeff Cai <[email protected]>
@@ -265,8 +274,7 @@
* po-sun/gnome-keyring-manager/po-sun/de.po:
* po-sun/gnome-keyring-manager/po-sun/es.po:
* po-sun/gnome-keyring-manager/po-sun/fr.po:
- * po-sun/gnome-keyring-manager/po-sun/gnome-keyring-manager-sun.pot
- :
+ * po-sun/gnome-keyring-manager/po-sun/gnome-keyring-manager-sun.pot:
* po-sun/gnome-keyring-manager/po-sun/hu.po:
* po-sun/gnome-keyring-manager/po-sun/it.po:
* po-sun/gnome-keyring-manager/po-sun/ja.po:
@@ -278,7 +286,8 @@
* po-sun/gnome-keyring-manager/po-sun/zh_CN.po:
* po-sun/gnome-keyring-manager/po-sun/zh_HK.po:
* po-sun/gnome-keyring-manager/po-sun/zh_TW.po:
- Remove gnome-keyring-manager since Seahorse replaces its functionality.
+ Remove gnome-keyring-manager since Seahorse replaces its
+ functionality.
2008-11-14 Halton Huo <[email protected]>
@@ -347,13 +356,12 @@
* base-specs/libtasn1.spec:Bump to 1.6
* manpages/Makefile:Remove libtasn1-config.1
* manpages/man1/libtasn1-config.1:Removed
- The community has removed libtasn1-config.1 so we don't ship it
- and its manpage.
+ The community has removed libtasn1-config.1 so we don't ship it
+ and its manpage.
2008-11-13 Wang Xin <[email protected]>
Fixes #6767860.
-
* base-specs/gnome-settings-daemon.spec: Remove 02-logout-shortcut and
add 02-sleep-action.
* patches/gnome-settings-daemon-02-logout-shortcut.diff: Removed.
@@ -374,7 +382,6 @@
2008-11-13 Wang Xin <[email protected]>
Ship libical-0.4.1.
-
* SUNWlibical.spec: New spec.
* copyright/SUNWlibical.copyright: New copyright.
* patches/libical-01-build.diff: New patch to fix build.
@@ -393,12 +400,11 @@
2008-11-12 Jeff Cai <[email protected]>
* manpages/man3/libenchant.3:
- Change a typo in man page.
+ Change a typo in man page.
2008-11-12 Jerry Tan <[email protected]>
Add pigment spec
-
* SUNWlibpigment.spec:
* SUNWlibpigment-python.spec:
* copyright/SUNWlibpigment.copyright
@@ -429,8 +435,9 @@
2008-11-10 Matt Keenan <[email protected]>
- * base-specs/gnome-panel.spec : Fix Bugster bugster:6769654 bugzilla:560200
- clock applet crashing when adding a custom location via preferences.
+ * base-specs/gnome-panel.spec : Fix Bugster bugster:6769654
+ bugzilla:560200 clock applet crashing when adding a custom location
+ via preferences.
* patches/gnome-panel-18-clock-applet-location-crash.diff : new patch
2008-11-10 Darren Kenny <[email protected]>
@@ -444,10 +451,9 @@
* base-specs/enchant.spec: Removed the unused patch
* patches/enchant-02-aspell-conversion.diff: Removed
- Remove this patch because it looks like not many users
- need to convert the local aspell dictionary to myspell
- format. We don't like to maintain a large Solaris
- only patch.
+ Remove this patch because it looks like not many users need to
+ convert the local aspell dictionary to myspell format. We don't like
+ to maintain a large Solaris only patch.
2008-11-10 Chris Wang <[email protected]>
@@ -613,8 +619,8 @@
* base-specs/seahorse.spec:
* patches/seahorse-06-import-ssh.diff:
- Add patch to make importing SSH work.
- Fix #556670, need a better patch.
+ Add patch to make importing SSH work.
+ Fix #556670, need a better patch.
2008-11-04 Halton Huo <[email protected]>
@@ -670,7 +676,7 @@
* base-specs/libsoup.spec:
* base-specs/libtasn1.spec:
* base-specs/seahorse.spec:
- Change the license tag info.
+ Change the license tag info.
2008-10-30 Matt Keenan <[email protected]>
@@ -796,7 +802,7 @@
2008-10-28 Alfred Peng <[email protected]>
* patches/firefox3-11-getting-started-bookmark.diff:
- Update the Firefox default bookmark for OpenSolaris 2008.11.
+ Update the Firefox default bookmark for OpenSolaris 2008.11.
2008-10-28 Takao Fujiwara <[email protected]>
@@ -806,7 +812,7 @@
2008-10-28 Li Yuan <[email protected]>
* base-specs/mousetweaks.spec:
- Bump to 2.24.1.
+ Bump to 2.24.1.
2008-10-28 Laszlo (Laca) Peter <[email protected]>
@@ -815,7 +821,7 @@
2008-10-27 Li Yuan <[email protected]>
* base-specs/atk.spec:
- Correct the url of source tarball.
+ Correct the url of source tarball.
2008-10-27 Brian Cameron <[email protected]>
@@ -1360,7 +1366,8 @@
* SUNWdbus.spec: put 0005.dbus into /etc/X11/xinit/xinitrc.d
* SUNWgnome-display-mgr.spec: specified /etc/X11/xinit/xinitrc.d
* SUNWgnome-dtlogin-integration.spec: bump to 0.37 and clean up.
- also put 0005.dbus into /usr/dt/config/Xsession.d when build --with-dt.
+ also put 0005.dbus into /usr/dt/config/Xsession.d when build
+ --with-dt.
* ext-sources/0005.dbus:
2008-10-02 Matt Keenan <[email protected]>
--- a/SUNWgnome-display-mgr.spec Fri Nov 21 07:04:34 2008 +0000
+++ b/SUNWgnome-display-mgr.spec Fri Nov 21 21:16:14 2008 +0000
@@ -18,6 +18,7 @@
Version: %{default_pkg_version}
Source: %{name}-manpages-0.1.tar.gz
Source1: gdm.xml
+Source2: svc-gdm
SUNW_BaseDir: %{_basedir}
SUNW_Copyright: %{name}.copyright
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -101,6 +102,8 @@
install -d $RPM_BUILD_ROOT/var/svc/manifest/application/graphical-login
install --mode=0444 %SOURCE1 $RPM_BUILD_ROOT/var/svc/manifest/application/graphical-login
+install -d $RPM_BUILD_ROOT/lib/svc/method
+cp %SOURCE2 $RPM_BUILD_ROOT/lib/svc/method/
rmdir $RPM_BUILD_ROOT/etc/X11/dm
rmdir $RPM_BUILD_ROOT/etc/pam.d
@@ -195,7 +198,26 @@
%{_datadir}/gdm
%dir %attr (0755, root, other) %{_datadir}/gnome
%{_datadir}/gnome/help/gdm/C
-%attr (-, root, other) %{_datadir}/icons
+%dir %attr (0755, root, other) %{_datadir}/icons
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/16x16
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/16x16/apps
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/22x22
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/22x22/apps
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/24x24
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/24x24/apps
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/32x32
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/32x32/apps
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/48x48
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/48x48/apps
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/scalable
+%dir %attr (0755, root, other) %{_datadir}/icons/hicolor/scalable/apps
+%attr (-, root, other) %{_datadir}/icons/hicolor/16x16/apps/*
+%attr (-, root, other) %{_datadir}/icons/hicolor/22x22/apps/*
+%attr (-, root, other) %{_datadir}/icons/hicolor/24x24/apps/*
+%attr (-, root, other) %{_datadir}/icons/hicolor/32x32/apps/*
+%attr (-, root, other) %{_datadir}/icons/hicolor/48x48/apps/*
+%attr (-, root, other) %{_datadir}/icons/hicolor/scalable/apps/*
%{_datadir}/omf/gdm/*-C.omf
%dir %attr (0755, root, other) %{_datadir}/pixmaps
%{_datadir}/pixmaps/*
@@ -228,6 +250,10 @@
%{_sysconfdir}/X11/gdm/modules
%dir %{_sysconfdir}/X11/xinit
%dir %{_sysconfdir}/X11/xinit/xinitrc.d
+%dir %attr (0755, root, bin) /lib
+%dir %attr (0755, root, bin) /lib/svc
+%dir %attr (0755, root, bin) /lib/svc/method
+%attr (0555, root, bin) /lib/svc/method/svc-gdm
# don't use %_localstatedir here, because this is an absolute path
# defined by another package, so it has to be /var/svc even if this
# package's %_localstatedir is redefined
@@ -249,6 +275,9 @@
%endif
%changelog
+* Wed Nov 21 2008 - [email protected]
+- Add /lib/svc/method/svc-gdm SMF method file so that the "stop" method
+ doesn't cause errors on shutdown/restart. Fix packaging permissions.
* Thu Oct 02 2008 - [email protected]
- Added directory /etc/X11/xinit/xinitrc.d as part of the fix to 6755007.
* Sun Sep 14 2008 - [email protected]
--- a/base-specs/gdm.spec Fri Nov 21 07:04:34 2008 +0000
+++ b/base-specs/gdm.spec Fri Nov 21 21:16:14 2008 +0000
@@ -40,16 +40,14 @@
#owner:stephen date:2008-07-23 type:feature bugster:6622109
Patch5: gdm-05-multilabel-sessions.diff
#owner:ww36193 date:2008-09-16 type:bug bugster:6752919 bugzilla:553305
-# Assistive technologies cannot access login GUI without launching GDM with dbus-launch.
-Patch6: gdm-06-dbus.diff
#owner:yippi date:2008-09-16 type:bug bugster:6760749
-Patch7: gdm-07-xsession.diff
+Patch6: gdm-06-xsession.diff
#owner:yippi date:2008-09-29 type:bug bugster:6753089 state:upstream
-Patch8: gdm-08-fbconsole.diff
+Patch7: gdm-07-fbconsole.diff
#owner:yippi date:2008-10-23 type:bug bugster:6753089 doo:3316 state:upstream
-Patch9: gdm-09-fbconsole-fix.diff
+Patch8: gdm-08-fbconsole-fix.diff
#owner:yippi date:2008-11-12 type:branding doo:4719 state:upstream
-Patch10: gdm-10-no-recreate-sockets.diff
+Patch9: gdm-09-no-recreate-sockets.diff
URL: www.gnome.org
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Docdir: %{_defaultdocdir}
@@ -126,11 +124,10 @@
%patch3 -p1
%patch4 -p1
%patch5 -p1
-%patch6 -p0
-%patch7 -p1
+%patch6 -p1
+%patch7 -p0
%patch8 -p0
-%patch9 -p0
-%patch10 -p1
+%patch9 -p1
%build
%ifos linux
@@ -198,7 +195,10 @@
%endif
%if %option_without_dt
-rm $RPM_BUILD_ROOT%{_datadir}/xsessions/CDE.desktop
+# We really want "rm -f" since the gdm module does not install the CDE.desktop
+# file unless /usr/dt/bin/Xsession exists on the system. So the rm command
+# is only useful when building without dt support when CDE is installed.
+rm -f $RPM_BUILD_ROOT%{_datadir}/xsessions/CDE.desktop
%endif
# Clean up unpackaged files
@@ -257,6 +257,9 @@
%config /etc/security/*
%changelog
+* Fri Nov 21 2008 - [email protected]
+- Remove patch gdm-06-dbus.spec, it is no longer needed since D-Bus autolaunch
+ is working better.
* Wed Nov 12 2008 - [email protected]
- Add gdm-10-no-recreate-sockets.diff so that GDM avoids recreating the
sockets directories in /tmp. This fixes Trusted Extensions. Refer to
--- a/ext-sources/gdm.xml Fri Nov 21 07:04:34 2008 +0000
+++ b/ext-sources/gdm.xml Fri Nov 21 21:16:14 2008 +0000
@@ -64,13 +64,13 @@
<exec_method
type='method'
name='start'
- exec='/usr/sbin/gdm'
+ exec='lib/svc/method/svc-gdm start'
timeout_seconds='60' />
<exec_method
type='method'
name='stop'
- exec='/usr/sbin/gdm-stop'
+ exec='lib/svc/method/svc-gdm stop'
timeout_seconds='60' />
<!-- Authorization -->
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ext-sources/svc-gdm Fri Nov 21 21:16:14 2008 +0000
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#pragma ident "@(#)svc-gdm.src 1.1 06/02/06 SMI"
+#
+# For modifying parameters passed to dtlogin, do not edit
+# this script. Instead use svccfg(1m) to modify the SMF
+# repository. For example:
+#
+# # svccfg
+# svc:> select application/graphical-login/gdm
+# svc:/application/graphical-login/gdm> setprop gdm/debug = "true"
+# svc:/application/graphical-login/gdm> exit
+
+. /lib/svc/share/smf_include.sh
+
+case "$1" in
+'start')
+
+ FMRI=svc:application/graphical-login/gdm
+
+ debug=`svcprop -p gdm/debug $FMRI`
+
+ arg=`eval "echo \`svcprop -p gdm/args $FMRI\`"`
+
+ if [ $debug = "true" ]; then
+ /usr/sbin/gdm $arg --debug
+ else
+ /usr/sbin/gdm $arg
+ fi
+
+ rc=$?
+ if [ $rc != 0 ]; then
+ echo "$0: gdm failed with $rc"
+ exit 1
+ fi
+ ;;
+
+'stop')
+ /usr/sbin/gdm-stop
+ ;;
+
+*)
+ echo "Usage: $0 { start | stop }"
+ exit 1
+ ;;
+esac
+
+exit $SMF_EXIT_OK
--- a/patches/gdm-06-dbus.diff Fri Nov 21 07:04:34 2008 +0000
+++ b/patches/gdm-06-dbus.diff Fri Nov 21 21:16:14 2008 +0000
@@ -1,18 +1,263 @@
-Index: daemon/gdm.in
+Index: daemon/gdm.c
===================================================================
---- daemon/gdm.in (revision 6546)
-+++ daemon/gdm.in (working copy)
-@@ -30,5 +30,13 @@
- fi
- fi
+--- daemon/gdm.c (revision 6598)
++++ daemon/gdm.c (working copy)
+@@ -147,6 +147,9 @@
+ static gboolean gdm_restart_mode = FALSE;
+ static gboolean monte_carlo_sqrt2 = FALSE;
+
++/* D-Bus PID value */
++static GPid dbus_pid;
++
+ /*
+ * Lookup display number if the display number is
+ * exists then clear the remove flag and return TRUE
+@@ -294,6 +297,7 @@
+ gboolean first;
+ GSList *displays;
+ struct sigaction sig;
++ int res;
+
+ /* Remove all signal handlers, since we are freeing structures used by the handlers */
+ sig.sa_handler = SIG_DFL;
+@@ -310,6 +314,23 @@
+ sigaction (SIGXFSZ, &sig, NULL);
+ #endif
+
++ if (dbus_pid > 0) {
++ gdm_debug ("Stopping D-Bus daemon");
++
++ errno = 0;
++ res = kill (dbus_pid, SIGTERM);
++
++ if (res < 0) {
++ if (errno == ESRCH) {
++ gdm_debug ("Child process %d was already dead.",
++ (int)dbus_pid);
++ } else {
++ gdm_debug ("Couldn't kill child process %d: %s",
++ dbus_pid, g_strerror (errno));
++ }
++ }
++ }
++
+ displays = gdm_daemon_config_get_display_list ();
+
+ gdm_debug ("gdm_final_cleanup");
+@@ -1559,6 +1580,207 @@
+ g_free (file);
+ }
-+# GConf now needs D-Bus, so to launch AT programs it is necessary for D-Bus to
-+# be started with gdm. We start D-Bus as the "gdm" user. We do not do not
-+# need root privilege for this since the GUI and AT programs all run as the
-+# "gdm" user.
-+#
-+eval `/usr/bin/su - gdm -c /usr/bin/dbus-launch --sh-syntax --exit-with-session`
-+export DBUS_SESSION_BUS_ADDRESS
-+export DBUS_SESSION_BUS_PID
- exec @sbindir@/gdm-binary "$@"
++typedef struct {
++ const char *user_name;
++ const char *group_name;
++} SpawnChildData;
++
++static void
++spawn_child_setup (SpawnChildData *data)
++{
++ struct passwd *pwent;
++ struct group *grent;
++
++ if (data->user_name == NULL) {
++ return;
++ }
++
++ pwent = getpwnam (data->user_name);
++ if (pwent == NULL) {
++ g_warning (_("User %s doesn't exist"),
++ data->user_name);
++ _exit (1);
++ }
++
++ grent = getgrnam (data->group_name);
++ if (grent == NULL) {
++ g_warning (_("Group %s doesn't exist"),
++ data->group_name);
++ _exit (1);
++ }
++
++ g_debug ("GdmWelcomeSession: Changing (uid:gid) for child process to (%d:%d)",
++ pwent->pw_uid,
++ grent->gr_gid);
++
++ if (pwent->pw_uid != 0) {
++ if (setgid (grent->gr_gid) < 0) {
++ g_warning (_("Couldn't set groupid to %d"),
++ grent->gr_gid);
++ _exit (1);
++ }
++
++ if (initgroups (pwent->pw_name, pwent->pw_gid) < 0) {
++ g_warning (_("initgroups () failed for %s"),
++ pwent->pw_name);
++ _exit (1);
++ }
++
++ if (setuid (pwent->pw_uid) < 0) {
++ g_warning (_("Couldn't set userid to %d"),
++ (int)pwent->pw_uid);
++ _exit (1);
++ }
++ } else {
++ gid_t groups[1] = { 0 };
++
++ if (setgid (0) < 0) {
++ g_warning (_("Couldn't set groupid to 0"));
++ /* Don't error out, it's not fatal, if it fails we'll
++ * just still be */
++ }
++
++ /* this will get rid of any suplementary groups etc... */
++ setgroups (1, groups);
++ }
++
++ if (setsid () < 0) {
++ g_debug ("GdmWelcomeSession: could not set pid '%u' as leader of new session and process group - %s",
++ (guint) getpid (), g_strerror (errno));
++ _exit (2);
++ }
++}
++
++static gboolean
++parse_value_as_integer (const char *value,
++ int *intval)
++{
++ char *end_of_valid_int;
++ glong long_value;
++ gint int_value;
++
++ errno = 0;
++ long_value = strtol (value, &end_of_valid_int, 10);
++
++ if (*value == '\0' || *end_of_valid_int != '\0') {
++ return FALSE;
++ }
++
++ int_value = long_value;
++ if (int_value != long_value || errno == ERANGE) {
++ return FALSE;
++ }
++
++ *intval = int_value;
++
++ return TRUE;
++}
++
++static gboolean
++parse_dbus_launch_output (const char *output,
++ char **addressp,
++ GPid *pidp)
++{
++ GRegex *re;
++ GMatchInfo *match_info;
++ gboolean ret;
++ gboolean res;
++ GError *error;
++
++ ret = FALSE;
++
++ error = NULL;
++ re = g_regex_new ("DBUS_SESSION_BUS_ADDRESS=(.+)\nDBUS_SESSION_BUS_PID=([0-9]+)", 0, 0, &error);
++ if (re == NULL) {
++ g_critical ("%s", error->message);
++ }
++
++ g_regex_match (re, output, 0, &match_info);
++
++ res = g_match_info_matches (match_info);
++ if (! res) {
++ g_warning ("Unable to parse output: %s", output);
++ goto out;
++ }
++
++ if (addressp != NULL) {
++ *addressp = g_strdup (g_match_info_fetch (match_info, 1));
++ }
++
++ if (pidp != NULL) {
++ int pid;
++ gboolean result;
++ result = parse_value_as_integer (g_match_info_fetch (match_info, 2), &pid);
++ if (result) {
++ *pidp = pid;
++ } else {
++ *pidp = 0;
++ }
++ }
++
++ ret = TRUE;
++
++ out:
++ g_match_info_free (match_info);
++ g_regex_unref (re);
++
++ return ret;
++}
++
++static void
++gdm_start_dbus (void)
++{
++ gboolean res;
++ SpawnChildData data;
++ GError *error;
++ char *std_out;
++ char *std_err;
++ int exit_status;
++ char **argv;
++ char *dbus_bus_address;
++
++ if (! g_shell_parse_argv ("/usr/bin/dbus-launch --exit-with-session", NULL, &argv, &error)) {
++ gdm_debug ("Problem starting D-Bus");
++ }
++
++ data.user_name = "gdm";
++ data.group_name = "gdm";
++
++ res = g_spawn_sync (NULL,
++ argv,
++ NULL,
++ G_SPAWN_SEARCH_PATH,
++ (GSpawnChildSetupFunc)spawn_child_setup,
++ &data,
++ &std_out,
++ &std_err,
++ &exit_status,
++ &error);
++
++ if (! res) {
++ gdm_debug ("Unable to launch D-Bus daemon: %s", error->message);
++ goto out;
++ }
++
++ res = parse_dbus_launch_output (std_out,
++ &dbus_bus_address,
++ &dbus_pid);
++
++ if (! res) {
++ gdm_debug ("Unable to launch D-Bus daemon");
++ goto out;
++ }
++
++ gdm_debug ("Started D-Bus daemon on pid %d", dbus_pid);
++ gdm_debug ("Setting DBUS_SESSION_BUS_ADDRESS to %s", dbus_bus_address);
++
++ g_setenv ("DBUS_SESSION_BUS_ADDRESS", dbus_bus_address, TRUE);
++
++out:
++
++return;
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -1826,6 +2048,8 @@
+ gdm_xdmcp_run ();
+ }
++ gdm_start_dbus ();
++
+ /* We always exit via exit (), and sadly we need to g_main_quit ()
+ * at times not knowing if it's this main or a recursive one we're
+ * quitting.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gdm-06-xsession.diff Fri Nov 21 21:16:14 2008 +0000
@@ -0,0 +1,16 @@
+--- gdm-2.20.8/config/Xsession.solaris.orig 2008-10-21 01:42:22.499854000 +0900
++++ gdm-2.20.8/config/Xsession.solaris 2008-10-21 01:45:53.663493000 +0900
+@@ -20,7 +20,12 @@ export G_BROKEN_FILENAMES
+ # G_FILENAME_ENCODING=@locale
+ # export G_FILENAME_ENCODING
+
+-export VTE_CJK_WIDTH=1
++case $LANG in
++ja*) VTE_CJK_WIDTH=1; export VTE_CJK_WIDTH;;
++ko*) VTE_CJK_WIDTH=1; export VTE_CJK_WIDTH;;
++zh*) VTE_CJK_WIDTH=1; export VTE_CJK_WIDTH;;
++*) ;;
++esac
+
+ if [ "x$LANG" = "xzh" ] ; then
+ export LANGUAGE=zh:zh_CN.EUC
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gdm-07-fbconsole.diff Fri Nov 21 21:16:14 2008 +0000
@@ -0,0 +1,178 @@
+Index: daemon/display.h
+===================================================================
+--- daemon/display.h (revision 6551)
++++ daemon/display.h (working copy)
+@@ -126,6 +126,7 @@
+ pid_t slavepid;
+ pid_t greetpid;
+ pid_t sesspid;
++ pid_t fbconsolepid;
+ int last_sess_status; /* status returned by last session */
+
+ /* Notification connection */
+Index: daemon/server.c
+===================================================================
+--- daemon/server.c (revision 6551)
++++ daemon/server.c (working copy)
+@@ -137,7 +137,6 @@
+ static void
+ gdm_exec_fbconsole (GdmDisplay *disp)
+ {
+- pid_t pid;
+ char *argv[6];
+
+ argv[0] = FBCONSOLE;
+@@ -148,113 +147,19 @@
+
+ gdm_debug ("Forking fbconsole");
+
+- pid = fork ();
+- if (pid == 0) {
++ d->fbconsolepid = fork ();
++ if (d->fbconsolepid == 0) {
+ gdm_close_all_descriptors (0 /* from */, -1 /* except */, -1 /* except2 */)
+ ;
+ VE_IGNORE_EINTR (execv (argv[0], argv));
+ }
+- if (pid == -1) {
++ if (d->fbconsolepid == -1) {
+ gdm_error (_("Can not start fallback console"));
+ }
+ }
+ #endif
+
+ /**
+- * gdm_server_reinit:
+- * @disp: Pointer to a GdmDisplay structure
+- *
+- * Reinit the display, basically sends a HUP signal
+- * but only if the display exists
+- */
+-
+-gboolean
+-gdm_server_reinit (GdmDisplay *disp)
+-{
+- if (disp == NULL)
+- return FALSE;
+-
+- if (disp->servpid <= 0) {
+- /* Kill our connection if one existed, likely to result
+- * in some bizzaro error right now */
+- if (disp->dsp != NULL) {
+- XCloseDisplay (disp->dsp);
+- disp->dsp = NULL;
+- }
+- return FALSE;
+- }
+-
+- gdm_debug ("gdm_server_reinit: Server for %s is about to be reinitialized!", disp->name);
+-
+- if ( ! setup_server_wait (disp))
+- return FALSE;
+-
+- d->servstat = SERVER_PENDING;
+-
+- if (disp->dsp != NULL) {
+- /* static because of the Setjmp */
+- static int (*old_xerror_handler)(Display *, XErrorEvent *) = NULL;
+- static int (*old_xioerror_handler)(Display *) = NULL;
+-
+- old_xerror_handler = NULL;
+- old_xioerror_handler = NULL;
+-
+- /* Do note the interaction of this Setjmp and the signal
+- handlers and the Setjmp in slave.c */
+-
+- /* Long live Setjmp, DIE DIE DIE XSetIOErrorHandler */
+-
+- if (Setjmp (reinitjmp) == 0) {
+- /* come here and we'll whack the server and wait to get
+- an xio error */
+- old_xerror_handler = XSetErrorHandler (ignore_xerror_handler);
+- old_xioerror_handler = XSetIOErrorHandler (jumpback_xioerror_handler);
+-
+- /* Now whack the server with a SIGHUP */
+- gdm_sigchld_block_push ();
+- if (disp->servpid > 1)
+- kill (disp->servpid, SIGHUP);
+- else
+- d->servstat = SERVER_DEAD;
+- gdm_sigchld_block_pop ();
+-
+- /* the server is dead, weird */
+- if (disp->dsp != NULL) {
+- XCloseDisplay (disp->dsp);
+- disp->dsp = NULL;
+- }
+- }
+- /* no more display */
+- disp->dsp = NULL;
+- XSetErrorHandler (old_xerror_handler);
+- XSetIOErrorHandler (old_xioerror_handler);
+- } else {
+- /* Now whack the server with a SIGHUP */
+- gdm_sigchld_block_push ();
+- if (disp->servpid > 1)
+- kill (disp->servpid, SIGHUP);
+- else
+- d->servstat = SERVER_DEAD;
+- gdm_sigchld_block_pop ();
+- }
+-
+- /* Wait for the SIGUSR1 */
+- do_server_wait (d);
+-
+- if (d->servstat == SERVER_RUNNING) {
+-#ifdef HAVE_FBCONSOLE
+- gdm_exec_fbconsole (d);
+-#endif
+- return TRUE;
+- } else {
+- /* if something really REALLY screwed up, then whack the
+- lockfiles for safety */
+- gdm_server_whack_lockfile (d);
+- return FALSE;
+- }
+-}
+-
+-/**
+ * gdm_server_stop:
+ * @disp: Pointer to a GdmDisplay structure
+ *
+@@ -336,6 +241,13 @@
+
+ gdm_server_wipe_cookies (disp);
+
++#ifdef HAVE_FBCONSOLE
++ /* Kill fbconsole if it is running */
++ if (d->fbconsolepid > 0)
++ kill (d->fbconsolepid, SIGTERM);
++ d->fbconsolepid = 0;
++#endif
++
+ gdm_slave_whack_temp_auth_file ();
+ }
+
+@@ -732,6 +644,10 @@
+
+ d = disp;
+
++#ifdef HAVE_FBCONSOLE
++ d->fbconsolepid = 0;
++#endif
++
+ /* if an X server exists, wipe it */
+ gdm_server_stop (d);
+
+Index: daemon/server.h
+===================================================================
+--- daemon/server.h (revision 6551)
++++ daemon/server.h (working copy)
+@@ -56,7 +56,6 @@
+ int min_flexi_disp,
+ int flexi_retries);
+ void gdm_server_stop (GdmDisplay *d);
+-gboolean gdm_server_reinit (GdmDisplay *d);
+ void gdm_server_whack_clients (Display *dsp);
+ void gdm_server_checklog (GdmDisplay *disp);
+
--- a/patches/gdm-07-xsession.diff Fri Nov 21 07:04:34 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
---- gdm-2.20.8/config/Xsession.solaris.orig 2008-10-21 01:42:22.499854000 +0900
-+++ gdm-2.20.8/config/Xsession.solaris 2008-10-21 01:45:53.663493000 +0900
-@@ -20,7 +20,12 @@ export G_BROKEN_FILENAMES
- # G_FILENAME_ENCODING=@locale
- # export G_FILENAME_ENCODING
-
--export VTE_CJK_WIDTH=1
-+case $LANG in
-+ja*) VTE_CJK_WIDTH=1; export VTE_CJK_WIDTH;;
-+ko*) VTE_CJK_WIDTH=1; export VTE_CJK_WIDTH;;
-+zh*) VTE_CJK_WIDTH=1; export VTE_CJK_WIDTH;;
-+*) ;;
-+esac
-
- if [ "x$LANG" = "xzh" ] ; then
- export LANGUAGE=zh:zh_CN.EUC
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gdm-08-fbconsole-fix.diff Fri Nov 21 21:16:14 2008 +0000
@@ -0,0 +1,15 @@
+Index: daemon/server.c
+===================================================================
+--- daemon/server.c (revision 6580)
++++ daemon/server.c (working copy)
+@@ -152,6 +152,10 @@
+ gdm_close_all_descriptors (0 /* from */, -1 /* except */, -1 /* except2 */)
+ ;
+ VE_IGNORE_EINTR (execv (argv[0], argv));
++
++ gdm_error ("Can not start fallback console: %s",
++ strerror (errno));
++ _exit (0);
+ }
+ if (d->fbconsolepid == -1) {
+ gdm_error (_("Can not start fallback console"));
--- a/patches/gdm-08-fbconsole.diff Fri Nov 21 07:04:34 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-Index: daemon/display.h
-===================================================================
---- daemon/display.h (revision 6551)
-+++ daemon/display.h (working copy)
-@@ -126,6 +126,7 @@
- pid_t slavepid;
- pid_t greetpid;
- pid_t sesspid;
-+ pid_t fbconsolepid;
- int last_sess_status; /* status returned by last session */
-
- /* Notification connection */
-Index: daemon/server.c
-===================================================================
---- daemon/server.c (revision 6551)
-+++ daemon/server.c (working copy)
-@@ -137,7 +137,6 @@
- static void
- gdm_exec_fbconsole (GdmDisplay *disp)
- {
-- pid_t pid;
- char *argv[6];
-
- argv[0] = FBCONSOLE;
-@@ -148,113 +147,19 @@
-
- gdm_debug ("Forking fbconsole");
-
-- pid = fork ();
-- if (pid == 0) {
-+ d->fbconsolepid = fork ();
-+ if (d->fbconsolepid == 0) {
- gdm_close_all_descriptors (0 /* from */, -1 /* except */, -1 /* except2 */)
- ;
- VE_IGNORE_EINTR (execv (argv[0], argv));
- }
-- if (pid == -1) {
-+ if (d->fbconsolepid == -1) {
- gdm_error (_("Can not start fallback console"));
- }
- }
- #endif
-
- /**
-- * gdm_server_reinit:
-- * @disp: Pointer to a GdmDisplay structure
-- *
-- * Reinit the display, basically sends a HUP signal
-- * but only if the display exists
-- */
--
--gboolean
--gdm_server_reinit (GdmDisplay *disp)
--{
-- if (disp == NULL)
-- return FALSE;
--
-- if (disp->servpid <= 0) {
-- /* Kill our connection if one existed, likely to result
-- * in some bizzaro error right now */
-- if (disp->dsp != NULL) {
-- XCloseDisplay (disp->dsp);
-- disp->dsp = NULL;
-- }
-- return FALSE;
-- }
--
-- gdm_debug ("gdm_server_reinit: Server for %s is about to be reinitialized!", disp->name);
--
-- if ( ! setup_server_wait (disp))
-- return FALSE;
--
-- d->servstat = SERVER_PENDING;
--
-- if (disp->dsp != NULL) {
-- /* static because of the Setjmp */
-- static int (*old_xerror_handler)(Display *, XErrorEvent *) = NULL;
-- static int (*old_xioerror_handler)(Display *) = NULL;
--
-- old_xerror_handler = NULL;
-- old_xioerror_handler = NULL;
--
-- /* Do note the interaction of this Setjmp and the signal
-- handlers and the Setjmp in slave.c */
--
-- /* Long live Setjmp, DIE DIE DIE XSetIOErrorHandler */
--
-- if (Setjmp (reinitjmp) == 0) {
-- /* come here and we'll whack the server and wait to get
-- an xio error */
-- old_xerror_handler = XSetErrorHandler (ignore_xerror_handler);
-- old_xioerror_handler = XSetIOErrorHandler (jumpback_xioerror_handler);
--
-- /* Now whack the server with a SIGHUP */
-- gdm_sigchld_block_push ();
-- if (disp->servpid > 1)
-- kill (disp->servpid, SIGHUP);
-- else
-- d->servstat = SERVER_DEAD;
-- gdm_sigchld_block_pop ();
--
-- /* the server is dead, weird */
-- if (disp->dsp != NULL) {
-- XCloseDisplay (disp->dsp);
-- disp->dsp = NULL;
-- }
-- }
-- /* no more display */
-- disp->dsp = NULL;
-- XSetErrorHandler (old_xerror_handler);
-- XSetIOErrorHandler (old_xioerror_handler);
-- } else {
-- /* Now whack the server with a SIGHUP */
-- gdm_sigchld_block_push ();
-- if (disp->servpid > 1)
-- kill (disp->servpid, SIGHUP);
-- else
-- d->servstat = SERVER_DEAD;
-- gdm_sigchld_block_pop ();
-- }
--
-- /* Wait for the SIGUSR1 */
-- do_server_wait (d);
--
-- if (d->servstat == SERVER_RUNNING) {
--#ifdef HAVE_FBCONSOLE
-- gdm_exec_fbconsole (d);
--#endif
-- return TRUE;
-- } else {
-- /* if something really REALLY screwed up, then whack the
-- lockfiles for safety */
-- gdm_server_whack_lockfile (d);
-- return FALSE;
-- }
--}
--
--/**
- * gdm_server_stop:
- * @disp: Pointer to a GdmDisplay structure
- *
-@@ -336,6 +241,13 @@
-
- gdm_server_wipe_cookies (disp);
-
-+#ifdef HAVE_FBCONSOLE
-+ /* Kill fbconsole if it is running */
-+ if (d->fbconsolepid > 0)
-+ kill (d->fbconsolepid, SIGTERM);
-+ d->fbconsolepid = 0;
-+#endif
-+
- gdm_slave_whack_temp_auth_file ();
- }
-
-@@ -732,6 +644,10 @@
-
- d = disp;
-
-+#ifdef HAVE_FBCONSOLE
-+ d->fbconsolepid = 0;
-+#endif
-+
- /* if an X server exists, wipe it */
- gdm_server_stop (d);
-
-Index: daemon/server.h
-===================================================================
---- daemon/server.h (revision 6551)
-+++ daemon/server.h (working copy)
-@@ -56,7 +56,6 @@
- int min_flexi_disp,
- int flexi_retries);
- void gdm_server_stop (GdmDisplay *d);
--gboolean gdm_server_reinit (GdmDisplay *d);
- void gdm_server_whack_clients (Display *dsp);
- void gdm_server_checklog (GdmDisplay *disp);
-
--- a/patches/gdm-09-fbconsole-fix.diff Fri Nov 21 07:04:34 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-Index: daemon/server.c
-===================================================================
---- daemon/server.c (revision 6580)
-+++ daemon/server.c (working copy)
-@@ -152,6 +152,10 @@
- gdm_close_all_descriptors (0 /* from */, -1 /* except */, -1 /* except2 */)
- ;
- VE_IGNORE_EINTR (execv (argv[0], argv));
-+
-+ gdm_error ("Can not start fallback console: %s",
-+ strerror (errno));
-+ _exit (0);
- }
- if (d->fbconsolepid == -1) {
- gdm_error (_("Can not start fallback console"));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gdm-09-no-recreate-sockets.diff Fri Nov 21 21:16:14 2008 +0000
@@ -0,0 +1,26 @@
+--- gdm-2.20.8/daemon/misc.c-orig 2008-11-12 16:53:54.907548000 -0600
++++ gdm-2.20.8/daemon/misc.c 2008-11-12 16:53:58.406566000 -0600
+@@ -874,7 +874,11 @@ ensure_tmp_socket_dir (const char *dir)
+ * Done on startup and when running display_manage
+ * This can do some sanity ensuring, one of the things it does now is make
+ * sure /tmp/.ICE-unix and /tmp/.X11-unix exist and have the correct
+- * permissions
++ * permissions.
++ *
++ * Do nothing on Solaris since this logic breaks Trusted Extensions, and
++ * the Solaris X permissions model (socket & pipe directories only writable
++ * by gid-root), and it ignores the Solaris /tmp/.X11-pipe directory.
+ */
+ void
+ gdm_ensure_sanity (void)
+@@ -882,6 +886,10 @@ gdm_ensure_sanity (void)
+ uid_t old_euid;
+ gid_t old_egid;
+
++#ifdef __sun
++ return;
++#endif
++
+ old_euid = geteuid ();
+ old_egid = getegid ();
+
--- a/patches/gdm-10-no-recreate-sockets.diff Fri Nov 21 07:04:34 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
---- gdm-2.20.8/daemon/misc.c-orig 2008-11-12 16:53:54.907548000 -0600
-+++ gdm-2.20.8/daemon/misc.c 2008-11-12 16:53:58.406566000 -0600
-@@ -874,7 +874,11 @@ ensure_tmp_socket_dir (const char *dir)
- * Done on startup and when running display_manage
- * This can do some sanity ensuring, one of the things it does now is make
- * sure /tmp/.ICE-unix and /tmp/.X11-unix exist and have the correct
-- * permissions
-+ * permissions.
-+ *
-+ * Do nothing on Solaris since this logic breaks Trusted Extensions, and
-+ * the Solaris X permissions model (socket & pipe directories only writable
-+ * by gid-root), and it ignores the Solaris /tmp/.X11-pipe directory.
- */
- void
- gdm_ensure_sanity (void)
-@@ -882,6 +886,10 @@ gdm_ensure_sanity (void)
- uid_t old_euid;
- gid_t old_egid;
-
-+#ifdef __sun
-+ return;
-+#endif
-+
- old_euid = geteuid ();
- old_egid = getegid ();
-