--- gnome-mount-0.5.orig/debian/control +++ gnome-mount-0.5/debian/control @@ -0,0 +1,24 @@ +Source: gnome-mount +Section: gnome +Priority: optional +Maintainer: Michael Biebl +Build-Depends: cdbs, debhelper (>= 5.0.0), libgnome-keyring-dev (>= 0.4), libgnomeui-dev (>= 2.1.5), libdbus-1-dev (>= 0.60), libdbus-glib-1-dev (>= 0.60), libhal-storage-dev (>= 0.5.8.1), libgtk2.0-dev (>= 2.8.0), libglade2-dev, libxml-parser-perl, libnautilus-extension-dev (>= 2.5.0), libnotify-dev (>= 0.3.0), libeel2-dev +Standards-Version: 3.7.2 + +Package: gnome-mount +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, hal, eject +Suggests: cryptsetup +Description: wrapper for (un)mounting and ejecting storage devices + The gnome-mount package contains programs for mounting, unmounting and + ejecting storage devices. The goal for gnome-mount is to get the appropriate + Gnome software (such as gnome-volume-manager and Gnome-VFS) to use his method + instead of invoking mount/umount/eject or direct HAL invoking methods. + . + All the gnome-mount programs utilize the methods on HAL and as such run + unprivileged. The rationale for gnome-mount is to have a centralized place (in + GConf) where settings (e.g. mount options and mount locations) are maintained. + . + A nautilus extension allows to easily change the mount options which can be + user, drive or volume specific. + --- gnome-mount-0.5.orig/debian/links +++ gnome-mount-0.5/debian/links @@ -0,0 +1,2 @@ +/usr/share/man/man1/gnome-mount.1.gz usr/share/man/man1/gnome-umount.1.gz +/usr/share/man/man1/gnome-mount.1.gz usr/share/man/man1/gnome-eject.1.gz --- gnome-mount-0.5.orig/debian/rules +++ gnome-mount-0.5/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/gnome.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk +include /usr/share/cdbs/1/rules/utils.mk + +DEB_CONFIGURE_EXTRA_FLAGS := --enable-nautilus-extension +DEB_DH_MAKESHLIBS_ARGS := -Xlibgnome-mount +DEB_INSTALL_DOCS_ALL := AUTHORS NEWS README + +LDFLAGS := -Wl,--as-needed + +binary-install/gnome-mount:: + rm -f debian/gnome-mount/usr/lib/nautilus/extensions-1.0/libgnome-mount.la + rm -f debian/gnome-mount/usr/lib/nautilus/extensions-1.0/libgnome-mount.a --- gnome-mount-0.5.orig/debian/watch +++ gnome-mount-0.5/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://people.freedesktop.org/~david/dist/gnome-mount-(.*)\.tar\.gz --- gnome-mount-0.5.orig/debian/changelog +++ gnome-mount-0.5/debian/changelog @@ -0,0 +1,59 @@ +gnome-mount (0.5-2ubuntu3) feisty; urgency=low + + * Add debian/patches/02_sudo_session_dbus.patch: + - When being run through sudo, temporarily drop real user id to the sudo + user, so that notify_init() connects to the actual user's session dbus + instead of root's nonexisting one. + * Add debian/patches/03_root_mounting.patch: + - If we get a PermissionDeniedByPolicy on mounting, unmounting, or + ejecting, and are in the 'admin' group, call ourselves through gksu, so + that administrators can handle fixed partitions just like removable ones. + - See https://wiki.ubuntu.com/MountAllLocalFilesystems for details. + + -- Martin Pitt Tue, 12 Dec 2006 09:05:18 +0100 + +gnome-mount (0.5-2ubuntu2) feisty; urgency=low + + * Drop cryptsetup from Recommends: to Suggests. + + -- Martin Pitt Thu, 16 Nov 2006 16:15:42 -0800 + +gnome-mount (0.5-2ubuntu1) feisty; urgency=low + + * First Ubuntu version. + * debian/control: Add missing libeel2-dev build dependency. (Debian bug + #395478) + * debian/rules: Use -Wl,--as-needed to get rid of unnecessary library + dependencies. + * Add debian/patches/ubuntu-default-mount-options.patch: + - Use 'utf8' option for VFAT, ISO-9660, and NTFS. + - Mount VFAT with umask 077 to stay compatible to previous Ubuntu releases + and keep the possibility of using VFAT USB sticks for ssh/gpg keys. + + -- Martin Pitt Wed, 1 Nov 2006 11:29:11 +0100 + +gnome-mount (0.5-2) unstable; urgency=low + + * debian/control + - Add Depends on hal and eject. + - Add a Recommends on cryptsetup for luks encrypted partitions. + - Update maintainer email address to biebl@debian.org. + * debian/patches/01-missing_includes.patch + - Added, fixes implicit pointer conversions. Closes: #393553 + + -- Michael Biebl Wed, 18 Oct 2006 18:37:45 +0200 + +gnome-mount (0.5-1) unstable; urgency=low + + * New upstream release. + * Added build dependency on libnotify-dev (>= 0.3.0). + * Tightened build dependency on libhal-storage-dev (>= 0.5.8.1). + + -- Michael Biebl Wed, 20 Sep 2006 00:59:21 +0200 + +gnome-mount (0.4-1) unstable; urgency=low + + * Initial release. Closes: #387208 + + -- Michael Biebl Wed, 13 Sep 2006 01:43:19 +0200 + --- gnome-mount-0.5.orig/debian/compat +++ gnome-mount-0.5/debian/compat @@ -0,0 +1 @@ +5 --- gnome-mount-0.5.orig/debian/patches/01-missing_includes.patch +++ gnome-mount-0.5/debian/patches/01-missing_includes.patch @@ -0,0 +1,24 @@ +diff -urN gnome-mount-0.5.orig/src/gnome-mount-properties-view.c gnome-mount-0.5/src/gnome-mount-properties-view.c +--- gnome-mount-0.5.orig/src/gnome-mount-properties-view.c 2006-08-13 22:17:22.000000000 -0600 ++++ gnome-mount-0.5/src/gnome-mount-properties-view.c 2006-10-16 14:15:31.000000000 -0600 +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #ifdef __FreeBSD__ + #include +diff -urN gnome-mount-0.5.orig/src/gnome-mount-properties.c gnome-mount-0.5/src/gnome-mount-properties.c +--- gnome-mount-0.5.orig/src/gnome-mount-properties.c 2006-07-16 14:33:58.000000000 -0600 ++++ gnome-mount-0.5/src/gnome-mount-properties.c 2006-10-16 14:11:13.000000000 -0600 +@@ -31,6 +31,8 @@ + #include + #include + ++#include ++ + #include "gnome-mount-properties-view.h" + + static DBusConnection *dbus_connection; + --- gnome-mount-0.5.orig/debian/patches/02_sudo_session_dbus.patch +++ gnome-mount-0.5/debian/patches/02_sudo_session_dbus.patch @@ -0,0 +1,42 @@ +diff -Nur gnome-mount-0.5/src/gnome-mount.c gnome-mount-0.5.new/src/gnome-mount.c +--- gnome-mount-0.5/src/gnome-mount.c 2006-09-17 07:17:54.000000000 +0200 ++++ gnome-mount-0.5.new/src/gnome-mount.c 2006-12-08 17:35:12.000000000 +0100 +@@ -72,6 +72,8 @@ + static gboolean opt_block = FALSE; + static gboolean opt_nodisplay = FALSE; + ++static int sudo_uid = -1; ++ + #define DBUS_TIMEOUT G_MAXINT + + static void +@@ -2576,6 +2578,15 @@ + { NULL, 0, 0, 0, NULL, NULL, NULL } + }; + ++ /* figure out real user id when called through sudo so that we can ++ * connect to the right session bus. */ ++ if (geteuid() == 0) { ++ /* drop user temporarily */ ++ const char *s = getenv("SUDO_UID"); ++ if (s) ++ sudo_uid = atoi (s); ++ } ++ + rc = 1; + + bindtextdomain (PACKAGE, GNOMELOCALEDIR); +@@ -2668,7 +2679,13 @@ + argc, argv, + GNOME_PARAM_NONE); + #ifdef ENABLE_NOTIFY ++ /* temporarily drop real uid to sudo user so that we connect to the real ++ * user's session bus */ ++ if (sudo_uid > 0) ++ setreuid (sudo_uid, -1); + notify_init ("gnome-mount"); ++ if (sudo_uid > 0) ++ setreuid (0, -1); + #endif + } + --- gnome-mount-0.5.orig/debian/patches/03_root_mounting.patch +++ gnome-mount-0.5/debian/patches/03_root_mounting.patch @@ -0,0 +1,139 @@ +diff -Nur gnome-mount-0.5/src/gnome-mount.c gnome-mount-0.5.new/src/gnome-mount.c +--- gnome-mount-0.5/src/gnome-mount.c 2006-12-08 17:44:23.000000000 +0100 ++++ gnome-mount-0.5.new/src/gnome-mount.c 2006-12-08 17:46:08.000000000 +0100 +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -73,6 +74,7 @@ + static gboolean opt_nodisplay = FALSE; + + static int sudo_uid = -1; ++static char** gksu_argv; + + #define DBUS_TIMEOUT G_MAXINT + +@@ -626,6 +628,48 @@ + return (mount_point); + } + ++/* check if we are (probably) a sudoer, i. e. member of the 'admin' group */ ++static gboolean ++check_sudoer() ++{ ++ gchar *out; ++ gchar **groups, **i; ++ gboolean result; ++ gint exitcode; ++ gint len; ++ gchar* argv[] = { "/usr/bin/groups", NULL }; ++ ++ /* capture groups output, switch to unpriv'ed user id for that */ ++ result = g_spawn_sync (NULL, argv, NULL, 0, NULL, NULL, ++ &out, NULL, &exitcode, NULL); ++ ++ if (!result || exitcode != 0) { ++ g_free (out); ++ return FALSE; ++ } ++ ++ /* chop off CRLF at the end */ ++ for (len = strlen(out); len > 0; --len) { ++ if (isspace(out[len-1])) ++ out[len-1] = 0; ++ else ++ break; ++ } ++ ++ groups = g_strsplit (out, " ", 0); ++ g_free (out); ++ ++ result = FALSE; ++ for (i = groups; *i; ++i) { ++ if (!strcmp (*i, "admin")) { ++ result = TRUE; ++ break; ++ } ++ } ++ g_strfreev (groups); ++ return result; ++} ++ + static gboolean + volume_mount_with_options (const char *udi, LibHalVolume *volume, LibHalDrive *drive, + const char *mount_point, const char *fstype, GPtrArray *options) +@@ -714,7 +758,16 @@ + dbus_error_free (&error); + + return ret; +- } ++ } else if (strcmp (error.name, "org.freedesktop.Hal.Device.PermissionDeniedByPolicy") == 0 && ++ /* try again as root if we cannot do it as user */ ++ !opt_noui && getuid() != 0 && check_sudoer()) { ++ g_debug("permission denied, but I'm an admin; gksu'ing myself to try again"); ++ if (g_spawn_sync (NULL, gksu_argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, ++ NULL, NULL, NULL, NULL)) { ++ ret = TRUE; ++ goto out; ++ } ++ } + + notify_parent (FALSE); + +@@ -1686,6 +1739,16 @@ + if (!is_ro) { + unmount_cache_timeout_cancel (FALSE); + } ++ ++ /* try again as root if we cannot do it as user */ ++ if (strcmp (error.name, "org.freedesktop.Hal.Device.PermissionDeniedByPolicy") == 0 && ++ !opt_noui && getuid() != 0 && check_sudoer()) { ++ g_debug("permission denied, but I'm an admin; gksu'ing myself to try again"); ++ if (g_spawn_sync (NULL, gksu_argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, ++ NULL, NULL, NULL, NULL)) ++ goto out; ++ } ++ + g_warning ("Unmount failed for %s: %s : %s\n", udi, error.name, error.message); + show_error_dialog_unmount (udi, volume, drive, error.name, error.message); + dbus_error_free (&error); +@@ -1890,6 +1953,16 @@ + if (!is_ro) { + unmount_cache_timeout_cancel (FALSE); + } ++ ++ /* try again as root if we cannot do it as user */ ++ if (strcmp (error.name, "org.freedesktop.Hal.Device.PermissionDeniedByPolicy") == 0 && ++ !opt_noui && getuid() != 0 && check_sudoer()) { ++ g_debug("permission denied, but I'm an admin; gksu'ing myself to try again"); ++ if (g_spawn_sync (NULL, gksu_argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, ++ NULL, NULL, NULL, NULL)) ++ goto out; ++ } ++ + g_warning ("Eject failed for %s: %s : %s\n", udi, error.name, error.message); + show_error_dialog_eject (udi, volume, drive, error.name, error.message); + dbus_error_free (&error); +@@ -2578,6 +2651,18 @@ + { NULL, 0, 0, 0, NULL, NULL, NULL } + }; + ++ /* rescue our original argv and prepend 'gksu --', in case we want to ++ * gksu ourselves */ ++ gksu_argv = g_new (char*, argc+5); ++ int i; ++ gksu_argv[0] = "gksu"; ++ gksu_argv[1] = "--message"; ++ gksu_argv[2] = _("Access to this internal disk it is restricted to system administrators for security reasons.\n\nPlease enter your password to proceed."); ++ gksu_argv[3] = "--"; ++ for (i = 0; i <= argc; ++i) { ++ gksu_argv[i+4] = g_strdup (argv[i]); ++ } ++ + /* figure out real user id when called through sudo so that we can + * connect to the right session bus. */ + if (geteuid() == 0) { --- gnome-mount-0.5.orig/debian/patches/ubuntu-default-mount-options.patch +++ gnome-mount-0.5/debian/patches/ubuntu-default-mount-options.patch @@ -0,0 +1,30 @@ +diff -Nur gnome-mount-0.5/gnome-mount.schemas.in gnome-mount-0.5.new/gnome-mount.schemas.in +--- gnome-mount-0.5/gnome-mount.schemas.in 2006-06-22 04:45:53.000000000 +0200 ++++ gnome-mount-0.5.new/gnome-mount.schemas.in 2006-11-01 11:28:57.000000000 +0100 +@@ -6,7 +6,7 @@ + /system/storage/default_options/vfat/mount_options + list + string +- [shortname=winnt,uid=] ++ [shortname=winnt,uid=,utf8,umask=077] + + Default mount options for vfat fs + A list of default mount options for volumes formatted with the vfat file system. +@@ -18,7 +18,7 @@ + /system/storage/default_options/iso9660/mount_options + list + string +- [uid=] ++ [uid=,utf8] + + Default mount options for iso9660 fs + A list of default mount options for volumes formatted with the iso9660 file system. +@@ -42,7 +42,7 @@ + /system/storage/default_options/ntfs/mount_options + list + string +- [umask=222] ++ [umask=222,utf8] + + Default mount options for ntfs fs + A list of default mount options for volumes formatted with the ntfs file system. --- gnome-mount-0.5.orig/debian/copyright +++ gnome-mount-0.5/debian/copyright @@ -0,0 +1,32 @@ +This package was debianized by Michael Biebl on +Tue, 15 Aug 2006 23:58:34 +0200. + +It was downloaded from http://people.freedesktop.org/~david/dist/ + +Upstream Author: + David Zeuthen + +Copyright: + Copyright (C) 2006 David Zeuthen, + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2006, Michael Biebl and +is licensed under the GPL, see above.