From 83f98c3a0ae3531fa3998fd24ac9850d26187dcb Mon Sep 17 00:00:00 2001 From: Remi Cardona Date: Sat, 23 Dec 2006 21:54:03 +0000 Subject: [PATCH] add backported fix from gvm 2.17 to fix a segfault on startup, fixes bug #154675, thanks to AJ Christensen for the patch Package-Manager: portage-2.1.2_rc4 --- gnome-base/gnome-volume-manager/ChangeLog | 10 +- gnome-base/gnome-volume-manager/Manifest | 19 +- .../digest-gnome-volume-manager-2.15.0-r1 | 3 + ...lume-manager-2.15.0-check_local_user.patch | 246 ++++++++++++++++++ .../gnome-volume-manager-2.15.0-r1.ebuild | 62 +++++ 5 files changed, 335 insertions(+), 5 deletions(-) create mode 100644 gnome-base/gnome-volume-manager/files/digest-gnome-volume-manager-2.15.0-r1 create mode 100644 gnome-base/gnome-volume-manager/files/gnome-volume-manager-2.15.0-check_local_user.patch create mode 100644 gnome-base/gnome-volume-manager/gnome-volume-manager-2.15.0-r1.ebuild diff --git a/gnome-base/gnome-volume-manager/ChangeLog b/gnome-base/gnome-volume-manager/ChangeLog index a99b95b669e5..b83609d2db4a 100644 --- a/gnome-base/gnome-volume-manager/ChangeLog +++ b/gnome-base/gnome-volume-manager/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for gnome-base/gnome-volume-manager # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-volume-manager/ChangeLog,v 1.76 2006/12/21 12:58:43 corsair Exp $ +# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-volume-manager/ChangeLog,v 1.77 2006/12/23 21:54:03 remi Exp $ + +*gnome-volume-manager-2.15.0-r1 (23 Dec 2006) + + 23 Dec 2006; Remi Cardona + +files/gnome-volume-manager-2.15.0-check_local_user.patch, + +gnome-volume-manager-2.15.0-r1.ebuild: + add backported fix from gvm 2.17 to fix a segfault on startup, fixes bug + #154675, thanks to AJ Christensen for the patch 21 Dec 2006; Markus Rothe gnome-volume-manager-2.15.0.ebuild: diff --git a/gnome-base/gnome-volume-manager/Manifest b/gnome-base/gnome-volume-manager/Manifest index f9868d542c1e..384f780f687e 100644 --- a/gnome-base/gnome-volume-manager/Manifest +++ b/gnome-base/gnome-volume-manager/Manifest @@ -14,6 +14,10 @@ AUX gnome-volume-manager-1.5.2-use-pmount.patch 1776 RMD160 ed2c3c5c17d758e4795a MD5 329acc9dbc95a443f2f5d9eeaaafedd2 files/gnome-volume-manager-1.5.2-use-pmount.patch 1776 RMD160 ed2c3c5c17d758e4795ac2b9cb572827675b5afb files/gnome-volume-manager-1.5.2-use-pmount.patch 1776 SHA256 2ba1565c55211bbfc37a41e020c68631cfe1c66673f2dec7e1603eb4d2c283c1 files/gnome-volume-manager-1.5.2-use-pmount.patch 1776 +AUX gnome-volume-manager-2.15.0-check_local_user.patch 6409 RMD160 03fe942c6d4235733a1908655dea173ff111470e SHA1 5018b196d1a82743b79b22a8d5ea29ce29b8bcce SHA256 b1ff00b38d6055c721d96acb054358214763565462aa815a9e5094a4d1e82c19 +MD5 faf7264c1ed1aa25b1bc06db9ac1a66b files/gnome-volume-manager-2.15.0-check_local_user.patch 6409 +RMD160 03fe942c6d4235733a1908655dea173ff111470e files/gnome-volume-manager-2.15.0-check_local_user.patch 6409 +SHA256 b1ff00b38d6055c721d96acb054358214763565462aa815a9e5094a4d1e82c19 files/gnome-volume-manager-2.15.0-check_local_user.patch 6409 DIST gnome-volume-manager-1.3.3-reconnect_dbus.patch.bz2 12026 RMD160 4f8050672b389f4721ef1b86af1667aabf40f526 SHA1 2af30d66131cc5b41e050d65a77073f67e3df275 SHA256 e58c4d8716e5321ef549311cd827be4aa41fbc207318b7ae497b7e416591c71b DIST gnome-volume-manager-1.5.15.tar.bz2 311956 RMD160 b179d3ea4fb6cc8fd1166f5e409d5e2d06c98b7e SHA1 bfc0beeab74cf1091bab99628a6751ee1f1ae196 SHA256 c346d7f47bc3194c96f62376b006e6c111963d3b697f2c92fbd13da34f04f19b DIST gnome-volume-manager-1.5.4.tar.bz2 270062 RMD160 734d5cbc0ea7023e7f003b026440da7b4187316f SHA1 a2b21d3d86852d086c8f609c04f8f5ab2ee58dde SHA256 251723cd1e1ab1f7eec5e74d2f7c89acca7e295501909c714b0262bcb7c695ff @@ -30,14 +34,18 @@ EBUILD gnome-volume-manager-1.5.4.ebuild 1433 RMD160 4a594c64ed7146f93ab3f78bb08 MD5 791741a00a84463add10bb7768b556b8 gnome-volume-manager-1.5.4.ebuild 1433 RMD160 4a594c64ed7146f93ab3f78bb0845e6e218c1259 gnome-volume-manager-1.5.4.ebuild 1433 SHA256 48b731c79a14a5c8ec57a2a3da2f892e59899e252167aff1604427660301667e gnome-volume-manager-1.5.4.ebuild 1433 +EBUILD gnome-volume-manager-2.15.0-r1.ebuild 1666 RMD160 8deb707e6d0d368a7ff0c591ad34529f0054cf93 SHA1 3e25adbfbd35c2bc1f844c1b271cf44bcba99b2d SHA256 71820ca403db549132b55ea41488dae43af058402b32b16ea9e23d0cc5401d0b +MD5 a4124463d9fb7ab02c4b9248da3a3860 gnome-volume-manager-2.15.0-r1.ebuild 1666 +RMD160 8deb707e6d0d368a7ff0c591ad34529f0054cf93 gnome-volume-manager-2.15.0-r1.ebuild 1666 +SHA256 71820ca403db549132b55ea41488dae43af058402b32b16ea9e23d0cc5401d0b gnome-volume-manager-2.15.0-r1.ebuild 1666 EBUILD gnome-volume-manager-2.15.0.ebuild 1580 RMD160 052e314d48f9e9f1a39d3f19407b61da91dcd817 SHA1 be217456934eac8ae5840878a9b0ea224f3cb7ff SHA256 21e6094fcf7268ad0a285a2cfee11a1569bed8bec1dcd3d14b5250616bcb71eb MD5 6498c1e53b7bef840d764d23f2de4747 gnome-volume-manager-2.15.0.ebuild 1580 RMD160 052e314d48f9e9f1a39d3f19407b61da91dcd817 gnome-volume-manager-2.15.0.ebuild 1580 SHA256 21e6094fcf7268ad0a285a2cfee11a1569bed8bec1dcd3d14b5250616bcb71eb gnome-volume-manager-2.15.0.ebuild 1580 -MISC ChangeLog 11179 RMD160 0f894e84332f76608d3e10dd7d920e4fe1eb5a68 SHA1 95702a48496e08c895d25f6e36fcda27e7a54213 SHA256 950a8efcff958b1f8e8b1710a3edc5f08181b9916affe9f215b7a2a84d1314be -MD5 7737514e8c8d39caf750396a805f4fd7 ChangeLog 11179 -RMD160 0f894e84332f76608d3e10dd7d920e4fe1eb5a68 ChangeLog 11179 -SHA256 950a8efcff958b1f8e8b1710a3edc5f08181b9916affe9f215b7a2a84d1314be ChangeLog 11179 +MISC ChangeLog 11498 RMD160 24611c47a838754adaf9a5baad405e813c12a9c6 SHA1 9f50bfe01a4c334c02d211217cefcfef297042a2 SHA256 d1ddde4581746773a8d0ec07b0c5cbdad1c180a18c09a358289ab19ebd77baed +MD5 2c085bc8770c07f18862ccfbc65bb406 ChangeLog 11498 +RMD160 24611c47a838754adaf9a5baad405e813c12a9c6 ChangeLog 11498 +SHA256 d1ddde4581746773a8d0ec07b0c5cbdad1c180a18c09a358289ab19ebd77baed ChangeLog 11498 MISC metadata.xml 158 RMD160 c0e2bae8e91bb6be8922bac5e4f597302e06587e SHA1 38f78e9790bcd4382b4a49aa226aa6dda1d3a3d7 SHA256 3a7dbca0fdc557de69783e0663e2d76ddab129ea8a19b2d0ef6d3e5d1b947ce1 MD5 03ad2e6c4ab41244af1015a8bbb0b39f metadata.xml 158 RMD160 c0e2bae8e91bb6be8922bac5e4f597302e06587e metadata.xml 158 @@ -54,3 +62,6 @@ SHA256 3d245c1e063d1fd3ff920d367175ff6431e212304a51841f5df976d95235d764 files/di MD5 87f7d0f480a84016aac5d54c4a42718e files/digest-gnome-volume-manager-2.15.0 286 RMD160 24a888ece144fc9a9dd4d9cb7ebb9a6762371d05 files/digest-gnome-volume-manager-2.15.0 286 SHA256 63e0ede732d541c479c89f6114d7498f5c81bc8a6d27bd171604233b4de7e8b3 files/digest-gnome-volume-manager-2.15.0 286 +MD5 87f7d0f480a84016aac5d54c4a42718e files/digest-gnome-volume-manager-2.15.0-r1 286 +RMD160 24a888ece144fc9a9dd4d9cb7ebb9a6762371d05 files/digest-gnome-volume-manager-2.15.0-r1 286 +SHA256 63e0ede732d541c479c89f6114d7498f5c81bc8a6d27bd171604233b4de7e8b3 files/digest-gnome-volume-manager-2.15.0-r1 286 diff --git a/gnome-base/gnome-volume-manager/files/digest-gnome-volume-manager-2.15.0-r1 b/gnome-base/gnome-volume-manager/files/digest-gnome-volume-manager-2.15.0-r1 new file mode 100644 index 000000000000..461fb7e2eaad --- /dev/null +++ b/gnome-base/gnome-volume-manager/files/digest-gnome-volume-manager-2.15.0-r1 @@ -0,0 +1,3 @@ +MD5 d723bc2069fd19cf1c31961fbc1cf3c8 gnome-volume-manager-2.15.0.tar.bz2 318479 +RMD160 eca6bb29b3173d8dbee36f4441b68c762732cb26 gnome-volume-manager-2.15.0.tar.bz2 318479 +SHA256 f3d2ce3e2f2a4b757d4688bae7f6b8418d11340618f15d34871a002516ab8e0e gnome-volume-manager-2.15.0.tar.bz2 318479 diff --git a/gnome-base/gnome-volume-manager/files/gnome-volume-manager-2.15.0-check_local_user.patch b/gnome-base/gnome-volume-manager/files/gnome-volume-manager-2.15.0-check_local_user.patch new file mode 100644 index 000000000000..985da86c8c7d --- /dev/null +++ b/gnome-base/gnome-volume-manager/files/gnome-volume-manager-2.15.0-check_local_user.patch @@ -0,0 +1,246 @@ +# patch to g-v-m 2.15.0 to fix the startx session bug which is caused by +# gvm_local_user, where ut_line is returned as ttyN rather than :0. +=================================================================== +RCS file: src/manager.c,v +retrieving revision 1.152 +retrieving revision 1.153 +diff -u -r1.152 -r1.153 +--- src/manager.c 2006/08/07 13:47:31 1.152 ++++ src/manager.c 2006/08/11 18:01:08 1.153 +@@ -1717,6 +1717,58 @@ + } + + ++static gboolean ++gvm_mount_options (GPtrArray *options, guint32 opts, const char *type, const char *where) ++{ ++ char *option, *key, *tmp, *p; ++ GSList *list, *l, *n; ++ GConfClient *gconf; ++ const char *dir; ++ ++ if (!strncmp (where, "/org/freedesktop/Hal/", 21)) { ++ /* flatten the UDI */ ++ dir = p = tmp = g_strdup (where); ++ while (*p != '\0') { ++ if (*p == '/') ++ *p = '_'; ++ p++; ++ } ++ } else { ++ dir = where; ++ tmp = NULL; ++ } ++ ++ key = g_strdup_printf ("/system/storage/%s/%s/mount_options", type, dir); ++ g_free (tmp); ++ ++ gconf = gconf_client_get_default (); ++ list = gconf_client_get_list (gconf, key, GCONF_VALUE_STRING, NULL); ++ g_object_unref (gconf); ++ g_free (key); ++ ++ if (list == NULL) { ++ fprintf (stderr, "no mount options found for %s::%s\n", type, where); ++ return FALSE; ++ } ++ ++ for (l = list; l != NULL; l = n) { ++ option = l->data; ++ n = l->next; ++ ++ g_ptr_array_add (options, option); ++ ++ g_slist_free_1 (l); ++ } ++ ++ if (opts & MOUNT_UID) { ++ option = g_strdup_printf ("uid=%u", getuid ()); ++ g_ptr_array_add (options, option); ++ } ++ ++ return TRUE; ++} ++ ++ + /* + * gvm_device_mount - mount the given device. + * +@@ -1761,10 +1813,13 @@ + + return retval; + } else { +- char *mount_point, *fstype, fmask_opt[12], *charset_opt = NULL; ++ char *mount_point, *fstype, *drive, **moptions, fmask_opt[12], *charset_opt = NULL; + DBusMessage *dmesg, *reply; ++ gboolean freev = FALSE; + GPtrArray *options; ++ guint32 opts = 0; + DBusError error; ++ size_t i, j; + + if (!(dmesg = dbus_message_new_method_call ("org.freedesktop.Hal", udi, + "org.freedesktop.Hal.Device.Volume", +@@ -1773,26 +1828,48 @@ + return FALSE; + } + ++ if ((moptions = libhal_device_get_property_strlist (hal_ctx, udi, "volume.mount.valid_options", NULL))) { ++ for (i = 0; moptions[i]; i++) { ++ for (j = 0; j < G_N_ELEMENTS (mount_options); j++) { ++ if (!strcmp (moptions[i], mount_options[j].name)) ++ opts |= mount_options[j].flag; ++ } ++ } ++ ++ libhal_free_string_array (moptions); ++ } ++ + options = g_ptr_array_new (); ++ ++ /* check volume-specific mount options */ ++ if (gvm_mount_options (options, opts, "volumes", udi)) { ++ freev = TRUE; ++ goto mount; ++ } ++ ++ /* check drive specific mount options */ ++ if ((drive = libhal_device_get_property_string (hal_ctx, udi, "block.storage_device", NULL))) { ++ if (gvm_mount_options (options, opts, "drives", drive)) { ++ libhal_free_string (drive); ++ freev = TRUE; ++ goto mount; ++ } ++ libhal_free_string (drive); ++ } ++ + if ((fstype = libhal_device_get_property_string (hal_ctx, udi, "volume.fstype", NULL))) { +- char **moptions = NULL; + const char *iocharset; +- guint32 opts = 0; + char uid[32]; +- size_t i, j; + mode_t mask; + +- if ((moptions = libhal_device_get_property_strlist (hal_ctx, udi, "volume.mount.valid_options", NULL))) { +- for (i = 0; moptions[i]; i++) { +- for (j = 0; j < G_N_ELEMENTS (mount_options); j++) { +- if (!strcmp (moptions[i], mount_options[j].name)) +- opts |= mount_options[j].flag; +- } +- } +- +- libhal_free_string_array (moptions); ++ /* fall back to using fstype-specific mount options */ ++ if (gvm_mount_options (options, opts, "default_options", fstype)) { ++ libhal_free_string (fstype); ++ freev = TRUE; ++ goto mount; + } + ++ /* take our best guess at what the user would want */ + if (!strcmp (fstype, "vfat")) { + if (opts & MOUNT_NOEXEC) + g_ptr_array_add (options, "noexec"); +@@ -1843,9 +1920,11 @@ + g_ptr_array_add (options, uid); + } + +- g_free (fstype); ++ libhal_free_string (fstype); + } + ++ mount: ++ + mount_point = ""; + fstype = ""; + +@@ -1857,6 +1936,11 @@ + return FALSE; + } + ++ if (freev) { ++ for (i = 0; i < options->len; i++) ++ g_free (options->pdata[i]); ++ } ++ + g_ptr_array_free (options, TRUE); + g_free (charset_opt); + +@@ -3080,31 +3164,64 @@ + } + + ++enum { ++ LOCAL_USER_CHECKED = (1 << 0), ++ LOCAL_USER_FOUND = (1 << 1) ++}; ++ + /* checks that the user is logged-in at a local X session (which does not necessarily infer an *active* session) */ + static gboolean + gvm_local_user (void) + { +- gboolean local = FALSE; ++ static guint32 local = 0; ++ struct dirent *dent; + struct utmp *utmp; + const char *user; +- size_t ulen; ++ char *vtend; ++ size_t n; ++ DIR *dir; ++ int vt; ++ ++ if (local & LOCAL_USER_CHECKED) ++ return (local & LOCAL_USER_FOUND); + + user = g_get_user_name (); +- ulen = strlen (user); ++ n = strlen (user); + +- setutent (); ++ if (!(dir = opendir (GVM_CONSOLE_AUTH_DIR))) ++ goto fallback; + +- while (!local && (utmp = getutent ())) { +- if (utmp->ut_type != USER_PROCESS || strncmp (utmp->ut_user, user, ulen) != 0) +- continue; ++ /* this works for pam_console ($path/user) and pam_foreground ($path/user:vt) - see bug #336932 */ ++ while ((dent = readdir (dir))) { ++ if (!strncmp (user, dent->d_name, n) && dent->d_name[n] == '\0' ++ || (dent->d_name[n] == ':' && ((vt = strtol (dent->d_name + n + 1, &vtend, 10)) >= 0) && *vtend == '\0')) { ++ local = LOCAL_USER_FOUND; ++ break; ++ } ++ } ++ ++ closedir (dir); ++ ++ fallback: ++ ++ if (!(local & LOCAL_USER_FOUND)) { ++ setutent (); ++ ++ while (!(local & LOCAL_USER_FOUND) && (utmp = getutent ())) { ++ if (utmp->ut_type != USER_PROCESS || strncmp (utmp->ut_user, user, n) != 0) ++ continue; ++ ++ /* only accept local X sessions or local tty's (user started X via `startx`) */ ++ local = utmp->ut_line[0] == ':' && utmp->ut_line[1] >= '0' && utmp->ut_line[1] <= '9' ++ || !strncmp (utmp->ut_line, "tty", 3) ? LOCAL_USER_FOUND : 0; ++ } + +- /* only accept local X sessions */ +- local = utmp->ut_line[0] == ':' && utmp->ut_line[1] >= '0' && utmp->ut_line[1] <= '9'; ++ endutent (); + } + +- endutent (); ++ local |= LOCAL_USER_CHECKED; + +- return local; ++ return (local & LOCAL_USER_FOUND); + } + + /* checks that the user is at the local active X session */ + diff --git a/gnome-base/gnome-volume-manager/gnome-volume-manager-2.15.0-r1.ebuild b/gnome-base/gnome-volume-manager/gnome-volume-manager-2.15.0-r1.ebuild new file mode 100644 index 000000000000..958d56b8bb72 --- /dev/null +++ b/gnome-base/gnome-volume-manager/gnome-volume-manager-2.15.0-r1.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/gnome-base/gnome-volume-manager/gnome-volume-manager-2.15.0-r1.ebuild,v 1.1 2006/12/23 21:54:03 remi Exp $ + +inherit gnome2 eutils autotools + +DESCRIPTION="Daemon that enforces volume-related policies" +HOMEPAGE="http://www.gnome.org/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha amd64 ~ia64 ppc ppc64 sparc x86" +IUSE="crypt debug doc" + +RDEPEND="gnome-base/nautilus + >=gnome-base/libgnomeui-2.1.5 + || ( + >=dev-libs/dbus-glib-0.71 + ( =sys-apps/dbus-0.31 ) + ) + >=sys-apps/hal-0.5.6 + >=x11-libs/gtk+-2.6 + >=gnome-base/libglade-2 + >=x11-libs/libnotify-0.3 + >=gnome-base/gconf-2 + >=gnome-base/control-center-2.0 + gnome-base/gnome-mime-data + gnome-base/gnome-mount" + +DEPEND="${RDEPEND} + sys-devel/gettext + >=dev-util/pkgconfig-0.20 + >=dev-util/intltool-0.35" + +DOCS="AUTHORS ChangeLog README HACKING NEWS TODO" + +src_unpack() { + unpack ${A} + cd ${S} + + epatch "${FILESDIR}/${P}-check_local_user.patch" +} + +pkg_setup() { + G2CONF="${G2CONF} \ + $(use_enable crypt) \ + $(use_enable debug) \ + $(use_enable doc)" + + # FIXME: We should be more intelligent about disabling multiuser support + # (like enable it when pam_console is available?). For now, this is a + # slightly nicer solution than applying ${PN}-1.5.9-no-pam_console.patch + G2CONF="${G2CONF} --disable-multiuser" +} + +pkg_postinst() { + gnome2_pkg_postinst + + einfo "To start the gnome-volume-manager daemon you need to configure" + einfo "it through it's preferences capplet. Also the HAL daemon (hald)" + einfo "needs to be running or it will shut down." +} -- 2.26.2