[Pkg-utopia-commits] r142 - in packages/hal/trunk/debian: . patches

Sjoerd Simons sjoerd@haydn.debian.org
Sat, 18 Dec 2004 14:50:46 -0700


Author: sjoerd
Date: 2004-12-18 14:50:23 -0700 (Sat, 18 Dec 2004)
New Revision: 142

Added:
   packages/hal/trunk/debian/patches/special_mtab_chars.patch
Modified:
   packages/hal/trunk/debian/changelog
Log:
Handle mountpoint names with spaces

Modified: packages/hal/trunk/debian/changelog
===================================================================
--- packages/hal/trunk/debian/changelog	2004-12-18 20:49:00 UTC (rev 141)
+++ packages/hal/trunk/debian/changelog	2004-12-18 21:50:23 UTC (rev 142)
@@ -1,3 +1,12 @@
+hal (0.4.2-3) unstable; urgency=low
+
+  * debian/patches/special_mtab_chars.patch
+    + Added. In /etc/mtab and /proc/mounts some special chars (like space) are
+    encoded in octal from. Decode these into normal chars again. Fixes
+    problems with spaces in mountpoints (Closes: #284322)
+
+ -- Sjoerd Simons <sjoerd@debian.org>  Sat, 18 Dec 2004 22:11:49 +0100
+
 hal (0.4.2-2) unstable; urgency=medium
 
   * debian/patches/fstab-sync-crash.patch

Added: packages/hal/trunk/debian/patches/special_mtab_chars.patch
===================================================================
--- packages/hal/trunk/debian/patches/special_mtab_chars.patch	2004-12-18 20:49:00 UTC (rev 141)
+++ packages/hal/trunk/debian/patches/special_mtab_chars.patch	2004-12-18 21:50:23 UTC (rev 142)
@@ -0,0 +1,33 @@
+Index: hald/linux/block_class_device.c
+===================================================================
+RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
+retrieving revision 1.86.2.4
+diff -u -r1.86.2.4 block_class_device.c
+--- hald/linux/block_class_device.c	9 Dec 2004 03:15:22 -0000	1.86.2.4
++++ hald/linux/block_class_device.c	18 Dec 2004 21:04:44 -0000
+@@ -1922,10 +1922,23 @@
+ 
+ 	mount_points[num_mount_points].major = major;
+ 	mount_points[num_mount_points].minor = minor;
++  for (i = 0, p = mount_point; i < MOUNT_POINT_STRING_SIZE && *p != '\0'; i++) {
++    char tmp;
++    if (*p == '\\') {
++      /* the kernel escapes various symbols into octal form, including \ ! */
++      p++;
++      tmp = 0;
++      if (*p != '\0') tmp |= ((g_ascii_digit_value(*p++) << 6));
++      if (*p != '\0') tmp |= ((g_ascii_digit_value(*p++) << 3) & 070);
++      if (*p != '\0') tmp |= ((g_ascii_digit_value(*p++)) & 07);
++    } else {
++      tmp = *p++;
++    }
++    mount_points[num_mount_points].mount_point[i] = tmp;
++  }
++  mount_points[num_mount_points].mount_point[i] = '\0';
+ 	strncpy (mount_points[num_mount_points].device, device,
+ 		 MOUNT_POINT_STRING_SIZE);
+-	strncpy (mount_points[num_mount_points].mount_point, mount_point,
+-		 MOUNT_POINT_STRING_SIZE);
+ 	strncpy (mount_points[num_mount_points].fs_type, fs_type,
+ 		 MOUNT_POINT_STRING_SIZE);
+