~ubuntu-branches/ubuntu/lucid/devicekit-disks/lucid

« back to all changes in this revision

Viewing changes to debian/patches/00git_fstab_unmount.patch

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-09-19 16:51:16 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090919165116-qywy5go6o82fkws4
Tags: 007-0ubuntu1
* New upstream release:
  - Bug 23761 – Some leaks
  - Bug 23541 – PartitionTableCreate method times out
  - Bug 22914 – Require password to eject a CD or DVD mounted by the same user
  - Rework ATA SMART handling
  - Also be paranoid about the UUID containing '/' characters
  - Use WindowsStyleCaps for property names
  - Bug 23829 – Undefined value in partutil.c
  - Bug 23828 – Undefined value in umount-devkit.c
  - Bug 23827 – Undefined value
  - Bug 23826 – NULL dereference
  - Bug 23825 – Leak in update_info_mount_state
  - Bug 23824 – Unused variable
  - Bug 23823 – NULL dereference
  - Bug 23764 – Small leak in update_drive_properties_from_sysfs
  - Bug 23762 – Fix typo
  - Bug 23579 – Must allow DBus Properties interface for g-d-u to work
  - Bug 23926 – Error creating partition
* Drop all our patches, all applied upstream.
* debian/control: Drop libsqlite3-dev build dependency, not needed any more.
* debian/control: Bump Standards-Version to 3.8.3 (no changes needed).
* debian/control: Add Breaks to GDU libraries << 2.28, since the D-BUS API
  changed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From e57f8698b52a9eaf5c848b5f5e27af3eee80b7b9 Mon Sep 17 00:00:00 2001
2
 
From: David Zeuthen <davidz@redhat.com>
3
 
Date: Mon, 17 Aug 2009 20:48:09 +0000
4
 
Subject: Bug 22914 – Require password to eject a CD or DVD mounted by the same user
5
 
 
6
 
Apparently this got messed up in the port to polkit1.
7
 
---
8
 
diff --git a/src/devkit-disks-device.c b/src/devkit-disks-device.c
9
 
index 06898c0..dac22e7 100644
10
 
--- a/src/devkit-disks-device.c
11
 
+++ b/src/devkit-disks-device.c
12
 
@@ -4853,6 +4853,8 @@ devkit_disks_device_filesystem_unmount_authorized_cb (DevkitDisksDaemon     *dae
13
 
         GError *error;
14
 
         gboolean force_unmount;
15
 
         char *mount_path;
16
 
+        uid_t uid;
17
 
+        gchar uid_buf[32];
18
 
 
19
 
         mount_path = NULL;
20
 
 
21
 
@@ -4877,10 +4879,10 @@ devkit_disks_device_filesystem_unmount_authorized_cb (DevkitDisksDaemon     *dae
22
 
                 }
23
 
         }
24
 
 
25
 
+        devkit_disks_daemon_local_get_uid (device->priv->daemon, &uid, context);
26
 
+        g_snprintf (uid_buf, sizeof uid_buf, "%d", uid);
27
 
+
28
 
         if (!devkit_disks_mount_file_has_device (device->priv->device_file, NULL, NULL)) {
29
 
-                /* Check if the device is referenced in /etc/fstab; if so, attempt to
30
 
-                 * unmount the device as uid 0 (since the user has acquired .unmount-others already)
31
 
-                 */
32
 
                 if (is_device_in_fstab (device, &mount_path)) {
33
 
 
34
 
                         n = 0;
35
 
@@ -4890,10 +4892,14 @@ devkit_disks_device_filesystem_unmount_authorized_cb (DevkitDisksDaemon     *dae
36
 
                         else
37
 
                                 argv[n++] = "unmount";
38
 
                         argv[n++] = device->priv->device_file;
39
 
-                        argv[n++] = "0";
40
 
+                        argv[n++] = uid_buf;
41
 
                         argv[n++] = NULL;
42
 
                         goto run_job;
43
 
                 }
44
 
+
45
 
+                /* otherwise the user will have the .unmount-others authorization per the logic in
46
 
+                 * devkit_disks_device_filesystem_unmount()
47
 
+                 */
48
 
         }
49
 
 
50
 
         mount_path = g_strdup (((gchar **) device->priv->device_mount_paths->pdata)[0]);
51
 
@@ -4930,9 +4936,8 @@ devkit_disks_device_filesystem_unmount (DevkitDisksDevice     *device,
52
 
                                         char                 **options,
53
 
                                         DBusGMethodInvocation *context)
54
 
 {
55
 
-        uid_t uid;
56
 
-        uid_t uid_of_mount;
57
 
         const gchar *action_id;
58
 
+        uid_t uid_of_mount;
59
 
 
60
 
         if (!device->priv->device_is_mounted ||
61
 
             device->priv->device_mount_paths->len == 0) {
62
 
@@ -4942,15 +4947,18 @@ devkit_disks_device_filesystem_unmount (DevkitDisksDevice     *device,
63
 
                 goto out;
64
 
         }
65
 
 
66
 
+        /* if device is in /etc/fstab, then we'll run unmount as the calling user */
67
 
+        action_id = NULL;
68
 
         if (!devkit_disks_mount_file_has_device (device->priv->device_file, &uid_of_mount, NULL)) {
69
 
-                uid_of_mount = 0;
70
 
-        }
71
 
-
72
 
-        devkit_disks_daemon_local_get_uid (device->priv->daemon, &uid, context);
73
 
-        if (uid_of_mount != uid) {
74
 
-                action_id = "org.freedesktop.devicekit.disks.filesystem-unmount-others";
75
 
+                if (!is_device_in_fstab (device, NULL)) {
76
 
+                        action_id = "org.freedesktop.devicekit.disks.filesystem-unmount-others";
77
 
+                }
78
 
         } else {
79
 
-                action_id = NULL;
80
 
+                uid_t uid;
81
 
+                devkit_disks_daemon_local_get_uid (device->priv->daemon, &uid, context);
82
 
+                if (uid_of_mount != uid) {
83
 
+                        action_id = "org.freedesktop.devicekit.disks.filesystem-unmount-others";
84
 
+                }
85
 
         }
86
 
 
87
 
         devkit_disks_daemon_local_check_auth (device->priv->daemon,
88
 
--
89
 
cgit v0.8.2