[patch] Handle special chars in mtab

Sjoerd Simons sjoerd at luon.net
Sun Dec 19 11:31:00 PST 2004


Hi,

  Several characters in mountpoints in /etc/mtab are encoded in octal form
  (space, tab, newline etc). Current hal uses that directly which confuses
  several other tools in the stack. Attached patch puts it back in plain text
  again.

  Sjoerd
-- 
When some people discover the truth, they just can't understand why
everybody isn't eager to hear it.
-------------- next part --------------
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	19 Dec 2004 16:10:21 -0000
@@ -1924,8 +1924,10 @@
 	mount_points[num_mount_points].minor = minor;
 	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);
+	p = g_strcompress(mount_point);
+	strncpy (mount_points[num_mount_points].mount_point, p, 
+		MOUNT_POINT_STRING_SIZE);
+	g_free(p);
 	strncpy (mount_points[num_mount_points].fs_type, fs_type,
 		 MOUNT_POINT_STRING_SIZE);
 
-------------- next part --------------
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal


More information about the Hal mailing list