~ubuntu-branches/ubuntu/quantal/udisks/quantal-security

« back to all changes in this revision

Viewing changes to debian/patches/00git-udf-permissions.patch

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-02-28 13:18:20 UTC
  • mfrom: (17.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110228131820-dne1hs19c7risn0o
Tags: 1.0.2-3+ubuntu1
Upload current packaging git head to Natty.

* 02-defer_smart_probing.patch: Try SMART probing again repeatedly while the
  daemon is inhibited. (LP: #580112)
* Add 00git-udf-permissions.patch: Ignore broken directory permissions on
  UDF when they are on readonly CD media. (LP: #635499)
* debian/control: Improve package description. Thanks Justin B Rye!
  (Closes: #614146)
* debian/control: Explain in the package description why udisks
  recommends/suggests file system creation/admin tools. (Closes: #595114)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 2d1901f74725da29c7af7602e1c74faf55f14672 Mon Sep 17 00:00:00 2001
 
2
From: Martin Pitt <martin.pitt@ubuntu.com>
 
3
Date: Thu, 24 Feb 2011 13:39:52 +0100
 
4
Subject: [PATCH] Ignore broken directory permissions on UDF media
 
5
 
 
6
Some broken DVDs come with 0400 directory permissions, making them unreadable;
 
7
according to the UDF spec (http://www.osta.org/specs/pdf/udf260.pdf) directory
 
8
permissions are to be respected, but apparently Windows ignores those.
 
9
 
 
10
To work around this, override readonly UDF media with a dmode=0500, as on those
 
11
it doesn't really make sense to hide anything.
 
12
 
 
13
https://launchpad.net/bugs/635499
 
14
---
 
15
 src/device.c |   21 ++++++++++++++++++---
 
16
 1 files changed, 18 insertions(+), 3 deletions(-)
 
17
 
 
18
diff --git a/src/device.c b/src/device.c
 
19
index c4a83ff..21d9530 100644
 
20
--- a/src/device.c
 
21
+++ b/src/device.c
 
22
@@ -5874,7 +5874,7 @@ static const char *iso9660_allow_gid_self[] = { "gid=", NULL };
 
23
 /* ---------------------- udf -------------------- */
 
24
 
 
25
 static const char *udf_defaults[] = { "uid=", "gid=", "iocharset=utf8", "umask=0077", NULL };
 
26
-static const char *udf_allow[] = { "iocharset=", "umask=", NULL };
 
27
+static const char *udf_allow[] = { "iocharset=", "umask=", "mode=", "dmode=", NULL };
 
28
 static const char *udf_allow_uid_self[] = { "uid=", NULL };
 
29
 static const char *udf_allow_gid_self[] = { "gid=", NULL };
 
30
 
 
31
@@ -6088,7 +6088,8 @@ is_mount_option_allowed (const FSMountOptions *fsmo,
 
32
 }
 
33
 
 
34
 static char **
 
35
-prepend_default_mount_options (const FSMountOptions *fsmo,
 
36
+prepend_default_mount_options (Device *device,
 
37
+                               const FSMountOptions *fsmo,
 
38
                                uid_t caller_uid,
 
39
                                char **given_options)
 
40
 {
 
41
@@ -6097,6 +6098,7 @@ prepend_default_mount_options (const FSMountOptions *fsmo,
 
42
   char *s;
 
43
   gid_t gid;
 
44
 
 
45
+  /* static default options from FSMountOptions */
 
46
   options = g_ptr_array_new ();
 
47
   if (fsmo != NULL)
 
48
     {
 
49
@@ -6124,6 +6126,19 @@ prepend_default_mount_options (const FSMountOptions *fsmo,
 
50
             }
 
51
         }
 
52
     }
 
53
+
 
54
+  /* dynamic default options */
 
55
+
 
56
+  /* some broken DVDs come with 0400 directory permissions, making them
 
57
+   * unreadable; overwrite readonly UDF media with a 0500 dmode. */
 
58
+  if (g_strcmp0 (device->priv->id_type, "udf") == 0 && device->priv->device_is_optical_disc &&
 
59
+      device->priv->drive_media != NULL && 
 
60
+      strstr(device->priv->drive_media, "_rw") == NULL && strstr(device->priv->drive_media, "_ram") == NULL)
 
61
+    {
 
62
+      g_ptr_array_add (options, g_strdup("dmode=0500"));
 
63
+    }
 
64
+
 
65
+  /* user supplied options */
 
66
   for (n = 0; given_options[n] != NULL; n++)
 
67
     {
 
68
       g_ptr_array_add (options, g_strdup (given_options[n]));
 
69
@@ -6304,7 +6319,7 @@ device_filesystem_mount_authorized_cb (Daemon *daemon,
 
70
   /* always prepend some reasonable default mount options; these are
 
71
    * chosen here; the user can override them if he wants to
 
72
    */
 
73
-  options = prepend_default_mount_options (fsmo, caller_uid, given_options);
 
74
+  options = prepend_default_mount_options (device, fsmo, caller_uid, given_options);
 
75
 
 
76
   /* validate mount options and check for authorizations */
 
77
   s = g_string_new ("uhelper=udisks,nodev,nosuid");
 
78
-- 
 
79
1.7.4.1
 
80