Bug 12899 - hald improperly deals with temporary cryptsetup device
Summary: hald improperly deals with temporary cryptsetup device
Status: RESOLVED FIXED
Alias: None
Product: hal
Classification: Unclassified
Component: hald (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: high major
Assignee: Rob Taylor
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2007-10-23 13:05 UTC by Jakub Schmidtke
Modified: 2008-03-04 08:26 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Jakub Schmidtke 2007-10-23 13:05:20 UTC
When hal is used to decrypt LUKS-encrypted device,
it detects and opens /dev/mapper/temporary-cryptsetup-* file,
which is temporary cryptsetup device, instead of proper one,
which is created later. This patch resolves the issue:

--- hal-0.5.9.1/hald/linux/osspec.c	2007-04-03 12:38:50.000000000 -0400
+++ hal-0.5.9.1_new/hald/linux/osspec.c	2007-09-18 23:18:24.000000000 -0400
@@ -227,6 +227,11 @@
 		goto invalid;
 	}
 
+	if (strncmp (hotplug_event->sysfs.device_file, "/dev/mapper/temporary-cryptsetup-", 33) == 0) {
+		HAL_INFO (("ignoring temporary cryptsetup file"));
+		goto invalid;
+	}
+	
 	HAL_INFO (("SEQNUM=%lld, ACTION=%s, SUBSYSTEM=%s, DEVPATH=%s, DEVNAME=%s, IFINDEX=%d",
 		   hotplug_event->sysfs.seqnum, action, hotplug_event->sysfs.subsystem, hotplug_event->sysfs.sysfs_path,
 		   hotplug_event->sysfs.device_file, hotplug_event->sysfs.net_ifindex));
Comment 1 Teemu Rytilahti 2007-11-25 17:21:07 UTC
Patch works fine for me. This bug (not a bug in hal actually) especially shows up when guessing the passphrase incorrectly and hal just adds the (incorrect) device mapper entry to its lists. After that for example KDE4's Solid checks if some device has a backing_volume for that specific device set and decides whether to ask for the passphrase. In this current case it founds the wrong entry and doesn't ask for the passphrase at all.

Even though the bug isn't in HAL I think this patch should be applied. Thanks for Robert for helping me out with this problem, it seems to work after patching the attached patch to the sourcetree of 0.5.9.1.

Thanks guys and keep up the good work :-)
Comment 2 Rob Taylor 2008-03-04 08:13:20 UTC
The /dev/mapper/temporary-cryptsetup-* file appears due to a udev RUN rules bug fixed in udev commit a0092d28. We should either coordinate a release with udev and up depends, or apply this workaround. I prefer the former...
Comment 3 Danny Kukawka 2008-03-04 08:26:39 UTC
I've commited an adopted version with additionally comments as workaround. We should remove this again as soon as a new udev version is out and HAL starts to depend on this (or a newer) version.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.