hal/hald/linux2 blockdev.c,1.37,1.38

David Zeuthen david at kemper.freedesktop.org
Thu Feb 23 20:29:08 PST 2006


Update of /cvs/hal/hal/hald/linux2
In directory kemper:/tmp/cvs-serv11516/hald/linux2

Modified Files:
	blockdev.c 
Log Message:
2006-02-23  David Zeuthen  <davidz at redhat.com>

        * hald/linux2/blockdev.c (hotplug_event_begin_add_blockdev): Add
        some useful debugging on errors

        * tools/hal-luks-setup: Sleep three seconds on error to avoid
        attacks for cracking the password



Index: blockdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/blockdev.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- blockdev.c	13 Feb 2006 02:16:57 -0000	1.37
+++ blockdev.c	24 Feb 2006 04:29:06 -0000	1.38
@@ -784,13 +784,17 @@
 		}
 
 		/* needs physical device */
-		if (physdev_udi == NULL)
+		if (physdev_udi == NULL) {
+			HAL_WARNING (("No physical device?"));
 			goto error;
+		}
 
 		hal_device_property_set_string (d, "storage.physical_device", physdev_udi);
 
-		if (!hal_util_get_int_from_file (sysfs_path, "removable", (gint *) &is_removable, 10))
+		if (!hal_util_get_int_from_file (sysfs_path, "removable", (gint *) &is_removable, 10)) {
+			HAL_WARNING (("Cannot get 'removable' file"));
 			goto error;
+		}
 
 		hal_device_property_set_bool (d, "storage.removable", is_removable);
 
@@ -823,6 +827,7 @@
 				    strcmp (media, "floppy") == 0) {
 					hal_device_property_set_string (d, "storage.drive_type", media);
 				} else {
+					HAL_WARNING (("Cannot determine IDE drive type from file %s/media", buf));
 					goto error;
 				}
 
@@ -838,8 +843,10 @@
 			}
 
 		} else if (strcmp (parent_bus, "scsi") == 0) {
-			if (strcmp (hal_device_property_get_string (parent, "scsi.type"), "unknown") == 0)
+			if (strcmp (hal_device_property_get_string (parent, "scsi.type"), "unknown") == 0) {
+				HAL_WARNING (("scsi.type is unknown"));
 				goto error;
+			}
 			hal_device_copy_property (parent, "scsi.type", d, "storage.drive_type");
 			hal_device_copy_property (parent, "scsi.vendor", d, "storage.vendor");
 			hal_device_copy_property (parent, "scsi.model", d, "storage.model");
@@ -938,9 +945,11 @@
 					partition_number = atoi (&sysfs_path[i+1]);
 					hal_device_property_set_int (d, "volume.partition.number", partition_number);
 				} else {
+					HAL_WARNING (("Cannot determine partition number?"));
 					goto error;
 				}
 			} else {
+				HAL_WARNING (("Cannot determine partition number"));
 				goto error;
 			}
 		}
@@ -972,6 +981,7 @@
 	return;
 
 error:
+	HAL_WARNING (("Not adding device object"));
 	if (d != NULL)
 		g_object_unref (d);
 out:




More information about the hal-commit mailing list